/* ============================================================================
   Cleanroom Design System - Sphinx Theme
   Auto-generated from design tokens - DO NOT EDIT DIRECTLY
   Edit tokens/colors.js and run: npm run build:sphinx-css
   ============================================================================ */

:root {
  --color-slate-950: #030712;
  --color-slate-900: #111827;
  --color-slate-800: #1f2937;
  --color-slate-700: #374151;
  --color-slate-600: #4b5563;
  --color-content-bg: #0f172a;
  --color-code-bg: #1e293b;
  --color-docs-content-bg: #ffffff;
  --color-docs-code-bg: #f8fafc;
  --color-docs-text-primary: #1e293b;
  --color-docs-text-secondary: #334155;
  --color-docs-text-muted: #64748b;
  --color-docs-code-text: #1e293b;
  --color-docs-border: #e2e8f0;
  --color-text-primary: #f9fafb;
  --color-text-secondary: #d1d5db;
  --color-text-muted: #9ca3af;
  --color-code-text: #e2e8f0;
  --color-emerald: #10b981;
  --color-emerald-light: #34d399;
  --color-emerald-dark: #059669;
  --color-emerald-glow: #10b98133;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #3b82f6;
  --color-success: #10b981;
  --color-purple: #8b5cf6;
  --color-yellow: #eab308;
  --color-orange: #f97316;
  --color-blue: #60a5fa;
  --color-violet: #a78bfa;
  --color-syntax-comment: #6b7280;
  --color-syntax-keyword: #c084fc;
  --color-syntax-string: #34d399;
  --color-syntax-function: #60a5fa;
  --color-syntax-number: #fbbf24;
  --color-syntax-name: #e2e8f0;
  --color-syntax-operator: #d1d5db;
}

/* ============================================================================
   Layout and Typography
   ============================================================================ */

.document {
    max-width: 980px;
    line-height: 1.7;
}

body {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif;
    overscroll-behavior: none;
}

/* Prevent overscroll/elastic scroll on mobile */
html {
    overscroll-behavior: none;
}

.wy-side-scroll {
    overflow-y: auto;
    overscroll-behavior: none;
}

.wy-nav-content-wrap {
    overscroll-behavior: none;
}

/* Content area - light theme for readability */
.wy-nav-content {
    background: var(--color-docs-content-bg) !important;
}

.wy-nav-content-wrap {
    background: var(--color-docs-content-bg) !important;
}

code, pre, .highlight {
    font-family: Monaco, Menlo, Ubuntu Mono, Consolas, source-code-pro, monospace;
    font-size: 0.9em;
}

/* Headings - dark text on light background */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-docs-text-primary);
}

.rst-content h1 {
    border-bottom: 3px solid var(--color-emerald);
    padding-bottom: 0.3em;
    margin-top: 1.5em;
    font-size: 2.2em;
}

.rst-content h2 {
    border-bottom: 2px solid var(--color-emerald);
    padding-bottom: 0.2em;
    margin-top: 2em !important;
    margin-bottom: 1em !important;
    font-size: 1.8em;
    color: var(--color-docs-text-primary);
}

h3,
.rst-content h3 {
    color: var(--color-docs-text-primary);
    margin-top: 1.5em;
    font-size: 1.5em !important;
    padding-bottom: 0.3em;
    border-bottom: 1px solid var(--color-docs-border);
}

/* List spacing */
.rst-content ul,
.rst-content ol {
    margin-top: 1em;
    margin-bottom: 1.5em;
}

.rst-content li:not(.toctree-l1):not(.toctree-l2):not(.toctree-l3) {
    margin-bottom: 0.5em;
}

.rst-content section ul.simple li > p,
.rst-content section ol.simple li > p,
.rst-content .section ul.simple li > p,
.rst-content .section ol.simple li > p {
    margin-bottom: 0;
}

.rst-content .toctree-wrapper > p.caption {
    margin-top: 2em !important;
}

.rst-content section {
    margin-top: 2em;
}

/* ============================================================================
   Task List / Checkbox Styling (myst-parser tasklist extension)
   ============================================================================ */

/* Remove bullet points from task list items - high specificity to override RTD theme */
.rst-content ul.contains-task-list,
.rst-content ul.contains-task-list.simple {
    list-style: none !important;
    padding-left: 0 !important;
}

.rst-content ul.contains-task-list ul.contains-task-list {
    padding-left: 1.5em !important;
}

.rst-content li.task-list-item {
    list-style: none !important;
    margin-left: 0 !important;
}

/* Style the checkbox */
.task-list-item-checkbox {
    margin-right: 0.5em;
    vertical-align: middle;
}

/* ============================================================================
   sphinx-needs Directive Styling
   ============================================================================ */

.needs_head {
    font-weight: bold;
    font-size: 1.1em;
    color: var(--color-docs-text-primary);
}

.needs_id {
    font-family: Monaco, Menlo, Ubuntu Mono, Consolas, source-code-pro, monospace;
    background-color: var(--color-docs-code-bg);
    border: 1px solid var(--color-docs-border);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.95em;
    color: var(--color-docs-code-text);
}

.needstable {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.needstable th {
    background: var(--color-docs-code-bg);
    color: var(--color-docs-text-primary);
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border: 1px solid var(--color-docs-border);
}

.needstable td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-docs-border);
    color: var(--color-docs-text-secondary);
}

.needstable tr:hover {
    background-color: var(--color-docs-code-bg);
}

.needstable tr:nth-child(even) {
    background-color: rgba(248, 250, 252, 0.5);
}

/* Use case highlighting */
.usecase {
    border-left: 5px solid var(--color-info);
    background: linear-gradient(to right, rgba(59, 130, 246, 0.08) 0%, transparent 100%);
    padding: 15px;
    padding-left: 20px;
    margin-bottom: 20px;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.usecase .needs_head {
    color: #2563eb;  /* blue-600 for light bg */
}

/* Requirement highlighting */
.req, .nfreq {
    border-left: 5px solid var(--color-orange);
    background: linear-gradient(to right, rgba(249, 115, 22, 0.08) 0%, transparent 100%);
    padding: 15px;
    padding-left: 20px;
    margin-bottom: 15px;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.req .needs_head, .nfreq .needs_head {
    color: #ea580c;  /* orange-600 for light bg */
}

/* Test case highlighting */
.test {
    border-left: 5px solid var(--color-emerald);
    background: linear-gradient(to right, rgba(16, 185, 129, 0.08) 0%, transparent 100%);
    padding: 15px;
    padding-left: 20px;
    margin-bottom: 15px;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.test .needs_head {
    color: var(--color-emerald-dark);
}

/* Implementation highlighting */
.impl {
    border-left: 5px solid var(--color-purple);
    background: linear-gradient(to right, rgba(139, 92, 246, 0.08) 0%, transparent 100%);
    padding: 15px;
    padding-left: 20px;
    margin-bottom: 15px;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.impl .needs_head {
    color: #7c3aed;  /* violet-600 for light bg */
}

/* Design specification highlighting */
.spec {
    border-left: 5px solid var(--color-yellow);
    background: linear-gradient(to right, rgba(234, 179, 8, 0.08) 0%, transparent 100%);
    padding: 15px;
    padding-left: 20px;
    margin-bottom: 15px;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.spec .needs_head {
    color: #ca8a04;  /* yellow-600 for light bg */
}

/* ============================================================================
   Code Blocks and Syntax Highlighting
   ============================================================================ */

.highlight {
    border-radius: 4px;
    border: 1px solid var(--color-docs-border);
    background-color: var(--color-docs-code-bg);
    padding: 1em;
    margin: 1em 0;
    overflow-x: auto;
}

.highlight pre {
    margin: 0;
    padding: 0;
    background-color: transparent;
    border: none;
    color: var(--color-docs-code-text);
}

/* Inline code */
code.literal {
    background-color: var(--color-docs-code-bg);
    border: 1px solid var(--color-docs-border);
    border-radius: 3px;
    padding: 0.2em 0.4em;
    color: #be185d;  /* pink-700 for inline code */
    font-size: 0.9em;
}

/* Syntax highlighting - light theme colors */
.highlight .c, .highlight .c1, .highlight .cm { color: #6b7280; }  /* gray-500 comments */
.highlight .k, .highlight .kn, .highlight .kd { color: #7c3aed; }  /* violet-600 keywords */
.highlight .s, .highlight .s1, .highlight .s2 { color: #059669; }  /* emerald-600 strings */
.highlight .n, .highlight .na, .highlight .nb { color: #1e293b; }  /* slate-800 names */
.highlight .nf { color: #2563eb; }  /* blue-600 functions */
.highlight .o, .highlight .p { color: #334155; }  /* slate-700 operators */
.highlight .mi, .highlight .mf { color: #d97706; }  /* amber-600 numbers */

/* ============================================================================
   Admonitions (Notes, Warnings, etc.)
   ============================================================================ */

.admonition {
    border-radius: 4px;
    padding: 12px;
    margin: 1.5em 0;
    border-left: 4px solid;
    color: var(--color-docs-text-secondary);
}

.admonition.note {
    background-color: rgba(100, 116, 139, 0.08);
    border-left: none;
}

.admonition.warning {
    background-color: rgba(245, 158, 11, 0.08);
    border-left-color: var(--color-warning);
}

.admonition.important {
    background-color: rgba(239, 68, 68, 0.08);
    border-left-color: var(--color-danger);
}

.admonition.tip {
    background-color: rgba(16, 185, 129, 0.08);
    border-left-color: var(--color-emerald);
}

.admonition.danger {
    background-color: rgba(239, 68, 68, 0.08);
    border-left-color: var(--color-danger);
}

.admonition-title {
    font-weight: 700;
    margin-bottom: 0.5em;
    color: var(--color-docs-text-primary);
}

/* ============================================================================
   Tables
   ============================================================================ */

table.docutils {
    border-collapse: collapse;
    border: 1px solid var(--color-docs-border);
    margin: 1.5em 0;
    width: 100%;
}

table.docutils th {
    background-color: var(--color-docs-code-bg);
    border: 1px solid var(--color-docs-border);
    padding: 10px;
    text-align: left;
    font-weight: 600;
    color: var(--color-docs-text-primary);
}

table.docutils td {
    border: 1px solid var(--color-docs-border);
    padding: 8px 10px;
    color: var(--color-docs-text-secondary);
}

table.docutils tr:hover {
    background-color: var(--color-docs-code-bg);
}

/* Compact table rows by resetting paragraph styles */
.rst-content table.docutils td p,
.rst-content table.docutils th p {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    line-height: 1.2 !important;
}

/* ============================================================================
   Navigation and Sidebar
   ============================================================================ */

.wy-nav-side {
    background-color: var(--color-slate-800);
}

.wy-side-nav-search {
    background-color: var(--color-slate-900);
}

.wy-menu-vertical a,
.wy-menu-vertical a:visited {
    color: var(--color-text-secondary);
}

.wy-menu-vertical a:hover {
    background-color: var(--color-slate-700);
    color: #ffffff;
}

.wy-menu-vertical li.current > a {
    background-color: var(--color-emerald);
    color: #ffffff;
}

/* Keep sidebar dark for expanded/current toctree sections */
.wy-menu-vertical li.current {
    background: var(--color-slate-800) !important;
}

.wy-menu-vertical li.toctree-l1.current > ul,
.wy-menu-vertical li.toctree-l2.current > ul,
.wy-menu-vertical li.toctree-l3.current > ul {
    background: var(--color-slate-800) !important;
}

.wy-menu-vertical li.toctree-l2,
.wy-menu-vertical li.toctree-l3,
.wy-menu-vertical li.toctree-l4 {
    background: var(--color-slate-800) !important;
}

.wy-menu-vertical .caption {
    color: var(--color-emerald);
}

/* Hide FontAwesome home icon — replaced by per-project SVG */
.wy-side-nav-search .icon-home::before,
.wy-breadcrumbs .icon-home::before {
    display: none;
}

.icon-home .project-home-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    margin-right: 0.35em;
}

.wy-breadcrumbs .icon-home .project-home-icon {
    margin-right: 0.15em;
    background-color: #cbd5e1;
    border-radius: 3px;
    padding: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wy-side-nav-search .icon-home .project-home-icon {
    margin-right: 0;
    margin-left: -0.5em;
}

.wy-side-nav-search .icon-home {
    word-spacing: 0.15em;
}

/* Breadcrumbs */
.wy-breadcrumbs {
    margin-bottom: 1.5em;
}

.wy-breadcrumbs li {
    color: var(--color-docs-text-muted);
}

.wy-breadcrumbs a {
    color: var(--color-emerald-dark);
}

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

.wy-breadcrumbs-aside a:hover {
    color: var(--color-emerald-dark);
}

/* ============================================================================
   Mobile Responsiveness
   ============================================================================ */

@media screen and (max-width: 768px) {
    .document {
        max-width: 100%;
        padding: 0 1em;
    }

    .rst-content h1 {
        font-size: 1.8em;
    }

    .rst-content h2 {
        font-size: 1.5em;
    }

    .needstable {
        font-size: 0.9em;
    }

    .needstable th,
    .needstable td {
        padding: 8px;
    }

    .highlight {
        font-size: 0.85em;
    }
}

/* ============================================================================
   Links and Cross-References
   ============================================================================ */

/* Links in content area - darker for light bg */
a {
    color: var(--color-emerald-dark);
    text-decoration: none;
}

a:hover {
    color: var(--color-emerald);
    text-decoration: underline;
}

a.reference.internal {
    border-bottom: 1px dotted var(--color-emerald);
}

.wy-menu-vertical a.reference.internal {
    border-bottom: none;
}

a.reference.external::after {
    content: " \2197";
    font-size: 0.8em;
    opacity: 0.6;
}

/* ============================================================================
   Special Elements
   ============================================================================ */

/* Download links */
a.download {
    background-color: var(--color-emerald);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    display: inline-block;
    margin: 4px 0;
}

a.download:hover {
    background-color: var(--color-emerald-dark);
    text-decoration: none;
}

/* Version badge */
.version {
    background-color: #6366f1;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

/* Status badges */
.status-approved {
    background-color: var(--color-emerald);
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: 600;
}

.status-pending {
    background-color: var(--color-warning);
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: 600;
}

.status-rejected {
    background-color: var(--color-danger);
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: 600;
}

/* Development Status Badges */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 8px;
    vertical-align: middle;
}

.status-active {
    background-color: var(--color-emerald);
    color: white;
}

.status-planned {
    background-color: transparent;
    border: 1.5px dashed var(--color-warning);
    color: var(--color-warning);
}

/* ============================================================================
   Version Sub-bar (below nav bar, for non-stable versions)
   ============================================================================ */

.version-sub-bar {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    z-index: 299;
    background: var(--color-slate-900);
    border-bottom: 1px solid var(--color-slate-700);
    padding: 4px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    box-sizing: border-box;
}

.version-switcher {
    position: absolute;
    right: 16px;
    appearance: none;
    -webkit-appearance: none;
    background-color: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-slate-600);
    border-radius: 3px;
    padding: 2px 8px;
    font-size: 0.8em;
    font-family: inherit;
    cursor: pointer;
}

.version-switcher:hover {
    border-color: var(--color-text-secondary);
    color: #ffffff;
}

.version-switcher:focus {
    outline: 1px solid var(--color-emerald);
    outline-offset: 1px;
}

.version-sub-bar__message {
    color: var(--color-text-muted);
    font-size: 0.8em;
}

.version-sub-bar__message--dev::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-info);
    margin-right: 6px;
    vertical-align: middle;
}

.version-sub-bar__message--beta::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-orange);
    margin-right: 6px;
    vertical-align: middle;
}

.version-sub-bar__message--rc::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-warning);
    margin-right: 6px;
    vertical-align: middle;
}

@media screen and (max-width: 768px) {
    .version-sub-bar__message {
        display: none;
    }
}

/* Layout shift when sub-bar is present */
body.has-version-sub-bar .wy-nav-side {
    top: 92px;
    height: calc(100% - 92px);
    min-height: 0;
    padding-bottom: 0;
}

body.has-version-sub-bar .wy-nav-content-wrap {
    margin-top: 92px;
}

body.has-version-sub-bar .sidebar-toggle {
    top: 106px;
}

@media screen and (max-width: 768px) {
    body.has-version-sub-bar .wy-nav-top {
        margin-top: 92px;
    }

    body.has-version-sub-bar .wy-nav-side {
        top: 92px;
        height: calc(100% - 92px);
        min-height: 0;
        padding-bottom: 0;
    }

    body.has-version-sub-bar .wy-nav-content-wrap {
        margin-top: 92px;
    }
}

/* ============================================================================
   Top Navigation Bar
   All layout handled via explicit CSS — no Tailwind CDN dependency.
   ============================================================================ */

.site-nav-bar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 300 !important;
    height: 64px !important;
    box-sizing: border-box !important;
    background-color: #1f2937 !important;
    border-bottom: 1px solid #374151 !important;
    color: #ffffff !important;
}

.site-nav-inner {
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 16px !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

@media (min-width: 640px) {
    .site-nav-inner { max-width: 640px !important; }
}
@media (min-width: 768px) {
    .site-nav-inner { max-width: 768px !important; }
}
@media (min-width: 1024px) {
    .site-nav-inner { max-width: 1024px !important; }
}
@media (min-width: 1280px) {
    .site-nav-inner { max-width: 1280px !important; }
}
@media (min-width: 1536px) {
    .site-nav-inner { max-width: 1536px !important; }
}

.site-nav-links {
    display: flex !important;
    align-items: center !important;
    gap: 24px !important;
}

@media (min-width: 768px) {
    .site-nav-links {
        gap: 32px !important;
    }
}

/* Logo */
.site-nav-logo {
    display: block !important;
    line-height: 0 !important;
    transition: opacity 0.2s !important;
    border-bottom: none !important;
}

.site-nav-logo:hover {
    opacity: 0.8 !important;
}

.site-nav-logo img {
    width: 32px !important;
    height: 32px !important;
}

/* Brand text */
.site-nav-bar .nav-brand {
    display: none !important;
    font-weight: 700 !important;
    font-size: 1.125rem !important;
    line-height: 1.75rem !important;
    color: #ffffff !important;
    text-decoration: none !important;
    border-bottom: none !important;
    transition: color 0.2s !important;
}

@media (min-width: 768px) {
    .site-nav-bar .nav-brand {
        display: block !important;
    }
}

.site-nav-bar .nav-brand:link,
.site-nav-bar .nav-brand:visited {
    color: #ffffff !important;
}

.site-nav-bar .nav-brand:hover {
    color: #10b981 !important;
}

/* Navigation menu links */
.site-nav-menu {
    display: flex !important;
    gap: 16px !important;
}

@media (min-width: 768px) {
    .site-nav-menu {
        gap: 24px !important;
    }
}

.site-nav-menu a {
    color: #d1d5db !important;
    text-decoration: none !important;
    border-bottom: none !important;
    transition: color 0.2s !important;
}

.site-nav-menu a:link,
.site-nav-menu a:visited {
    color: #d1d5db !important;
}

.site-nav-menu a:hover {
    color: #10b981 !important;
    text-decoration: none !important;
}

/* Donate button */
.site-nav-donate {
    background-color: #10b981 !important;
    color: #ffffff !important;
    padding: 8px 16px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    border-bottom: none !important;
    transition: background-color 0.2s !important;
}

.site-nav-donate:link,
.site-nav-donate:visited,
.site-nav-donate:active {
    color: #ffffff !important;
}

.site-nav-donate:hover {
    background-color: #34d399 !important;
    color: #ffffff !important;
}

/* Sidebar search input */
.wy-side-nav-search input[type="text"] {
    background-color: var(--color-docs-code-bg);
    border: 1px solid var(--color-slate-700);
    border-radius: 4px;
    box-shadow: none;
    color: var(--color-docs-text-secondary);
}

.wy-side-nav-search input[type="text"]::placeholder {
    color: var(--color-syntax-comment);
}

/* Ensure bottom nav items are not clipped */
.wy-menu-vertical {
    padding-bottom: 2em;
}

/* Remove vertical separators between sidebar sections */
.wy-menu-vertical .caption {
    border-bottom: none !important;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Adjust RTD theme layout for fixed header */
.wy-nav-side {
    top: 64px;
    height: calc(100% - 64px);
    min-height: 0;
    padding-bottom: 0;
}

.wy-nav-content-wrap {
    margin-top: 64px;
}

.wy-side-nav-search {
    position: sticky;
    top: 0;
    z-index: 10;
    margin-top: 0;
    padding-top: 1rem !important;
}

/* Sidebar header link (Technical Documentation) */
.wy-side-nav-search a:hover {
    background-color: transparent !important;
    text-decoration: none !important;
}

/* Sidebar header link spacing */
.wy-side-nav-search > a {
    margin-top: 0.5rem;
}

/* ============================================================================
   Sidebar Toggle Button
   ============================================================================ */

/* Sidebar toggle button */
.sidebar-toggle {
    position: fixed;
    top: 78px;
    left: 270px;
    z-index: 250;
    width: 24px;
    height: 24px;
    background: var(--color-slate-700);
    border: 1px solid var(--color-slate-600);
    border-radius: 4px;
    color: var(--color-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: left 0.3s ease, background-color 0.2s;
}

.sidebar-toggle:hover {
    background: var(--color-slate-600);
    color: #ffffff;
}

/* Collapsed state */
body.sidebar-collapsed .wy-nav-side {
    transform: translateX(-100%);
}

body.sidebar-collapsed .wy-nav-content-wrap {
    margin-left: 0;
}

body.sidebar-collapsed .sidebar-toggle {
    left: 10px;
}

/* Smooth transitions */
.wy-nav-side {
    transition: transform 0.3s ease;
}

.wy-nav-content-wrap {
    transition: margin-left 0.3s ease;
}

/* Hide toggle on mobile (RTD handles collapse) */
@media screen and (max-width: 768px) {
    .sidebar-toggle {
        display: none;
    }
}

/* Mobile nav adjustments */
@media screen and (max-width: 768px) {
    .wy-nav-top {
        margin-top: 64px;  /* Use margin-top since RTD's .wy-nav-top has position: relative */
        background-color: var(--color-slate-800);
    }

    .wy-nav-side {
        top: 64px;
        height: calc(100% - 64px);
        min-height: 0;
        padding-bottom: 0;
    }

    .wy-nav-content-wrap {
        margin-top: 64px;
    }
}

/* RST content text colors - dark on light */
.rst-content p,
.rst-content li,
.rst-content dd,
.rst-content dt {
    color: var(--color-docs-text-secondary);
}

.rst-content strong {
    color: var(--color-docs-text-primary);
}

/* Footer styling */
footer {
    color: var(--color-text-muted);
}

footer a {
    color: var(--color-emerald);
}

/* Version selector / RTD badge */
.rst-versions {
    background-color: var(--color-slate-900);
    color: var(--color-text-secondary);
}

.rst-versions a {
    color: var(--color-emerald);
}

/* Toctree caption (section titles in sidebar) */
.wy-menu-vertical p.caption {
    color: var(--color-emerald);
}

/* Nested toctree items - keep dark backgrounds */
.wy-menu-vertical li.toctree-l2 a,
.wy-menu-vertical li.toctree-l2 a:visited,
.wy-menu-vertical li.toctree-l3 a,
.wy-menu-vertical li.toctree-l3 a:visited,
.wy-menu-vertical li.toctree-l4 a,
.wy-menu-vertical li.toctree-l4 a:visited {
    color: var(--color-text-secondary);
    background: transparent !important;
}

.wy-menu-vertical li.toctree-l2.current > a,
.wy-menu-vertical li.toctree-l3.current > a {
    background-color: rgba(16, 185, 129, 0.2) !important;
    color: var(--color-emerald-light);
}

/* Ensure current item children stay dark */
.wy-menu-vertical li.current ul {
    background: var(--color-slate-800) !important;
}

/* Definition lists */
.rst-content dl dt {
    background-color: var(--color-docs-code-bg);
    border-top: 3px solid var(--color-emerald);
    color: var(--color-docs-text-primary);
}

/* ============================================================================
   Sidebar Project Ordering Fix
   Forces consistent ordering: AirGap Transfer, AirGap Deploy, Cleanroom Whisper
   regardless of which page is currently being viewed.

   Uses data-project attributes set by JavaScript in layout.html.
   ============================================================================ */

/* Make the Projects section ul a flex container */
.wy-menu-vertical .caption + ul {
    display: flex;
    flex-direction: column;
}

/* Assign explicit order to each project based on data attribute */
.wy-menu-vertical li.toctree-l1[data-project="transfer"] {
    order: 1;
}

.wy-menu-vertical li.toctree-l1[data-project="deploy"] {
    order: 2;
}

.wy-menu-vertical li.toctree-l1[data-project="whisper"] {
    order: 3;
}

/* ============================================================================
   Print Styles
   ============================================================================ */

@media print {
    .wy-nav-side,
    .wy-nav-content-wrap,
    .rst-versions {
        display: none;
    }

    .document {
        max-width: 100%;
        margin: 0;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    .usecase, .req, .nfreq, .test, .impl, .spec {
        page-break-inside: avoid;
    }
}
