:root {
    --lmdpc-navy: #001529;
    --lmdpc-navy-light: #1b2838;
    --lmdpc-blue: #1e3a5f;
    --lmdpc-green: #16a34a;
    --lmdpc-green-dark: #15803d;
    --lmdpc-bg: #f4f6f8;
    --lmdpc-card: #ffffff;
    --lmdpc-orange: #ea580c;
    --lmdpc-blue-accent: #2563eb;
    --lmdpc-purple: #7c3aed;
}

body.portal-app {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--lmdpc-bg);
    color: #1e293b;
}

.portal-sidebar {
    position: sticky;
    top: 0;
    align-self: flex-start;
    flex-shrink: 0;
    overflow-x: hidden;
    overflow-y: auto;
    width: 260px;
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: transparent;
}

/* Background tied to viewport height — not page content height (Dashboard is taller) */
.portal-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    max-height: 100%;
    z-index: 0;
    pointer-events: none;
    background-image: url('/images/navbar-menu-background.jpeg');
    background-size: auto 100%;
    background-position: center top;
    background-repeat: no-repeat;
}

.portal-sidebar > * {
    position: relative;
    z-index: 1;
}

.portal-sidebar-footer {
    flex-shrink: 0;
    margin-top: auto;
}

.portal-sidebar-art {
    display: none;
}

.portal-topbar {
    position: relative;
    z-index: 30;
}

.portal-user-menu {
    position: relative;
}

.portal-user-menu > summary {
    list-style: none;
    cursor: pointer;
}

.portal-user-menu > summary::-webkit-details-marker {
    display: none;
}

.portal-user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0.5rem;
    margin: -0.25rem -0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.15s;
}

.portal-user-menu-trigger:hover,
.portal-user-menu[open] .portal-user-menu-trigger {
    background: #f1f5f9;
}

.portal-user-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    min-width: 11rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
    padding: 0.375rem;
    z-index: 40;
}

.portal-user-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    color: #334155;
    border-radius: 0.375rem;
    transition: background-color 0.15s, color 0.15s;
}

.portal-user-menu-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.portal-user-menu-item--danger {
    color: #b91c1c;
}

.portal-user-menu-item--danger:hover {
    background: #fef2f2;
    color: #991b1b;
}

.portal-stat-card {
    min-height: 140px;
}

.portal-stat-mini {
    min-height: 140px;
}

.portal-stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.portal-info-banner {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 0.5rem;
    padding: 0.875rem 1rem;
}

.portal-link-blue {
    color: #2563eb;
}

.portal-link-blue:hover {
    text-decoration: underline;
}

.portal-btn-outline-green {
    display: inline-block;
    border: 2px solid var(--lmdpc-green);
    color: var(--lmdpc-green);
    font-weight: 600;
    border-radius: 0.375rem;
    padding: 0.25rem 0.875rem;
    background: #fff;
}

.portal-btn-outline-green:hover {
    background: #f0fdf4;
}

.portal-quick-action {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    transition: color 0.15s;
}

.portal-quick-action:hover {
    color: var(--lmdpc-green);
}

.portal-quick-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    flex-shrink: 0;
}

.portal-quick-action:hover .portal-quick-icon {
    background: #dcfce7;
    color: var(--lmdpc-green);
}

.portal-sidebar .nav-active {
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
    border-radius: 0.5rem;
    color: #fff;
}

.portal-sidebar a:not(.nav-active):hover {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
}

.portal-stat-green { color: var(--lmdpc-green); }
.portal-stat-blue { color: var(--lmdpc-blue-accent); }
.portal-stat-orange { color: var(--lmdpc-orange); }
.portal-stat-purple { color: var(--lmdpc-purple); }

.portal-card {
    background: var(--lmdpc-card);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    border: 1px solid #e2e8f0;
}

.portal-tabs .tab-active {
    color: var(--lmdpc-green);
    border-bottom: 3px solid var(--lmdpc-green);
    font-weight: 600;
}

.badge-active {
    background: #dcfce7;
    color: #166534;
}

.badge-expiring {
    background: #ffedd5;
    color: #c2410c;
}

.badge-in-progress {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-submitted {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-approved {
    background: #dcfce7;
    color: #166534;
}

.badge-rejected {
    background: #fee2e2;
    color: #b91c1c;
}

.portal-btn-primary {
    background: var(--lmdpc-green);
    color: #fff;
    border-radius: 0.5rem;
    font-weight: 600;
}

.portal-btn-primary:hover {
    background: var(--lmdpc-green-dark);
}

.portal-expiry-banner {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 0.75rem;
}

/* Login — new Login GUI.jpeg + new Login GUI Background.jpeg */
html.portal-login-locked-root,
html.portal-login-locked-root body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

.portal-login-page {
    background: #dce6f0 url('/images/new-login-background.jpeg') center center / cover no-repeat;
}

/* Login only: fixed viewport, no scroll */
.portal-login-page.portal-login-locked {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: manipulation;
    margin: 0;
    padding: 0;
}

.portal-login-page.portal-auth-scrollable {
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

.portal-login-page.portal-auth-scrollable .portal-login-shell {
    min-height: 100vh;
    overflow: visible;
    align-items: center;
}

.portal-login-page.portal-auth-scrollable .portal-login-card,
.portal-login-page.portal-auth-scrollable .portal-login-form-panel {
    max-height: none;
    overflow: visible;
}

/* Register — background not zoomed; fixed layer while form scrolls */
.portal-login-page.portal-auth-register {
    background-color: #dce6f0;
    background-image: none;
}

.portal-login-page.portal-auth-register::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-color: #dce6f0;
    background-image: url('/images/new-login-background.jpeg');
    background-repeat: no-repeat;
    background-position: left center;
    background-size: auto 100%;
}

.portal-login-page.portal-auth-register::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(
        90deg,
        rgba(220, 230, 240, 0) 0%,
        rgba(220, 230, 240, 0.35) 45%,
        rgba(236, 242, 248, 0.92) 62%,
        rgba(244, 247, 250, 0.98) 100%
    );
}

.portal-login-page.portal-auth-register .portal-login-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 2rem 3rem 2.5rem 1rem;
}

.portal-login-page.portal-auth-register .portal-login-card {
    max-width: 600px;
    margin-top: 0;
    margin-bottom: 1rem;
}

.portal-login-page.portal-auth-register .portal-login-form-panel {
    padding: 2rem 2.5rem;
}

.portal-login-page.portal-auth-register .portal-login-title {
    font-size: 1.625rem;
}

@media (max-width: 1024px) {
    .portal-login-page.portal-auth-register::before {
        background-size: auto 85%;
        background-position: center top;
        opacity: 0.45;
    }

    .portal-login-page.portal-auth-register::after {
        background: rgba(244, 247, 250, 0.88);
    }

    .portal-login-page.portal-auth-register .portal-login-shell {
        justify-content: center;
        align-items: center;
        padding: 1.5rem 1rem 2rem;
    }
}

@media (max-width: 640px) {
    .portal-login-page.portal-auth-register .portal-login-form .grid {
        grid-template-columns: 1fr;
    }
}

.portal-login-page.portal-login-locked .portal-login-shell {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0.75rem 3rem 0.75rem 0.75rem;
    box-sizing: border-box;
    overflow: hidden;
}

.portal-login-shell {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 1rem 3.5rem 1rem 1rem;
    box-sizing: border-box;
}

.portal-login-card {
    width: 100%;
    max-width: 560px;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 20px 50px rgba(0, 29, 65, 0.15), 0 4px 16px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    flex-shrink: 0;
}

.portal-login-page.portal-login-locked .portal-login-card {
    max-height: calc(100dvh - 1.5rem);
}

.portal-login-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 3rem;
    background: #fff;
    box-sizing: border-box;
    border-radius: 1rem;
}

.portal-login-page.portal-login-locked .portal-login-form-panel {
    max-height: calc(100dvh - 1.5rem);
    overflow: hidden;
}

.portal-login-form {
    width: 100%;
    max-width: 100%;
}

.portal-login-shield {
    width: 3.25rem;
    height: 3.25rem;
    margin: 0 auto 1rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
}

.portal-login-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #002d62;
    line-height: 1.2;
}

.portal-login-subtitle {
    font-size: 0.9rem;
    color: #64748b;
    margin-top: 0.5rem;
}

.portal-login-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: #002d62;
    margin-bottom: 0.5rem;
}

.portal-input-wrap {
    position: relative;
}

.portal-input-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    display: flex;
}

.portal-input {
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    width: 100%;
    font-size: 0.9375rem;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.portal-input-with-icon {
    padding-left: 2.75rem;
}

.portal-input-with-toggle {
    padding-right: 2.75rem;
}

.portal-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.portal-input-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    padding: 0.25rem;
}

.portal-input-toggle:hover {
    color: #475569;
}

.portal-btn-signin {
    background: #002d62;
    color: #fff;
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}

.portal-btn-signin:hover {
    background: #001a41;
}

.portal-login-divider {
    position: relative;
    text-align: center;
}

.portal-login-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    border-top: 1px solid #e2e8f0;
}

.portal-login-divider span {
    position: relative;
    background: #fff;
    padding: 0 0.75rem;
    font-size: 0.8125rem;
    color: #94a3b8;
}

.portal-btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #334155;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.portal-btn-google:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.portal-btn-lesotho-id {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #334155;
    cursor: not-allowed;
    opacity: 0.85;
}

.portal-lesotho-dots {
    display: inline-flex;
    gap: 3px;
}

.portal-lesotho-dots span {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
}

.portal-btn-biometric {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 9999px;
    border: 1px solid #cbd5e1;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: not-allowed;
    opacity: 0.85;
    transition: border-color 0.15s, background 0.15s;
}

.portal-link-green {
    color: #16a34a;
    font-weight: 600;
}

.portal-link-green:hover {
    color: #15803d;
}

@media (max-width: 1024px) {
    .portal-login-shell,
    .portal-login-page.portal-login-locked .portal-login-shell {
        justify-content: center;
        padding: 0.75rem;
    }

    .portal-login-card {
        max-width: 520px;
    }

    .portal-login-form-panel {
        padding: 1.75rem 2rem;
    }
}

@media (max-width: 480px) {
    .portal-login-shell,
    .portal-login-page.portal-login-locked .portal-login-shell {
        padding: 0.75rem;
    }

    .portal-login-card {
        border-radius: 1rem;
        max-width: 100%;
    }

    .portal-login-form-panel {
        padding: 1.5rem 1.25rem;
        border-radius: 1rem;
    }
}

/* Shorter screens: shrink form to fit without scrolling */
@media (max-height: 820px) {
    .portal-login-page.portal-login-locked .portal-login-form {
        transform: scale(0.94);
        transform-origin: center center;
    }

    .portal-login-page.portal-login-locked .portal-login-form-panel {
        padding: 1.5rem 2rem;
    }
}

@media (max-height: 700px) {
    .portal-login-page.portal-login-locked .portal-login-form {
        transform: scale(0.88);
    }

    .portal-login-page.portal-login-locked .portal-login-title {
        font-size: 1.5rem;
    }

    .portal-login-page.portal-login-locked .portal-login-shield {
        width: 2.75rem;
        height: 2.75rem;
        margin-bottom: 0.75rem;
    }
}

.portal-table th {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: none;
    letter-spacing: 0;
}

.portal-table td {
    font-size: 0.875rem;
    padding: 1rem 0.75rem;
    border-top: 1px solid #f1f5f9;
}

@media (max-width: 768px) {
    .portal-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 50;
        height: 100vh;
        max-height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.2s;
    }

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

/* —— Dashboard (new Dashboard GUI.jpeg) —— */
.portal-brand-serif {
    font-family: 'Libre Baskerville', Georgia, serif;
}

.portal-nav-badge {
    background: #22c55e;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 1.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.25rem;
    flex-shrink: 0;
}

.portal-nav-badge--new {
    background: #a855f7;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    min-width: auto;
    height: auto;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.dashboard-welcome-title {
    font-size: 1.65rem;
    font-weight: 700;
    color: #1e3a5f;
    line-height: 1.25;
}

.dashboard-welcome {
    margin-bottom: 1.25rem;
}

.portal-jotform-sync {
    max-width: none;
}

.dashboard-welcome-sub {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.35rem;
}

/* Main body: left = stats + tables; right = inbox + sidebar widgets */
.dashboard-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    align-items: start;
}

@media (min-width: 1024px) {
    .dashboard-body {
        grid-template-columns: minmax(0, 1fr) 300px;
        gap: 1.25rem;
    }
}

.dashboard-col-main {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.dashboard-main-panels {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dashboard-col-aside {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.875rem;
    width: 100%;
    min-width: 0;
}

@media (min-width: 640px) {
    .dashboard-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .dashboard-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1rem;
    }
}

.dashboard-inbox {
    height: fit-content;
}

.dashboard-stat-card {
    padding: 1.25rem 1.375rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    min-height: 120px;
    min-width: 0;
    transition: background-color 0.18s ease-in-out;
}

.dashboard-stat-card--green:hover {
    background: linear-gradient(135deg, #34d399 0%, #22c55e 40%, #0ea5a4 100%) !important;
}

.dashboard-stat-card--blue:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 42%, #6366f1 100%) !important;
}

.dashboard-stat-card--orange:hover {
    background: linear-gradient(135deg, #fb923c 0%, #f97316 38%, #ec4899 100%) !important;
}

.dashboard-stat-card:hover .dashboard-stat-label,
.dashboard-stat-card:hover .dashboard-stat-value,
.dashboard-stat-card:hover .dashboard-stat-link,
.dashboard-stat-card:hover .dashboard-stat-icon {
    color: #ffffff !important;
}

.dashboard-stat-card:hover .dashboard-stat-icon {
    background-color: rgba(255, 255, 255, 0.2) !important;
}

.dashboard-stat-label {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.35rem;
}

.dashboard-stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.dashboard-stat-link {
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 0.75rem;
    display: inline-block;
}

.dashboard-stat-link:hover {
    text-decoration: underline;
}

.dashboard-stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}


.dashboard-panel {
    padding: 1.5rem;
}

.dashboard-panel-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 1rem;
}

.dashboard-tabs {
    display: flex;
    gap: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1rem;
    overflow-x: auto;
}

.dashboard-tab {
    font-size: 0.875rem;
    color: #64748b;
    padding-bottom: 0.75rem;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
}

.dashboard-tab:hover {
    color: #334155;
}

.dashboard-tab.is-active {
    color: #16a34a;
    font-weight: 600;
    border-bottom-color: #16a34a;
}

.dashboard-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    display: inline-block;
}

.dashboard-badge-new {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    background: #dcfce7;
    color: #166534;
    flex-shrink: 0;
}

.dashboard-btn-view {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    padding: 0.35rem 0.75rem;
    background: #fff;
    color: #334155;
}

.dashboard-btn-view:hover {
    background: #f8fafc;
}

.dashboard-action-continue {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #16a34a;
}

.dashboard-action-continue:hover {
    text-decoration: underline;
}

.dashboard-footer-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: #2563eb;
}

.dashboard-footer-link:hover {
    text-decoration: underline;
}

.dashboard-inbox-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dashboard-inbox-item {
    display: flex;
    gap: 0.75rem;
}

.dashboard-inbox-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    background: #f0fdf4;
    color: #16a34a;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dashboard-quick-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-top: 1px solid #f1f5f9;
}

.dashboard-quick-list li + li {
    border-top: 1px solid #f1f5f9;
}

.portal-card {
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
}

/* Dashboard notification carousel */
.dashboard-notifications {
    overflow: hidden;
}

.notification-carousel {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #0f172a;
}

.notification-carousel-viewport {
    overflow: hidden;
}

.notification-carousel-track {
    position: relative;
    min-height: 220px;
}

@media (min-width: 768px) {
    .notification-carousel-track {
        min-height: 280px;
    }
}

.notification-carousel-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transform: scale(1.02);
    transition: opacity 0.55s ease, transform 0.55s ease, visibility 0.55s;
    pointer-events: none;
}

.notification-carousel-slide.is-active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    pointer-events: auto;
    position: relative;
}

.notification-carousel-media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    max-height: 320px;
    background: #1e293b;
}

.notification-carousel-expand {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    background: transparent;
    cursor: zoom-in;
}

.notification-carousel-expand img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.notification-carousel-expand-hint {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.notification-carousel-expand:hover .notification-carousel-expand-hint,
.notification-carousel-expand:focus-visible .notification-carousel-expand-hint {
    opacity: 1;
    transform: translateY(0);
}

.notification-carousel-expand:focus-visible {
    outline: 2px solid #0d9488;
    outline-offset: 2px;
}

.notification-carousel-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(
        to top,
        rgba(15, 23, 42, 0.92) 0%,
        rgba(15, 23, 42, 0.45) 45%,
        rgba(15, 23, 42, 0.05) 100%
    );
}

.notification-carousel-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1rem 1.125rem 1.25rem;
    color: #fff;
    z-index: 2;
}

@media (min-width: 768px) {
    .notification-carousel-caption {
        padding: 1.25rem 1.5rem 1.5rem;
    }
}

.notification-carousel-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 0.35rem;
}

@media (min-width: 768px) {
    .notification-carousel-title {
        font-size: 1.125rem;
    }
}

.notification-carousel-body {
    font-size: 0.8125rem;
    line-height: 1.45;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-carousel-date {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.65);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.notification-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    border: none;
    background: rgba(255, 255, 255, 0.92);
    color: #1e3a5f;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: background 0.15s, transform 0.15s;
}

.notification-carousel-btn:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.05);
}

.notification-carousel-btn--prev {
    left: 0.5rem;
}

.notification-carousel-btn--next {
    right: 0.5rem;
}

.notification-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 0 0.25rem;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.06), transparent);
}

.notification-carousel-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    border: none;
    padding: 0;
    background: #cbd5e1;
    cursor: pointer;
    transition: width 0.25s ease, background 0.25s ease;
}

.notification-carousel-dot.is-active {
    width: 1.5rem;
    background: #0d9488;
}

.notification-carousel-empty {
    border: 1px dashed #e2e8f0;
    border-radius: 0.75rem;
    background: #f8fafc;
}

/* Notification full-screen lightbox */
html.notification-lightbox-open {
    overflow: hidden;
}

.notification-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.notification-lightbox[hidden] {
    display: none !important;
}

.notification-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.92);
    cursor: zoom-out;
}

.notification-lightbox-panel {
    position: relative;
    z-index: 1;
    width: min(100%, 72rem);
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    display: flex;
    flex-direction: column;
    animation: notification-lightbox-in 0.25s ease;
}

@keyframes notification-lightbox-in {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.notification-lightbox-figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}

.notification-lightbox-img {
    width: 100%;
    max-height: calc(100vh - 8rem);
    max-height: calc(100dvh - 8rem);
    object-fit: contain;
    display: block;
    border-radius: 0.5rem;
    background: #0f172a;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.notification-lightbox-caption {
    margin-top: 1rem;
    padding: 0 0.25rem;
    color: #fff;
    text-align: center;
}

.notification-lightbox-title {
    margin: 0 0 0.35rem;
    font-size: 1.125rem;
    font-weight: 700;
}

.notification-lightbox-body {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
    max-width: 40rem;
    margin-left: auto;
    margin-right: auto;
}

.notification-lightbox-close {
    position: absolute;
    top: -0.25rem;
    right: 0;
    z-index: 2;
    width: 2.75rem;
    height: 2.75rem;
    border: none;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease;
}

.notification-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.22);
}

.notification-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 2.75rem;
    height: 2.75rem;
    border: none;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease;
}

.notification-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.22);
}

.notification-lightbox-nav--prev {
    left: -0.5rem;
}

.notification-lightbox-nav--next {
    right: -0.5rem;
}

@media (max-width: 640px) {
    .notification-lightbox {
        padding: 0.5rem;
    }

    .notification-lightbox-nav--prev {
        left: 0.25rem;
    }

    .notification-lightbox-nav--next {
        right: 0.25rem;
    }

    .notification-lightbox-close {
        top: 0.25rem;
        right: 0.25rem;
        background: rgba(15, 23, 42, 0.65);
    }
}
