﻿:root {
    --bg-main: #080f17;
    --bg-deep: #0e1a28;
    --surface-1: #112131;
    --surface-2: #172c40;
    --surface-3: #20384f;
    --line: #2f4961;
    --line-strong: #476889;
    --text-main: #e9f2fb;
    --text-soft: #aac0d4;
    --text-muted: #7f9ab4;
    --accent: #55c4ff;
    --accent-2: #4de6c1;
    --danger: #ff8a99;
    --shadow-xl: 0 28px 54px rgba(0, 0, 0, 0.45);
    --radius-xl: 22px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 9px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden !important;
    overflow-y: scroll !important;
    font-family: 'Manrope', 'IBM Plex Sans', Arial, sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(1200px 700px at -10% -15%, rgba(57, 106, 149, 0.42) 0%, rgba(57, 106, 149, 0) 58%),
        radial-gradient(1100px 680px at 115% -12%, rgba(39, 95, 152, 0.37) 0%, rgba(39, 95, 152, 0) 56%),
        linear-gradient(168deg, var(--bg-main) 0%, #091321 45%, var(--bg-deep) 100%);
    letter-spacing: 0.1px;
}

main { padding: 18px 14px 28px; }
.wrapper { max-width: 1600px; margin: 0 auto; }
#content {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    border: 1px solid #2a445d;
    background: linear-gradient(180deg, rgba(10, 22, 34, 0.95) 0%, rgba(10, 19, 30, 0.96) 100%);
    box-shadow: var(--shadow-xl);
    isolation: isolate;
}
#content::before {
    content: '';
    position: absolute;
    top: -160px;
    right: -180px;
    width: 460px;
    height: 460px;
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(95, 189, 255, 0.26) 0%, rgba(95, 189, 255, 0) 70%);
    pointer-events: none;
    z-index: 0;
}

#sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 8, 16, 0.72);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 2990;
}

header {
    position: relative;
    z-index: 1;
    padding: 16px 18px 14px;
    border-bottom: 1px solid rgba(81, 118, 150, 0.35);
    background: linear-gradient(180deg, rgba(17, 33, 49, 0.85) 0%, rgba(17, 33, 49, 0.35) 100%);
}
.header-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
}
.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #3c5976;
    border-radius: 10px;
    background: #1b3246;
    color: #f2f8ff;
    cursor: pointer;
    font-size: 17px;
    flex: 0 0 40px;
}
.app-intro h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.18;
    font-weight: 800;
    letter-spacing: .2px;
    color: #f5f9ff;
}
.app-intro p {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--text-soft);
}
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.header-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.stat-pill {
    min-width: 108px;
    padding: 7px 10px;
    border-radius: 10px;
    border: 1px solid rgba(87, 127, 161, 0.8);
    background: linear-gradient(180deg, #1b344a 0%, #182d40 100%);
}
.stat-pill span {
    display: block;
    font-size: 11px;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: .6px;
}
.stat-pill strong {
    display: block;
    margin-top: 2px;
    font-size: 16px;
    color: #ffffff;
    line-height: 1;
}
.drop-list-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-decoration: none;
    color: #ffffff;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: .4px;
    background: linear-gradient(130deg, #2baee7 0%, #19c9a2 100%);
    box-shadow: 0 10px 24px rgba(16, 169, 200, 0.26);
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.drop-list-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(16, 169, 200, 0.34);
    filter: brightness(1.06);
}

.content-area {
    position: relative;
    z-index: 1;
    display: grid !important;
    grid-template-columns: minmax(320px, 390px) minmax(0, 1fr) !important;
    gap: 18px;
    align-items: start;
    padding: 16px 18px 18px;
}

section, article {
    float: none !important;
    width: auto !important;
    height: auto !important;
    text-shadow: none !important;
}
.sidebar-panel {
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow: auto;
    padding: 14px;
    border-radius: var(--radius-lg);
    border: 1px solid #35526f;
    background: linear-gradient(180deg, #122538 0%, #0f2031 100%);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.36);
}
.sidebar-panel::-webkit-scrollbar { width: 8px; }
.sidebar-panel::-webkit-scrollbar-thumb {
    border-radius: 10px;
    background: #37556f;
}

.content-panel {
    min-height: 640px;
    border-radius: var(--radius-lg);
    border: 1px solid #35526f;
    background: linear-gradient(180deg, #132638 0%, #101f30 100%);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32);
    padding: 16px;
}
.guide-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.guide-meta-wrap {
    min-width: 0;
    flex: 1 1 420px;
}
#guide-breadcrumbs {
    font-size: 12px;
    color: var(--text-soft);
    margin-bottom: 6px;
    word-break: break-word;
}
#guide-meta {
    font-size: 13px;
    color: #89d2ff;
}

.language-section { margin-bottom: 12px; }
.lang-selector-container {
    width: 100%;
    max-width: 100%;
    position: relative;
    display: inline-block;
}
.current-lang {
    width: 100%;
    border: 1px solid #496987;
    border-radius: var(--radius-md);
    background: #1d3449;
    color: #f4f9ff;
    padding: 11px 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-size: 12px;
}
.lang-options {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    z-index: 1000;
    display: none;
    overflow: hidden;
    border-radius: var(--radius-md);
    border: 1px solid #4a6985;
    background: #1d344a;
}
.lang-options.visible { display: block; }
.lang-option {
    padding: 10px 11px;
    color: #eaf3fd;
    text-align: center;
    cursor: pointer;
    transition: background .15s ease;
    font-size: 13px;
}
.lang-option.active,
.lang-option:hover { background: #2a4863; }

.search-section { margin-bottom: 14px; }
.search-container {
    position: relative;
    width: 100%;
}
.search-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: #9ab4ce;
    pointer-events: none;
}
#search-input {
    width: 100%;
    padding: 12px 14px 12px 41px;
    border-radius: var(--radius-md);
    border: 1px solid #4a6985;
    background: #1c3347;
    color: #f2f8ff;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
#search-input:focus {
    border-color: #71cfff;
    box-shadow: 0 0 0 3px rgba(85, 196, 255, 0.18);
    background: #1e384f;
}
.search-suggest {
    display: none;
    margin-top: 7px;
    border-radius: var(--radius-md);
    border: 1px solid #476582;
    background: #1b3348;
    overflow: hidden;
}
.search-suggest-item {
    border-bottom: 1px solid #35526d;
    color: #eaf3fd;
    padding: 9px 10px;
    cursor: pointer;
    font-size: 13px;
}
.search-suggest-item:last-child { border-bottom: none; }
.search-suggest-item:hover { background: #2a4863; }

.category-filters {
    margin-top: 9px;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.filter-chip {
    border: 1px solid #496987;
    background: #1e374d;
    color: #e9f3fe;
    border-radius: 999px;
    padding: 6px 11px;
    font-size: 12px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.filter-chip.active {
    border-color: #74d7ff;
    background: linear-gradient(130deg, #2c88bc 0%, #247a95 100%);
}

.tool-grid {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}
.tool-card {
    border-radius: var(--radius-md);
    border: 1px solid #3b5772;
    background: linear-gradient(180deg, #1a3246 0%, #172d40 100%);
    padding: 10px;
}
.tool-title {
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 800;
    color: #f0f7ff;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.tool-actions {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}
.tool-btn {
    border: 1px solid #4a6985;
    background: #213a50;
    color: #edf6ff;
    border-radius: 8px;
    padding: 7px 10px;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.tool-btn:hover {
    background: #29455f;
    transform: translateY(-1px);
}
.tool-btn.active {
    border-color: #5be6c1;
    background: linear-gradient(130deg, #287d74 0%, #236f69 100%);
}

.mini-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.mini-list li + li { margin-top: 6px; }
.mini-list a {
    color: #d8e7f8;
    text-decoration: none;
    font-size: 13px;
}
.mini-list a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.pages-menu {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.category {
    border-radius: var(--radius-md);
    border: 1px solid #3f5f7c;
    background: linear-gradient(180deg, #172d40 0%, #13283a 100%);
    overflow: hidden;
}
.category-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid rgba(67, 100, 130, 0.35);
}
.category-title:hover { background: rgba(54, 87, 117, 0.2); }
.category-title-text {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.category-title-text b {
    color: #f0f8ff;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 800;
}
.category-toggle {
    color: #aecde8;
    font-size: 12px;
    flex: 0 0 auto;
}
.pin-category {
    margin-left: 2px;
    color: #ffd479;
    opacity: .5;
    cursor: pointer;
    transition: opacity .15s ease;
}
.category-new-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid #2f9d7f;
    background: rgba(40, 152, 117, 0.2);
    color: #8cf5cb;
    padding: 2px 7px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.category-list {
    display: none;
    margin: 0;
    padding: 8px;
    list-style: none;
}
.category-list .improved-page + .improved-page { margin-top: 6px; }

.improved-page { margin: 0; }
.improved-page.standalone { margin: 0; }
.page-link-improved {
    display: block;
    text-decoration: none;
}
.topic {
    border-radius: 10px;
    border: 1px solid #466684;
    background: linear-gradient(180deg, #20394f 0%, #1a3043 100%);
    color: #f3f9ff;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.topic span {
    flex: 1 1 auto;
    min-width: 0;
    white-space: normal;
    word-break: break-word;
    line-height: 1.4;
    font-size: 14px;
}
.page-link-improved:hover .topic {
    border-color: #6fa0cb;
    background: linear-gradient(180deg, #274560 0%, #203b52 100%);
    transform: translateY(-1px);
}
.improved-page.current-active .topic {
    border-color: #74d7ff !important;
    background: linear-gradient(130deg, #2b6896 0%, #2a5f81 100%) !important;
    box-shadow: 0 0 0 2px rgba(114, 211, 255, 0.2);
}

.new-label {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    border-radius: 999px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .3px;
    color: #8ef6d0;
    background: rgba(43, 161, 124, 0.2);
}
.fav-toggle {
    border: none;
    background: transparent;
    color: #c1d4e8;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    line-height: 1;
    font-size: 15px;
    flex: 0 0 20px;
    transition: color .15s ease, transform .15s ease;
}
.fav-toggle:hover {
    color: #ffd46a;
    transform: scale(1.08);
}
.fav-toggle.active { color: #ffd46a; }

.no-results {
    display: none;
    margin-top: 10px;
    padding: 10px 11px;
    border-radius: 10px;
    border: 1px solid #b74a60;
    background: rgba(188, 67, 91, 0.16);
    color: #ffb6c2;
    font-size: 13px;
    font-weight: 700;
}
.highlight {
    border-radius: 4px;
    padding: 1px 4px;
    background: #ffd36d;
    color: #0f1f30;
}
.hidden-by-search { display: none !important; }

#guide-nav {
    display: flex;
    gap: 8px;
    margin: 0;
    flex-wrap: wrap;
}
.guide-nav-btn {
    border-radius: 9px;
    border: 1px solid #4c6f90;
    background: #20384e;
    color: #edf6ff;
    padding: 8px 12px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background .15s ease, border-color .15s ease;
}
.guide-nav-btn:hover {
    background: #2a4862;
    border-color: #6694bc;
}
.guide-nav-btn.disabled {
    pointer-events: none;
    opacity: .5;
}

#guide-feedback {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #3f617f;
    background: linear-gradient(180deg, #1c3348 0%, #192d40 100%);
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    color: #dce9f7;
    font-size: 13px;
}
.feedback-btn {
    border: 1px solid #4a6a88;
    background: #223a50;
    color: #ebf5ff;
    border-radius: 8px;
    padding: 7px 11px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.feedback-btn:hover {
    background: #2d4a65;
    border-color: #678fb3;
}
.feedback-btn.active {
    border-color: #58e8c2;
    background: linear-gradient(130deg, #2b7f75 0%, #236967 100%);
}

#guide-toc,
#similar-guides {
    display: none;
    margin-bottom: 12px;
    padding: 11px;
    border-radius: 10px;
    border: 1px solid #3f617f;
    background: linear-gradient(180deg, #1d354a 0%, #1a3044 100%);
}
#guide-toc strong,
#similar-guides strong {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #f0f8ff;
}
#guide-toc ul,
#similar-guides ul {
    margin: 0;
    padding-left: 18px;
}
#guide-toc a,
#similar-guides a {
    color: #d6e8fb;
    text-decoration: none;
    line-height: 1.55;
}
#guide-toc a:hover,
#similar-guides a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.loader-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 130px;
    color: #95b6d2;
    font-size: 30px;
}

.opisanie {
    color: #ecf4fd;
    font-size: 15px;
    line-height: 1.72;
}
.opisanie > *:first-child { margin-top: 0; }
.opisanie h1,
.opisanie h2,
.opisanie h3 {
    color: #ffffff;
    margin-top: 18px;
}
.opisanie img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}
.opisanie pre,
.opisanie code,
.opisanie table {
    border-radius: 8px;
    border: 1px solid #3a5670;
    background: #14283a;
}
.opisanie table {
    border-collapse: collapse;
    width: 100%;
    overflow: auto;
    display: block;
}
.opisanie td,
.opisanie th {
    border: 1px solid #365069;
    padding: 8px 10px;
}
.copy-btn {
    margin: 0 0 6px;
    border: 1px solid #4a6a88;
    background: #223a50;
    color: #edf6ff;
    border-radius: 7px;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
}
.copy-btn:hover { background: #2a4660; }

.compact-mode .topic {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}

#read-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #47c7ff 0%, #63efd2 100%);
    z-index: 3500;
}
#to-top {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(124, 176, 215, 0.75);
    background: #274862;
    color: #ffffff;
    cursor: pointer;
    display: none;
    z-index: 3510;
}

footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    padding: 14px 0 18px;
}
footer a {
    color: #c6dbef;
    text-decoration: none;
}
footer a:hover { text-decoration: underline; }

@media (max-width: 1320px) {
    .content-area {
        grid-template-columns: minmax(290px, 350px) minmax(0, 1fr) !important;
    }
    .stat-pill { min-width: 94px; }
}

@media (max-width: 1080px) {
    .sidebar-toggle { display: inline-flex; }
    .header-shell { grid-template-columns: 1fr; }
    .header-right { justify-content: flex-start; }
    .content-area {
        grid-template-columns: 1fr !important;
    }
    .sidebar-panel {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(90vw, 390px);
        max-height: none;
        border-radius: 0 18px 18px 0;
        border-left: none;
        z-index: 3000;
        transform: translateX(-103%);
        transition: transform .22s ease;
    }
    .content-panel {
        min-height: 0;
    }
    body.sidebar-open .sidebar-panel {
        transform: translateX(0);
    }
    body.sidebar-open #sidebar-overlay {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 760px) {
    main { padding: 10px 8px 16px; }
    #content { border-radius: 14px; }
    header { padding: 12px 12px 10px; }
    .app-intro h1 { font-size: 22px; }
    .app-intro p { font-size: 12px; }
    .header-stats { width: 100%; }
    .stat-pill {
        flex: 1 1 auto;
        min-width: 0;
    }
    .drop-list-btn {
        width: 100%;
    }
    .content-area {
        padding: 10px;
        gap: 10px;
    }
    .content-panel {
        padding: 12px;
        border-radius: 12px;
    }
    #guide-feedback {
        padding: 9px 10px;
    }
    #guide-nav {
        width: 100%;
    }
    .guide-nav-btn {
        flex: 1 1 auto;
        text-align: center;
    }
}

@media (max-width: 460px) {
    .topic span { font-size: 13px; }
    .tool-actions { gap: 6px; }
    .tool-btn {
        font-size: 11px;
        padding: 6px 8px;
    }
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: flex-end;
}
.action-btn {
    border: 1px solid #4a6a88;
    background: #223a50;
    color: #ebf5ff;
    border-radius: 8px;
    padding: 7px 11px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.action-btn:hover {
    background: #2d4a65;
    border-color: #6791b6;
    transform: translateY(-1px);
}
.action-btn.active {
    border-color: #58e8c2;
    background: linear-gradient(130deg, #2b7f75 0%, #236967 100%);
}

.guide-top-row {
    display: grid;
    grid-template-columns: 1fr minmax(230px, 320px);
    gap: 10px;
    margin-bottom: 10px;
}
.guide-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.badge-pill {
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid #4a6a88;
    background: #233a50;
    color: #eaf4ff;
}
.badge-pill.easy {
    border-color: #57d89d;
    color: #9bf2c9;
    background: rgba(40, 152, 117, 0.22);
}
.badge-pill.medium {
    border-color: #f2c062;
    color: #ffd99d;
    background: rgba(181, 124, 32, 0.25);
}
.badge-pill.hard {
    border-color: #ee7d87;
    color: #ffc2cb;
    background: rgba(159, 57, 72, 0.25);
}

.section-progress {
    border: 1px solid #3e5f7d;
    border-radius: 10px;
    background: linear-gradient(180deg, #1b3348 0%, #182c3f 100%);
    padding: 9px 10px;
}
#section-progress-label {
    display: block;
    font-size: 12px;
    color: #d7e8fa;
    margin-bottom: 6px;
}
.section-progress-track {
    position: relative;
    height: 8px;
    border-radius: 999px;
    background: #10202f;
    overflow: hidden;
}
#section-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 0%;
    background: linear-gradient(90deg, #49cbff 0%, #64efd4 100%);
    transition: width .22s ease;
}

.guide-changelog {
    border: 1px solid #3e607d;
    border-radius: 10px;
    background: #1a3044;
    color: #d8e9fb;
    font-size: 12px;
    line-height: 1.5;
    padding: 10px;
    margin-bottom: 10px;
}
.guide-changelog strong {
    display: block;
    margin-bottom: 4px;
    color: #f0f8ff;
}

.mini-toc {
    border: 1px solid #3e607d;
    border-radius: 10px;
    background: #1a3044;
    padding: 10px;
    margin-bottom: 10px;
}
.mini-toc strong {
    display: block;
    margin-bottom: 7px;
    font-size: 12px;
    color: #f0f8ff;
    text-transform: uppercase;
    letter-spacing: .35px;
}
#mini-toc-list {
    margin: 0;
    padding-left: 16px;
    max-height: 180px;
    overflow: auto;
}
#mini-toc-list li { margin-bottom: 4px; }
#mini-toc-list a {
    color: #d5e8fb;
    text-decoration: none;
    font-size: 12px;
    line-height: 1.45;
}
#mini-toc-list a.active {
    color: #7ed5ff;
    font-weight: 700;
}
#mini-toc-list a:hover { text-decoration: underline; }

.guide-feedback-end {
    margin: 12px 0;
    border: 1px solid #3e607d;
    border-radius: 10px;
    background: linear-gradient(180deg, #1c3348 0%, #182d40 100%);
    padding: 10px;
}
.guide-feedback-end-title {
    color: #e8f3ff;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 13px;
}
.guide-feedback-end-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}
#fb-comment {
    width: 100%;
    min-height: 78px;
    resize: vertical;
    border: 1px solid #4b6c89;
    border-radius: 8px;
    background: #13273a;
    color: #ebf5ff;
    font-family: inherit;
    font-size: 13px;
    padding: 8px 10px;
    outline: none;
}
#fb-comment:focus {
    border-color: #74d7ff;
    box-shadow: 0 0 0 2px rgba(85, 196, 255, 0.17);
}
.guide-feedback-end-send {
    margin-top: 8px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
#fb-comment-status {
    font-size: 12px;
    color: #9fd1f4;
}

.skeleton-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    min-height: 130px;
}
.skeleton-line {
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, #173247 0%, #274760 50%, #173247 100%);
    background-size: 280% 100%;
    animation: guideShimmer 1.15s linear infinite;
}
.skeleton-line.w-90 { width: 90%; }
.skeleton-line.w-95 { width: 95%; }
.skeleton-line.w-70 { width: 70%; }
.skeleton-line.w-65 { width: 65%; }

@keyframes guideShimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.search-modal {
    position: fixed;
    inset: 0;
    z-index: 3600;
}
.search-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 10, 18, 0.78);
}
.search-modal-panel {
    position: relative;
    width: min(820px, calc(100vw - 24px));
    margin: 9vh auto 0;
    border: 1px solid #3f617f;
    border-radius: 14px;
    background: linear-gradient(180deg, #162b3f 0%, #13263a 100%);
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.45);
    padding: 12px;
}
.search-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.search-modal-head strong {
    color: #f3f9ff;
    font-size: 15px;
}
.search-modal-x {
    border: 1px solid #4a6a88;
    background: #223a50;
    color: #fff;
    border-radius: 7px;
    width: 30px;
    height: 30px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
#search-modal-input {
    width: 100%;
    border: 1px solid #4b6c89;
    border-radius: 9px;
    background: #102335;
    color: #edf6ff;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    padding: 11px 12px;
}
#search-modal-input:focus {
    border-color: #74d7ff;
    box-shadow: 0 0 0 3px rgba(85, 196, 255, 0.16);
}
.search-modal-hint {
    margin-top: 6px;
    color: #9fc1df;
    font-size: 12px;
}
#search-modal-results {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
    max-height: 42vh;
    overflow: auto;
}
#search-modal-results li + li { margin-top: 5px; }
.search-modal-item {
    display: block;
    border: 1px solid #456482;
    border-radius: 9px;
    background: #1e374d;
    color: #e9f3ff;
    text-decoration: none;
    padding: 9px 10px;
    font-size: 13px;
}
.search-modal-item:hover,
.search-modal-item.active {
    border-color: #70c9f2;
    background: #2a4b67;
}
.search-modal-item small {
    display: block;
    margin-top: 3px;
    color: #a9c5df;
    font-size: 11px;
}

body[data-theme="light"] {
    --text-main: #142b3c;
    --text-soft: #4b6478;
    --text-muted: #70859a;
    background:
        radial-gradient(1200px 700px at -10% -15%, rgba(130, 187, 234, 0.35) 0%, rgba(130, 187, 234, 0) 58%),
        radial-gradient(1100px 680px at 115% -12%, rgba(150, 190, 230, 0.33) 0%, rgba(150, 190, 230, 0) 56%),
        linear-gradient(170deg, #dcecf8 0%, #f3f9ff 52%, #daeaf6 100%);
}
body[data-theme="light"] #content {
    border-color: #9eb7cb;
    background: linear-gradient(180deg, rgba(247, 252, 255, 0.96) 0%, rgba(236, 246, 252, 0.97) 100%);
}
body[data-theme="light"] header,
body[data-theme="light"] .sidebar-panel,
body[data-theme="light"] .content-panel,
body[data-theme="light"] .tool-card,
body[data-theme="light"] .section-progress,
body[data-theme="light"] .guide-changelog,
body[data-theme="light"] .mini-toc,
body[data-theme="light"] #guide-feedback,
body[data-theme="light"] .guide-feedback-end,
body[data-theme="light"] #guide-toc,
body[data-theme="light"] #similar-guides,
body[data-theme="light"] .search-modal-panel {
    background: #f3f9ff;
    border-color: #a4bdd0;
    color: #1a2f41;
}
body[data-theme="light"] .topic,
body[data-theme="light"] .action-btn,
body[data-theme="light"] .feedback-btn,
body[data-theme="light"] .guide-nav-btn,
body[data-theme="light"] .current-lang,
body[data-theme="light"] #search-input,
body[data-theme="light"] #search-modal-input,
body[data-theme="light"] .filter-chip,
body[data-theme="light"] .search-suggest,
body[data-theme="light"] #fb-comment {
    background: #e7f1f9;
    border-color: #9eb8cb;
    color: #1a3146;
}
body[data-theme="light"] .topic:hover,
body[data-theme="light"] .action-btn:hover,
body[data-theme="light"] .feedback-btn:hover,
body[data-theme="light"] .guide-nav-btn:hover,
body[data-theme="light"] .search-modal-item:hover,
body[data-theme="light"] .search-modal-item.active {
    background: #d8eaf7;
}
body[data-theme="light"] .search-modal-hint,
body[data-theme="light"] #fb-comment-status,
body[data-theme="light"] .app-intro p,
body[data-theme="light"] #guide-breadcrumbs {
    color: #587088;
}

@media (max-width: 1080px) {
    .header-actions { justify-content: flex-start; }
    .guide-top-row { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .header-actions {
        width: 100%;
    }
    .header-actions .action-btn {
        flex: 1 1 calc(50% - 7px);
        text-align: center;
    }
    .mini-toc { display: none !important; }
    .search-modal-panel {
        margin-top: 5vh;
    }
}

/* guide enhancements */
.pages-menu .page,
.pages-menu .improved-page,
.pages-menu .category-list > li {
    display: block !important;
    float: none !important;
    width: 100% !important;
    clear: both;
}

.topic span {
    word-break: normal;
    overflow-wrap: anywhere;
}

.hidden-by-favorites {
    display: none !important;
}

.mini-toc {
    position: sticky;
    top: 12px;
    z-index: 5;
}
/* UI simplification and stronger light-theme readability */
.search-section,
#search-input,
#search-suggest,
#category-filters,
.filter-chip,
#no-results,
#toggle-compact,
#qa-favorites,
#mini-toc,
.mini-toc {
    display: none !important;
}

body.compact-mode .topic {
    padding: 10px 12px !important;
}

body[data-theme="light"] {
    color: #102334;
}

body[data-theme="light"] header,
body[data-theme="light"] .sidebar-panel,
body[data-theme="light"] .content-panel,
body[data-theme="light"] .tool-card,
body[data-theme="light"] .section-progress,
body[data-theme="light"] .guide-changelog,
body[data-theme="light"] #guide-feedback,
body[data-theme="light"] .guide-feedback-end,
body[data-theme="light"] #guide-toc,
body[data-theme="light"] #similar-guides,
body[data-theme="light"] .search-modal-panel {
    background: #ffffff !important;
    border-color: #8ea8bf !important;
    color: #102334 !important;
}

body[data-theme="light"] .app-intro h1,
body[data-theme="light"] .tool-title,
body[data-theme="light"] #guide-toc strong,
body[data-theme="light"] #similar-guides strong,
body[data-theme="light"] .guide-feedback-end-title,
body[data-theme="light"] .badge-pill,
body[data-theme="light"] .category-title-text b,
body[data-theme="light"] #guide-meta {
    color: #102a40 !important;
}

body[data-theme="light"] #guide-breadcrumbs,
body[data-theme="light"] .app-intro p,
body[data-theme="light"] .search-modal-hint,
body[data-theme="light"] #fb-comment-status {
    color: #3b5971 !important;
}

body[data-theme="light"] .topic {
    background: #f7fbff !important;
    border-color: #90a9bf !important;
    color: #102a3f !important;
}

body[data-theme="light"] .topic span,
body[data-theme="light"] .mini-list a,
body[data-theme="light"] .lang-option,
body[data-theme="light"] .current-lang,
body[data-theme="light"] .pages-menu a,
body[data-theme="light"] #guide-toc a,
body[data-theme="light"] #similar-guides a {
    color: #12324b !important;
}

body[data-theme="light"] .action-btn,
body[data-theme="light"] .feedback-btn,
body[data-theme="light"] .guide-nav-btn,
body[data-theme="light"] .tool-btn,
body[data-theme="light"] .search-modal-item,
body[data-theme="light"] #search-modal-input,
body[data-theme="light"] #fb-comment,
body[data-theme="light"] .current-lang,
body[data-theme="light"] .lang-options {
    background: #edf5fc !important;
    border-color: #8ea8bf !important;
    color: #12324b !important;
}

body[data-theme="light"] .action-btn:hover,
body[data-theme="light"] .feedback-btn:hover,
body[data-theme="light"] .guide-nav-btn:hover,
body[data-theme="light"] .tool-btn:hover,
body[data-theme="light"] .search-modal-item:hover,
body[data-theme="light"] .search-modal-item.active,
body[data-theme="light"] .page-link-improved:hover .topic {
    background: #dcebf8 !important;
    border-color: #7d9ab4 !important;
    color: #102a40 !important;
}

body[data-theme="light"] .improved-page.current-active .topic {
    background: linear-gradient(130deg, #2f6f9f 0%, #285b82 100%) !important;
    border-color: #2f6f9f !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 2px rgba(47, 111, 159, 0.22) !important;
}

body[data-theme="light"] .improved-page.current-active .topic span,
body[data-theme="light"] .improved-page.current-active .fav-toggle {
    color: #ffffff !important;
}

body[data-theme="light"] .opisanie,
body[data-theme="light"] .opisanie p,
body[data-theme="light"] .opisanie li,
body[data-theme="light"] .opisanie td,
body[data-theme="light"] .opisanie th,
body[data-theme="light"] .opisanie h1,
body[data-theme="light"] .opisanie h2,
body[data-theme="light"] .opisanie h3 {
    color: #102a3f !important;
}

body[data-theme="light"] .opisanie a {
    color: #005f98 !important;
}

body[data-theme="light"] .opisanie pre,
body[data-theme="light"] .opisanie code,
body[data-theme="light"] .opisanie table {
    background: #f0f6fc !important;
    border-color: #97b0c6 !important;
    color: #102a3f !important;
}

/* =====================================================================
   Creative Dark Refresh (dark-only)
   ===================================================================== */

:root {
    --neo-bg-0: #05090f;
    --neo-bg-1: #0a131d;
    --neo-bg-2: #0f1b29;
    --neo-card: #121f2e;
    --neo-card-2: #17283a;
    --neo-line: #2d4761;
    --neo-line-soft: #234057;
    --neo-text: #eaf3ff;
    --neo-text-soft: #9db5cc;
    --neo-accent: #4ec9ff;
    --neo-accent-2: #26e2ba;
    --neo-warning: #ffcc66;
}

body {
    background:
        radial-gradient(1200px 680px at -8% -18%, rgba(53, 99, 150, 0.42) 0%, rgba(53, 99, 150, 0) 60%),
        radial-gradient(860px 580px at 106% -10%, rgba(31, 133, 182, 0.34) 0%, rgba(31, 133, 182, 0) 62%),
        linear-gradient(164deg, var(--neo-bg-0) 0%, #07111c 42%, var(--neo-bg-1) 100%) !important;
    color: var(--neo-text);
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 34px 34px;
    opacity: .12;
    z-index: -1;
}

#content {
    border: 1px solid #35506a !important;
    border-radius: 26px !important;
    background: linear-gradient(180deg, rgba(10, 21, 32, .95) 0%, rgba(8, 17, 27, .97) 100%) !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .48), inset 0 1px 0 rgba(255, 255, 255, .04) !important;
}

#content::before {
    background: radial-gradient(circle at center, rgba(94, 201, 255, .18) 0%, rgba(94, 201, 255, 0) 68%) !important;
}

header {
    position: sticky !important;
    top: 0;
    z-index: 80;
    padding: 16px 18px !important;
    border-bottom: 1px solid rgba(76, 120, 154, .55) !important;
    background: linear-gradient(180deg, rgba(13, 26, 39, .94) 0%, rgba(13, 26, 39, .78) 100%) !important;
    backdrop-filter: blur(8px);
}

.header-shell {
    gap: 16px !important;
}

.app-intro h1 {
    font-size: clamp(24px, 2.2vw, 33px) !important;
    letter-spacing: .4px !important;
    color: #f4f9ff !important;
    text-shadow: 0 0 24px rgba(76, 201, 255, .28);
}

.app-intro p {
    color: var(--neo-text-soft) !important;
    font-size: 13px !important;
}

.stat-pill {
    border: 1px solid var(--neo-line) !important;
    background: linear-gradient(180deg, #1a3044 0%, #16293b 100%) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.stat-pill span {
    color: #9ab8d2 !important;
}

.stat-pill strong {
    color: #f2f8ff !important;
}

.drop-list-btn {
    border: 1px solid rgba(113, 229, 205, .45) !important;
    background: linear-gradient(130deg, #2079a7 0%, #1f9b8a 100%) !important;
    box-shadow: 0 10px 28px rgba(24, 152, 167, .3) !important;
    letter-spacing: .55px !important;
}

.header-actions {
    gap: 8px !important;
    padding: 4px;
    border-radius: 12px;
    border: 1px solid rgba(67, 103, 133, .5);
    background: rgba(13, 28, 42, .56);
}

.action-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    border: 1px solid #3e617f !important;
    border-radius: 9px !important;
    background: linear-gradient(180deg, #1e364c 0%, #1b3045 100%) !important;
    color: #e9f4ff !important;
    font-weight: 700;
    font-size: 12px !important;
    padding: 8px 12px !important;
    min-height: 36px;
}

.action-btn i {
    font-size: 13px;
    opacity: .95;
}

#qa-search {
    border-color: #4cc8ff !important;
    background: linear-gradient(130deg, #245a84 0%, #2080a8 100%) !important;
}

.action-btn:hover {
    transform: translateY(-1px) !important;
    border-color: #66b4e5 !important;
    background: linear-gradient(180deg, #27445f 0%, #213b54 100%) !important;
}

.content-area {
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr) !important;
    gap: 16px !important;
    padding: 14px 16px 16px !important;
}

.sidebar-panel {
    top: 78px !important;
    max-height: calc(100vh - 96px) !important;
    border: 1px solid #33526d !important;
    border-radius: 16px !important;
    background: linear-gradient(180deg, rgba(17, 31, 45, .95) 0%, rgba(14, 26, 39, .96) 100%) !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .36) !important;
}

.tool-grid {
    gap: 9px !important;
}

.tool-card {
    border: 1px solid #375673 !important;
    background: linear-gradient(180deg, #1b3247 0%, #182d40 100%) !important;
    border-radius: 12px !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.tool-title {
    color: #ecf6ff !important;
    font-size: 11px !important;
    letter-spacing: .8px !important;
}

.tool-btn {
    border-color: #4a6d8c !important;
    background: #223c53 !important;
    color: #e9f4ff !important;
    font-weight: 600;
}

.tool-btn:hover {
    border-color: #6f9ec6 !important;
    background: #294a67 !important;
}

.pages-menu {
    gap: 8px !important;
}

.category {
    border: 1px solid #375673 !important;
    border-radius: 12px !important;
    background: linear-gradient(180deg, #172d41 0%, #13283a 100%) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.category-title {
    padding: 10px 11px !important;
}

.category-title-text b {
    font-size: 12px !important;
    color: #eff8ff !important;
}

.topic {
    border: 1px solid #436784 !important;
    border-radius: 10px !important;
    background: linear-gradient(180deg, #203a52 0%, #1b3247 100%) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
    padding: 9px 11px !important;
}

.page-link-improved:hover .topic {
    border-color: #6ba2cf !important;
    background: linear-gradient(180deg, #294764 0%, #234157 100%) !important;
    transform: translateY(-1px);
}

.improved-page.current-active .topic {
    border-color: #56cbff !important;
    background: linear-gradient(130deg, #2a678f 0%, #23567a 100%) !important;
    box-shadow: 0 0 0 2px rgba(86, 203, 255, .2) !important;
}

.fav-toggle {
    color: #c4d8ec !important;
}

.fav-toggle:hover,
.fav-toggle.active {
    color: #ffd166 !important;
}

.content-panel {
    border: 1px solid #33526d !important;
    border-radius: 16px !important;
    background: linear-gradient(180deg, rgba(17, 32, 46, .97) 0%, rgba(14, 27, 39, .98) 100%) !important;
    padding: 16px !important;
}

#guide-breadcrumbs {
    color: #9cb8cf !important;
}

#guide-meta {
    color: #82d7ff !important;
    font-weight: 600;
}

.guide-nav-btn {
    border-color: #4a7091 !important;
    background: #213a51 !important;
    color: #edf6ff !important;
    font-weight: 700;
}

.guide-nav-btn:hover {
    background: #2a4a66 !important;
}

.badge-pill {
    border-color: #476b8c !important;
    background: #203a52 !important;
}

.section-progress,
.guide-changelog,
#guide-feedback,
.guide-feedback-end,
#guide-toc,
#similar-guides {
    border-color: #3d5f7d !important;
    background: linear-gradient(180deg, #1b3349 0%, #182d40 100%) !important;
}

#section-progress-label {
    color: #d6e9fb !important;
    font-weight: 700;
}

.section-progress-track {
    background: #102130 !important;
}

#guide-feedback,
.guide-feedback-end-title {
    color: #e4f1ff !important;
}

.feedback-btn {
    border-color: #4d7090 !important;
    background: #233d54 !important;
    color: #eef7ff !important;
    font-weight: 700;
}

.feedback-btn:hover {
    background: #2b4b68 !important;
}

#guide-toc ul,
#similar-guides ul {
    padding-left: 18px !important;
}

#guide-toc li,
#similar-guides li {
    margin: 2px 0;
}

#guide-toc a,
#similar-guides a {
    color: #d9ebfb !important;
}

#guide-toc a.active {
    color: #74d6ff !important;
    font-weight: 700;
}

#guide-toc a:hover,
#similar-guides a:hover {
    color: #ffffff !important;
}

.opisanie {
    color: #ebf4ff !important;
    font-size: 15px !important;
    line-height: 1.74 !important;
}

.opisanie h1,
.opisanie h2,
.opisanie h3 {
    color: #ffffff !important;
    line-height: 1.28;
}

.opisanie a {
    color: #79d6ff !important;
    text-decoration-thickness: 1px;
}

.opisanie pre,
.opisanie code,
.opisanie table {
    border: 1px solid #3a5975 !important;
    background: #14283a !important;
    color: #e8f3ff;
}

.search-modal-backdrop {
    background: rgba(2, 8, 15, .84) !important;
}

.search-modal-panel {
    border-color: #446586 !important;
    background: linear-gradient(180deg, #152a3f 0%, #12263a 100%) !important;
    box-shadow: 0 24px 54px rgba(0, 0, 0, .5) !important;
}

.search-modal-item {
    border-color: #4a6d8d !important;
    background: #1f384f !important;
}

.search-modal-item:hover,
.search-modal-item.active {
    background: #2b4d6b !important;
    border-color: #73c5ef !important;
}

#theme-toggle {
    display: none !important;
}

@keyframes softRise {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header,
.sidebar-panel,
.content-panel,
.tool-card,
.category {
    animation: softRise .34s ease-out;
}

@media (max-width: 1240px) {
    .header-right {
        width: 100%;
        justify-content: flex-start !important;
    }

    .content-area {
        grid-template-columns: minmax(280px, 330px) minmax(0, 1fr) !important;
    }
}

@media (max-width: 1080px) {
    header {
        position: relative !important;
        top: auto;
    }

    .content-area {
        grid-template-columns: 1fr !important;
    }

    .sidebar-panel {
        top: 0 !important;
        max-height: none !important;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start !important;
    }
}

@media (max-width: 760px) {
    #content {
        border-radius: 14px !important;
    }

    .content-panel,
    .sidebar-panel {
        border-radius: 12px !important;
    }

    .header-actions .action-btn {
        flex: 1 1 calc(50% - 8px);
        justify-content: center;
    }

    .guide-toolbar {
        gap: 10px;
    }

    #guide-nav {
        width: 100%;
    }

    .guide-nav-btn {
        flex: 1 1 auto;
        text-align: center;
    }
}

/* Center badges and progress in top guide row */
.guide-top-row {
    grid-template-columns: 1fr !important;
    justify-items: center;
    gap: 12px !important;
}

.guide-badges {
    width: 100%;
    justify-content: center !important;
    align-items: center;
}

#section-progress {
    width: min(560px, 100%);
}

/* Hide removed read-percent widget */
#section-progress,
.section-progress {
    display: none !important;
}
