/* =================================================================
   Andex Hub — global stylesheet
   Self-hosted Inter + JetBrains Mono with system-font fallback.
   ================================================================= */

@font-face {
    font-family: 'Inter';
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    src: url('/fonts/Inter-Regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-weight: 500;
    font-style: normal;
    font-display: swap;
    src: url('/fonts/Inter-Medium.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-weight: 600;
    font-style: normal;
    font-display: swap;
    src: url('/fonts/Inter-SemiBold.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    src: url('/fonts/Inter-Bold.woff2') format('woff2');
}
@font-face {
    font-family: 'JetBrains Mono';
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    src: url('/fonts/JetBrainsMono-Regular.woff2') format('woff2');
}

html, body {
    margin: 0;
    padding: 0;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

code, pre, kbd, samp {
    font-family: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;
}

/* Custom focus ring (WCAG AA, overrides browser default) */
*:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Selection color */
::selection {
    background-color: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
}

/* Scrollbars (subtle, themed) */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--mud-palette-lines-default) transparent;
}
*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
*::-webkit-scrollbar-track {
    background: transparent;
}
*::-webkit-scrollbar-thumb {
    background-color: var(--mud-palette-lines-default);
    border-radius: 4px;
}
*::-webkit-scrollbar-thumb:hover {
    background-color: var(--mud-palette-text-disabled);
}

/* =================================================================
   Layout: 3-column structure (rail + secondary + main + optional right)
   ================================================================= */
.andex-app {
    display: grid;
    grid-template-columns: 72px auto 1fr;
    grid-template-rows: 56px 1fr;
    grid-template-areas:
        "rail topbar topbar"
        "rail secondary main";
    height: 100vh;
    /* Mobile browsers (Chrome Android, Safari) shrink the visible viewport while their
       toolbars are shown; dvh tracks that so the bottom nav is never pushed off-screen. */
    height: 100dvh;
    width: 100vw;
    overflow: hidden;
    background: var(--mud-palette-background);
    color: var(--mud-palette-text-primary);
}

.andex-app--has-right {
    grid-template-columns: 72px auto 1fr 280px;
    grid-template-areas:
        "rail topbar topbar topbar"
        "rail secondary main right";
}

.andex-app--no-secondary {
    grid-template-columns: 72px 1fr;
    grid-template-areas:
        "rail topbar"
        "rail main";
}
.andex-app--no-secondary.andex-app--has-right {
    grid-template-columns: 72px 1fr 280px;
    grid-template-areas:
        "rail topbar topbar"
        "rail main right";
}

/* Desktop: the module pane is collapsed by the TopBar toggle. The grid column stays in
   the template (so the areas map unchanged) but takes no width. */
.andex-app--pane-collapsed { grid-template-columns: 72px 0 1fr; }
.andex-app--pane-collapsed.andex-app--has-right { grid-template-columns: 72px 0 1fr 280px; }
.andex-app--pane-collapsed .andex-secondary { display: none; }

/* Admin impersonation: a fixed warning bar sits above everything; the app grid is shifted
   down by its height so the bar never covers the topbar. The bar itself is position:fixed,
   so it does not occupy a grid cell. */
.andex-app--impersonating {
    height: calc(100vh - 36px);
    margin-top: 36px;
}

.andex-impersonation-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 36px;
    z-index: 2100;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0 0.9rem;
    background: var(--mud-palette-warning, #f0a020);
    color: #1a1200;
    font-size: 0.85rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.andex-impersonation-banner__text {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.andex-impersonation-banner__by {
    opacity: 0.8;
    margin-left: 0.35rem;
}

.andex-impersonation-banner__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(0, 0, 0, 0.18);
    color: inherit;
    border: 1px solid rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    padding: 3px 10px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.andex-impersonation-banner__btn:hover {
    background: rgba(0, 0, 0, 0.3);
}

.andex-rail {
    grid-area: rail;
    background: var(--mud-palette-drawer-background);
    color: var(--mud-palette-drawer-text);
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.andex-topbar {
    grid-area: topbar;
    background: var(--mud-palette-appbar-background);
    color: var(--mud-palette-appbar-text);
    border-bottom: 1px solid var(--mud-palette-divider);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 1rem;
    z-index: 10;
}

.andex-topbar-hamburger { display: none; }
.andex-topbar-search-icon { display: none; }
@media (max-width: 768px) {
    .andex-topbar { padding: 0 .25rem; gap: .25rem; }
    .andex-topbar-hamburger { display: inline-flex !important; }
    .andex-topbar-search { display: none !important; }
    .andex-topbar-search-icon { display: inline-flex !important; }
    .andex-topbar-desktop-only { display: none !important; }
    .andex-topbar-brand-name { display: none; }
    .andex-topbar-brand { min-width: 0; }
    .andex-topbar-actions { margin-left: auto; }
    .andex-topbar-breadcrumb {
        max-width: 40vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: .85rem;
    }
}

.andex-secondary {
    grid-area: secondary;
    background: var(--mud-palette-surface);
    border-right: 1px solid var(--mud-palette-divider);
    overflow-y: auto;
    /* Width is user-resizable: the drag handle sets --andex-secondary-w on <html>
       (persisted in localStorage). Mobile drawer rules below override this. */
    width: var(--andex-secondary-w, 320px);
    position: relative;
}

/* Drag handle on the right edge of the secondary pane (desktop only). */
.andex-secondary-resizer {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 6px;
    cursor: col-resize;
    z-index: 5;
    transition: background-color .15s;
}
.andex-secondary-resizer:hover,
.andex-secondary-resizer.dragging { background: rgba(23, 93, 220, 0.18); }
@media (max-width: 768px) {
    .andex-secondary-resizer { display: none; }
}

.andex-main {
    grid-area: main;
    overflow-y: auto;
    padding: 1.5rem;
    background: var(--mud-palette-background);
}

/* Subtle per-module page tint — kicks in only when --module-accent is set
   on the .andex-app container by MainLayout. Mixes 4% of the accent into
   the page background, so it works for both light and dark themes. */
.andex-app[data-module] .andex-main {
    background: color-mix(in srgb, var(--module-accent, transparent) 4%, var(--mud-palette-background));
}

.andex-right {
    grid-area: right;
    background: var(--mud-palette-surface);
    border-left: 1px solid var(--mud-palette-divider);
    overflow-y: auto;
}

/* =================================================================
   Icon Rail
   ================================================================= */
.andex-rail-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 56px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
}

.andex-rail-items {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 8px 0;
    gap: 2px;
    overflow-y: auto;
}

.andex-rail-footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 8px 0;
    gap: 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.andex-rail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    margin: 0 8px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--mud-palette-drawer-icon);
    text-decoration: none;
    position: relative;
    transition: background-color 120ms ease;
}
.andex-rail-item:hover {
    background-color: color-mix(in srgb, var(--module-accent, #FFFFFF) 8%, transparent);
    color: var(--mud-palette-drawer-text);
}
.andex-rail-item--active {
    background-color: color-mix(in srgb, var(--module-accent, #175DDC) 16%, transparent);
    color: #FFFFFF;
}
.andex-rail-item--active::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 12px;
    bottom: 12px;
    width: 3px;
    background-color: var(--module-accent, var(--mud-palette-primary));
    border-radius: 0 2px 2px 0;
}
.andex-rail-item-icon {
    font-size: 22px;
    line-height: 1;
}
.andex-rail-item-label {
    font-size: 0.625rem;
    font-weight: 500;
    margin-top: 4px;
    letter-spacing: 0.02em;
}
.andex-rail-badge {
    position: absolute;
    top: 4px;
    right: 8px;
    background-color: var(--mud-palette-error);
    color: #FFFFFF;
    font-size: 0.625rem;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =================================================================
   Top bar
   ================================================================= */
.andex-topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}
.andex-topbar-breadcrumb {
    color: var(--mud-palette-text-secondary);
    font-size: 0.875rem;
}
.andex-topbar-search {
    flex: 1;
    max-width: 600px;
    margin: 0 auto;
}
.andex-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* =================================================================
   Login page (centered card on full-bleed background)
   ================================================================= */
.andex-login-shell {
    min-height: 100vh;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--mud-palette-background);
    padding: 1rem;
    box-sizing: border-box;
}
.andex-login-card {
    width: 100%;
    max-width: 400px;
    padding: 2rem !important;
    border-radius: 12px !important;
    background: var(--mud-palette-surface, #fff);
    box-shadow: 0 2px 8px rgba(0,0,0,.12), 0 0 0 1px rgba(0,0,0,.06);
}
.andex-login-brand {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.75rem;
    margin-bottom: 2rem;
}
.andex-login-brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--mud-palette-text-primary);
}
.andex-login-subtitle {
    text-align: center;
    color: var(--mud-palette-text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.andex-login-form {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem;
}
.andex-form-field {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.375rem;
    width: 100%;
}
.andex-form-label {
    display: block !important;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--mud-palette-text-primary, rgba(0,0,0,.87));
}
.andex-form-input {
    /* !important on all layout/appearance props — Syncfusion material.css and
       MudBlazor.min.css both aggressively reset native input/label styles. */
    display: block !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 100% !important;
    min-height: 42px;
    padding: 0.625rem 0.75rem !important;
    border: 1px solid var(--mud-palette-lines-inputs, #bdbdbd) !important;
    border-radius: 4px !important;
    background: var(--mud-palette-surface, #fff) !important;
    color: var(--mud-palette-text-primary, rgba(0,0,0,.87)) !important;
    font-family: inherit !important;
    font-size: 0.875rem !important;
    line-height: 1.5;
    transition: border-color 120ms ease, box-shadow 120ms ease;
    box-sizing: border-box !important;
}
.andex-form-input:focus {
    outline: none !important;
    border-color: var(--mud-palette-primary, #175DDC) !important;
    box-shadow: 0 0 0 3px rgba(23, 93, 220, 0.15);
}
.andex-form-checkbox {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--mud-palette-text-primary, rgba(0,0,0,.87));
    cursor: pointer;
}
.andex-form-submit {
    display: block !important;
    width: 100% !important;
    min-height: 42px;
    padding: 0.625rem 1.5rem;
    background: var(--mud-palette-primary, #175DDC) !important;
    color: var(--mud-palette-primary-text, #fff) !important;
    border: none !important;
    border-radius: 4px !important;
    font-family: inherit !important;
    font-size: 0.9375rem !important;
    font-weight: 500;
    cursor: pointer;
    transition: background 120ms ease, opacity 120ms ease;
    margin-top: 0.5rem;
    box-sizing: border-box;
}
.andex-form-submit:hover {
    opacity: 0.88;
}
.andex-form-submit:active {
    opacity: 0.76;
}

/* Prijava preko NUKLEUS-a (SSO) — glavni put; DocMan lozinka ostaje ispod (nalog za nuždu). */
a.andex-sso-btn {
    text-align: center;
    text-decoration: none;
    line-height: 22px;
    box-sizing: border-box;
}
.andex-sso-hint {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--mud-palette-text-secondary, #666);
    text-align: center;
    line-height: 1.4;
}
.andex-sso-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0 0.25rem;
    font-size: 0.8125rem;
    color: var(--mud-palette-text-secondary, #666);
}
.andex-sso-divider::before,
.andex-sso-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--mud-palette-lines-default, #ddd);
}
.andex-sso-explain {
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0 0 1rem;
}

/* =================================================================
   Mobile (responsive switch <= 768px)
   ================================================================= */
@media (max-width: 768px) {
    .andex-app,
    .andex-app--has-right,
    .andex-app--no-secondary,
    .andex-app--no-secondary.andex-app--has-right {
        grid-template-columns: 1fr;
        grid-template-rows: 56px 1fr 64px;
        grid-template-areas:
            "topbar"
            "main"
            "bottomnav";
    }
    .andex-rail,
    .andex-right {
        display: none;
    }

    /* Primary app-navigation drawer (TopBar hamburger). Carries only the IconRail. */
    .andex-navdrawer {
        position: fixed;
        top: 56px;
        bottom: 64px;
        left: 0;
        width: min(82vw, 320px);
        z-index: 900;
        background: var(--mud-palette-surface);
        color: var(--mud-palette-text-primary);
        border-right: 1px solid var(--mud-palette-divider);
        box-shadow: 4px 0 16px rgba(0, 0, 0, 0.18);
        transform: translateX(-105%);
        transition: transform 0.18s ease-out;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        overscroll-behavior: contain;
    }
    .andex-navdrawer--open { transform: translateX(0); }
    .andex-navdrawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 44px;
        padding: 0 4px 0 16px;
        border-bottom: 1px solid var(--mud-palette-divider);
    }
    .andex-navdrawer-title { font-weight: 600; }

    /* Module pane (folders / conversations / tree): slides in from the left edge of the
       content area, directly beside the module content. Lower z-index than the nav
       drawer so the two overlays never stack; LayoutState also keeps them exclusive. */
    .andex-secondary {
        position: fixed;
        top: 56px;
        bottom: 64px;
        left: 0;
        width: min(86vw, 340px);
        z-index: 700;
        box-shadow: 4px 0 16px rgba(0, 0, 0, 0.18);
        transform: translateX(-105%);
        transition: transform 0.18s ease-out;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        overscroll-behavior: contain;
    }
    .andex-secondary--open { transform: translateX(0); }
    .andex-secondary-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 44px;
        padding: 0 4px 0 16px;
        border-bottom: 1px solid var(--mud-palette-divider);
        flex-shrink: 0;
    }
    .andex-secondary-title { font-weight: 600; }
    .andex-secondary-body { flex: 1; min-height: 0; overflow-y: auto; }
    /* Static widgets inside the pane (e.g. the calendar's date picker) must not exceed its width. */
    .andex-secondary-body .mud-picker,
    .andex-secondary-body .mud-picker-static { max-width: 100%; }

    /* Backdrop scrims that catch taps to close an overlay. */
    .andex-drawer-scrim {
        position: fixed;
        top: 56px;
        bottom: 64px;
        left: 0;
        right: 0;
        background: rgba(0, 0, 0, 0.4);
    }
    .andex-drawer-scrim--nav { z-index: 800; }
    .andex-drawer-scrim--pane { z-index: 650; }

    /* Main content gets vertical padding back since splitters are stacked. */
    .andex-main { padding: 1rem; }

    /* Touch targets: ensure tappable controls are at least 40px. */
    .andex-main .mud-button-root { min-height: 40px; }
}

/* Overlay chrome is meaningless on desktop. */
@media (min-width: 769px) {
    .andex-navdrawer,
    .andex-secondary-head,
    .andex-drawer-scrim { display: none; }
}

/* IconRail re-skinned when embedded in the mobile nav drawer: full-width rows
   with icon + label side-by-side instead of the slim vertical icon strip. */
@media (max-width: 768px) {
    .andex-navdrawer .andex-rail {
        position: static;
        background: transparent;
        color: inherit;
        border-right: none;
        height: auto;
        display: block;
    }
    .andex-navdrawer .andex-rail-logo { display: none; }
    .andex-navdrawer .andex-rail-items {
        display: flex;
        flex-direction: column;
        padding: 4px 0;
    }
    .andex-navdrawer .andex-rail-item {
        flex-direction: row;
        justify-content: flex-start;
        gap: 14px;
        padding: 12px 16px;
        margin: 0;
        border-radius: 0;
        color: inherit;
    }
    .andex-navdrawer .andex-rail-item:hover { background: rgba(0,0,0,0.04); }
    .andex-navdrawer .andex-rail-item--active {
        background: rgba(23, 93, 220, 0.10);
        color: var(--mud-palette-primary);
    }
    .andex-navdrawer .andex-rail-item--active::before { display: none; }
    .andex-navdrawer .andex-rail-item-label {
        font-size: 0.95rem;
        font-weight: 500;
        margin-top: 0;
        letter-spacing: 0;
    }
    .andex-navdrawer .andex-rail-badge {
        position: static;
        margin-left: auto;
    }
    .andex-navdrawer .andex-rail-footer {
        display: flex;
        flex-direction: column;
        border-top: 1px solid var(--mud-palette-divider);
        padding: 4px 0;
        margin-top: 8px;
    }
}

/* Generic helper class — apply to any element that should disappear on mobile. */
@media (max-width: 768px) {
    .andex-mobile-hide { display: none !important; }
}

/* Mobile typography scale-down. MudBlazor uses rem units so reducing the root
   shrinks all body text consistently. Inputs stay at 16px so iOS Safari does
   NOT zoom in when a field is focused. */
@media (max-width: 768px) {
    html { font-size: 14px; }
    input, textarea, select,
    .mud-input-slot input,
    .mud-input-slot textarea { font-size: 16px !important; }
    .andex-main { padding: .75rem; }
}

/* Mobile: dialogs go full-screen so users can use the whole viewport. */
@media (max-width: 768px) {
    .mud-dialog-container.mud-dialog-center {
        align-items: stretch;
        justify-content: stretch;
    }
    .mud-dialog {
        max-width: 100vw !important;
        max-height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        display: flex !important;
        flex-direction: column;
    }
    .mud-dialog-content {
        flex: 1;
        overflow-y: auto;
        max-height: none !important;
    }
    .mud-dialog-actions { padding: .5rem .75rem; flex-wrap: wrap; }
}

.andex-bottomnav {
    grid-area: bottomnav;
    display: none;
    background: var(--mud-palette-surface);
    border-top: 1px solid var(--mud-palette-divider);
    z-index: 850;
}
@media (max-width: 768px) {
    .andex-bottomnav {
        display: flex;
        justify-content: space-around;
        align-items: stretch;
    }
}

.andex-bottomnav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: none;
    background: transparent;
    color: inherit;
    padding: 6px 4px;
    cursor: pointer;
    font: inherit;
    -webkit-tap-highlight-color: transparent;
}
.andex-bottomnav-btn.is-active { color: var(--mud-palette-primary); }
.andex-bottomnav-btn:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: -2px; }
.andex-bottomnav-icon-wrap { position: relative; line-height: 1; }
.andex-bottomnav-label { font-size: 0.7rem; line-height: 1; }
.andex-bottomnav-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--mud-palette-error);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* =================================================================
   Blazor error UI (server-rendered fallback)
   ================================================================= */
#blazor-error-ui {
    background: var(--mud-palette-error);
    color: white;
    bottom: 0;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.75rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-weight: 500;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* =================================================================
   Wide-physical devices (e.g., Samsung Galaxy Fold).
   These devices have a CSS viewport <768px in portrait but a physical
   width >=1800px (added by viewport.js as html.andex-wide-device).
   The mobile @media rules above would drawerize the sidebar — override
   back to the desktop 3-column grid so the secondary pane stays pinned.
   ================================================================= */
html.andex-wide-device .andex-app {
    grid-template-columns: 72px auto 1fr;
    grid-template-rows: 56px 1fr;
    grid-template-areas:
        "rail topbar topbar"
        "rail secondary main";
}
html.andex-wide-device .andex-app--has-right {
    grid-template-columns: 72px auto 1fr 280px;
    grid-template-areas:
        "rail topbar topbar topbar"
        "rail secondary main right";
}
html.andex-wide-device .andex-app--no-secondary {
    grid-template-columns: 72px 1fr;
    grid-template-areas:
        "rail topbar"
        "rail main";
}
html.andex-wide-device .andex-app--no-secondary.andex-app--has-right {
    grid-template-columns: 72px 1fr 280px;
    grid-template-areas:
        "rail topbar topbar"
        "rail main right";
}
html.andex-wide-device .andex-app--pane-collapsed { grid-template-columns: 72px 0 1fr; }
html.andex-wide-device .andex-app--pane-collapsed.andex-app--has-right { grid-template-columns: 72px 0 1fr 280px; }
html.andex-wide-device .andex-rail,
html.andex-wide-device .andex-right { display: flex; }
html.andex-wide-device .andex-secondary {
    position: static;
    transform: none;
    box-shadow: none;
    width: var(--andex-secondary-w, 320px);
    top: auto;
    bottom: auto;
    left: auto;
    z-index: auto;
    display: block;
    overflow: hidden auto;
}
html.andex-wide-device .andex-navdrawer,
html.andex-wide-device .andex-secondary-head,
html.andex-wide-device .andex-drawer-scrim,
html.andex-wide-device .andex-bottomnav { display: none; }
/* Mobile @media shrinks root font to 14px and padding; restore for wide devices. */
html.andex-wide-device { font-size: 16px; }
html.andex-wide-device .andex-main { padding: 1.5rem; }
