:root {
    --fx-bg: #f1f5ff;
    --fx-surface: #ffffff;
    --fx-surface-2: #f6f9ff;
    --fx-text: #0f172a;
    --fx-muted: #64748b;
    --fx-border: #d8e3f5;
    --fx-accent: #4f46e5;
    --fx-accent-2: #0891b2;
    --fx-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
    --fx-header-h: 68px;
    --fx-footer-h: 82px;
}

body.facelift-dark {
    --fx-bg: #0b1220;
    --fx-surface: #111b2f;
    --fx-surface-2: #16243d;
    --fx-text: #e5edf9;
    --fx-muted: #a8b6cc;
    --fx-border: #294061;
    --fx-accent: #7c83ff;
    --fx-accent-2: #22d3ee;
    --fx-shadow: 0 18px 34px rgba(0, 0, 0, 0.45);
}

body.app-shell {
    min-height: 100vh;
    background: radial-gradient(circle at top right, rgba(79, 70, 229, 0.12), transparent 34%), var(--fx-bg);
    color: var(--fx-text);
}

#main_menu.app-shell__content {
    max-width: 1120px;
    width: min(1120px, 100% - 20px);
    margin: 0 auto;
    padding: 10px 0 calc(var(--fx-footer-h) + 14px);
}

/* Drawer/header navigation removed: footer now carries the primary app navigation. */

.app-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid var(--fx-border);
    background: var(--fx-surface-2);
    color: var(--fx-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-icon-btn:hover,
.app-icon-btn:focus-visible,
.app-chip-btn:hover,
.app-chip-btn:focus-visible {
    filter: brightness(1.03);
}

#header {
    display: none;
}

.facelift-page {
    display: grid;
    gap: 12px;
}

.fx-card {
    border: 1px solid var(--fx-border);
    border-radius: 16px;
    background: var(--fx-surface);
    box-shadow: var(--fx-shadow);
    padding: 14px;
}

.fx-card .dark-grey,
.fx-muted {
    color: var(--fx-muted) !important;
}

.fx-list-link {
    border: 1px solid var(--fx-border);
    border-radius: 14px;
    padding: 11px 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--fx-surface-2);
    color: var(--fx-text);
}

.fx-list-link:hover {
    border-color: var(--fx-accent);
}

#frames .fx-frame-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

.fx-frame-card {
    border: 1px solid var(--fx-border);
    border-radius: 16px;
    box-shadow: var(--fx-shadow);
    background: var(--fx-surface);
    padding: 12px;
    display: grid;
    gap: 10px;
}

.fx-frame-card img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 12px solid #3b3b3b;
}

#footer {
    position: fixed;
    left: 50%;
    bottom: max(8px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: min(1120px, calc(100% - 20px));
    z-index: 920;
}

.app-footer-bar {
    border: 1px solid var(--fx-border);
    border-radius: 16px;
    box-shadow: var(--fx-shadow);
    background: color-mix(in srgb, var(--fx-surface) 92%, transparent);
    backdrop-filter: blur(8px);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
}

.app-footer-link {
    min-height: 52px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: var(--fx-surface-2);
    color: var(--fx-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.app-footer-link:hover,
.app-footer-link.active {
    border-color: var(--fx-accent);
}

.app-footer-link .material-icons {
    font-size: 1.25rem;
}

.app-auth-shell {
    width: min(640px, 100% - 20px);
    margin: 24px auto;
}

.app-auth-shell .form-control,
.facelift-page .form-control,
.facelift-page .form-select,
.facelift-page textarea {
    border-radius: 12px;
    border: 1px solid var(--fx-border);
    background: var(--fx-surface-2);
    color: var(--fx-text);
}

.facelift-page .btn-master-gradient,
.facelift-page .bg-master-gradient {
    background: linear-gradient(135deg, var(--fx-accent-2), var(--fx-accent)) !important;
}

@media (min-width: 1024px) {
    #main_menu.app-shell__content {
        padding-left: 0;
        padding-right: 0;
    }

    #main_menu.app-shell__content {
        margin-left: auto;
        width: min(1120px, calc(100% - 20px));
        max-width: none;
        padding-right: 12px;
        padding-bottom: 16px;
    }

    #footer {
        width: min(1120px, calc(100% - 32px));
    }
}

@media (max-width: 800px) {

    .app-footer-link span:last-child {
        display: none;
    }
}

