:root {
    --primary-color: #39668a;
    --primary-dark: #274a67;
    --accent-color: #f2a14c;
    --bg-color: #edf3f8;
    --surface-color: #ffffff;
    --surface-alt: #f5f9fd;
    --sidebar-bg: rgba(255, 255, 255, 0.86);
    --text-main: #333;
    --text-muted: #6f84a0;
    --border-color: #d7e2ec;
    --shadow-soft: 0 0.625rem 1.5rem rgba(39, 74, 109, 0.08);
    --shadow-hover: 0 1rem 1.875rem rgba(39, 74, 109, 0.12);
    --radius-lg: 0.5rem;
    --radius-md: 0.5rem;
    --radius-sm: 0.5rem;
    --content-max: 90rem;
    --mobile-header-offset: 5.75rem;
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: system-ui, sans-serif;
    color: var(--text-main);
    background:
        linear-gradient(180deg, #dce8f2 0%, #edf3f8 7.5rem, #edf3f8 100%),
        linear-gradient(180deg, #f7f9fc 0%, #eef3f8 100%);
    overflow-x: hidden;
    line-height: 1.5;
    font-size: .93rem;
}

body.sidebar-open {
    overflow: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.page-shell {
    position: relative;
    left: calc((100vw - 100%) / 2);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 1.125rem 1.5rem 1.5rem;
}

.top-header {
    position: static;
    top: 0.625rem;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1.125rem;
    padding: .8rem 1.375rem;
    border: 0.0625rem solid rgba(28, 60, 90, 0.18);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #3f739b 0%, #26547E 100%);
    box-shadow: 0 0.875rem 1.75rem rgba(39, 74, 109, 0.18);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    flex: 1 1 auto;
    min-width: 0;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.header-logo svg,  .header-logo img {
    flex-shrink: 0;
    filter: drop-shadow(0 0.5rem 0.9rem rgba(18, 41, 62, 0.22));
    max-width: 2.625rem;
    max-height: 2.625rem;
    opacity: .85;
    margin: 0;
}

.header-logo h1 {
    margin: 0;
    color: #ffffff;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.045em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 1px 2px 1px rgba(51, 51, 51, .25);
}

.header-title-compact {
    display: none;
}
.header-title-mini{
    display: none;
}
.header-logo p {
    margin-top: 0.125rem;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.92rem;
}

.header-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    border: 0.0625rem solid rgba(255, 255, 255, 0.22);
    border-radius: 62.4375rem;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-shadow: 1px 2px 1px rgba(51, 51, 51, .25);
}

.top-header-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: auto;
    flex-shrink: 0;
}

.language-switcher {
    position: relative;
    flex-shrink: 0;
}

.language-switcher-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 0.65rem 0.75rem;
    border: 0.0625rem solid rgba(255, 255, 255, 0.22);
    border-radius: 62.4375rem;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    cursor: pointer;
    line-height: 0;
    text-shadow: 1px 2px 1px rgba(51, 51, 51, .25);
}

.language-switcher-flag {
    display: block;
    width: 1.25rem;
    height: 0.875rem;
    border-radius: 0;
    object-fit: cover;
    margin: 0;
    flex-shrink: 0;
}

.language-switcher-name {
    font-size: 0.86rem;
    font-weight: 600;
    white-space: nowrap;
}

.language-switcher-menu {
    position: absolute;
    top: calc(100% + 0.65rem);
    right: 0;
    z-index: 130;
    display: none;
    min-width: 12rem;
    padding: 0.45rem;
    border: 0.0625rem solid rgba(47, 95, 137, 0.12);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 1rem 2rem rgba(39, 74, 109, 0.16);
}

.language-switcher-menu.open {
    display: grid;
    gap: 0.25rem;
}

.language-switcher-option {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.5rem 0.5rem;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--primary-dark);
    font: inherit;
    font-size: 0.92rem;
    text-align: left;
    cursor: pointer;
}

.language-switcher-option:hover,
.language-switcher-option.is-active {
    background: rgba(57, 102, 138, 0.08);
}

.language-switcher-static .language-switcher-toggle {
    cursor: default;
}

.menu-toggle {
    display: none;
    width: 2.75rem;
    height: 2.75rem;
    border: 0.0625rem solid rgba(255, 255, 255, 0.24);
    border-radius: 0.5625rem;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: none;
}

.sidebar-overlay {
    display: none;
}

.layout {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: 19.375rem minmax(0, 1fr);
    gap: 1.375rem;
    align-items: stretch;
    min-height: 0;
    margin-top: 1.125rem;
}

.sidebar {
    position: static;
    top: auto;
    align-self: stretch;
    height: 100%;
    padding: 0.875rem;
    border: 0.0625rem solid rgba(47, 95, 137, 0.1);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(247, 251, 255, 0.96) 100%);
    box-shadow: var(--shadow-soft);
    contain: layout paint;
}

.sidebar-title {
    padding: 0.5rem 0.5rem 0.875rem;
    border-bottom: 0.0625rem solid rgba(47, 95, 137, 0.08);
    margin-bottom: 0.875rem;
}

.sidebar-title strong {
    display: block;
    color: var(--primary-dark);
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.sidebar-title span {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.sidebar-search {
    padding: 0.25rem 0.25rem 0.875rem;
    border-bottom: 0.0625rem solid rgba(47, 95, 137, 0.08);
    margin-bottom: 0.875rem;
}

.sidebar-nav {
    min-height: 0;
}

.sidebar-search-form {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.sidebar-search-label {
    color: var(--primary-dark);
    font-size: 0.94rem;
    font-weight: 700;
}

.sidebar-search-row {
    position: relative;
    display: block;
}

.sidebar-search-input {
    width: 100%;
    min-width: 0;
    padding: 0.78rem 2.85rem 0.78rem 0.9rem;
    border: 0.0625rem solid #d3deea;
    border-radius: 0.75rem;
    background: #ffffff;
    color: var(--text-main);
    font: inherit;
    outline: 0;
}

.sidebar-search-icon {
    position: absolute;
    top: 50%;
    right: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #7f96b0;
    transform: translateY(-50%);
    cursor: pointer;
    appearance: none;
}

.sidebar-search-icon svg {
    width: 1.2rem;
    height: 1.2rem;
    pointer-events: none;
}

.sidebar-search-icon:hover,
.sidebar-search-icon:focus-visible {
    color: #486f96;
}

.sidebar-search-icon:focus-visible {
    outline: 0;
    border-radius: 999px;
    box-shadow: 0 0 0 0.125rem rgba(72, 111, 150, 0.22);
}

.nav-menu {
    list-style: none;
    padding-left: 0;
}

.nav-item {
    position: relative;
    margin-bottom: 0.5rem;
    border: 0.0625rem solid #e3ebf3;
    border-radius: 0.75rem;
    overflow: visible;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
    transition: border-color 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease;
}

.nav-item:hover {
    border-color: rgba(47, 95, 137, 0.18);
    box-shadow: 0 0.625rem 1.25rem rgba(39, 74, 109, 0.07);
}

.nav-submenu {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows 0.2s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.16s ease;
    contain: layout paint;
}

.nav-submenu > ul {
    list-style: none;
    min-height: 0;
    overflow: hidden;
    background: #ffffff;
    margin: 0;
    padding: 0;
}

.nav-item.open {
    border-color: rgba(47, 95, 137, 0.18);
    background: #ffffff;
}

.nav-item.open .nav-submenu {
    grid-template-rows: 1fr;
    opacity: 1;
}

.nav-item.open .nav-submenu > ul {
    opacity: 1;
    padding-bottom: 0.5rem;
    border-bottom-right-radius: .75rem;
    border-bottom-left-radius: .75rem;
}

.nav-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.8125rem 0.9375rem;
    color: var(--primary-dark);
    font-size: 0.93rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    cursor: pointer;
    user-select: none;
}

.nav-title-wrap {
    display: flex;
    align-items: stretch;
    position: relative;
}

.nav-title-wrap .nav-title {
    flex: 1 1 auto;
    min-width: 0;
}

.nav-section-actions {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    padding-right: 0.35rem;
}

.nav-section-actions-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1875rem;
    width: 2.3rem;
    height: 2rem;
    border: 0.0625rem solid rgba(47, 95, 137, 0.16);
    border-radius: 0.75rem;
    background: linear-gradient(180deg, #ffffff 0%, #f3f8fc 100%);
    cursor: pointer;
    box-shadow: 0 0.375rem 0.875rem rgba(39, 74, 109, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.nav-section-actions-toggle span {
    display: block;
    width: 0.72rem;
    height: 0.125rem;
    border-radius: 999px;
    background: var(--primary-dark);
}

.nav-section-actions-toggle:hover,
.nav-section-actions-toggle[aria-expanded="true"] {
    border-color: rgba(47, 95, 137, 0.22);
    box-shadow: 0 0.625rem 1.25rem rgba(39, 74, 109, 0.08);
    transform: translateY(-0.0625rem);
}

.nav-section-actions-menu {
    position: absolute;
    right: 0.35rem;
    top: calc(100% + 0.35rem);
    z-index: 60;
    display: none;
    min-width: 11.75rem;
    padding: 0.45rem;
    border: 0.0625rem solid rgba(47, 95, 137, 0.12);
    border-radius: 0.875rem;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 1rem 2rem rgba(39, 74, 109, 0.14);
}

.nav-section-actions-menu.open {
    display: block;
}

.nav-section-actions-menu button {
    display: block;
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: none;
    border-radius: 0.625rem;
    background: transparent;
    color: var(--primary-dark);
    font-size: 0.92rem;
    text-align: left;
    cursor: pointer;
}

.nav-section-actions-menu button:hover {
    background: rgba(57, 102, 138, 0.08);
}

.nav-section-actions-menu .danger {
    color: #9f3f3f;
}

.nav-title::after {
    content: "";
    width: 0.4rem;
    height: 0.4rem;
    min-width: 0.4rem;
    margin-right: 0.1rem;
    border-top: 0.125rem solid #7f96b0;
    border-right: 0.125rem solid #7f96b0;
    transform: rotate(45deg);
    transition: transform 0.25s ease, border-color 0.2s ease;
}

.nav-item.open .nav-title::after {
    transform: rotate(135deg);
}

.nav-item:hover .nav-title::after,
.nav-item.open .nav-title::after {
    border-color: var(--primary-color);
}

.nav-link {
    display: block;
    position: relative;
    padding: 0.5625rem 0.875rem 0.5625rem 2.25rem;
    color: #59718d;
    text-decoration: none;
    font-size: 0.93rem;
    line-height: 1.4;
}

.nav-link::before {
    content: "";
    position: absolute;
    left: 1rem;
    top: 50%;
    width: 0.4375rem;
    height: 0.4375rem;
    border-radius: 50%;
    transform: translateY(-50%);
    background: #c8d6e4;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-link:hover {
    color: var(--primary-dark);
    background: linear-gradient(90deg, rgba(57, 102, 138, 0.12) 0%, rgba(57, 102, 138, 0.03) 100%);
}

.nav-link.active {
    color: #fff;
    background: linear-gradient(90deg, #517fa4 0%, #6298c4f0 100%);
    text-shadow: 1px 1px 2px rgba(51, 51, 51, .5);
}

.nav-link:hover::before,
.nav-link.active::before {
    background: var(--accent-color);
    box-shadow: 0 0 0 0.3125rem rgba(242, 161, 76, 0.14);
}

.nav-link-strong {
    font-weight: 500;
}

.main-content {
    display: flex;
    flex-direction: column;
    align-self: stretch;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

#content-area {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    padding: 0;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    box-shadow: var(--shadow-soft);
    animation: fadeIn 0.32s ease;
    overflow: hidden;
}

#content-area.is-topic-enter .content-topbar,
#content-area.is-topic-enter .content-body {
    animation: topicSwapIn 0.2s ease;
}

.content-topbar {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .694em 1.389em;
    background: linear-gradient(180deg, #6298c4 0%, #517fa4 100%);
}

.content-topbar strong {
    color: #fff;
    font-size: 0.93rem;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(51, 51, 51, .5);
    letter-spacing: .03em;
}

.content-topbar span {
    color: #f1f1f1;
    font-size: 0.88rem;
}

.content-body {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    padding: 1rem;
}

.intro-text {
    color: var(--text-muted);
    font-size: 1.06rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(0.5rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes topicSwapIn {
    from {
        opacity: 0.52;
    }

    to {
        opacity: 1;
    }
}

.content-header {
    margin-bottom: 2.4rem;
    padding-bottom: 1.2rem;
    border-bottom: 0.0625rem solid var(--border-color);
}

h1,
h2,
h3,
h4 {
    color: var(--text-main);
    margin-bottom: .75rem;
    line-height: 1.24;
}

h1 {
    font-size: 1.7rem;
    letter-spacing: -0.02em;
}

h2 {
    margin-top: 0;
    font-size: 1.6rem;
    padding-bottom: 0.45rem;
    border-bottom: 0.0625rem solid rgba(47, 95, 137, 0.08);
}

h3 {
    font-size: 1.2rem;
}

p {
    margin-bottom: 0.75rem;
    font-size: .93rem;
    line-height: 1.55;
}

ul,
ol {
    margin-bottom: .75rem;
    padding-left: 1.6rem;
}

.doc-content li {
    margin-bottom: 0.7rem;
}

.doc-content .quote {
    padding: .555em .78em;
    border: 1px solid #FF9800;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .24);
    color: #333;
    background-color: #FFF3E0;
    border-left-width: .347em;
    margin: 0;
}

.doc-content  div+p, .doc-content  div+ul, .doc-content  div+ol, .doc-content  div+h1, .doc-content  div+h2, .doc-content div+h3, .doc-content div+h4, .doc-content div+h5, .doc-content div+h6 {
    margin-top: 0.7em;
}

p:last-child, ul:last-child, ol:last-child {
    margin-bottom: 0;
}

a {
    color: #0d518d;
    text-decoration: none;
}

.doc-content a:hover {
    border-bottom: 1px dashed #0d518d;
}

.search-results a:hover {
    border-bottom: 0.0625rem solid rgba(47, 95, 137, 0.18);
}

.docs-search-highlight {
    border-radius: 0.2em;
    background: rgba(255, 208, 74, 0.55);
    color: inherit;
    box-shadow: inset 0 -0.08em 0 rgba(210, 139, 14, 0.18);
}

img {
    max-width: 100%;
    height: auto;
    margin-bottom: 1rem;
}

img.image-bordered {
    border: 0.0625rem solid var(--border-color);
    border-radius: 0.625rem;
    box-shadow: 0 0.875rem 1.625rem rgba(39, 74, 109, 0.08);
}

pre {
    margin-bottom: 1.8rem;
    padding: 1.25rem 1.35rem;
    overflow-x: auto;
    border: 0.0625rem solid #cdd9e5;
    border-radius: 0.5rem;
    background: #f5f8fc;
    color: #27425f;
    box-shadow: inset 0 0.0625rem 0 rgba(255, 255, 255, 0.7);
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.93rem;
}
pre[class*=language-] {
    margin: 0 !important;
    margin-bottom: .75rem !important;
}
code {
    padding: 0.15rem 0.15rem;
    border-radius: 0.375rem;
    background: rgba(175, 184, 193, 0.2);
    border: 1px solid #d0d7de;
    color: #c92c2c;
    font-family: 'Menlo','Monaco','Ubuntu Mono','Lucida Console','Consolas','Source Code Pro','source-code-pro',monospace;
    font-size: .87em;
}

pre code {
    padding: 0;
    background: transparent;
    color: inherit;
    border: 0;
}

.note {
    margin: 1.7rem 0;
    padding: 1.2rem 1.3rem;
    border-left: 0.25rem solid var(--primary-color);
    border-radius: 0 0.625rem 0.625rem 0;
    background: #f5f9fd;
    box-shadow: 0 0.5rem 1.25rem rgba(39, 74, 109, 0.05);
}

.warning {
    border-left-color: var(--accent-color);
    background: #fff8ef;
}

.note strong {
    display: inline-block;
    margin-bottom: 0.6rem;
    color: var(--primary-dark);
}

.table-responsive {
    margin-bottom: 1.8rem;
    overflow-x: auto;
    border: 0.0625rem solid var(--border-color);
    background: #ffffff;
    margin-left: -2.125rem;
    margin-right: -2.125rem;
    border-left: none;
    border-right: none;
    border-bottom: none;
}

.doc-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    background: #ffffff;
}

.doc-table th,
.doc-table td {
    padding: .5rem;
    border-bottom: 0.0625rem solid var(--border-color);
}
.doc-table th:first-child, .doc-table td:first-child {
    padding-left: 2rem;
    min-width: 16rem;
}

.doc-table th:last-child, .doc-table td:last-child {
    padding-right: 2rem;
}

.doc-table th {
    background: #f6f9fc;
    color: var(--primary-dark);
    font-weight: 700;
}

.doc-table tr:hover td {
    background: #f9fbfe;
}

.page-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.375rem;
    padding: 0 0.25rem;
    color: var(--text-muted);
    font-size: 0.92rem;
}

@media (min-width: 53.8125rem) {
    html {
        overscroll-behavior-y: none;
    }

    .page-shell {
        min-height: 100dvh;
        padding-bottom: 0.5rem;
    }

    .sidebar {
        position: sticky;
        top: 0.5rem;
        align-self: start;
        display: flex;
        flex-direction: column;
        height: var(--desktop-sidebar-height, calc(100dvh - 1rem));
        max-height: var(--desktop-sidebar-height, calc(100dvh - 1rem));
        padding: 0;
        overflow: hidden;
    }

    .sidebar-search {
        flex: 0 0 auto;
        margin-bottom: 0;
        padding: 0.875rem 0.875rem 0.75rem;
    }

    .sidebar-nav {
        flex: 1 1 auto;
        min-height: 0;
        padding: 0.875rem 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
        scrollbar-width: thin;
    }

    .sidebar-nav::-webkit-scrollbar {
        width: 0.375rem;
        height: 0.375rem;
    }

    .nav-menu {
        padding: 0 0.875rem 0 0.875rem;
    }

    .sidebar-admin {
        flex: 0 0 auto;
        margin-top: auto;
        margin-bottom: 0;
        padding: 1rem 0.875rem 0.875rem;
    }

    .main-content {
        height: auto;
    }

    #content-area {
        flex: 1 1 auto;
    }

    .content-body {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
    }

    .page-footer {
        flex: 0 0 auto;
    }
}

@media (max-width: 70rem) {
    .layout {
        grid-template-columns: 18.125rem minmax(0, 1fr);
        gap: 1.125rem;
    }
}

@media (max-width: 53.75rem) {
    .page-shell {
        min-height: 100vh;
        min-height: 100dvh;
        padding: var(--mobile-header-offset) 1rem 1rem;
    }
    .top-header {
        position: fixed;
        top: 0;
        left: 0;
        border-radius: 0;
        right: 0;
        padding: .6rem .91rem;     
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .top-header-meta {
        order: 3;
        margin-left: auto;
    }

    .language-switcher {
        margin-left: 0;
    }

    .header-logo svg, .header-logo img,  .header-logo p{
        display: none;
    }

    .header-logo .header-title-full {
        display: none;
    }

    .header-logo .header-title-compact {
        display: inline;
    }

    .layout {
        grid-template-columns: 1fr;
        margin-top: 0;
        min-height: 0;
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 119;
        background: rgba(17, 34, 49, 0.26);
        backdrop-filter: blur(0.625rem);
        -webkit-backdrop-filter: blur(0.625rem);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.28s ease;
    }

    body.sidebar-open .sidebar-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 121;
        width: min(21.5rem, calc(100vw - 2.25rem));
        height: 100dvh;
        max-height: 100dvh;
        margin-bottom: 0;
        padding-top: 1rem;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem);
        border-radius: 0;
        transform: translateX(calc(-100% - 1.5rem));
        opacity: 0;
        pointer-events: none;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        box-shadow: 0 1.125rem 2.25rem rgba(23, 47, 71, 0);
        transition:
            transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
            opacity 0.24s ease,
            box-shadow 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
        box-shadow: 0 1.5rem 2.8rem rgba(23, 47, 71, 0.28);
    }

    .content-body {
        padding: 1rem;
    }

    .page-footer {
        flex-direction: column;
    }
    .page-footer p:last-child{
        display: none;
    }
    .table-responsive {
        margin-left: 0;
        margin-right: 0;
        border-left: 0.0625rem solid var(--border-color);
        border-right: 0.0625rem solid var(--border-color);        
    }

    .doc-table th:first-child, .doc-table td:first-child {
        padding-left: .5rem;
        min-width: auto;
    }

    .doc-table th:last-child, .doc-table td:last-child {
        padding-right: .5rem;
    }

}

@media (max-width: 35rem) {
    .top-header {
        gap: 0.75rem;
    }

    .top-header-meta {
        gap: 0.45rem;
    }

    .header-title-full {
        display: none;
    }

    .header-title-compact{
        display: none;
    }
    .header-title-mini{
        display: inline;
    }

    .header-logo p {
        display: none;
    }

    .content-body {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    .table-responsive {
        overflow-x: auto;
        width: 100%;     
    }

    .table-responsive .doc-table {
        table-layout: auto !important;
    }

    .doc-table th, .doc-table td {
        padding: .5rem;
    }

}
@media (max-width: 35rem) {
    .header-logo .header-title-compact {
        display: none;
    }
}

.doc-content {
    min-height: 18rem;
}

.search-results {
    display: grid;
    gap: 0.9rem;
}

.search-result-card {
    display: block;
    padding: 1rem 1.1rem;
    border: 0.0625rem solid #dce6ef;
    border-radius: 0.875rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfe 100%);
    box-shadow: 0 0.625rem 1.35rem rgba(39, 74, 109, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.search-result-card:hover {
    transform: translateY(-0.0625rem);
    border-color: rgba(47, 95, 137, 0.18);
    box-shadow: 0 0.875rem 1.7rem rgba(39, 74, 109, 0.1);
}

.search-result-card strong {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--primary-dark);
    font-size: 1.02rem;
}

.search-result-card span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.inline-editor {
    min-height: 18rem;
}

.inline-editor-header {
    margin-bottom: 1.5rem;
}

.inline-editor-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.inline-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.sidebar-admin {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 0.0625rem solid rgba(47, 95, 137, 0.08);
}

.sidebar-admin-title {
    margin-bottom: 0.75rem;
    color: var(--primary-dark);
    font-size: 0.92rem;
    font-weight: 700;
}

.sidebar-admin-link,
.sidebar-auth-link {
    display: block;
    width: 100%;
    margin-bottom: 0.55rem;
    padding: 0.75rem 0.9rem;
    border: 0.0625rem solid rgba(47, 95, 137, 0.14);
    border-radius: 0.75rem;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbfe 100%);
    color: var(--primary-dark);
    font-size: 0.92rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.sidebar-admin-link:hover,
.sidebar-auth-link:hover {
    border-color: rgba(47, 95, 137, 0.22);
    box-shadow: 0 0.625rem 1.25rem rgba(39, 74, 109, 0.08);
    transform: translateY(-0.0625rem);
}

.sidebar-admin-exit {
    color: #94514c;
}

.topic-actions {
    position: relative;
    flex-shrink: 0;
    z-index: 30;
}

.topic-actions-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.1875rem;
    width: 2.3rem;
    height: 2rem;
    border: 0.0625rem solid rgba(47, 95, 137, 0.16);
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    box-shadow: 0 0.375rem 0.875rem rgba(39, 74, 109, 0.06);
}

.topic-actions-toggle span {
    width: 0.25rem;
    height: 0.25rem;
    border-radius: 50%;
    background: #fff;
}

.topic-actions-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    z-index: 50;
    display: none;
    min-width: 12rem;
    padding: 0.5rem;
    border: 0.0625rem solid rgba(47, 95, 137, 0.12);
    border-radius: 0.875rem;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 1rem 2rem rgba(39, 74, 109, 0.14);
}

.topic-actions-menu.open {
    display: block;
}

.topic-actions-menu button {
    display: block;
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: none;
    border-radius: 0.625rem;
    background: transparent;
    color: var(--primary-dark);
    font-size: 0.92rem;
    text-align: left;
    cursor: pointer;
}

.topic-actions-menu button:hover {
    background: rgba(57, 102, 138, 0.08);
}

.topic-actions-menu .danger {
    color: #9f3f3f;
}

body.has-modal {
    overflow: hidden;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal.is-open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(24, 42, 59, 0.36);
    backdrop-filter: blur(0.25rem);
}

.modal-dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 34rem);
    max-height: calc(100vh - 3rem);
    overflow: auto;
    padding: 1.5rem;
    border: 0.0625rem solid var(--border-color);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    box-shadow: 0 1.5rem 3rem rgba(39, 74, 109, 0.18);
}

.modal-dialog-wide {
    width: min(100%, 56rem);
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 1.8rem;
    height: 1.8rem;
    border: 0.0625rem solid rgba(47, 95, 137, 0.14);
    border-radius: 0.625rem;
    background: #f7fbfe;
    color: var(--primary-dark);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.modal-header {
    margin-bottom: 1.25rem;
    padding-right: 2.5rem;
    border-bottom: 0.0625rem solid rgba(47, 95, 137, 0.08);
}

.modal-header h2 {
    margin-bottom: 0.45rem;
    border-bottom: none;
    padding-bottom: 0;
}

.modal-header p {
    color: var(--text-muted);
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.form-field span {
    color: var(--primary-dark);
    font-size: 0.92rem;
    font-weight: 600;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 0.5rem 0.5rem;
    border: 0.0625rem solid #d3deea;
    border-radius: 0.5rem;
    background: #ffffff;
    color: var(--text-main);
    font: inherit;
}

.form-field textarea {
    min-height: 15rem;
    resize: vertical;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.modal-actions-between {
    justify-content: space-between;
}

.button {
    padding: 0.5rem .7rem;
    border: 0.0625rem solid transparent;
    border-radius: 0.75rem;
    font: inherit;
    font-size: .9rem;
    font-weight: 400;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.button:hover {
    transform: translateY(-0.0625rem);
}

.button-primary {
    background: linear-gradient(180deg, #3f739b 0%, #26547e 100%);
    color: #ffffff;
    box-shadow: 0 0.75rem 1.25rem rgba(39, 74, 109, 0.16);
}

.button-secondary {
    border-color: rgba(47, 95, 137, 0.18);
    background: #f6fbff;
    color: var(--primary-dark);
}

.button-danger {
    background: linear-gradient(180deg, #bf5959 0%, #9f3f3f 100%);
    color: #ffffff;
}

.modal-feedback {
    display: none;
    padding: 0.75rem 0.9rem;
    border-radius: 0.75rem;
    font-size: 0.92rem;
}

.modal-feedback.is-visible {
    display: block;
}

.modal-feedback.is-error {
    background: #fff1f1;
    color: #a14d4d;
}

.modal-feedback.is-success {
    background: #eefaf1;
    color: #357b4a;
}

.tox-tinymce {
    border-color: #d3deea !important;
    border-top: .35em solid #5a89c2 !important;
    border-top-left-radius: .139em !important;
    border-top-right-radius: .139em !important;
}

@media (max-width: 53.75rem) {
    .modal {
        padding: 1rem;
    }

    .modal-dialog {
        width: 100%;
        max-height: calc(100vh - 2rem);
        padding: 1.25rem;
    }

    .content-topbar {
        align-items: flex-start;
    }
}

@media (max-width: 35rem) {
    .modal-actions,
    .modal-actions-between,
    .inline-editor-actions {
        flex-direction: column;
    }

    .topic-actions-menu {
        min-width: 10.5rem;
    }
}
