/* source: assets/archive.css lines 554-771 */
body.page-app {
    background: var(--bg);
    color: var(--text);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

@supports (height: 100dvh) {
    body.page-auth {
        min-height: 100dvh;
    }

    body.page-app {
        height: 100dvh;
    }
}

body.page-app.standalone-app {
    min-height: 100dvh;
    height: 100dvh;
}

body.page-app.standalone-app .top-bar {
    min-height: calc(56px + env(safe-area-inset-top, 0px));
    height: calc(56px + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
}

body.page-app.standalone-app .sidebar {
    padding-top: env(safe-area-inset-top, 0px);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(3px);
    z-index: 18;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.sidebar {
    width: 280px;
    min-width: 220px;
    max-width: 40vw;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    background: var(--sidebar-glow), var(--sidebar-gradient), var(--sidebar);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 20;
    box-shadow: 2px 0 18px rgba(0, 0, 0, 0.12);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s ease;
}

.sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 24%, rgba(0, 0, 0, 0.08) 100%);
    pointer-events: none;
}

.sidebar > * {
    position: relative;
    z-index: 1;
}

.sidebar-resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 18px;
    height: 100%;
    cursor: ew-resize;
    z-index: 4;
}

.sidebar-resize-handle::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 1px;
    transform: translateY(-50%);
    width: 1px;
    height: 160px;
    background-color: var(--accent);
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, black 15%, black 85%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0%, black 15%, black 85%, transparent 100%);
    opacity: 0.68;
    transition: opacity 0.2s ease, background-color 0.2s ease;
}

.sidebar-resize-handle:hover::before,
.sidebar.sidebar-resizing .sidebar-resize-handle::before {
    opacity: 1;
}

.sidebar.sidebar-resizing {
    transition: none;
}

.header {
    padding: 22px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-title-wrap {
    flex: 1 1 auto;
    min-width: 0;
}

.header h1 {
    margin: 0;
    font-size: 1.02em;
    color: var(--accent);
    letter-spacing: 0.6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.header-home-btn {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(211, 99, 58, 0.16);
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.18), transparent 58%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(211, 99, 58, 0.08)),
        rgba(33, 24, 18, 0.56);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    box-shadow:
        0 8px 18px rgba(0, 0, 0, 0.18),
        0 2px 6px rgba(211, 99, 58, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-home-btn svg,
.header-settings-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.header-home-btn:hover,
.header-home-btn:focus-visible {
    transform: translateY(-1px) scale(1.02);
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.22), transparent 60%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(211, 99, 58, 0.12)),
        rgba(37, 27, 20, 0.64);
    border-color: rgba(211, 99, 58, 0.28);
    box-shadow:
        0 12px 24px rgba(0, 0, 0, 0.24),
        0 3px 8px rgba(211, 99, 58, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
    outline: none;
}

:root[data-theme="light"] .header-home-btn {
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.86), transparent 58%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(184, 91, 63, 0.1)),
        rgba(255, 248, 241, 0.82);
    border-color: rgba(184, 91, 63, 0.18);
    box-shadow:
        0 8px 18px rgba(121, 87, 66, 0.12),
        0 2px 6px rgba(184, 91, 63, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.theme-toggle,
.header-settings-btn {
    cursor: pointer;
    background: var(--soft-btn-bg);
    border: 1px solid var(--border);
    opacity: 1;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    flex: 0 0 28px;
    flex-shrink: 0;
    padding: 0;
    border-radius: 999px;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible,
.header-settings-btn:hover,
.header-settings-btn:focus-visible {
    background: var(--soft-btn-hover);
    border-color: rgba(211, 99, 58, 0.32);
    transform: translateY(-1px);
    outline: none;
}
@media (max-width: 768px) {
    .sidebar-resize-handle {
        display: none !important;
    }

    .header {
        gap: 10px;
        padding: 18px 14px;
    }

    .header h1 {
        font-size: 0.9rem;
        letter-spacing: 0.2px;
    }

    .header-actions {
        gap: 6px;
    }

    .theme-toggle,
    .header-settings-btn {
        width: 30px;
        height: 30px;
        min-width: 30px;
        min-height: 30px;
        flex-basis: 30px;
    }
}

