/* ==========================================================================
   OptiWave Guides — Shared Stylesheet
   Design: Indigo-forward documentation with wave accent motif
   ========================================================================== */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@500;700;800&family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ---------- Tokens ---------- */
:root {
    --g-primary: #075af8;
    --g-primary-hover: #0548d0;
    --g-primary-light: #edf4ff;
    --g-primary-faint: rgba(7, 90, 248, 0.06);
    --g-bg: #f8fafc;
    --g-card: #ffffff;
    --g-border: #e2e8f0;
    --g-border-subtle: #f1f5f9;
    --g-text: #111154;
    --g-text-secondary: #475569;
    --g-text-muted: #64748b;
    --g-success: #059669;
    --g-success-bg: #ecfdf5;
    --g-success-border: #a7f3d0;
    --g-warning: #d97706;
    --g-warning-bg: #fffbeb;
    --g-warning-border: #fde68a;
    --g-danger: #dc2626;
    --g-danger-bg: #fef2f2;
    --g-danger-border: #fecaca;
    --g-info: #0284c7;
    --g-info-bg: #f0f9ff;
    --g-info-border: #bae6fd;
    --g-radius: 12px;
    --g-radius-sm: 8px;
    --g-radius-lg: 20px;
    --g-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
    --g-shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
    --g-shadow-lg: 0 12px 40px rgba(0,0,0,0.08);
    --g-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --g-heading: 'Outfit', var(--g-font);
    --g-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    --g-sidebar-w: 280px;
    --g-header-h: 72px;
    --g-max-content: 820px;
    --g-wave-from: #075af8;
    --g-wave-via: #04e2f7;
    --g-wave-to: #04e2f7;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--g-header-h) + 24px);
    -webkit-text-size-adjust: 100%;
    overflow-x: clip;
    width: 100%;
}

body {
    font-family: var(--g-font);
    font-size: 15px;
    line-height: 1.7;
    color: var(--g-text);
    background: var(--g-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip;
    width: 100%;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--g-heading);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--g-text);
}

h1 { font-size: 2.25rem; font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: 1.625rem; margin-top: 3rem; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--g-border); }
h3 { font-size: 1.25rem; margin-top: 2rem; margin-bottom: 0.75rem; }
h4 { font-size: 1.05rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

a {
    color: var(--g-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}
a:hover { color: var(--g-primary-hover); text-decoration: underline; }

strong { font-weight: 700; }

ul, ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}
li { margin-bottom: 0.35rem; }
li:last-child { margin-bottom: 0; }

/* ---------- Code ---------- */
code {
    font-family: var(--g-mono);
    font-size: 0.875em;
    background: var(--g-primary-light);
    color: var(--g-primary-hover);
    padding: 0.15em 0.4em;
    border-radius: 5px;
    font-weight: 500;
}

pre {
    background: #1e293b;
    color: #e2e8f0;
    border-radius: var(--g-radius);
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    font-size: 0.85rem;
    position: relative;
    border: 1px solid #334155;
}

pre code {
    background: none;
    color: inherit;
    padding: 0;
    border-radius: 0;
    font-weight: 400;
    font-size: inherit;
}

.code-block {
    position: relative;
}

.code-block .copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: #94a3b8;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-family: var(--g-font);
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 500;
}
.code-block .copy-btn:hover {
    background: rgba(255,255,255,0.18);
    color: #e2e8f0;
}
.code-block .copy-btn.copied {
    background: var(--g-success);
    color: white;
    border-color: var(--g-success);
}

/* ---------- Layout ---------- */
.g-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow-x: clip;
}

/* Sidebar */
.g-sidebar {
    width: var(--g-sidebar-w);
    background: var(--g-card);
    border-right: 1px solid var(--g-border);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.g-sidebar-brand {
    padding: 20px 20px;
    border-bottom: 1px solid var(--g-border);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}

.g-sidebar-brand:hover { text-decoration: none; }

.g-sidebar-full-logo {
    height: 30px;
    width: auto;
    display: block;
}

.g-sidebar-doc-tag {
    color: var(--g-text-muted);
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0;
    margin-left: 2px;
}

.g-sidebar-nav {
    padding: 16px 12px;
    flex: 1;
    overflow-y: auto;
}

.g-nav-group {
    margin-bottom: 20px;
}

.g-nav-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--g-text-muted);
    padding: 0 12px;
    margin-bottom: 6px;
}

.g-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--g-radius-sm);
    color: var(--g-text-secondary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
}

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

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

.g-nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
}

.g-nav-link.active .g-nav-icon { opacity: 1; }

/* Main Content */
.g-main {
    margin-left: var(--g-sidebar-w);
    flex: 1;
    min-width: 0;
    max-width: 100%;
}

/* Header */
.g-header {
    height: var(--g-header-h);
    background: rgba(248, 250, 252, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--g-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.g-header-brand-mobile {
    display: none !important;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.g-header-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--g-text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.g-header-title strong {
    color: var(--g-text);
}

.g-header-brand-mobile:hover {
    text-decoration: none;
}

.g-header-logo-img {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.g-header-brand-text {
    font-size: 15px;
    font-weight: 800;
    color: var(--g-text);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.g-header-brand-text span {
    color: var(--g-text-muted);
    font-weight: 500;
    font-size: 12px;
}

.g-header-badge {
    font-size: 11px;
    font-weight: 600;
    background: var(--g-primary-light);
    color: var(--g-primary);
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

/* Content */
.g-content {
    max-width: 1180px;
    margin: 0 auto;
    padding: 48px 40px 80px;
}

/* Mobile toggle */
.g-mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--g-text-secondary);
    border-radius: var(--g-radius-sm);
    transition: background 0.15s;
}
.g-mobile-toggle:hover { background: var(--g-primary-faint); }
.g-mobile-toggle svg {
    width: 22px;
    height: 22px;
    display: block;
}

.g-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99;
}

/* ---------- Components ---------- */

/* Hero */
.g-hero {
    background: linear-gradient(135deg, #111154, var(--g-primary), var(--g-wave-via));
    border-radius: var(--g-radius-lg);
    padding: 56px 48px;
    margin-bottom: 48px;
    color: white;
    position: relative;
    overflow: hidden;
}

.g-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='rgba(255,255,255,0.05)' d='M0,224L48,213.3C96,203,192,181,288,181.3C384,181,480,203,576,218.7C672,235,768,245,864,229.3C960,213,1056,171,1152,149.3C1248,128,1344,128,1392,128L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'/%3E%3C/svg%3E") no-repeat bottom center;
    background-size: cover;
    pointer-events: none;
}

.g-hero h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 12px;
    position: relative;
}

.g-hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    line-height: 1.6;
    position: relative;
}

.g-hero-tag {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    border: 1px solid rgba(255,255,255,0.2);
    position: relative;
}

/* Cards */
.g-card {
    background: var(--g-card);
    border: 1px solid var(--g-border);
    border-radius: var(--g-radius);
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: var(--g-shadow);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.g-card:hover {
    box-shadow: var(--g-shadow-md);
    border-color: #cbd5e1;
}

.g-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.g-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.g-card-icon.blue { background: var(--g-primary-light); color: var(--g-primary); }
.g-card-icon.green { background: var(--g-success-bg); color: var(--g-success); }
.g-card-icon.amber { background: var(--g-warning-bg); color: var(--g-warning); }
.g-card-icon.red { background: var(--g-danger-bg); color: var(--g-danger); }
.g-card-icon.teal { background: #f0fdfa; color: #0d9488; }
.g-card-icon.purple { background: #faf5ff; color: #9333ea; }

.g-card h3 {
    margin: 0;
    font-size: 1.1rem;
}

/* Link cards (index page) */
.g-link-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

.g-link-card:hover {
    text-decoration: none;
    color: inherit;
}

.g-link-card .g-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.g-link-card .g-card-body {
    flex: 1;
}

.g-link-card .g-card-body p {
    color: var(--g-text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.g-card-arrow {
    color: var(--g-text-muted);
    margin-top: 12px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s;
}

.g-link-card:hover .g-card-arrow { color: var(--g-primary); }

/* Grid */
.g-grid {
    display: grid;
    gap: 20px;
}

.g-grid-2 { grid-template-columns: repeat(2, 1fr); }
.g-grid-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 768px) {
    .g-grid-2, .g-grid-3 { grid-template-columns: 1fr; }
}

/* Callout / Admonition */
.g-callout {
    border-radius: var(--g-radius);
    padding: 18px 20px;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 14px;
    font-size: 14px;
    line-height: 1.6;
}

.g-callout-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 2px;
}

.g-callout.info { background: var(--g-info-bg); border: 1px solid var(--g-info-border); color: #0c4a6e; }
.g-callout.success { background: var(--g-success-bg); border: 1px solid var(--g-success-border); color: #064e3b; }
.g-callout.warning { background: var(--g-warning-bg); border: 1px solid var(--g-warning-border); color: #78350f; }
.g-callout.danger { background: var(--g-danger-bg); border: 1px solid var(--g-danger-border); color: #7f1d1d; }

/* Table */
.g-table-wrap {
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border: 1px solid var(--g-border);
    border-radius: var(--g-radius);
}

.g-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.g-table th {
    text-align: left;
    padding: 12px 16px;
    background: var(--g-bg);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--g-text-muted);
    border-bottom: 1px solid var(--g-border);
    white-space: nowrap;
}

.g-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--g-border-subtle);
    vertical-align: top;
}

.g-table tr:last-child td { border-bottom: none; }
.g-table tr:hover td { background: var(--g-bg); }

/* Steps */
.g-steps {
    counter-reset: step;
    padding-left: 0;
    list-style: none;
}

.g-step {
    counter-increment: step;
    position: relative;
    padding-left: 56px;
    margin-bottom: 28px;
}

.g-step::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 36px;
    height: 36px;
    background: var(--g-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.g-step::after {
    content: '';
    position: absolute;
    left: 17px;
    top: 40px;
    bottom: -24px;
    width: 2px;
    background: var(--g-border);
}

.g-step:last-child::after { display: none; }
.g-step:last-child { margin-bottom: 0; }

.g-step h4 {
    margin-top: 0;
    margin-bottom: 8px;
    padding-top: 6px;
}

/* Keyboard shortcut */
.kbd {
    display: inline-block;
    font-family: var(--g-mono);
    font-size: 12px;
    background: var(--g-bg);
    border: 1px solid var(--g-border);
    border-radius: 5px;
    padding: 2px 7px;
    box-shadow: 0 2px 0 var(--g-border);
    font-weight: 500;
}

/* Divider */
.g-divider {
    border: none;
    border-top: 1px solid var(--g-border);
    margin: 3rem 0;
}

/* Inline list */
.g-inline-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin-bottom: 1rem;
}

.g-inline-list li {
    background: var(--g-primary-light);
    color: var(--g-primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin: 0;
}

/* Screenshot / Figure */
.g-screenshot {
    margin-bottom: 1.5rem;
    border: 1px solid var(--g-border);
    border-radius: var(--g-radius);
    overflow: hidden;
    box-shadow: var(--g-shadow);
    background: var(--g-card);
}

.g-screenshot img {
    display: block;
    width: 100%;
    height: auto;
}

.g-screenshot figcaption {
    padding: 10px 16px;
    font-size: 13px;
    color: var(--g-text-muted);
    border-top: 1px solid var(--g-border-subtle);
    background: var(--g-bg);
    text-align: center;
    font-weight: 500;
}

/* Footer */
.g-footer {
    border-top: 1px solid var(--g-border);
    padding: 24px 40px;
    text-align: center;
    font-size: 13px;
    color: var(--g-text-muted);
    max-width: var(--g-max-content);
    margin: 0 auto;
}

.g-footer a { color: var(--g-text-muted); font-weight: 500; }
.g-footer a:hover { color: var(--g-primary); }

/* Breadcrumb */
.g-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--g-text-muted);
    margin-bottom: 24px;
}

.g-breadcrumb a {
    color: var(--g-text-muted);
    font-weight: 500;
}

.g-breadcrumb a:hover { color: var(--g-primary); }

.g-breadcrumb-sep { opacity: 0.4; }

/* Back to top */
.g-back-top {
    position: fixed;
    bottom: 24px;
    right: 90px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--g-card);
    border: 1px solid var(--g-border);
    color: var(--g-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s;
    box-shadow: var(--g-shadow);
    z-index: 50;
}

.g-back-top.visible {
    opacity: 1;
    pointer-events: auto;
}

.g-back-top:hover {
    border-color: var(--g-primary);
    color: var(--g-primary);
}

.g-back-top svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ---------- 3-Column Layout & On-Page Sticky TOC ---------- */
.g-page-body {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.g-content-main {
    flex: 1;
    min-width: 0;
    max-width: var(--g-max-content);
}

.g-onpage-toc {
    width: 220px;
    position: sticky;
    top: calc(var(--g-header-h) + 24px);
    max-height: calc(100vh - var(--g-header-h) - 48px);
    overflow-y: auto;
    flex-shrink: 0;
    background: var(--g-card);
    border: 1px solid var(--g-border);
    border-radius: var(--g-radius);
    padding: 16px 20px;
    box-shadow: var(--g-shadow);
}

.g-toc-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--g-text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.g-toc-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.g-toc-nav li {
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.g-toc-nav a {
    color: var(--g-text-secondary);
    font-weight: 500;
    transition: all 0.15s;
    display: block;
}

.g-toc-nav a:hover, .g-toc-nav a.active {
    color: var(--g-primary);
    text-decoration: none;
    font-weight: 700;
    transform: translateX(2px);
}

/* ---------- Header Search Trigger & Modal ---------- */
.g-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.g-back-site {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--g-primary-light);
    color: var(--g-primary);
    border: 1px solid rgba(7, 90, 248, 0.15);
    padding: 6px 14px;
    border-radius: var(--g-radius-sm);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}

.g-back-site:hover {
    background: var(--g-primary);
    color: #ffffff;
    text-decoration: none;
    box-shadow: var(--g-shadow);
}

.g-search-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--g-bg);
    border: 1px solid var(--g-border);
    padding: 6px 14px;
    border-radius: var(--g-radius-sm);
    color: var(--g-text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.g-search-trigger:hover {
    border-color: var(--g-primary);
    color: var(--g-primary);
    background: var(--g-card);
}

.g-search-kbd {
    background: var(--g-card);
    border: 1px solid var(--g-border);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 11px;
    font-family: var(--g-mono);
}

/* Search Modal */
.g-search-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    padding-top: 100px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.g-search-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.g-search-box {
    background: var(--g-card);
    width: 100%;
    max-width: 580px;
    border-radius: var(--g-radius-lg);
    box-shadow: var(--g-shadow-lg);
    border: 1px solid var(--g-border);
    overflow: hidden;
    height: fit-content;
    max-height: 480px;
    display: flex;
    flex-direction: column;
}

.g-search-input-wrap {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--g-border);
    gap: 12px;
}

.g-search-input-wrap svg {
    width: 20px; height: 20px;
    stroke: var(--g-text-muted);
}

.g-search-input {
    border: none;
    outline: none;
    font-size: 16px;
    font-family: var(--g-font);
    width: 100%;
    color: var(--g-text);
    background: transparent;
}

.g-search-results {
    overflow-y: auto;
    padding: 12px;
}

.g-search-item {
    padding: 10px 14px;
    border-radius: var(--g-radius-sm);
    display: block;
    text-decoration: none;
    transition: background 0.15s;
}

.g-search-item:hover {
    background: var(--g-primary-light);
    text-decoration: none;
}

.g-search-item-title {
    font-weight: 700;
    color: var(--g-text);
    font-size: 14px;
}

.g-search-item-desc {
    font-size: 12px;
    color: var(--g-text-muted);
}

/* ---------- Responsive Adjustments ---------- */
@media (max-width: 1200px) {
    .g-onpage-toc {
        display: none;
    }
}

@media (max-width: 900px) {
    body, html, .g-layout, .g-main, .g-content, .g-header {
        max-width: 100vw !important;
        overflow-x: clip !important;
    }
    .g-sidebar {
        transform: translateX(-100%);
    }
    .g-sidebar.open {
        transform: translateX(0);
    }
    .g-main {
        margin-left: 0;
    }
    .g-mobile-toggle {
        display: block;
    }
    .g-overlay.active {
        display: block;
    }
    .g-content {
        padding: 24px 16px 60px;
    }
    .g-header {
        padding: 0 16px;
    }
    .g-header-title {
        display: none !important;
    }
    .g-header-brand-mobile {
        display: flex !important;
    }
    .g-header-right {
        gap: 8px;
    }
    .g-back-site span,
    .g-search-trigger span,
    .g-search-kbd {
        display: none !important;
    }
    .g-back-site {
        padding: 8px;
        border-radius: var(--g-radius-sm);
    }
    .g-search-trigger {
        padding: 8px;
    }
    .g-hero {
        padding: 32px 20px;
        border-radius: var(--g-radius);
    }
    .g-hero h1 { font-size: 1.625rem; }
    .g-back-top { right: 20px; bottom: 20px; }
}

@media (max-width: 640px) {
    .g-header-title {
        max-width: 100px;
    }
    .g-search-modal {
        padding: 16px;
        padding-top: 60px;
    }
    .g-search-box {
        max-height: 80vh;
    }
    .g-grid-2, .g-grid-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.25rem; margin-top: 2rem; }
    h3 { font-size: 1.1rem; }
    .g-hero h1 { font-size: 1.4rem; }
    .g-hero p { font-size: 13.5px; }
    .g-table-wrap {
        margin: 0 -16px 1.5rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    .g-table th, .g-table td {
        padding: 10px 12px;
        font-size: 13px;
    }
}
