:root {
    --border-color: #d8dce2;
    --mobile-header-height: 60px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    background: #ffffff;
    color-scheme: light;
    font-family: Arial, sans-serif;
}

body {
    display: flex;
    overflow: hidden;
}

.sidebar {
    display: flex;
    flex: 0 0 320px;
    height: 100vh;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    background: #ffffff;
}

.sidebar-header {
    padding: 24px 20px 18px;
    border-bottom: 1px solid #e2e5e9;
}

.logo {
    display: block;
    max-width: 220px;
    max-height: 80px;
    margin: 0 auto 18px;
}

.logo-link {
    display: block;
    text-decoration: none;
}

.title {
    margin: 0 0 18px;
    text-align: center;
    font-size: 22px;
}

.search {
    width: 100%;
    padding: 11px;
    border: 1px solid #bfc5cc;
    border-radius: 6px;
    font: inherit;
}

.navigation {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.article-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.article-link {
    display: block;
    margin-bottom: 3px;
    padding: 11px 12px;
    border-radius: 5px;
    color: #26384d;
    text-decoration: none;
}

.article-link:hover {
    background: #edf3fa;
}

.article-link.active {
    background: #dceaf8;
    color: #064f9e;
    font-weight: bold;
}

.content {
    flex: 1;
    min-width: 0;
    height: 100vh;
    padding: 0;
    background: #ffffff;
}

.article-frame {
    width: 100%;
    height: 100%;
    border: 0;
    background: #ffffff;
}

.no-results {
    padding: 20px 10px;
    text-align: center;
    color: #666666;
}

.mobile-header,
.menu-close,
.menu-overlay {
    display: none;
}

.welcome {
    display: block;
    overflow: auto;
    margin: 0;
    padding: 50px;
    color: #444444;
}

@media (max-width: 700px) {
    body {
        display: block;
        height: 100vh;
        height: 100lvh;
    }

    .mobile-header {
        position: fixed;
        z-index: 40;
        top: 0;
        right: 0;
        left: 0;
        display: flex;
        align-items: center;
        gap: 10px;
        height: calc(var(--mobile-header-height) + var(--safe-top));
        padding: var(--safe-top) 12px 0;
        border-bottom: 1px solid var(--border-color);
        background: #ffffff;
    }

    .mobile-logo {
        width: auto;
        max-width: 90px;
        height: 36px;
        object-fit: contain;
    }

    .mobile-title {
        position: absolute;
        left: 50%;
        width: min(46vw, 220px);
        overflow: hidden;
        margin: 0;
        color: #26384d;
        font-size: 16px;
        text-align: center;
        white-space: nowrap;
        text-overflow: ellipsis;
        transform: translateX(-50%);
    }

    .menu-button,
    .menu-close {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 44px;
        border: 1px solid #c9ced5;
        border-radius: 8px;
        background: #ffffff;
        color: #26384d;
        font: bold 15px Arial, sans-serif;
        cursor: pointer;
    }

    .menu-button {
        margin-left: auto;
        flex: none;
        padding: 0 14px;
    }

    .sidebar {
        position: fixed;
        z-index: 30;
        top: calc(var(--mobile-header-height) + var(--safe-top));
        bottom: var(--safe-bottom);
        left: 0;
        width: min(85vw, 320px);
        height: auto;
        border-right: 1px solid var(--border-color);
        box-shadow: 4px 0 18px rgb(0 0 0 / 18%);
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-header {
        position: relative;
        padding: 18px 16px 14px;
    }

    .logo {
        max-width: 180px;
        max-height: 60px;
        margin-bottom: 12px;
    }

    .title {
        margin-bottom: 12px;
        font-size: 18px;
    }

    .menu-close {
        position: absolute;
        top: 10px;
        right: 10px;
        width: 44px;
        padding: 0;
        border: 0;
        font-size: 25px;
    }

    .search {
        padding: 9px;
    }

    .navigation {
        min-height: 0;
        padding: 6px 10px;
    }

    .article-link {
        padding: 9px 10px;
    }

    .menu-overlay {
        position: fixed;
        z-index: 25;
        top: calc(var(--mobile-header-height) + var(--safe-top));
        right: 0;
        bottom: var(--safe-bottom);
        left: 0;
        width: 100%;
        padding: 0;
        border: 0;
        background: transparent;
        -webkit-tap-highlight-color: transparent;
    }

    .menu-overlay.open {
        display: block;
    }

    .content {
        width: 100%;
        height: 100vh;
        height: 100lvh;
        padding: calc(var(--mobile-header-height) + var(--safe-top)) 0 0;
    }

    .welcome {
        padding: 24px;
    }
}

.article-category {
    margin-top: 8px;
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
}

.category-title {
    padding: 11px 12px;
    border-radius: 5px;
    color: #26384d;
    font-weight: bold;
    cursor: pointer;
}

.category-title:hover {
    background: #edf3fa;
}

.category-title:focus-visible {
    outline: 2px solid #064f9e;
    outline-offset: -2px;
}

.category-articles {
    padding-left: 16px;
}
