:root {
    --shell-header-height: 64px;
    --shell-sidebar-width: 230px;
    --shell-header-bg: #172033;
    --shell-sidebar-bg: #111827;
    --shell-content-bg: #F3F7FB;
    --shell-text: #f4f7fb;
    --shell-body-text: #1f2937;
    --shell-muted: #9ca8ba;
    --shell-border: rgba(255,255,255,.10);
    --shell-content-border: #d8dee8;
    --shell-accent: #58a6ff;
}

html, body { min-height: 100%; }
body { margin: 0; }

#site-header, #site-header *,
#site-sidebar, #site-sidebar *,
#site-sidebar-backdrop { box-sizing: border-box; }

body.site-shell-enabled {
    box-sizing: border-box;
    min-height: 100vh;
    padding-top: var(--shell-header-height) !important;
    padding-left: var(--shell-sidebar-width) !important;
}

.site-page {
    box-sizing: border-box;
    width: min(1180px, calc(100% - 48px));
    min-height: calc(100vh - var(--shell-header-height) - 48px);
    margin: 24px auto;
    padding: 32px;
    color: var(--shell-body-text);
    background: var(--shell-content-bg);
    border: 1px solid var(--shell-content-border);
    border-radius: 12px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.site-page h1:first-child,
.site-page h2:first-child,
.site-page h3:first-child { margin-top: 0; }

.site-page a { color: #1769aa; }

.content-placeholder {
    margin-top: 24px;
    padding: 32px;
    border: 3px dashed #9aa7b8;
    border-radius: 10px;
    background: #f8fafc;
    text-align: center;
}

.content-placeholder strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.15rem;
}

.content-placeholder code {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 7px;
    border-radius: 5px;
    background: #e8edf4;
}

#site-header {
    position: fixed;
    z-index: 100000;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    align-items: center;
    height: var(--shell-header-height);
    padding: 0 22px;
    color: var(--shell-text);
    background: var(--shell-header-bg);
    border-bottom: 1px solid var(--shell-border);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--shell-text) !important;
    text-decoration: none !important;
}

.site-logo {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: #07111f;
    background: var(--shell-accent);
    border-radius: 10px;
    font-size: 21px;
    font-weight: 800;
}

.site-logo-image {
    display: block;
    height: 52px;
    width: auto;
    max-width: 600px;
    object-fit: contain;
}

.main-image {
    max-width: 100%;
    height: auto;
    display: block;
}

.site-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.site-brand-text strong { color: var(--shell-text); font-size: 16px; }
.site-brand-text small { margin-top: 3px; color: var(--shell-muted); font-size: 11px; }
.site-header-spacer { flex: 1; }

.site-header-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-header-links a {
    padding: 8px 11px;
    color: var(--shell-text) !important;
    border-radius: 7px;
    text-decoration: none !important;
    font-size: 14px;
}

.site-header-links a:hover,
.site-header-links a:focus-visible { background: rgba(255,255,255,.09); }

#site-sidebar {
    position: fixed;
    z-index: 99999;
    top: var(--shell-header-height);
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    width: var(--shell-sidebar-width);
    overflow-x: hidden;
    overflow-y: auto;
    color: var(--shell-text);
    background: var(--shell-sidebar-bg);
    border-right: 1px solid var(--shell-border);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.site-sidebar-nav { flex: 1; padding: 18px 12px; }

.site-nav-heading {
    margin: 17px 12px 7px;
    color: var(--shell-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.site-nav-heading:first-child { margin-top: 2px; }

.site-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 42px;
    margin: 3px 0;
    padding: 8px 12px;
    color: #dbe3ef !important;
    border-radius: 8px;
    text-decoration: none !important;
    font-size: 14px;
}

.site-sidebar-nav a:hover,
.site-sidebar-nav a:focus-visible {
    color: #fff !important;
    background: rgba(255,255,255,.08);
}

.site-sidebar-nav a.site-nav-active {
    color: #fff !important;
    background: rgba(88,166,255,.20);
    box-shadow: inset 3px 0 var(--shell-accent);
}

.site-nav-icon {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    color: var(--shell-accent);
    font-size: 16px;
    font-weight: 700;
}

.site-sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 16px 20px 20px;
    color: var(--shell-muted);
    border-top: 1px solid var(--shell-border);
}

.site-sidebar-footer small { color: #dbe3ef; font-size: 12px; }
.site-sidebar-footer span { font-size: 11px; }

#site-sidebar-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 40px;
    height: 40px;
    margin: 0 11px 0 -7px;
    padding: 9px;
    color: inherit;
    background: transparent;
    border: 0;
    border-radius: 7px;
    cursor: pointer;
}

#site-sidebar-toggle:hover,
#site-sidebar-toggle:focus-visible { background: rgba(255,255,255,.09); }

#site-sidebar-toggle span {
    display: block;
    width: 21px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
}

#site-sidebar-backdrop { display: none; }

/* Copyparty columns hidden by request */
#files th[name="lead"],
#files tbody td:nth-child(1),
#files th[name="tags/.files"],
#files tbody td:nth-child(4),
#files th[name="ext"],
#files tbody td:nth-child(5) {
    display: none !important;
}

body.site-shell-enabled #wrap {
    box-sizing: border-box;
    max-width: 100%;
}

@media (max-width: 800px) {
    body.site-shell-enabled { padding-left: 0 !important; }
    #site-header { padding-right: 12px; padding-left: 12px; }
    #site-sidebar-toggle { display: flex; }

    #site-sidebar {
        width: min(280px, 84vw);
        transform: translateX(-105%);
        transition: transform 180ms ease;
        box-shadow: 8px 0 24px rgba(0,0,0,.30);
    }

    body.site-sidebar-open #site-sidebar { transform: translateX(0); }

    #site-sidebar-backdrop {
        position: fixed;
        z-index: 99998;
        inset: var(--shell-header-height) 0 0 0;
        background: rgba(0,0,0,.48);
    }

    body.site-sidebar-open #site-sidebar-backdrop { display: block; }
    .site-header-links a:first-child { display: none; }

    .site-page {
        width: min(100% - 24px, 1180px);
        min-height: calc(100vh - var(--shell-header-height) - 24px);
        margin: 12px auto;
        padding: 22px;
    }
}

@media (max-width: 480px) {
    .site-brand-text small, .site-header-links { display: none; }
    .site-page { padding: 18px; border-radius: 8px; }
    .content-placeholder { padding: 22px 16px; }
}

