/**
 * BoxCart Documentation — Design System & Layout
 *
 * A complete self-contained CSS design system for the BoxCart documentation site.
 * Supports light/dark mode, responsive layout, print, and all documentation components.
 *
 * @package BoxCart
 */

/* ==========================================================================
   1. Font Faces
   ========================================================================== */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/inter-v13-latin-regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/inter-v13-latin-500.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/inter-v13-latin-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/inter-v13-latin-700.woff2') format('woff2');
}

/* ==========================================================================
   2. CSS Custom Properties — Light Theme (default)
   ========================================================================== */

:root {
    /* Brand */
    --bc-primary: #2D7D5F;
    --bc-primary-hover: #246850;
    --bc-primary-light: #E8F5F0;
    --bc-primary-dark: #1B4D3A;

    /* Secondary */
    --bc-secondary: #8B7355;
    --bc-secondary-hover: #745F47;
    --bc-secondary-light: #F5F1ED;

    /* Backgrounds */
    --bc-bg: #FFFFFF;
    --bc-bg-sidebar: #FAFBFB;
    --bc-bg-code: #F8F9FA;
    --bc-bg-hover: #F0F2F4;
    --bc-bg-callout: #F6F8FA;

    /* Text */
    --bc-text: #1E1E1E;
    --bc-text-secondary: #50575E;
    --bc-text-muted: #787C82;
    --bc-text-inverse: #FFFFFF;

    /* Borders */
    --bc-border: #DCDCDE;
    --bc-border-light: #E8EAED;
    --bc-border-heavy: #C3C4C7;

    /* Status */
    --bc-info: #4B7CC4;
    --bc-info-bg: #EDF3FD;
    --bc-info-border: #B8D0F0;
    --bc-tip: #2D7D5F;
    --bc-tip-bg: #E8F5F0;
    --bc-tip-border: #A8D5C4;
    --bc-warning: #C4922E;
    --bc-warning-bg: #FEF8E8;
    --bc-warning-border: #E8D5A0;
    --bc-danger: #C44B4B;
    --bc-danger-bg: #FDEDED;
    --bc-danger-border: #E8B0B0;

    /* Shadows */
    --bc-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
    --bc-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --bc-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

    /* Layout */
    --bc-sidebar-width: 280px;
    --bc-toc-width: 220px;
    --bc-content-max: 780px;
    --bc-header-height: 60px;

    /* Spacing */
    --bc-space-1: 4px;
    --bc-space-2: 8px;
    --bc-space-3: 12px;
    --bc-space-4: 16px;
    --bc-space-5: 20px;
    --bc-space-6: 24px;
    --bc-space-8: 32px;
    --bc-space-10: 40px;
    --bc-space-12: 48px;
    --bc-space-16: 64px;

    /* Typography */
    --bc-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --bc-font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', Consolas, 'Courier New', monospace;
    --bc-text-xs: 0.75rem;
    --bc-text-sm: 0.8125rem;
    --bc-text-base: 0.9375rem;
    --bc-text-lg: 1.0625rem;
    --bc-text-xl: 1.25rem;
    --bc-text-2xl: 1.5rem;
    --bc-text-3xl: 1.875rem;
    --bc-leading-tight: 1.3;
    --bc-leading-normal: 1.6;
    --bc-leading-relaxed: 1.7;

    /* Radius */
    --bc-radius-sm: 4px;
    --bc-radius-md: 6px;
    --bc-radius-lg: 8px;
    --bc-radius-xl: 12px;

    /* Transitions */
    --bc-transition: 0.2s ease;
    --bc-transition-slow: 0.3s ease;
}

/* ==========================================================================
   3. Dark Theme
   ========================================================================== */

[data-theme="dark"] {
    --bc-bg: #1A1A1A;
    --bc-bg-sidebar: #1E1E1E;
    --bc-bg-code: #2A2A2A;
    --bc-bg-hover: #2C2C2C;
    --bc-bg-callout: #242424;

    --bc-text: #E8E8EA;
    --bc-text-secondary: #B0B0B4;
    --bc-text-muted: #8C8F94;

    --bc-border: #3A3A3A;
    --bc-border-light: #333333;
    --bc-border-heavy: #4A4A4A;

    --bc-info-bg: #1A2636;
    --bc-info-border: #2A4A6E;
    --bc-tip-bg: #1A2E24;
    --bc-tip-border: #2A5E44;
    --bc-warning-bg: #2E2810;
    --bc-warning-border: #5E4E20;
    --bc-danger-bg: #2E1A1A;
    --bc-danger-border: #5E2A2A;

    --bc-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --bc-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --bc-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);

    --bc-primary-light: #1A3D2E;
    --bc-secondary-light: #2E2820;
}

/* ==========================================================================
   4. Reset & Base
   ========================================================================== */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--bc-header-height) + var(--bc-space-6));
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--bc-font);
    font-size: var(--bc-text-base);
    line-height: var(--bc-leading-normal);
    color: var(--bc-text);
    background-color: var(--bc-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

img, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

code, kbd, samp, pre {
    font-family: var(--bc-font-mono);
}

hr {
    border: none;
    border-top: 1px solid var(--bc-border);
    margin: var(--bc-space-8) 0;
}

/* ==========================================================================
   5. Header
   ========================================================================== */

.docs-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--bc-header-height);
    background-color: var(--bc-bg);
    border-bottom: 1px solid var(--bc-border);
    display: flex;
    align-items: center;
    padding: 0 var(--bc-space-6);
    gap: var(--bc-space-4);
}

.docs-header__logo {
    display: flex;
    align-items: center;
    gap: var(--bc-space-3);
    text-decoration: none;
    color: var(--bc-text);
    font-weight: 700;
    font-size: var(--bc-text-lg);
    flex-shrink: 0;
    white-space: nowrap;
}
.docs-header__logo:hover {
    color: var(--bc-primary);
    text-decoration: none;
}

.docs-header__logo svg {
    width: 28px;
    height: 28px;
}

.docs-header__logo-badge {
    font-size: var(--bc-text-xs);
    font-weight: 600;
    color: var(--bc-primary);
    background-color: var(--bc-primary-light);
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.02em;
}

.docs-header__search {
    flex: 1;
    max-width: 480px;
    position: relative;
}

.docs-header__search-input {
    width: 100%;
    height: 36px;
    padding: 0 var(--bc-space-4) 0 36px;
    font-family: var(--bc-font);
    font-size: var(--bc-text-sm);
    color: var(--bc-text);
    background-color: var(--bc-bg-callout);
    border: 1px solid var(--bc-border);
    border-radius: var(--bc-radius-lg);
    outline: none;
    transition: all var(--bc-transition);
}
.docs-header__search-input:focus {
    border-color: var(--bc-primary);
    box-shadow: 0 0 0 3px rgba(45, 125, 95, 0.12);
    background-color: var(--bc-bg);
}
.docs-header__search-input::placeholder {
    color: var(--bc-text-muted);
}

.docs-header__search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--bc-text-muted);
    pointer-events: none;
}

.docs-header__search-kbd {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--bc-font);
    font-size: 11px;
    font-weight: 500;
    color: var(--bc-text-muted);
    background-color: var(--bc-bg);
    border: 1px solid var(--bc-border);
    border-radius: var(--bc-radius-sm);
    padding: 1px 6px;
    line-height: 1.4;
    pointer-events: none;
}

.docs-search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background-color: var(--bc-bg);
    border: 1px solid var(--bc-border);
    border-radius: var(--bc-radius-lg);
    box-shadow: var(--bc-shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 200;
}
.docs-search-results.is-active {
    display: block;
}

.docs-search-results__item {
    display: block;
    padding: var(--bc-space-3) var(--bc-space-4);
    color: var(--bc-text);
    text-decoration: none;
    border-bottom: 1px solid var(--bc-border-light);
    transition: background-color var(--bc-transition);
}
.docs-search-results__item:last-child {
    border-bottom: none;
}
.docs-search-results__item:hover,
.docs-search-results__item.is-active {
    background-color: var(--bc-bg-hover);
    text-decoration: none;
    color: var(--bc-text);
}

.docs-search-results__title {
    font-weight: 600;
    font-size: var(--bc-text-sm);
    margin-bottom: 2px;
}
.docs-search-results__section {
    font-size: var(--bc-text-xs);
    color: var(--bc-text-muted);
}

.docs-search-results__empty {
    padding: var(--bc-space-6) var(--bc-space-4);
    text-align: center;
    color: var(--bc-text-muted);
    font-size: var(--bc-text-sm);
}

.docs-header__actions {
    display: flex;
    align-items: center;
    gap: var(--bc-space-2);
    flex-shrink: 0;
    margin-left: auto;
}

.docs-header__theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--bc-border);
    border-radius: var(--bc-radius-md);
    background-color: transparent;
    color: var(--bc-text-secondary);
    cursor: pointer;
    transition: all var(--bc-transition);
}
.docs-header__theme-toggle:hover {
    background-color: var(--bc-bg-hover);
    color: var(--bc-text);
    border-color: var(--bc-border-heavy);
}

.docs-header__theme-toggle svg {
    width: 18px;
    height: 18px;
}

.docs-header__theme-toggle .icon-moon,
[data-theme="dark"] .docs-header__theme-toggle .icon-sun {
    display: none;
}
[data-theme="dark"] .docs-header__theme-toggle .icon-moon {
    display: block;
}

.docs-header__link {
    display: flex;
    align-items: center;
    gap: var(--bc-space-2);
    padding: var(--bc-space-2) var(--bc-space-3);
    font-size: var(--bc-text-sm);
    font-weight: 500;
    color: var(--bc-text-secondary);
    border: 1px solid var(--bc-border);
    border-radius: var(--bc-radius-md);
    text-decoration: none;
    transition: all var(--bc-transition);
    white-space: nowrap;
}
.docs-header__link:hover {
    background-color: var(--bc-bg-hover);
    color: var(--bc-text);
    border-color: var(--bc-border-heavy);
    text-decoration: none;
}

.docs-header__hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    color: var(--bc-text);
    cursor: pointer;
    padding: 0;
}
.docs-header__hamburger svg {
    width: 22px;
    height: 22px;
}

/* ==========================================================================
   6. Layout Grid
   ========================================================================== */

.docs-layout {
    display: grid;
    grid-template-columns: var(--bc-sidebar-width) 1fr var(--bc-toc-width);
    margin-top: var(--bc-header-height);
    min-height: calc(100vh - var(--bc-header-height));
}

/* ==========================================================================
   7. Sidebar Navigation
   ========================================================================== */

.docs-sidebar {
    position: sticky;
    top: var(--bc-header-height);
    height: calc(100vh - var(--bc-header-height));
    overflow-y: auto;
    overflow-x: hidden;
    background-color: var(--bc-bg-sidebar);
    border-right: 1px solid var(--bc-border);
    padding: var(--bc-space-6) 0;
    font-size: var(--bc-text-sm);
    scrollbar-width: thin;
    scrollbar-color: var(--bc-border) transparent;
}
.docs-sidebar::-webkit-scrollbar {
    width: 4px;
}
.docs-sidebar::-webkit-scrollbar-thumb {
    background-color: var(--bc-border);
    border-radius: 2px;
}

.docs-sidebar__section {
    margin-bottom: var(--bc-space-6);
}

.docs-sidebar__heading {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bc-text-muted);
    padding: 0 var(--bc-space-6) var(--bc-space-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}
.docs-sidebar__heading::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    transition: transform var(--bc-transition);
}
.docs-sidebar__heading.is-collapsed::after {
    transform: rotate(-90deg);
}

.docs-sidebar__links {
    list-style: none;
    overflow: hidden;
    transition: max-height var(--bc-transition-slow);
}
.docs-sidebar__heading.is-collapsed + .docs-sidebar__links {
    max-height: 0 !important;
}

.docs-sidebar__link {
    display: block;
    padding: var(--bc-space-2) var(--bc-space-6);
    color: var(--bc-text-secondary);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all var(--bc-transition);
    line-height: 1.5;
}
.docs-sidebar__link:hover {
    color: var(--bc-text);
    background-color: var(--bc-bg-hover);
    text-decoration: none;
}
.docs-sidebar__link.is-active {
    color: var(--bc-primary);
    font-weight: 600;
    border-left-color: var(--bc-primary);
    background-color: var(--bc-primary-light);
}

.docs-sidebar__overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 49;
}

/* ==========================================================================
   8. Main Content Area
   ========================================================================== */

.docs-content {
    padding: var(--bc-space-10) var(--bc-space-12);
    max-width: calc(var(--bc-content-max) + var(--bc-space-12) * 2);
    min-width: 0;
}

/* Breadcrumb */
.docs-breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--bc-space-2);
    font-size: var(--bc-text-sm);
    color: var(--bc-text-muted);
    margin-bottom: var(--bc-space-6);
    flex-wrap: wrap;
}
.docs-breadcrumb a {
    color: var(--bc-text-muted);
}
.docs-breadcrumb a:hover {
    color: var(--bc-primary);
}
.docs-breadcrumb__sep {
    color: var(--bc-border-heavy);
    font-size: var(--bc-text-xs);
}

/* Page title */
.docs-content h1 {
    font-size: var(--bc-text-3xl);
    font-weight: 700;
    line-height: var(--bc-leading-tight);
    color: var(--bc-text);
    margin-bottom: var(--bc-space-3);
    letter-spacing: -0.01em;
}

.docs-content__lead {
    font-size: var(--bc-text-lg);
    color: var(--bc-text-secondary);
    line-height: var(--bc-leading-relaxed);
    margin-bottom: var(--bc-space-10);
}

/* Section headings */
.docs-content h2 {
    font-size: var(--bc-text-2xl);
    font-weight: 700;
    line-height: var(--bc-leading-tight);
    color: var(--bc-text);
    margin-top: var(--bc-space-12);
    margin-bottom: var(--bc-space-4);
    padding-bottom: var(--bc-space-3);
    border-bottom: 1px solid var(--bc-border-light);
    letter-spacing: -0.005em;
}
.docs-content h2:first-of-type {
    margin-top: 0;
}

.docs-content h3 {
    font-size: var(--bc-text-xl);
    font-weight: 600;
    line-height: var(--bc-leading-tight);
    color: var(--bc-text);
    margin-top: var(--bc-space-8);
    margin-bottom: var(--bc-space-3);
}

.docs-content h4 {
    font-size: var(--bc-text-lg);
    font-weight: 600;
    color: var(--bc-text);
    margin-top: var(--bc-space-6);
    margin-bottom: var(--bc-space-2);
}

/* Heading anchors */
.docs-heading-anchor {
    display: inline-block;
    margin-left: var(--bc-space-2);
    color: var(--bc-text-muted);
    font-weight: 400;
    opacity: 0;
    transition: opacity var(--bc-transition);
    text-decoration: none;
}
h2:hover .docs-heading-anchor,
h3:hover .docs-heading-anchor,
h4:hover .docs-heading-anchor {
    opacity: 1;
}
.docs-heading-anchor:hover {
    color: var(--bc-primary);
    text-decoration: none;
}
.docs-heading-anchor.is-copied {
    opacity: 1;
    color: var(--bc-tip);
    font-size: 0.5em;
    font-weight: 500;
}

/* Paragraphs and lists */
.docs-content p {
    margin-bottom: var(--bc-space-4);
    line-height: var(--bc-leading-relaxed);
}

.docs-content ul,
.docs-content ol {
    margin-bottom: var(--bc-space-4);
    padding-left: var(--bc-space-6);
}
.docs-content li {
    margin-bottom: var(--bc-space-2);
    line-height: var(--bc-leading-relaxed);
}
.docs-content li > ul,
.docs-content li > ol {
    margin-top: var(--bc-space-2);
    margin-bottom: 0;
}

/* Inline code */
.docs-content code:not([class*="language-"]) {
    font-size: 0.875em;
    padding: 2px 6px;
    background-color: var(--bc-bg-code);
    border: 1px solid var(--bc-border-light);
    border-radius: var(--bc-radius-sm);
    color: var(--bc-primary-dark);
    font-weight: 500;
    word-break: break-word;
}
[data-theme="dark"] .docs-content code:not([class*="language-"]) {
    color: #7CC4A8;
}

/* Strong and em */
.docs-content strong {
    font-weight: 600;
    color: var(--bc-text);
}

/* ==========================================================================
   9. Code Blocks
   ========================================================================== */

.docs-code-block {
    position: relative;
    margin-bottom: var(--bc-space-6);
    border-radius: var(--bc-radius-lg);
    border: 1px solid var(--bc-border);
    overflow: hidden;
}

.docs-code-block__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--bc-space-2) var(--bc-space-4);
    background-color: var(--bc-bg-callout);
    border-bottom: 1px solid var(--bc-border);
    font-size: var(--bc-text-xs);
}

.docs-code-block__lang {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bc-text-muted);
}

.docs-code-block__copy {
    display: flex;
    align-items: center;
    gap: var(--bc-space-1);
    padding: var(--bc-space-1) var(--bc-space-2);
    font-family: var(--bc-font);
    font-size: var(--bc-text-xs);
    font-weight: 500;
    color: var(--bc-text-muted);
    background: none;
    border: 1px solid transparent;
    border-radius: var(--bc-radius-sm);
    cursor: pointer;
    transition: all var(--bc-transition);
}
.docs-code-block__copy:hover {
    color: var(--bc-text);
    background-color: var(--bc-bg-hover);
    border-color: var(--bc-border);
}
.docs-code-block__copy.is-copied {
    color: var(--bc-tip);
    position: relative;
}
.docs-code-block__copy.is-copied::after {
    content: 'Copied!';
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    background-color: var(--bc-tip);
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    animation: docs-fade-in 0.15s ease;
}
.docs-code-block__copy svg {
    width: 14px;
    height: 14px;
}

.docs-code-block pre {
    margin: 0;
    padding: var(--bc-space-4);
    overflow-x: auto;
    background-color: var(--bc-bg-code);
    font-size: var(--bc-text-sm);
    line-height: 1.7;
    tab-size: 4;
}

.docs-code-block pre code {
    font-size: inherit;
    padding: 0;
    background: none;
    border: none;
    color: inherit;
}

/* ==========================================================================
   10. Callout Boxes
   ========================================================================== */

.docs-callout {
    padding: var(--bc-space-4) var(--bc-space-5);
    margin-bottom: var(--bc-space-6);
    border-radius: var(--bc-radius-md);
    border-left: 4px solid;
    font-size: var(--bc-text-sm);
}

.docs-callout__title {
    display: flex;
    align-items: center;
    gap: var(--bc-space-2);
    font-weight: 600;
    font-size: var(--bc-text-sm);
    margin-bottom: var(--bc-space-2);
}
.docs-callout__title svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

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

/* Info */
.docs-callout--info {
    background-color: var(--bc-info-bg);
    border-left-color: var(--bc-info);
}
.docs-callout--info .docs-callout__title {
    color: var(--bc-info);
}

/* Tip */
.docs-callout--tip {
    background-color: var(--bc-tip-bg);
    border-left-color: var(--bc-tip);
}
.docs-callout--tip .docs-callout__title {
    color: var(--bc-tip);
}

/* Warning */
.docs-callout--warning {
    background-color: var(--bc-warning-bg);
    border-left-color: var(--bc-warning);
}
.docs-callout--warning .docs-callout__title {
    color: var(--bc-warning);
}

/* Danger */
.docs-callout--danger {
    background-color: var(--bc-danger-bg);
    border-left-color: var(--bc-danger);
}
.docs-callout--danger .docs-callout__title {
    color: var(--bc-danger);
}

/* ==========================================================================
   11. Tables
   ========================================================================== */

.docs-table-wrap {
    overflow-x: auto;
    margin-bottom: var(--bc-space-6);
    border: 1px solid var(--bc-border);
    border-radius: var(--bc-radius-lg);
}

.docs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--bc-text-sm);
}

.docs-table th {
    text-align: left;
    font-weight: 600;
    padding: var(--bc-space-3) var(--bc-space-4);
    background-color: var(--bc-bg-callout);
    border-bottom: 2px solid var(--bc-border);
    color: var(--bc-text);
    white-space: nowrap;
}

.docs-table td {
    padding: var(--bc-space-3) var(--bc-space-4);
    border-bottom: 1px solid var(--bc-border-light);
    vertical-align: top;
    color: var(--bc-text-secondary);
}

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

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

.docs-table code {
    font-size: 0.8125em;
    white-space: nowrap;
    word-break: normal;
}

/* ==========================================================================
   12. Step Lists
   ========================================================================== */

.docs-steps {
    list-style: none;
    padding-left: 0;
    counter-reset: step-counter;
    margin-bottom: var(--bc-space-6);
}

.docs-steps__item {
    position: relative;
    padding-left: 48px;
    padding-bottom: var(--bc-space-6);
    margin-bottom: 0;
    counter-increment: step-counter;
}

.docs-steps__item::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 30px;
    height: 30px;
    background-color: var(--bc-primary);
    color: var(--bc-text-inverse);
    font-size: var(--bc-text-sm);
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.docs-steps__item::after {
    content: '';
    position: absolute;
    left: 14px;
    top: 34px;
    bottom: 0;
    width: 2px;
    background-color: var(--bc-border);
}
.docs-steps__item:last-child::after {
    display: none;
}
.docs-steps__item:last-child {
    padding-bottom: 0;
}

.docs-steps__title {
    font-weight: 600;
    font-size: var(--bc-text-base);
    margin-bottom: var(--bc-space-2);
    color: var(--bc-text);
}

/* ==========================================================================
   13. Shortcode Display
   ========================================================================== */

.docs-shortcode {
    display: inline-flex;
    align-items: center;
    gap: var(--bc-space-2);
    padding: var(--bc-space-2) var(--bc-space-3);
    background-color: var(--bc-bg-code);
    border: 1px solid var(--bc-border);
    border-radius: var(--bc-radius-md);
    font-family: var(--bc-font-mono);
    font-size: var(--bc-text-sm);
    color: var(--bc-primary-dark);
    margin-bottom: var(--bc-space-3);
    cursor: pointer;
    transition: all var(--bc-transition);
}
[data-theme="dark"] .docs-shortcode {
    color: #7CC4A8;
}
.docs-shortcode:hover {
    border-color: var(--bc-primary);
    background-color: var(--bc-primary-light);
}
.docs-shortcode__copy {
    width: 14px;
    height: 14px;
    color: var(--bc-text-muted);
    flex-shrink: 0;
}
.docs-shortcode.is-copied {
    border-color: var(--bc-tip);
    background-color: var(--bc-primary-light);
    position: relative;
}
.docs-shortcode.is-copied::after {
    content: 'Copied!';
    position: absolute;
    top: -32px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 10px;
    font-family: var(--bc-font-sans);
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    background-color: var(--bc-tip);
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    animation: docs-fade-in 0.15s ease;
}
@keyframes docs-fade-in {
    from { opacity: 0; transform: translateX(-50%) translateY(4px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ==========================================================================
   14. Screenshot Placeholders
   ========================================================================== */

.docs-figure {
    margin-bottom: var(--bc-space-6);
}

.docs-figure__img {
    width: 100%;
    border-radius: var(--bc-radius-lg);
    border: 1px solid var(--bc-border);
    overflow: hidden;
}

.docs-figure__placeholder {
    width: 100%;
    min-height: 240px;
    background-color: var(--bc-bg-callout);
    border: 2px dashed var(--bc-border);
    border-radius: var(--bc-radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--bc-space-2);
    color: var(--bc-text-muted);
    font-size: var(--bc-text-sm);
}
.docs-figure__placeholder svg {
    width: 32px;
    height: 32px;
    opacity: 0.5;
}

.docs-figure figcaption {
    font-size: var(--bc-text-sm);
    color: var(--bc-text-muted);
    text-align: center;
    margin-top: var(--bc-space-2);
    font-style: italic;
}

/* ==========================================================================
   15. On This Page (TOC) — Right Column
   ========================================================================== */

.docs-toc {
    position: sticky;
    top: var(--bc-header-height);
    height: calc(100vh - var(--bc-header-height));
    overflow-y: auto;
    padding: var(--bc-space-8) var(--bc-space-5) var(--bc-space-8) 0;
    font-size: var(--bc-text-sm);
    scrollbar-width: none;
}
.docs-toc::-webkit-scrollbar {
    display: none;
}

.docs-toc__title {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bc-text-muted);
    margin-bottom: var(--bc-space-3);
    padding-left: var(--bc-space-4);
}

.docs-toc__list {
    list-style: none;
    border-left: 1px solid var(--bc-border-light);
}

.docs-toc__link {
    display: block;
    padding: var(--bc-space-1) var(--bc-space-4);
    color: var(--bc-text-muted);
    text-decoration: none;
    border-left: 2px solid transparent;
    margin-left: -1px;
    transition: all var(--bc-transition);
    line-height: 1.5;
}
.docs-toc__link:hover {
    color: var(--bc-text);
    text-decoration: none;
}
.docs-toc__link.is-active {
    color: var(--bc-primary);
    border-left-color: var(--bc-primary);
    font-weight: 500;
}
.docs-toc__link--h3 {
    padding-left: calc(var(--bc-space-4) + var(--bc-space-4));
    font-size: var(--bc-text-xs);
}

/* ==========================================================================
   16. Previous / Next Navigation
   ========================================================================== */

.docs-pager {
    display: flex;
    gap: var(--bc-space-4);
    margin-top: var(--bc-space-12);
    padding-top: var(--bc-space-8);
    border-top: 1px solid var(--bc-border);
}

.docs-pager__link {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--bc-space-1);
    padding: var(--bc-space-4) var(--bc-space-5);
    border: 1px solid var(--bc-border);
    border-radius: var(--bc-radius-lg);
    text-decoration: none;
    color: var(--bc-text);
    transition: all var(--bc-transition);
}
.docs-pager__link:hover {
    border-color: var(--bc-primary);
    box-shadow: var(--bc-shadow-sm);
    text-decoration: none;
    color: var(--bc-text);
}

.docs-pager__label {
    font-size: var(--bc-text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bc-text-muted);
}

.docs-pager__title {
    font-weight: 600;
    font-size: var(--bc-text-base);
    color: var(--bc-primary);
}

.docs-pager__link--next {
    text-align: right;
    margin-left: auto;
}

/* ==========================================================================
   17. Footer
   ========================================================================== */

.docs-footer {
    margin-top: var(--bc-space-8);
    padding: var(--bc-space-6) 0;
    border-top: 1px solid var(--bc-border-light);
    font-size: var(--bc-text-sm);
    color: var(--bc-text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--bc-space-2);
}

.docs-footer a {
    color: var(--bc-text-muted);
}
.docs-footer a:hover {
    color: var(--bc-primary);
}

/* ==========================================================================
   18. Back to Top
   ========================================================================== */

.docs-back-to-top {
    position: fixed;
    bottom: var(--bc-space-6);
    right: var(--bc-space-6);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bc-primary);
    color: var(--bc-text-inverse);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--bc-shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--bc-transition);
    z-index: 50;
}
.docs-back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.docs-back-to-top:hover {
    background-color: var(--bc-primary-hover);
    box-shadow: var(--bc-shadow-lg);
}
.docs-back-to-top svg {
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   19. Landing Page — Hero & Cards
   ========================================================================== */

.docs-hero {
    text-align: left;
    padding: var(--bc-space-16) 0 var(--bc-space-12);
}

.docs-hero__title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: var(--bc-leading-tight);
    color: var(--bc-text);
    margin-bottom: var(--bc-space-4);
    letter-spacing: -0.02em;
}

.docs-hero__subtitle {
    font-size: var(--bc-text-xl);
    color: var(--bc-text-secondary);
    max-width: 560px;
    margin: 0 0 var(--bc-space-8);
    line-height: var(--bc-leading-relaxed);
}

.docs-hero__version {
    display: inline-flex;
    align-items: center;
    gap: var(--bc-space-2);
    padding: var(--bc-space-2) var(--bc-space-4);
    font-size: var(--bc-text-sm);
    font-weight: 500;
    color: var(--bc-primary);
    background-color: var(--bc-primary-light);
    border-radius: 20px;
}

/* Audience cards */
.docs-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--bc-space-6);
    margin-bottom: var(--bc-space-12);
}

.docs-card {
    padding: var(--bc-space-6);
    border: 1px solid var(--bc-border);
    border-radius: var(--bc-radius-xl);
    transition: all var(--bc-transition);
    text-decoration: none;
    color: var(--bc-text);
    display: flex;
    flex-direction: column;
}
.docs-card:hover {
    border-color: var(--bc-primary);
    box-shadow: var(--bc-shadow-md);
    text-decoration: none;
    color: var(--bc-text);
    transform: translateY(-2px);
}

.docs-card__icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bc-primary-light);
    color: var(--bc-primary);
    border-radius: var(--bc-radius-lg);
    margin-bottom: var(--bc-space-4);
}
.docs-card__icon svg {
    width: 22px;
    height: 22px;
}

.docs-card__title {
    font-size: var(--bc-text-lg);
    font-weight: 600;
    margin-bottom: var(--bc-space-2);
    color: var(--bc-text);
}

.docs-card__desc {
    font-size: var(--bc-text-sm);
    color: var(--bc-text-secondary);
    line-height: var(--bc-leading-relaxed);
    flex: 1;
}

.docs-card__links {
    margin-top: var(--bc-space-4);
    padding-top: var(--bc-space-3);
    border-top: 1px solid var(--bc-border-light);
    display: flex;
    flex-direction: column;
    gap: var(--bc-space-1);
}

.docs-card__links a {
    font-size: var(--bc-text-sm);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--bc-space-1);
}
.docs-card__links a::before {
    content: '→';
    color: var(--bc-primary);
}

/* Quick links grid */
.docs-quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--bc-space-3);
    margin-bottom: var(--bc-space-8);
}

.docs-quick-link {
    display: flex;
    align-items: center;
    gap: var(--bc-space-3);
    padding: var(--bc-space-3) var(--bc-space-4);
    border: 1px solid var(--bc-border-light);
    border-radius: var(--bc-radius-md);
    color: var(--bc-text);
    font-size: var(--bc-text-sm);
    font-weight: 500;
    text-decoration: none;
    transition: all var(--bc-transition);
}
.docs-quick-link:hover {
    border-color: var(--bc-primary);
    background-color: var(--bc-primary-light);
    color: var(--bc-text);
    text-decoration: none;
}

/* ==========================================================================
   20. Feature Page — Feature Cards
   ========================================================================== */

.docs-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--bc-space-6);
    margin-bottom: var(--bc-space-10);
}

.docs-feature-card {
    padding: var(--bc-space-6);
    border: 1px solid var(--bc-border);
    border-radius: var(--bc-radius-xl);
}

.docs-feature-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bc-primary-light);
    color: var(--bc-primary);
    flex-shrink: 0;
    margin-bottom: 12px;
}
.docs-feature-card__icon svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.docs-feature-card__title {
    font-size: var(--bc-text-base);
    font-weight: 600;
    margin-bottom: var(--bc-space-2);
}

.docs-feature-card__desc {
    font-size: var(--bc-text-sm);
    color: var(--bc-text-secondary);
    line-height: var(--bc-leading-relaxed);
}

/* ==========================================================================
   21. Parameter / Hook Tables (Developer Ref)
   ========================================================================== */

.docs-param-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--bc-text-sm);
    margin-bottom: var(--bc-space-6);
}

.docs-param-table th {
    text-align: left;
    font-weight: 600;
    padding: var(--bc-space-3) var(--bc-space-4);
    background-color: var(--bc-bg-callout);
    border-bottom: 2px solid var(--bc-border);
    font-size: var(--bc-text-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bc-text-muted);
}

.docs-param-table td {
    padding: var(--bc-space-3) var(--bc-space-4);
    border-bottom: 1px solid var(--bc-border-light);
    vertical-align: top;
}
.docs-param-table tr:last-child td {
    border-bottom: none;
}

.docs-param-table .param-name {
    font-family: var(--bc-font-mono);
    font-size: var(--bc-text-sm);
    font-weight: 600;
    color: var(--bc-primary-dark);
    white-space: nowrap;
}
[data-theme="dark"] .docs-param-table .param-name {
    color: #7CC4A8;
}

.docs-param-table .param-type {
    font-family: var(--bc-font-mono);
    font-size: var(--bc-text-xs);
    color: var(--bc-secondary);
    white-space: nowrap;
}

.docs-param-table .param-default {
    font-family: var(--bc-font-mono);
    font-size: var(--bc-text-xs);
    color: var(--bc-text-muted);
}

/* Badge for required/optional */
.docs-badge {
    display: inline-block;
    padding: 1px 6px;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: var(--bc-radius-sm);
    letter-spacing: 0.02em;
}
.docs-badge--required {
    background-color: var(--bc-danger-bg);
    color: var(--bc-danger);
}
.docs-badge--optional {
    background-color: var(--bc-bg-callout);
    color: var(--bc-text-muted);
}
.docs-badge--admin {
    background-color: var(--bc-warning-bg);
    color: var(--bc-warning);
}
.docs-badge--public {
    background-color: var(--bc-tip-bg);
    color: var(--bc-tip);
}
.docs-badge--new {
    background-color: var(--bc-primary-light);
    color: var(--bc-primary);
}

/* ==========================================================================
   22. Responsive — Tablet (768px–1199px)
   ========================================================================== */

@media (max-width: 1199px) {
    .docs-layout {
        grid-template-columns: 1fr;
    }

    .docs-toc {
        display: none;
    }

    .docs-sidebar {
        position: fixed;
        left: -100%;
        top: var(--bc-header-height);
        bottom: 0;
        width: var(--bc-sidebar-width);
        z-index: 50;
        transition: left var(--bc-transition-slow);
    }
    .docs-sidebar.is-open {
        left: 0;
    }
    .docs-sidebar.is-open ~ .docs-sidebar__overlay {
        display: block;
    }

    .docs-header__hamburger {
        display: flex;
    }

    .docs-content {
        padding: var(--bc-space-8) var(--bc-space-6);
    }
}

/* ==========================================================================
   23. Responsive — Mobile (<768px)
   ========================================================================== */

@media (max-width: 767px) {
    :root {
        --bc-header-height: 54px;
    }

    .docs-header {
        padding: 0 var(--bc-space-4);
    }

    .docs-header__search {
        max-width: none;
    }

    .docs-header__search-kbd {
        display: none;
    }

    .docs-header__link span {
        display: none;
    }

    .docs-content {
        padding: var(--bc-space-6) var(--bc-space-4);
    }

    .docs-content h1 {
        font-size: var(--bc-text-2xl);
    }

    .docs-content h2 {
        font-size: var(--bc-text-xl);
    }

    .docs-hero__title {
        font-size: 1.75rem;
    }

    .docs-cards {
        grid-template-columns: 1fr;
    }

    .docs-pager {
        flex-direction: column;
    }

    .docs-pager__link--next {
        text-align: left;
    }

    .docs-table-wrap {
        font-size: var(--bc-text-xs);
    }

    .docs-code-block pre {
        font-size: var(--bc-text-xs);
    }

    .docs-quick-links {
        grid-template-columns: 1fr;
    }

    .docs-feature-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   24. Print Styles
   ========================================================================== */

@media print {
    :root {
        --bc-bg: #FFFFFF !important;
        --bc-text: #1E1E1E !important;
        --bc-bg-sidebar: #FFFFFF !important;
        --bc-bg-code: #F5F5F5 !important;
        --bc-border: #CCCCCC !important;
    }

    .docs-header,
    .docs-sidebar,
    .docs-toc,
    .docs-back-to-top,
    .docs-pager,
    .docs-header__search,
    .docs-code-block__copy,
    .docs-sidebar__overlay {
        display: none !important;
    }

    .docs-layout {
        display: block;
    }

    .docs-content {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }

    a {
        color: inherit;
        text-decoration: underline;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }

    .docs-content a[href^="#"]::after,
    .docs-heading-anchor::after {
        content: none;
    }

    .docs-code-block {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .docs-callout {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .docs-table-wrap {
        overflow: visible;
    }
}

/* ==========================================================================
   25. Utility Classes
   ========================================================================== */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.docs-text-center {
    text-align: center;
}

.docs-mt-0 { margin-top: 0; }
.docs-mb-0 { margin-bottom: 0; }
.docs-mb-4 { margin-bottom: var(--bc-space-4); }
.docs-mb-6 { margin-bottom: var(--bc-space-6); }
.docs-mb-8 { margin-bottom: var(--bc-space-8); }

/* Landing page full-width layout (no sidebar/toc) */
.docs-layout--landing {
    grid-template-columns: 1fr;
}
.docs-layout--landing .docs-sidebar {
    display: none;
}
.docs-layout--landing .docs-content {
    max-width: 960px;
    margin: 0 auto;
    padding: var(--bc-space-10) var(--bc-space-6);
}

/* Screenshot placeholders */
.docs-screenshot-placeholder {
    border: 2px dashed var(--bc-border);
    border-radius: 8px;
    padding: 40px 24px;
    text-align: center;
    background: var(--bc-surface);
    margin: 24px 0;
    color: var(--bc-text-muted);
}
.docs-screenshot-placeholder__icon {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}
.docs-screenshot-placeholder__icon svg {
    width: 32px;
    height: 32px;
    stroke: var(--bc-text-muted);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.5;
}
.docs-screenshot-placeholder__label {
    font-size: 14px;
    font-weight: 500;
    color: var(--bc-text-muted);
}
