/* ============================================
   KaxhyapUI Documentation - Apple-Style CSS
   ============================================ */

/* CSS Variables */
:root {
    /* Colors - Light Theme */
    --color-bg: #ffffff;
    --color-bg-secondary: #f5f5f7;
    --color-bg-tertiary: #fafafa;
    --color-text: #1d1d1f;
    --color-text-secondary: #6e6e73;
    --color-text-tertiary: #86868b;
    --color-border: rgba(0, 0, 0, 0.08);
    --color-border-strong: rgba(0, 0, 0, 0.12);
    --color-accent: #0071e3;
    --color-accent-hover: #0077ed;
    --color-accent-light: rgba(0, 113, 227, 0.08);
    --color-success: #34c759;
    --color-warning: #ff9f0a;
    --color-error: #ff3b30;
    
    /* Glass Effect */
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    
    /* Code Block */
    --code-bg: #1d1d1f;
    --code-text: #f5f5f7;
    --code-keyword: #fc5fa3;
    --code-type: #5dd8ff;
    --code-string: #fc6a5d;
    --code-comment: #6c7986;
    
    /* Typography */
    --font-display: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-text: 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
    
    /* Spacing */
    --nav-height: 52px;
    --sidebar-width: 280px;
    --content-max-width: 800px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-medium: 0.25s ease;
    --transition-slow: 0.35s ease;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
}

/* Dark Theme */
[data-theme="dark"] {
    --color-bg: #000000;
    --color-bg-secondary: #1c1c1e;
    --color-bg-tertiary: #2c2c2e;
    --color-text: #f5f5f7;
    --color-text-secondary: #a1a1a6;
    --color-text-tertiary: #6e6e73;
    --color-border: rgba(255, 255, 255, 0.1);
    --color-border-strong: rgba(255, 255, 255, 0.15);
    --color-accent: #0a84ff;
    --color-accent-hover: #409cff;
    --color-accent-light: rgba(10, 132, 255, 0.15);
    
    --glass-bg: rgba(28, 28, 30, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    
    --code-bg: #1c1c1e;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-height) + 24px);
    overflow-x: hidden;
}

body {
    font-family: var(--font-text);
    font-size: 17px;
    line-height: 1.47059;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    width: 100%;
    min-width: 0;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition-fast);
    word-break: break-word;
    overflow-wrap: break-word;
}

a:hover {
    color: var(--color-accent-hover);
}

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--color-bg-secondary);
    padding: 0.15em 0.4em;
    border-radius: var(--radius-sm);
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: none;
}

/* Ensure code in paragraphs doesn't cause overflow */
p code,
li code,
td code {
    word-break: break-all;
}

/* ============================================
   Top Navigation
   ============================================ */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--glass-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--color-border);
    z-index: 1000;
}

.nav-content {
    max-width: 1440px;
    width: 100%;
    height: 100%;
    margin: 0 auto;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-shrink: 1;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text);
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    min-width: 0;
}

.logo-icon {
    width: 24px;
    height: 24px;
    color: var(--color-accent);
}

.nav-divider {
    color: var(--color-text-tertiary);
    font-weight: 300;
}

.nav-section {
    color: var(--color-text-secondary);
    font-size: 15px;
}

.nav-center {
    flex: 1;
    max-width: 400px;
    margin: 0 24px;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: var(--color-text-tertiary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    height: 36px;
    padding: 0 40px 0 36px;
    font-family: var(--font-text);
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    outline: none;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.search-input:hover {
    border-color: var(--color-border-strong);
}

.search-input:focus {
    background: var(--color-bg);
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-light);
}

.search-shortcut {
    position: absolute;
    right: 10px;
    padding: 2px 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--color-text-tertiary);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 1px;
}

.cmd-icon {
    font-size: 14px;
    line-height: 1;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.mobile-search-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.mobile-search-btn:hover {
    background: var(--color-bg-secondary);
    color: var(--color-text);
}

.mobile-search-btn svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 1024px) {
    .mobile-search-btn {
        display: flex;
    }
}

@media (max-width: 768px) {
    .mobile-search-btn {
        width: 44px;
        height: 44px;
    }
    
    .mobile-search-btn svg {
        width: 22px;
        height: 22px;
    }
}

.nav-link {
    display: flex;
    align-items: center;
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
}

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

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    background: var(--color-bg-secondary);
    color: var(--color-text);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

.sun-icon {
    display: block;
}

.moon-icon {
    display: none;
}

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

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

/* ============================================
   Search Modal
   ============================================ */
.search-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 120px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-medium);
}

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

.search-modal-content {
    width: 100%;
    max-width: 640px;
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow), 0 0 0 1px var(--color-border);
    overflow: hidden;
    transform: scale(0.96) translateY(-10px);
    transition: transform var(--transition-medium);
}

.search-modal.active .search-modal-content {
    transform: scale(1) translateY(0);
}

.search-modal-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
}

.search-modal-header .search-icon {
    position: relative;
    left: 0;
    margin-right: 12px;
}

.search-modal-input {
    flex: 1;
    font-family: var(--font-text);
    font-size: 17px;
    color: var(--color-text);
    background: transparent;
    border: none;
    outline: none;
}

.search-modal-input::placeholder {
    color: var(--color-text-tertiary);
}

.search-modal-close {
    padding: 4px 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--color-text-tertiary);
    background: var(--color-bg-secondary);
    border-radius: 4px;
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
}

.search-results-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--color-text-tertiary);
}

.search-result-item {
    display: block;
    padding: 12px 20px;
    border-bottom: 1px solid var(--color-border);
    transition: background var(--transition-fast);
}

.search-result-item:hover,
.search-result-item.active {
    background: var(--color-accent-light);
}

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

.search-result-title {
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 4px;
}

.search-result-section {
    font-size: 13px;
    color: var(--color-text-tertiary);
}

/* ============================================
   Main Layout
   ============================================ */
.main-container {
    display: flex;
    min-height: 100vh;
    padding-top: var(--nav-height);
    max-width: 100vw;
    overflow-x: hidden;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--nav-height));
    background: var(--color-bg);
    border-right: 1px solid var(--color-border);
    overflow-y: auto;
    padding: 24px 0;
    z-index: 100;
    transition: transform var(--transition-medium);
}

.sidebar-nav {
    padding: 0 20px;
}

.sidebar-section {
    margin-bottom: 28px;
}

.sidebar-title {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-tertiary);
    margin-bottom: 12px;
}

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

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

.sidebar-link {
    display: block;
    padding: 8px 12px;
    font-size: 14px;
    color: var(--color-text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.sidebar-link:hover {
    color: var(--color-text);
    background: var(--color-bg-secondary);
}

.sidebar-link.active {
    color: var(--color-accent);
    background: var(--color-accent-light);
    font-weight: 500;
}

/* ============================================
   Content Area
   ============================================ */
.content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 48px 48px 80px;
    max-width: calc(var(--content-max-width) + var(--sidebar-width) + 96px);
    min-width: 0;
    overflow-x: hidden;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.doc-section {
    margin-bottom: 80px;
    padding-top: 20px;
}

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

.section-eyebrow {
    display: inline-block;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-accent);
    margin-bottom: 8px;
}

.section-header h1 {
    font-family: var(--font-display);
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--color-text);
    line-height: 1.1;
}

.section-content {
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.section-content h2 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--color-text);
    margin: 40px 0 16px;
}

.section-content h3 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    color: var(--color-text);
    margin: 32px 0 12px;
}

.section-content p {
    margin-bottom: 16px;
    color: var(--color-text);
    line-height: 1.58824;
}

.section-content p.lead {
    font-size: 21px;
    font-weight: 400;
    color: var(--color-text-secondary);
    line-height: 1.381;
    margin-bottom: 24px;
}

.section-content p.note {
    font-size: 14px;
    color: var(--color-text-tertiary);
    margin-top: 24px;
}

/* ============================================
   Callouts
   ============================================ */
.callout {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    margin: 24px 0;
}

.callout-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.callout-icon svg {
    width: 100%;
    height: 100%;
}

.callout-content p {
    margin: 0;
    font-size: 15px;
}

.callout-info .callout-icon {
    color: var(--color-accent);
}

.callout-warning .callout-icon {
    color: var(--color-warning);
}

.callout-warning {
    background: rgba(255, 159, 10, 0.1);
}

.callout-neutral .callout-icon {
    color: var(--color-text-tertiary);
}

/* ============================================
   Feature Grid
   ============================================ */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 32px 0;
}

.feature-card {
    padding: 24px;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    transition: all var(--transition-medium);
}

.feature-card:hover {
    background: var(--color-bg-tertiary);
    transform: translateY(-2px);
}

.feature-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent-light);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.feature-icon svg {
    width: 22px;
    height: 22px;
    color: var(--color-accent);
}

.feature-card h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--color-text);
}

.feature-card p {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin: 0;
}

/* ============================================
   Principle List
   ============================================ */
.principle-list {
    margin: 32px 0;
}

.principle-item {
    display: flex;
    gap: 20px;
    padding: 24px 0;
    border-bottom: 1px solid var(--color-border);
}

.principle-item:first-child {
    padding-top: 0;
}

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

.principle-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    color: var(--color-accent);
    background: var(--color-accent-light);
    border-radius: 50%;
}

.principle-content h3 {
    font-size: 19px;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--color-text);
}

.principle-content p {
    font-size: 15px;
    color: var(--color-text-secondary);
    margin: 0;
}

/* ============================================
   Platform Grid
   ============================================ */
.platform-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 32px 0;
}

.platform-card {
    padding: 28px;
    background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-tertiary) 100%);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    text-align: center;
    transition: all var(--transition-medium);
}

.platform-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--glass-shadow);
}

.platform-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent);
    border-radius: var(--radius-lg);
}

.platform-icon svg {
    width: 32px;
    height: 32px;
    color: white;
}

.platform-card h3 {
    font-size: 19px;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--color-text);
}

.platform-card p {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin: 0 0 16px;
}

.platform-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-success);
    background: rgba(52, 199, 89, 0.15);
    border-radius: 100px;
}

/* ============================================
   Steps List
   ============================================ */
.steps-list {
    margin: 24px 0;
}

.step-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
}

.step-number {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: white;
    background: var(--color-accent);
    border-radius: 50%;
}

.step-content {
    flex: 1;
    padding-top: 3px;
}

.step-content p {
    margin: 0;
}

/* ============================================
   Code Blocks
   ============================================ */
.code-block {
    margin: 20px 0;
    background: var(--code-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.code-block.compact {
    margin: 12px 0;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-header span {
    font-size: 12px;
    font-weight: 500;
    color: var(--code-text);
    opacity: 0.6;
}

.copy-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-family: var(--font-text);
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.copy-button svg {
    width: 14px;
    height: 14px;
}

.copy-button:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.copy-button.copied {
    color: var(--color-success);
}

.code-block pre {
    padding: 16px 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    margin: 0;
}

.code-block.compact pre {
    padding: 12px 16px;
    overflow-x: auto;
}

.code-block code {
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    color: var(--code-text);
    background: transparent;
    padding: 0;
    white-space: pre;
    word-break: normal;
    overflow-wrap: normal;
    display: block;
}

.code-block .keyword {
    color: var(--code-keyword);
}

.code-block .type {
    color: var(--code-type);
}

.code-block .string {
    color: var(--code-string);
}

.code-block .comment {
    color: var(--code-comment);
}

.code-block .property {
    color: #a167e6;
}

.code-block .attribute {
    color: #ff8170;
}

/* ============================================
   Version Badge
   ============================================ */
.version-badge {
    display: block;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--color-success) 0%, #28a745 100%);
    border-radius: 100px;
    margin-top: 16px;
    width: fit-content;
}

/* ============================================
   Platform Requirements
   ============================================ */
.platform-requirements {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0 32px;
}

.platform-req-badge {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

/* ============================================
   State Grid
   ============================================ */
.state-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin: 24px 0;
}

.state-card {
    padding: 16px 14px;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition-medium);
}

.state-card:hover {
    background: var(--color-bg-tertiary);
    transform: translateY(-2px);
}

.state-card h4 {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--color-text);
}

.state-card p {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin: 0;
    line-height: 1.3;
}

/* ============================================
   Defaults Table
   ============================================ */
.defaults-table {
    margin: 24px 0;
    overflow-x: auto;
    max-width: 100%;
}

.defaults-table table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.defaults-table th,
.defaults-table td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.defaults-table th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-tertiary);
    background: var(--color-bg-tertiary);
}

.defaults-table td {
    font-size: 14px;
    color: var(--color-text);
}

.defaults-table td code {
    font-size: 13px;
}

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

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

/* ============================================
   Status Banner
   ============================================ */
.status-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(255, 159, 10, 0.15) 0%, rgba(255, 159, 10, 0.05) 100%);
    border: 1px solid rgba(255, 159, 10, 0.2);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-indicator.beta {
    background: var(--color-warning);
    box-shadow: 0 0 0 4px rgba(255, 159, 10, 0.2);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.status-text h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 4px;
}

.status-text p {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin: 0;
}

/* ============================================
   Check List
   ============================================ */
.check-list {
    list-style: none;
    margin: 24px 0;
}

.check-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    font-size: 16px;
    color: var(--color-text);
}

.check-list svg {
    width: 22px;
    height: 22px;
    color: var(--color-success);
    flex-shrink: 0;
}

/* ============================================
   Styled List
   ============================================ */
.styled-list {
    margin: 16px 0;
    padding-left: 24px;
}

.styled-list li {
    margin-bottom: 12px;
    padding-left: 8px;
    color: var(--color-text);
}

.styled-list.muted li {
    color: var(--color-text-secondary);
}

/* ============================================
   Feature Pills
   ============================================ */
.feature-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.feature-pill {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-accent);
    background: var(--color-accent-light);
    border-radius: 100px;
}

/* ============================================
   Component Cards
   ============================================ */
.component-cards {
    margin: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.component-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-medium);
}

.component-card:hover {
    background: var(--color-bg-tertiary);
    border-color: var(--color-accent);
    transform: translateX(4px);
}

.component-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.component-icon svg {
    width: 26px;
    height: 26px;
    color: white;
}

.component-info {
    flex: 1;
}

.component-info h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 4px;
    color: var(--color-text);
}

.component-info p {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin: 0;
}

.component-arrow {
    width: 20px;
    height: 20px;
    color: var(--color-text-tertiary);
    transition: transform var(--transition-fast);
}

.component-card:hover .component-arrow {
    transform: translateX(4px);
    color: var(--color-accent);
}

/* ============================================
   Use Case Grid
   ============================================ */
.use-case-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 24px 0;
}

.use-case-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
}

.use-case-item svg {
    width: 20px;
    height: 20px;
    color: var(--color-accent);
    flex-shrink: 0;
}

.use-case-item span {
    font-size: 14px;
    color: var(--color-text);
}

/* ============================================
   Style Cards
   ============================================ */
.style-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 24px 0;
}

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

.style-card {
    padding: 24px;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-width: 0;
}

.style-card h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 12px;
    color: var(--color-text);
}

.style-card p {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin: 0 0 16px;
}

/* ============================================
   Screenshot Gallery
   ============================================ */
.screenshot-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 24px 0;
}

.screenshot-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    transition: border-color 0.2s ease;
}

.screenshot-item:hover {
    border-color: var(--color-accent);
}

.screenshot-item img {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: var(--radius-md);
    object-fit: contain;
}

.screenshot-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    letter-spacing: 0.02em;
}

/* ============================================
   Best Practices
   ============================================ */
.best-practices {
    margin: 24px 0;
}

.practice-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: var(--radius-md);
}

.practice-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.practice-item.good {
    background: rgba(52, 199, 89, 0.1);
}

.practice-item.good svg {
    color: var(--color-success);
}

.practice-item.avoid {
    background: rgba(255, 59, 48, 0.1);
}

.practice-item.avoid svg {
    color: var(--color-error);
}

.practice-item span {
    font-size: 14px;
    color: var(--color-text);
}

/* ============================================
   Version Timeline
   ============================================ */
.version-timeline {
    margin: 32px 0;
    position: relative;
}

.version-timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--color-border);
}

.timeline-item {
    display: flex;
    gap: 24px;
    padding: 24px 0;
    position: relative;
}

.timeline-marker {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    z-index: 1;
}

.timeline-marker.pre {
    background: var(--color-warning);
}

.timeline-marker.post {
    background: var(--color-success);
}

.timeline-content h3 {
    font-size: 19px;
    font-weight: 600;
    margin: 0 0 16px;
    color: var(--color-text);
}

/* ============================================
   Roadmap Grid
   ============================================ */
.roadmap-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 24px 0;
}

.roadmap-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.roadmap-item:hover {
    background: var(--color-bg-tertiary);
}

.roadmap-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent-light);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.roadmap-icon svg {
    width: 18px;
    height: 18px;
    color: var(--color-accent);
}

.roadmap-item span {
    font-size: 14px;
    color: var(--color-text);
}

/* ============================================
   Guidelines Grid
   ============================================ */
.guidelines-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 24px 0;
}

.guideline-item {
    padding: 24px;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    text-align: center;
}

.guideline-item svg {
    width: 28px;
    height: 28px;
    color: var(--color-accent);
    margin-bottom: 12px;
}

.guideline-item h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--color-text);
}

.guideline-item p {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin: 0;
}

/* ============================================
   License Card
   ============================================ */
.license-card {
    padding: 32px;
    background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-tertiary) 100%);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    text-align: center;
}

.license-card h3 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 16px;
    color: var(--color-text);
}

.license-card p {
    font-size: 16px;
    color: var(--color-text-secondary);
    margin: 0 0 8px;
}

.license-card p:last-child {
    margin: 0;
}

/* ============================================
   Support Cards
   ============================================ */
.support-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 32px 0;
}

.support-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 20px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition-medium);
}

.support-card:hover {
    background: var(--color-bg-tertiary);
    border-color: var(--color-accent);
    transform: translateY(-4px);
    box-shadow: var(--glass-shadow);
}

.support-card svg {
    width: 32px;
    height: 32px;
    color: var(--color-accent);
    margin-bottom: 16px;
}

.support-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--color-text);
}

.support-card p {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin: 0;
}

/* ============================================
   Footer
   ============================================ */
.doc-footer {
    margin-top: 80px;
    padding: 40px 0;
    border-top: 1px solid var(--color-border);
}

.footer-content {
    text-align: center;
}

.footer-content p {
    font-size: 14px;
    color: var(--color-text-tertiary);
    margin: 0 0 8px;
}

.footer-content p:last-child {
    margin: 0;
}

/* ============================================
   Mobile Menu Toggle
   ============================================ */
.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--color-accent);
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.3);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mobile-menu-toggle svg {
    width: 14px;
    height: 14px;
    color: white;
}

.mobile-menu-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.4);
}

/* ============================================
   Responsive Design
   ============================================ */

/* Tablet Landscape */
@media (max-width: 1200px) {
    .content {
        padding: 40px 32px 80px;
    }
}

/* Tablet Portrait */
@media (max-width: 1024px) {
    .nav-center {
        display: none;
    }
    
    .feature-grid,
    .platform-grid,
    .style-cards,
    .use-case-grid,
    .roadmap-grid,
    .guidelines-grid,
    .screenshot-gallery {
        grid-template-columns: 1fr;
    }
    
    .state-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .support-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile Landscape / Small Tablets */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 85vw;
        --nav-height: 56px;
    }
    
    html {
        scroll-padding-top: calc(var(--nav-height) + 16px);
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    body {
        font-size: 16px;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    /* Prevent horizontal overflow on mobile */
    .main-container,
    .content,
    .doc-section,
    .section-content {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Navigation improvements */
    .top-nav {
        height: var(--nav-height);
    }
    
    .nav-content {
        padding: 0 16px;
    }
    
    .logo {
        font-size: 14px;
    }
    
    .logo-icon {
        width: 22px;
        height: 22px;
    }
    
    .nav-right {
        gap: 8px;
    }
    
    .theme-toggle {
        width: 44px;
        height: 44px;
    }
    
    .mobile-menu-toggle {
        width: 32px;
        height: 32px;
    }
    
    .mobile-menu-toggle svg {
        width: 16px;
        height: 16px;
    }
    
    .nav-link svg {
        width: 22px;
        height: 22px;
    }
    
    /* Sidebar mobile overlay */
    .sidebar {
        position: fixed;
        width: var(--sidebar-width);
        max-width: 320px;
        transform: translateX(-100%);
        box-shadow: none;
        background: var(--color-bg);
        z-index: 1050;
    }
    
    .sidebar.active {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    }
    
    /* Sidebar backdrop */
    .sidebar::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        opacity: 0;
        visibility: hidden;
        transition: opacity var(--transition-medium), visibility var(--transition-medium);
        pointer-events: none;
        z-index: -1;
    }
    
    .sidebar.active::before {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        left: var(--sidebar-width);
    }
    
    .sidebar-nav {
        padding: 0 16px;
    }
    
    .sidebar-link {
        padding: 12px 14px;
        font-size: 15px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    /* Content area */
    .content {
        margin-left: 0;
        padding: 28px 20px 120px;
    }
    
    .doc-section {
        margin-bottom: 60px;
        padding-top: 12px;
    }
    
    /* Typography scaling */
    .section-header h1 {
        font-size: 28px;
        line-height: 1.15;
    }
    
    .section-content h2 {
        font-size: 22px;
        margin: 32px 0 14px;
    }
    
    .section-content h3 {
        font-size: 18px;
        margin: 24px 0 10px;
    }
    
    .section-content p.lead {
        font-size: 17px;
        line-height: 1.45;
    }
    
    .section-content p {
        font-size: 16px;
        line-height: 1.6;
    }
    
    /* Mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Feature cards */
    .feature-card {
        padding: 20px;
    }
    
    .feature-icon {
        width: 36px;
        height: 36px;
        margin-bottom: 12px;
    }
    
    .feature-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .feature-card h3 {
        font-size: 16px;
    }
    
    /* Platform cards */
    .platform-card {
        padding: 24px 20px;
    }
    
    .platform-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 14px;
    }
    
    .platform-icon svg {
        width: 26px;
        height: 26px;
    }
    
    .platform-card h3 {
        font-size: 17px;
    }
    
    /* Support cards */
    .support-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .support-card {
        flex-direction: row;
        text-align: left;
        padding: 16px 20px;
    }
    
    .support-card svg {
        width: 28px;
        height: 28px;
        margin-bottom: 0;
        margin-right: 16px;
    }
    
    .support-card h3 {
        font-size: 15px;
        margin-bottom: 2px;
    }
    
    .support-card p {
        font-size: 12px;
    }
    
    /* State grid */
    .state-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .state-card {
        padding: 14px 12px;
    }
    
    .state-card h4 {
        font-size: 12px;
    }
    
    .state-card p {
        font-size: 11px;
    }
    
    /* Timeline */
    .timeline-item {
        flex-direction: column;
        gap: 16px;
        padding-left: 48px;
    }
    
    .timeline-marker {
        position: absolute;
        left: 0;
    }
    
    .timeline-content h3 {
        font-size: 17px;
    }
    
    /* Code blocks */
    .code-block {
        margin: 16px 0;
        border-radius: var(--radius-md);
        max-width: 100%;
        overflow: hidden;
    }
    
    .code-block pre {
        padding: 14px 16px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }
    
    .code-block code {
        font-size: 13px;
        line-height: 1.5;
        white-space: pre;
        word-break: normal;
        overflow-wrap: normal;
    }
    
    .code-header {
        padding: 10px 16px;
    }
    
    .copy-button {
        padding: 8px 12px;
        min-height: 36px;
    }
    
    /* Callouts */
    .callout {
        flex-direction: row;
        gap: 14px;
        padding: 16px;
        margin: 20px 0;
    }
    
    .callout-icon {
        width: 22px;
        height: 22px;
        flex-shrink: 0;
    }
    
    .callout-content p {
        font-size: 14px;
    }
    
    /* Component cards */
    .component-card {
        padding: 16px;
        gap: 14px;
    }
    
    .component-icon {
        width: 44px;
        height: 44px;
    }
    
    .component-icon svg {
        width: 24px;
        height: 24px;
    }
    
    .component-info h3 {
        font-size: 16px;
    }
    
    .component-info p {
        font-size: 13px;
    }
    
    /* Use case grid */
    .use-case-grid {
        gap: 10px;
    }
    
    .use-case-item {
        padding: 14px;
    }
    
    .use-case-item span {
        font-size: 13px;
    }
    
    /* Defaults table */
    .defaults-table {
        margin: 20px 0;
        border-radius: var(--radius-md);
        overflow-x: hidden;
        max-width: 100%;
    }
    
    .defaults-table table {
        border-radius: var(--radius-md);
    }
    
    .defaults-table thead {
        display: none;
    }
    
    .defaults-table tbody tr {
        display: flex;
        flex-direction: column;
        padding: 14px 16px;
        border-bottom: 1px solid var(--color-border);
        gap: 6px;
    }
    
    .defaults-table tbody tr:last-child {
        border-bottom: none;
    }
    
    .defaults-table td {
        display: flex;
        padding: 0;
        font-size: 13px;
        border-bottom: none;
    }
    
    .defaults-table td::before {
        content: attr(data-label);
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--color-text-tertiary);
        min-width: 80px;
        flex-shrink: 0;
        padding-top: 1px;
    }
    
    .defaults-table tr:hover td {
        background: transparent;
    }
    
    /* Feature pills */
    .feature-pills {
        gap: 8px;
    }
    
    .feature-pill {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    /* Platform requirements */
    .platform-requirements {
        gap: 8px;
        margin: 14px 0 28px;
    }
    
    .platform-req-badge {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    /* Principle list */
    .principle-item {
        gap: 16px;
        padding: 20px 0;
    }
    
    .principle-number {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }
    
    .principle-content h3 {
        font-size: 17px;
    }
    
    .principle-content p {
        font-size: 14px;
    }
    
    /* Steps */
    .step-item {
        gap: 14px;
        padding: 14px 0;
    }
    
    .step-number {
        width: 26px;
        height: 26px;
        font-size: 13px;
    }
    
    .step-content p {
        font-size: 15px;
    }
    
    /* Best practices */
    .practice-item {
        padding: 10px 14px;
        gap: 10px;
    }
    
    .practice-item span {
        font-size: 13px;
    }
    
    /* Status banner */
    .status-banner {
        padding: 16px 18px;
        gap: 14px;
    }
    
    .status-text h3 {
        font-size: 15px;
    }
    
    .status-text p {
        font-size: 13px;
    }
    
    /* Check list */
    .check-list li {
        gap: 10px;
        padding: 8px 0;
        font-size: 15px;
    }
    
    .check-list svg {
        width: 20px;
        height: 20px;
    }
    
    /* Styled list */
    .styled-list {
        padding-left: 20px;
    }
    
    .styled-list li {
        margin-bottom: 10px;
        font-size: 15px;
    }
    
    /* License card */
    .license-card {
        padding: 24px 20px;
    }
    
    .license-card h3 {
        font-size: 20px;
    }
    
    .license-card p {
        font-size: 14px;
    }
    
    /* Footer */
    .doc-footer {
        margin-top: 60px;
        padding: 32px 0;
    }
    
    .footer-content p {
        font-size: 13px;
    }
    
    /* Roadmap */
    .roadmap-item {
        padding: 14px;
    }
    
    .roadmap-icon {
        width: 28px;
        height: 28px;
    }
    
    .roadmap-icon svg {
        width: 16px;
        height: 16px;
    }
    
    .roadmap-item span {
        font-size: 13px;
    }
    
    /* Guidelines */
    .guideline-item {
        padding: 20px;
    }
    
    .guideline-item svg {
        width: 24px;
        height: 24px;
        margin-bottom: 10px;
    }
    
    .guideline-item h3 {
        font-size: 14px;
    }
    
    .guideline-item p {
        font-size: 12px;
    }
    
    /* Version badge */
    .version-badge {
        font-size: 11px;
        padding: 3px 10px;
        margin-top: 12px;
    }
    
    /* Search modal mobile */
    .search-modal {
        padding-top: 60px;
        padding: 16px;
        align-items: flex-start;
    }
    
    .search-modal-content {
        max-width: 100%;
        margin-top: 60px;
    }
    
    .search-modal-header {
        padding: 14px 16px;
    }
    
    .search-modal-input {
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    .search-results {
        max-height: 60vh;
    }
    
    .search-result-item {
        padding: 14px 16px;
    }
    
    .search-result-title {
        font-size: 15px;
    }
    
    .search-result-section {
        font-size: 12px;
    }
}

/* Mobile Portrait - Small Phones */
@media (max-width: 480px) {
    :root {
        --sidebar-width: 100vw;
    }
    
    .nav-divider,
    .nav-section {
        display: none;
    }
    
    .content {
        padding: 20px 16px 120px;
    }
    
    .doc-section {
        margin-bottom: 48px;
    }
    
    .section-header {
        margin-bottom: 24px;
    }
    
    .section-header h1 {
        font-size: 24px;
    }
    
    .section-eyebrow {
        font-size: 12px;
    }
    
    .section-content h2 {
        font-size: 20px;
        margin: 28px 0 12px;
    }
    
    .section-content h3 {
        font-size: 17px;
    }
    
    .section-content p.lead {
        font-size: 16px;
    }
    
    /* Callouts stack on smallest screens */
    .callout {
        flex-direction: column;
        gap: 12px;
        padding: 14px;
    }
    
    /* Principle items stack */
    .principle-item {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    /* State grid single column on tiny screens */
    .state-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    /* Feature grid improvements */
    .feature-grid {
        gap: 12px;
    }
    
    .feature-card {
        padding: 16px;
    }
    
    /* Code improvements */
    .code-block {
        margin: 14px 0;
        border-radius: var(--radius-sm);
    }
    
    .code-block pre {
        padding: 12px 14px;
    }
    
    .code-block code {
        font-size: 12px;
        white-space: pre;
        word-break: normal;
    }
    
    /* Table improvements */
    .defaults-table {
        margin: 16px 0;
    }
    
    /* Component cards */
    .component-card {
        padding: 14px;
        gap: 12px;
    }
    
    .component-icon {
        width: 40px;
        height: 40px;
    }
    
    .component-icon svg {
        width: 22px;
        height: 22px;
    }
    
    /* Style cards */
    .style-card {
        padding: 14px;
    }
    
    .style-card h3 {
        font-size: 15px;
        margin-bottom: 8px;
    }
    
    .style-card p {
        font-size: 13px;
    }
    
    .style-card .code-block.compact pre {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .style-card .code-block.compact code {
        font-size: 12px;
    }
    
    /* Best practices */
    .practice-item {
        padding: 10px 12px;
    }
    
    .practice-item span {
        font-size: 12px;
        line-height: 1.4;
    }
    
    /* Mobile toggle adjustments */
    .mobile-menu-toggle svg {
        width: 20px;
        height: 20px;
    }
    
    /* Sidebar full width on small phones */
    .sidebar {
        max-width: 100%;
    }
    
    .sidebar.active {
        box-shadow: none;
    }
    
    .sidebar.active::before {
        display: none;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .section-header h1 {
        font-size: 22px;
    }
    
    .section-content h2 {
        font-size: 18px;
    }
    
    .code-block code {
        font-size: 11px;
        white-space: pre;
        word-break: normal;
    }
    
    .feature-card h3,
    .platform-card h3 {
        font-size: 14px;
    }
    
    .state-grid {
        grid-template-columns: 1fr;
    }
}

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
    .top-nav {
        padding-top: env(safe-area-inset-top);
        height: calc(var(--nav-height) + env(safe-area-inset-top));
    }
    
    .main-container {
        padding-top: calc(var(--nav-height) + env(safe-area-inset-top));
    }
    
    .sidebar {
        top: calc(var(--nav-height) + env(safe-area-inset-top));
        height: calc(100vh - var(--nav-height) - env(safe-area-inset-top));
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .content {
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    :root {
        --nav-height: 48px;
    }
    
    .sidebar {
        padding: 16px 0;
    }
    
    .sidebar-link {
        padding: 10px 14px;
        min-height: 40px;
    }
    
    .content {
        padding: 20px 24px 80px;
    }
    
    .doc-section {
        margin-bottom: 40px;
    }
    
    .search-modal {
        padding-top: 20px;
    }
    
    .search-modal-content {
        margin-top: 10px;
    }
    
    .search-results {
        max-height: 40vh;
    }
}

/* High DPI / Retina optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .code-block {
        -webkit-font-smoothing: antialiased;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .sidebar {
        transition: none;
    }
    
    .search-modal,
    .search-modal-content {
        transition: none;
    }
}

/* ============================================
   Scrollbar Styling
   ============================================ */

/* Use native browser scrollbars - they're already overlay on macOS/iOS */
/* Only apply minimal styling for consistency */

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

/* ============================================
   Selection Styling
   ============================================ */
::selection {
    background: var(--color-accent);
    color: white;
}

/* ============================================
   Focus Styles
   ============================================ */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.doc-section {
    animation: fadeIn 0.5s ease forwards;
}

/* Smooth page transitions */
.content {
    animation: fadeIn 0.4s ease;
}

