/* css/manual.css */

:root {
    --manual-panel-radius: 10px;
    --manual-panel-padding: 20px;
    --manual-panel-margin-y: 25px;
    --manual-accent-border-width: 5px;
    --manual-card-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    --manual-surface-border: 1px solid #ddd;
    --manual-high-contrast-bg: #000;
    --manual-high-contrast-text: #fff;
    --manual-high-contrast-border: #fff;
    --manual-high-contrast-muted-bg: #111;
    --manual-high-contrast-hover-bg: #222;
    --manual-high-contrast-accent: #ffe082;
    --manual-high-contrast-link-accent: #4dd0e1;
    --manual-inline-code-bg: rgba(0, 0, 0, 0.05);
    --manual-content-block-radius: 8px;
    --manual-content-block-padding: 15px;
    --manual-content-block-margin-y: 20px;
    --manual-content-block-border: 1px solid #ccc;
    --manual-content-block-bg: #fff;
    --manual-content-block-border-subtle: 1px solid #eee;
    --manual-content-block-shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.1);
    --manual-section-margin-bottom: 30px;
    --manual-section-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --manual-toolbar-spacing: 14px;
    --manual-palette-bg: #f0f0f0;
    --manual-text-strong: #222;
    --manual-text-body-strong: #333;
    --manual-rule-accent: #ff6347;
    --manual-state-success-bg: #e8f5e9;
    --manual-state-success-accent: #4caf50;
    --manual-state-success-border: #a5d6a7;
    --manual-state-success-text: #2e7d32;
    --manual-state-info-bg: #fff3e0;
    --manual-state-info-accent: #ff9800;
    --manual-state-info-border: #ffcc80;
    --manual-state-info-text: #e65100;
    --manual-state-error-bg: #ffebee;
    --manual-state-error-accent: #f44336;
    --manual-state-error-border: #e57373;
    --manual-state-error-text: #d32f2f;
    --manual-state-error-strong: #c62828;
    --manual-state-success-hc: #81c784;
    --manual-state-info-hc: #ffb74d;
    --manual-state-error-hc: #e57373;
    --manual-command-accent: #6a5acd;
    --manual-command-name: #00796b;
    --manual-command-desc: #444;
    --manual-example-code-bg: #f8f9fa;
    --manual-example-code-border: #32cd32;
    --manual-example-code-text: #333;
    --manual-example-result-bg: #fff9e6;
    --manual-example-result-border: #ffa500;
    --manual-example-result-text: #d97706;
    --manual-shell-bg: #f5f2ff;
    --manual-ui-border-soft: #d5cdef;
    --manual-ui-border-muted: #cfc8ee;
    --manual-ui-border-emphasis: #d9dfef;
    --manual-ui-surface-soft: #ede9f9;
    --manual-ui-surface-hover: #f3efff;
    --manual-ui-surface-tinted: rgba(255, 255, 255, 0.55);
    --manual-ui-surface-details: #f8fbff;
    --manual-ui-surface-details-open: #e4ecff;
    --manual-ui-surface-summary: #eef4ff;
    --manual-ui-focus-ring: rgba(106, 90, 205, 0.2);
    --manual-ui-heading: #30265f;
    --manual-ui-heading-strong: #2f255c;
    --manual-ui-text: #352d66;
    --manual-ui-text-muted: #5a5672;
    --manual-ui-text-summary: #3b3f65;
    --manual-ui-icon: #5c6bc0;
    --manual-ui-shadow-soft: 0 8px 24px rgba(47, 37, 92, 0.06);
    --manual-ui-shadow-details: 0 2px 6px rgba(63, 81, 181, 0.08);
    --manual-usage-border: rgba(106, 90, 205, 0.16);
    --manual-code-action-bg: rgba(255, 255, 255, 0.96);
    --manual-code-action-border: #cfc8ee;
    --manual-code-action-text: #352d66;
    --manual-code-action-hover-bg: #ede9f9;
    --manual-code-action-hover-text: #2f255c;
    --manual-callout-tips-bg: #e6f7ff;
    --manual-callout-tips-accent: #1890ff;
    --manual-callout-tips-heading: #0050b3;
    --manual-callout-interactive-bg: #fff3cd;
    --manual-callout-interactive-accent: #ffc107;
    --manual-callout-interactive-heading: #b08c00;
    --manual-callout-challenge-bg: #e0f2f1;
    --manual-callout-challenge-accent: #009688;
    --manual-callout-challenge-heading: #00695c;
    --manual-challenge-summary-text: #00796b;
    --manual-challenge-summary-hover-bg: rgba(0, 121, 107, 0.1);
    --manual-concept-bg: #f5f5f5;
    --manual-palette-chip-border: rgba(0, 0, 0, 0.1);
    --manual-palette-gradient-border: #999;
    --manual-palette-yellow-text: #504000;
    --manual-palette-pink-text: #7c1f3e;
    --manual-palette-gradient-text: #333;
}

/* === Message Components === */

/* Base layout for all message boxes */
.message-list-manual {
    border-radius: var(--manual-panel-radius);
    padding: var(--manual-panel-padding);
    margin: var(--manual-panel-margin-y) 0;
    border-left-width: var(--manual-accent-border-width);
    border-left-style: solid;
}

.message-list-manual p {
    padding-bottom: 14px;
    margin-bottom: 22px;
    margin-top: 0;
    position: relative;
    border-bottom-style: solid;
    border-bottom-width: 2px;
}

.message-list-manual p:last-child {
    border-bottom: none;
}

.message-list-manual code {
    font-weight: bold;
    background: none;
    font-size: 1.08em;
}

.message-list-manual strong {
    color: var(--manual-text-strong);
    font-weight: bold;
}

.manual-start-example {
    background-color: var(--manual-state-success-bg);
    border-left: var(--manual-accent-border-width) solid var(--manual-state-success-accent);
    border-radius: var(--manual-panel-radius);
    padding: var(--manual-panel-padding);
    margin: var(--manual-panel-margin-y) 0;
}

.manual-start-example p {
    padding-bottom: 14px;
    margin-bottom: 22px;
    margin-top: 0;
    position: relative;
    border-bottom: 2px solid var(--manual-state-success-border);
}

.manual-start-example p:last-child {
    border-bottom: none;
}

.manual-start-example code {
    font-weight: 700;
    background: none;
    font-size: 1.08em;
    color: var(--manual-state-success-text);
}

.manual-start-example strong {
    color: var(--manual-text-strong);
    font-weight: 700;
}

/* State Variants */
.success-list-manual {
    background-color: var(--manual-state-success-bg);
    border-left-color: var(--manual-state-success-accent);
}
.success-list-manual p {
    border-bottom-color: var(--manual-state-success-border);
}
.success-list-manual code {
    color: var(--manual-state-success-text);
}

.info-list-manual {
    background-color: var(--manual-state-info-bg);
    border-left-color: var(--manual-state-info-accent);
}
.info-list-manual p {
    border-bottom-color: var(--manual-state-info-border);
}
.info-list-manual code {
    color: var(--manual-state-info-text);
}

.error-list-manual {
    background-color: var(--manual-state-error-bg);
    border-left-color: var(--manual-state-error-accent);
}
.error-list-manual p {
    border-bottom-color: var(--manual-state-error-border);
}
.error-list-manual code {
    color: var(--manual-state-error-text);
}

/* High Contrast Overrides */
.a11y-high-contrast .message-list-manual {
    background: var(--manual-high-contrast-bg) !important;
    color: var(--manual-high-contrast-text) !important;
}
.a11y-high-contrast .message-list-manual p {
    border-bottom-color: var(--manual-high-contrast-border) !important;
}
.a11y-high-contrast .message-list-manual strong {
    color: var(--manual-high-contrast-text) !important;
}
.a11y-high-contrast .success-list-manual {
    border-left-color: var(--manual-state-success-accent) !important;
}
.a11y-high-contrast .success-list-manual code {
    color: var(--manual-state-success-hc) !important;
}
.a11y-high-contrast .manual-start-example {
    background: var(--manual-high-contrast-bg) !important;
    color: var(--manual-high-contrast-text) !important;
    border-left-color: var(--manual-state-success-accent) !important;
}
.a11y-high-contrast .manual-start-example p {
    border-bottom-color: var(--manual-high-contrast-border) !important;
}
.a11y-high-contrast .manual-start-example strong {
    color: var(--manual-high-contrast-text) !important;
}
.a11y-high-contrast .manual-start-example code {
    color: var(--manual-state-success-hc) !important;
}
.a11y-high-contrast .info-list-manual {
    border-left-color: var(--manual-state-info-accent) !important;
}
.a11y-high-contrast .info-list-manual code {
    color: var(--manual-state-info-hc) !important;
}
.a11y-high-contrast .error-list-manual {
    border-left-color: var(--manual-state-error-accent) !important;
}
.a11y-high-contrast .error-list-manual code {
    color: var(--manual-state-error-hc) !important;
}

.a11y-high-contrast .toc-container,
.a11y-high-contrast .guide-section,
.a11y-high-contrast .manual-example-result,
.a11y-high-contrast .concept-box {
    background: var(--manual-high-contrast-bg) !important;
    color: var(--manual-high-contrast-text) !important;
    border: 1px solid var(--manual-high-contrast-border) !important;
}



/* === Page Shell And Layout === */
.top-navigation,
.bottom-navigation {
    display: flex;
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
    justify-content: center; /* Center buttons by default */
    gap: 15px;
    margin-bottom: 25px;
    padding: 10px 0;
    border-bottom: 1px solid #ddd; /* Separator for top nav */
}

.bottom-navigation {
    margin-top: 30px;
    border-top: 1px solid #ddd; /* Separator for bottom nav */
    border-bottom: none;
}

.manual-mobile-menu-btn,
.manual-mobile-close-btn,
.manual-mobile-backdrop {
    display: none;
}

.guide-content-area {
    --manual-content-max-width: 980px;
    --manual-content-padding-x: 15px;
    --manual-content-grid-sidebar: 300px;
    --manual-content-grid-gap: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 980px; /* Вужча зона читання для розділів */
    margin: 0 auto; /* Center the content area */
    padding: 0 15px; /* Додаємо відступи по краях для мобільних пристроїв */
}

/* === Table Of Contents === */
.toc-container {
    --manual-toc-accent: #6a5acd;
    --manual-toc-title: #4b0082;
    --manual-toc-title-size: 1.6rem;
    --manual-toc-title-margin-bottom: 15px;
    --manual-toc-title-padding-bottom: 10px;
    --manual-toc-link: #6a5acd;
    --manual-toc-link-hover: #ff6347;
    --manual-toc-link-hover-bg: #ede9f9;
    --manual-toc-link-active-bg: #6a5acd;
    --manual-toc-link-active-text: #fff;
    --manual-toc-sticky-top: 20px;
    --manual-toc-sidebar-width: 100%;
    --manual-toc-sidebar-padding-left: 20px;
    --manual-toc-desktop-padding: 16px 18px;
    --manual-toc-mobile-width: min(88vw, 360px);
    --manual-toc-mobile-radius: 0 14px 14px 0;
    --manual-toc-mobile-padding-top: 62px;
    --manual-toc-mobile-hidden-transform: translateX(-105%);
    --manual-toc-mobile-open-transform: translateX(0);
    --manual-toc-mobile-z-index: 40;
    --manual-toc-mobile-backdrop-z-index: 30;
    --manual-toc-mobile-backdrop-bg: rgba(0, 0, 0, 0.45);
    --manual-toc-mobile-transition: transform 0.25s ease;
    --manual-mobile-control-text: #4b0082;
    --manual-mobile-control-cursor: pointer;
    --manual-mobile-control-gap: 8px;
    --manual-mobile-menu-margin: 0 auto 14px auto;
    --manual-mobile-menu-padding: 10px 16px;
    --manual-mobile-menu-radius: 10px;
    --manual-mobile-menu-font-size: 1.05rem;
    --manual-mobile-close-size: 40px;
    --manual-mobile-close-offset: 12px;
    --manual-mobile-close-radius: 8px;
    --manual-mobile-close-bg: rgba(106, 90, 205, 0.12);
    --manual-mobile-close-font-size: 1.2rem;
    background-color: #eae5f5;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #d5cdef;
    box-shadow: 0 2px 8px rgba(106, 90, 205, 0.1);
    margin-bottom: 20px; /* Space below TOC on small screens */
    height: fit-content;
}


.toc-title {
    color: var(--manual-toc-title); /* Purple */
    font-size: var(--manual-toc-title-size);
    margin-bottom: var(--manual-toc-title-margin-bottom);
    text-align: center;
    border-bottom: 2px solid var(--manual-toc-accent);
    padding-bottom: var(--manual-toc-title-padding-bottom);
}
.a11y-high-contrast .toc-title {
    color: var(--manual-high-contrast-text) !important;
    border-bottom: 2px solid var(--manual-high-contrast-border) !important;
}


.toc-list {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}

@media (max-width: 1279px) {
    .manual-mobile-menu-btn,
    .manual-mobile-close-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: var(--manual-mobile-control-text);
        cursor: var(--manual-mobile-control-cursor);
    }

    .manual-mobile-menu-btn {
        --manual-mobile-menu-border: #6a5acd;
        --manual-mobile-menu-bg: #ede9f9;
        gap: var(--manual-mobile-control-gap);
        margin: var(--manual-mobile-menu-margin);
        padding: var(--manual-mobile-menu-padding);
        border-radius: var(--manual-mobile-menu-radius);
        border: 2px solid var(--manual-mobile-menu-border);
        background: var(--manual-mobile-menu-bg);
        font-size: var(--manual-mobile-menu-font-size);
        font-weight: 700;
        box-shadow: none;
    }

    .manual-mobile-menu-btn:hover,
    .manual-mobile-menu-btn:focus-visible {
        transform: none;
        box-shadow: none;
    }

    .manual-mobile-close-btn {
        position: absolute;
        top: var(--manual-mobile-close-offset);
        right: var(--manual-mobile-close-offset);
        width: var(--manual-mobile-close-size);
        height: var(--manual-mobile-close-size);
        border: 0;
        border-radius: var(--manual-mobile-close-radius);
        background: var(--manual-mobile-close-bg);
        font-size: var(--manual-mobile-close-font-size);
    }

    .manual-mobile-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: var(--manual-toc-mobile-backdrop-z-index);
        background: var(--manual-toc-mobile-backdrop-bg);
    }

    .toc-container {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: var(--manual-toc-mobile-width);
        z-index: var(--manual-toc-mobile-z-index);
        margin: 0;
        border-radius: var(--manual-toc-mobile-radius);
        border-left: 0;
        padding-top: var(--manual-toc-mobile-padding-top);
        overflow-y: auto;
        transform: var(--manual-toc-mobile-hidden-transform);
        transition: var(--manual-toc-mobile-transition);
        box-shadow: none;
    }

    body.manual-toc-open .toc-container {
        transform: var(--manual-toc-mobile-open-transform);
    }

    body.manual-toc-open {
        overflow: hidden;
    }
}

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

.toc-list a {
    color: var(--manual-toc-link); /* Lilac */
    text-decoration: none;
    font-size: 1rem;
    line-height: 1.24;
    transition: color 0.2s, background-color 0.2s;
    display: block;
    padding: 6px 9px;
    border-radius: 7px;
}
.a11y-high-contrast .toc-list a {
    color: var(--manual-high-contrast-text) !important;
    background: transparent !important;
}
.a11y-high-contrast .toc-list a:hover, .a11y-high-contrast .toc-list a:focus-visible {
    color: var(--manual-high-contrast-accent) !important;
    background: var(--manual-high-contrast-hover-bg) !important;
}

.a11y-high-contrast .toc-list a.is-active {
    background: var(--manual-high-contrast-border) !important;
    color: var(--manual-high-contrast-bg) !important;
    font-weight: 800;
}


.toc-list a:hover,
.toc-list a:focus-visible {
    color: var(--manual-toc-link-hover); /* Tomato */
    background-color: var(--manual-toc-link-hover-bg); /* Very light lilac for hover */
}

.toc-list a.is-active {
    color: var(--manual-toc-link-active-text);
    background-color: var(--manual-toc-link-active-bg);
    font-weight: 700;
}

.guide-sections-wrapper {
    flex: 1; /* Takes up remaining space */
    min-width: 0; /* Prevents overflow issues in flex item */
    max-width: 100%; /* Дозволяємо використовувати всю доступну ширину */
}

/* === Section Paging === */
.manual-section-toolbar {
    --manual-toolbar-bg: #ede9f9;
    --manual-toolbar-border: #d4c8f4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--manual-panel-radius);
    background: var(--manual-toolbar-bg);
    border: 1px solid var(--manual-toolbar-border);
    margin-bottom: var(--manual-toolbar-spacing);
}

.manual-section-toolbar-bottom {
    margin-top: var(--manual-toolbar-spacing);
}

.manual-section-toolbar .btn {
    min-width: 238px;
    flex: 0 0 auto;
}

.manual-section-indicator {
    flex: 1 1 auto;
    margin: 0;
    font-weight: 700;
    color: #4b0082;
    text-align: center;
}

body.manual-paged-ready .guide-section {
    display: none;
}

body.manual-paged-ready .guide-section.is-active {
    display: block;
}

.guide-section {
    --manual-section-bg: #fff;
    --manual-section-border: #ddd;
    --manual-section-title: #4b0082;
    --manual-section-title-border: #6a5acd;
    --manual-section-subtitle: #ff6347;
    background-color: var(--manual-section-bg);
    border-radius: var(--manual-panel-radius);
    padding: 25px;
    margin-bottom: var(--manual-section-margin-bottom);
    box-shadow: var(--manual-section-shadow);
    border: var(--manual-surface-border);
}


.guide-section h2 {
    color: var(--manual-section-title); /* Purple */
    font-size: clamp(1.8rem, 4vw, 2.2rem);
    margin-bottom: 20px;
    border-bottom: 2px dashed var(--manual-section-title-border); /* Lilac dashed */
    padding-bottom: 10px;
}
.a11y-high-contrast .guide-section h2 {
    color: var(--manual-high-contrast-text) !important;
    border-bottom: 2px dashed var(--manual-high-contrast-border) !important;
}


.guide-section h3 {
    color: var(--manual-section-subtitle); /* Tomato */
    font-size: clamp(1.4rem, 3vw, 1.7rem);
    margin-top: 25px;
    margin-bottom: 15px;
}
.a11y-high-contrast .guide-section h3 {
    color: var(--manual-high-contrast-accent) !important;
}

.message-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.message-group-title i {
    font-size: 1.05em;
}

.success-title i {
    color: var(--manual-state-success-text);
}

.info-title i {
    color: var(--manual-state-info-text);
}

.error-title i {
    color: var(--manual-state-error-strong);
}

.a11y-high-contrast .message-group-title i {
    color: var(--manual-high-contrast-text) !important;
}


.guide-section p {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 15px;
}
.a11y-high-contrast .guide-section p, .a11y-high-contrast .guide-section ul, .a11y-high-contrast .guide-section ol, .a11y-high-contrast .guide-section li {
    color: var(--manual-high-contrast-text) !important;
    background: transparent !important;
}

.guide-section p strong {
    color: var(--manual-text-body-strong);
}
.a11y-high-contrast .guide-section p strong {
    color: var(--manual-high-contrast-text) !important;
}


.guide-section ul, .guide-section ol {
    padding-left: 30px; /* Standard indentation for lists */
    margin-bottom: 15px;
}
.guide-section ul li, .guide-section ol li {
    margin-bottom: 8px;
    font-size: 1.05rem;
    line-height: 1.6;
}
.guide-section ul {
    list-style-type: '🐌'; /* Default snail bullet */
}
.guide-section ul li {
    padding-left: 8px;
}


/* === Command Reference Blocks === */
.command-list-manual {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: var(--manual-content-block-margin-y) 0;
    padding: 0;
    list-style: none;
}
.a11y-high-contrast .command-list-manual {
    background: var(--manual-high-contrast-bg) !important;
    color: var(--manual-high-contrast-text) !important;
}


.command-item-manual {
    background-color: var(--manual-example-code-bg);
    padding: var(--manual-content-block-padding);
    border-radius: var(--manual-content-block-radius);
    border-left: var(--manual-accent-border-width) solid var(--manual-command-accent); /* Lilac */
    box-shadow: var(--manual-card-shadow);
}
.a11y-high-contrast .command-item-manual {
    background: var(--manual-high-contrast-bg) !important;
    color: var(--manual-high-contrast-text) !important;
    border-left: var(--manual-accent-border-width) solid var(--manual-high-contrast-border) !important;
    box-shadow: none !important;
}


.command-item-manual .cmd-name {
    font-family: 'Fira Mono', 'Consolas', monospace;
    font-weight: bold;
    color: var(--manual-command-name); /* Teal */
    font-size: 1.15rem;
    display: block;
    margin-bottom: 5px;
}
.a11y-high-contrast .command-item-manual .cmd-name {
    color: var(--manual-high-contrast-link-accent) !important;
}


.command-item-manual .cmd-desc {
    font-size: 1rem;
    color: var(--manual-command-desc);
}
.a11y-high-contrast .command-item-manual .cmd-desc {
    color: var(--manual-high-contrast-text) !important;
}


/* === Code Example Components === */
.example-code-manual {
    --manual-example-code-bg: #f8f9fa;
    --manual-example-code-border: #32cd32;
    background-color: var(--manual-example-code-bg);
    border-left: var(--manual-accent-border-width) solid var(--manual-example-code-border);
    padding: 12px 18px;
    margin: 20px 0;
    font-family: 'Fira Mono', 'Consolas', 'Courier New', monospace;
    font-size: clamp(0.9rem, 2.5vw, 1.05rem);
    border-radius: var(--manual-content-block-radius);
    white-space: pre-wrap;
    overflow-x: auto;
    box-shadow: var(--manual-card-shadow);
    color: var(--manual-example-code-text);
}

.manual-code-block {
    position: relative;
    margin: 20px 0;
    width: min(100%, 560px);
    max-width: 100%;
    margin-inline: auto;
}

.manual-code-block .example-code-manual {
    margin: 0;
    padding-top: 54px;
    width: 100%;
    box-sizing: border-box;
}

.manual-code-toolbar {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    z-index: 1;
}

.manual-code-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border-radius: 999px;
    border: 1px solid var(--manual-code-action-border);
    background: var(--manual-code-action-bg);
    color: var(--manual-code-action-text);
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.manual-code-action:hover,
.manual-code-action:focus-visible {
    background: var(--manual-code-action-hover-bg);
    color: var(--manual-code-action-hover-text);
    text-decoration: none;
}

.manual-code-action .ui-icon {
    width: 1rem;
    height: 1rem;
    margin-right: 8px;
}

.manual-code-copy {
    min-width: 34px;
    padding: 0 9px;
    gap: 6px;
    cursor: pointer;
}

.manual-code-copy-label {
    display: none;
    font-size: 0.85rem;
    line-height: 1;
}

.manual-code-copy.is-copied {
    color: #2e7d32;
}

.manual-code-copy.is-copied .manual-code-copy-label {
    display: inline;
}

.manual-code-editor {
    padding: 0 12px;
    font-size: 0.92rem;
    white-space: nowrap;
}

.manual-example-subsection .manual-code-block {
    width: min(100%, 640px);
}

.manual-example-subsection .manual-code-block .example-code-manual {
    min-height: 150px;
}

@media (max-width: 767px) {
    .manual-code-toolbar {
        left: 10px;
        right: 10px;
        justify-content: space-between;
    }

    .manual-code-block,
    .manual-example-subsection .manual-code-block {
        width: 100%;
    }

    .manual-example-subsection .manual-code-block .example-code-manual {
        min-height: 0;
    }

    .manual-code-editor {
        font-size: 0.86rem;
        padding: 0 10px;
    }
}


.a11y-high-contrast .example-code-manual {
    background: var(--manual-high-contrast-muted-bg) !important;
    color: var(--manual-high-contrast-text) !important;
    border: 1px solid var(--manual-high-contrast-border) !important;
}

.a11y-high-contrast .manual-code-action {
    background: var(--manual-high-contrast-bg) !important;
    color: var(--manual-high-contrast-text) !important;
    border-color: var(--manual-high-contrast-border) !important;
}

.manual-example-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: var(--manual-content-block-margin-y) 0;
    padding: var(--manual-content-block-padding);
    background-color: var(--manual-example-result-bg); /* Light yellow */
    border-radius: var(--manual-content-block-radius);
    border: 2px dashed var(--manual-example-result-border); /* Orange dashed */
    text-align: center;
}
.a11y-high-contrast .manual-example-result {
    border: 2px dashed var(--manual-high-contrast-border) !important;
}


.manual-example-result img {
    max-width: 60%; /* Adjust as needed */
    height: auto;
    border-radius: var(--manual-content-block-radius);
    margin-bottom: 10px;
    border: var(--manual-content-block-border-subtle);
    background-color: var(--manual-content-block-bg); /* Ensure transparent SVGs have a background */
}

.manual-example-result p {
    font-style: italic;
    color: var(--manual-example-result-text);
    font-size: 1rem;
    margin-bottom: 0;
}

/* === Callout Components === */
.tips-box,
.interactive-example-manual,
.challenge-box {
    --manual-callout-bg: transparent;
    --manual-callout-accent: transparent;
    --manual-callout-heading: inherit;
    border-radius: var(--manual-panel-radius);
    padding: var(--manual-panel-padding);
    margin: var(--manual-panel-margin-y) 0;
    background-color: var(--manual-callout-bg);
    border-left: var(--manual-accent-border-width) solid var(--manual-callout-accent);
}

.a11y-high-contrast .tips-box,
.a11y-high-contrast .interactive-example-manual,
.a11y-high-contrast .challenge-box {
    background: var(--manual-high-contrast-bg) !important;
    color: var(--manual-high-contrast-text) !important;
    border-left: var(--manual-accent-border-width) solid var(--manual-high-contrast-border) !important;
}

.tips-box h4,
.interactive-example-manual h4,
.challenge-box h4 {
    color: var(--manual-callout-heading);
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.tips-box {
    --manual-callout-bg: var(--manual-callout-tips-bg);
    --manual-callout-accent: var(--manual-callout-tips-accent);
    --manual-callout-heading: var(--manual-callout-tips-heading);
}
.interactive-example-manual {
    --manual-callout-bg: var(--manual-callout-interactive-bg);
    --manual-callout-accent: var(--manual-callout-interactive-accent);
    --manual-callout-heading: var(--manual-callout-interactive-heading);
}

.interactive-example-manual p code,
.guide-section p code {
    background-color: var(--manual-inline-code-bg);
    padding: 2px 5px;
    border-radius: 4px;
    font-family: 'Fira Mono', 'Consolas', monospace;
}


.challenge-box {
    --manual-callout-bg: var(--manual-callout-challenge-bg);
    --manual-callout-accent: var(--manual-callout-challenge-accent);
    --manual-callout-heading: var(--manual-callout-challenge-heading);
}
.a11y-high-contrast .tips-box h4,
.a11y-high-contrast .interactive-example-manual h4,
.a11y-high-contrast .challenge-box h4 {
    color: var(--manual-high-contrast-accent) !important;
}
/* === Disclosure Blocks === */
.guide-section details {
    margin-top: 12px;
    border: 1px solid var(--manual-ui-border-emphasis);
    border-radius: 10px;
    background: var(--manual-ui-surface-details);
    overflow: hidden;
    box-shadow: var(--manual-ui-shadow-details);
}

.guide-section summary {
    position: relative;
    cursor: pointer;
    padding: 12px 16px 12px 42px;
    font-weight: 700;
    color: var(--manual-ui-text-summary);
    background: var(--manual-ui-surface-summary);
    list-style: none;
    transition: background-color 0.2s ease;
}

.guide-section summary::-webkit-details-marker {
    display: none;
}

.guide-section summary::before {
    content: "▸";
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--manual-ui-icon);
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.guide-section details[open] summary {
    background: var(--manual-ui-surface-details-open);
    border-bottom: 1px solid var(--manual-ui-border-emphasis);
}

.guide-section details[open] summary::before {
    transform: translateY(-50%) rotate(90deg);
}

.guide-section details > *:not(summary) {
    margin: 0;
    padding: 14px 16px 16px;
}

.guide-section details > *:not(summary):last-child {
    padding-top: 12px;
}

.guide-section details .example-code-manual {
    margin-top: 10px;
    margin-bottom: 0;
}

.a11y-high-contrast .guide-section details,
.a11y-high-contrast .guide-section summary {
    background: var(--manual-high-contrast-bg) !important;
    color: var(--manual-high-contrast-text) !important;
    border-color: var(--manual-high-contrast-border) !important;
}

.a11y-high-contrast .guide-section summary::before {
    color: var(--manual-high-contrast-accent) !important;
}


.error-list-manual p {
    margin-bottom: 10px;
}
.error-list-manual p strong {
    color: var(--manual-state-error-strong);
}
.error-list-manual em { /* For messages like "Не вказано..." */
    font-family: 'Fira Mono', 'Consolas', monospace;
    color: var(--manual-state-error-text);
}

/* === Content Media Blocks === */
.concept-box {
    display: flex;
    gap: 20px;
    margin: var(--manual-panel-margin-y) 0;
    padding: var(--manual-panel-padding);
    background-color: var(--manual-concept-bg); /* Light grey */
    border-radius: var(--manual-panel-radius);
    flex-direction: column; /* Default for mobile */
}


@media (min-width: 768px) {
    .concept-box {
        flex-direction: row;
        align-items: center;
    }
}

.concept-image {
    flex: 1; /* Takes 1/3 of space */
    min-width: 150px; /* Min width for image */
    max-width: 250px; /* Max width for image on larger screens */
    margin: 0 auto 15px auto; /* Center image on mobile */
}
.concept-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--manual-content-block-radius);
    display: block;
    background-color: var(--manual-content-block-bg);
    padding: 5px;
    border: var(--manual-content-block-border);
}
@media (min-width: 768px) {
    .concept-image {
        margin: 0; /* Reset margin for larger screens */
    }
}

.concept-text {
    flex: 2; /* Takes 2/3 of space */
}
.concept-text h3 { /* If h3 is used inside concept-text */
    margin-top: 0;
}


.color-palette-manual {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
    padding: 10px;
    background-color: var(--manual-palette-bg);
    border-radius: var(--manual-content-block-radius);
    justify-content: center;
}

.color-palette-manual span {
    padding: 8px 15px;
    border-radius: 20px; /* Pill shape */
    font-weight: bold;
    font-size: 0.95rem;
    text-align: center;
    border: 2px solid var(--manual-palette-chip-border);
    box-shadow: var(--manual-content-block-shadow-soft);
}
/* Palette Contrast Exceptions */
.color-palette-manual span[style*="background-color:yellow"] { color: var(--manual-palette-yellow-text); }
.color-palette-manual span[style*="background-color:pink"] { color: var(--manual-palette-pink-text); }
.color-palette-manual span[style*="background:linear-gradient"] { color: var(--manual-palette-gradient-text); border-color: var(--manual-palette-gradient-border);}

.a11y-high-contrast .color-palette-manual span {
    background: var(--manual-high-contrast-bg) !important;
    color: var(--manual-high-contrast-text) !important;
    border: 2px solid var(--manual-high-contrast-border) !important;
    text-shadow: none !important;
}

.a11y-high-contrast .manual-section-toolbar {
    --manual-toolbar-bg: #000;
    --manual-toolbar-border: #fff;
}

.a11y-high-contrast .manual-section-indicator {
    color: var(--manual-high-contrast-text) !important;
}

.a11y-high-contrast .manual-section-toolbar .btn,
.a11y-high-contrast .manual-mobile-menu-btn,
.a11y-high-contrast .manual-mobile-close-btn {
    background: var(--manual-high-contrast-bg) !important;
    color: var(--manual-high-contrast-text) !important;
    border: 1px solid var(--manual-high-contrast-border) !important;
}

@media (max-width: 1279px) {
    .manual-section-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .manual-section-toolbar .btn {
        min-width: 0;
        width: 100%;
    }
}

/* === Desktop Layout === */
@media (min-width: 1280px) {
    :root {
        --manual-sidebar-width: 360px;
        --manual-sidebar-gap: 28px;
        --manual-shell-edge-gap: 12px;
        --manual-content-offset-left: calc(var(--manual-sidebar-width) + var(--manual-sidebar-gap));
    }

    body {
        padding-inline: var(--manual-shell-edge-gap);
        background-color: var(--manual-shell-bg);
    }

    .page-wrapper {
        max-width: none;
        margin: 0;
        padding-left: var(--manual-content-offset-left);
        padding-right: var(--manual-shell-edge-gap);
    }

    .guide-content-area {
        display: block;
        max-width: var(--manual-content-max-width);
        margin: 0 auto;
        padding: 0;
    }

    .toc-container {
        position: fixed;
        left: var(--manual-shell-edge-gap);
        top: var(--manual-shell-edge-gap);
        bottom: var(--manual-shell-edge-gap);
        width: var(--manual-sidebar-width);
        margin: 0;
        padding: var(--manual-toc-desktop-padding);
        overflow-y: auto;
        overflow-x: hidden;
        border-right: none;
        border-left: 3px solid var(--manual-toc-accent);
        z-index: 20;
        scrollbar-gutter: stable;
    }

    .manual-mobile-menu-btn,
    .manual-mobile-close-btn,
    .manual-mobile-backdrop {
        display: none !important;
    }

    .toc-title {
        --manual-toc-title-size: 1.45rem;
        --manual-toc-title-margin-bottom: 12px;
    }

    .toc-list a {
        font-size: 1rem;
        line-height: 1.28;
    }

}


/* === Manual Discovery And Reading Modes === */
hr { /* From original manual-style.css, if needed */
    border: 0;
    height: 1px;
    background-color: var(--manual-rule-accent); /* Tomato color */
    margin: 20px 0;
}

.manual-mode-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto 18px;
    padding: 12px 16px;
    border: 1px solid var(--manual-ui-border-soft);
    border-radius: 10px;
    background: var(--manual-ui-surface-soft);
}

.manual-mode-strip-label {
    margin: 0;
    font-weight: 700;
    color: var(--manual-ui-heading);
}

.manual-toc-search {
    margin-bottom: 16px;
}

.manual-toc-search .manual-search-input {
    display: block;
}

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

.manual-usage-subsection .tips-box {
    margin-bottom: 16px;
    padding: 12px;
    border: 1px solid var(--manual-usage-border);
    border-radius: 10px;
    background: var(--manual-ui-surface-tinted);
}

.manual-search-input {
    width: 100%;
    min-height: 46px;
    padding: 11px 14px;
    border: 1px solid var(--manual-ui-border-muted);
    border-radius: 12px;
    font-size: 1rem;
}

.manual-search-input:focus {
    outline: 2px solid var(--manual-ui-focus-ring);
    border-color: var(--manual-command-accent);
}

.manual-mode-btn {
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--manual-ui-border-muted);
    border-radius: 999px;
    background: var(--manual-content-block-bg);
    color: var(--manual-ui-text);
    font-weight: 700;
    cursor: pointer;
}

.manual-mode-btn:hover {
    background: var(--manual-ui-surface-hover);
}

.manual-search-status {
    margin: 0;
    color: var(--manual-ui-text-muted);
    font-size: 0.96rem;
}

.manual-reading-mode {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.manual-mode-btn.is-active {
    background: var(--manual-command-accent);
    border-color: var(--manual-command-accent);
    color: var(--manual-content-block-bg);
}

.manual-example-subsection > .manual-start-example h3,
.manual-example-subsection > .manual-example-result h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--manual-ui-heading-strong);
}

.manual-example-subsection > .manual-start-example,
.manual-example-subsection > .manual-example-result {
    box-shadow: var(--manual-ui-shadow-soft);
}

.manual-example-subsection .example-code-manual {
    margin-top: 12px;
}

.toc-list a.is-filter-hidden,
.guide-section.is-hidden-by-filter {
    display: none !important;
}

body.mode-beginner .advanced-only {
    display: none;
}

.a11y-high-contrast .manual-mode-strip,
.a11y-high-contrast .manual-toc-search .manual-search-input,
.a11y-high-contrast .manual-usage-subsection .tips-box,
.a11y-high-contrast .manual-search-input,
.a11y-high-contrast .manual-mode-btn {
    background: var(--manual-high-contrast-bg) !important;
    color: var(--manual-high-contrast-text) !important;
    border-color: var(--manual-high-contrast-border) !important;
}

@media (max-width: 1279px) {
    .manual-mode-strip {
        padding: 18px;
        margin-inline: 15px;
        justify-content: stretch;
    }

    .manual-reading-mode {
        width: 100%;
    }

    .manual-mode-btn {
        width: 100%;
    }
}
