/* Main layout */
.page {
    display: flex;
    min-height: 100vh;
}

.nav-theme-btn,
.nav-theme-icon-btn {
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-radius: 8px;
    height: 34px;
    padding: 0 0.75rem;
    font-weight: 600;
    font-size: 0.8rem;
}

.nav-theme-icon-btn {
    width: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.page.theme-dark article.content {
    background:
        radial-gradient(1200px 600px at 100% -10%, rgba(224, 122, 95, 0.22), transparent),
        radial-gradient(800px 420px at 0% 10%, rgba(242, 166, 90, 0.14), transparent),
        #16110d;
    color: #e5e7eb;
}

.page.theme-light .sidebar {
    background-image: linear-gradient(180deg, #f8fafc 0%, #ece4d4 75%);
    border-right: 1px solid #e3dccf;
}

.page.theme-light .top-row {
    background: rgba(255,255,255,0.9);
    border-bottom: 1px solid #e3dccf;
}

.page.theme-light .navbar-brand,
.page.theme-light .nav-icon,
.page.theme-light .nav-item .nav-link,
.page.theme-light .nav-favorites-header,
.page.theme-light .nav-fav-title {
    color: #1f2937;
}

.page.theme-light .nav-item .nav-link:hover {
    background-color: rgba(194,65,12,0.08);
    color: #1f2937;
}

.page.theme-light .nav-item a.active {
    background-color: rgba(194,65,12,0.2);
    color: #111827;
}

.page.theme-light .sidebar-toggle-btn,
.page.theme-light .nav-theme-btn,
.page.theme-light .nav-theme-icon-btn {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.page.theme-light .nav-footer {
    border-top-color: #e3dccf;
}

.page.theme-light .nav-footer-bottom-row {
    background: #fffaf0;
    border: 1px solid #e3dccf;
    border-radius: 12px;
    padding: 0.35rem 0.45rem;
}

.page.theme-light article.content {
    background: #f8fafc;
    color: #0f172a;
}

.page.theme-light .home-page {
    background: transparent;
}

.page.theme-light .dash-top,
.page.theme-light .dash-card {
    background: linear-gradient(150deg, #ffffff 0%, #fffaf0 100%);
    border-color: #f0e3cb;
    box-shadow: 0 10px 22px rgba(30, 41, 59, 0.08);
}

.page.theme-light .dash-kicker {
    color: #c2410c;
    border-color: #fed7aa;
    background: #fff7ed;
}

.page.theme-light .dash-top h1,
.page.theme-light .dash-card h2 {
    color: #111827;
}

.page.theme-light .dash-top p,
.page.theme-light .dash-card p,
.page.theme-light .dash-card li {
    color: #4b5563;
}

.page.theme-light .dash-card .home-cta-secondary,
.page.theme-light .dash-top .home-cta-secondary {
    background: #fff;
    color: #9a3412;
    border-color: #fed7aa;
}

.page.theme-light .home-app-header {
    background: linear-gradient(135deg, #ffffff 0%, #fffaf0 52%, #fff7ed 100%);
    border-color: #f0e3cb;
    box-shadow: 0 6px 16px rgba(59, 130, 246, .08);
}

.page.theme-light .home-app-header-kicker {
    color: #c2410c;
    border-color: #fed7aa;
    background: #fff7ed;
}

.page.theme-light .home-app-header h1 {
    color: #1f2937;
}

.page.theme-light .home-app-header p {
    color: #4b5563;
}

.page.theme-light .home-app-card {
    background: linear-gradient(150deg, #ffffff 0%, #fffaf0 100%);
    border-color: #f0e3cb;
    box-shadow: 0 10px 22px rgba(30, 41, 59, 0.08);
}

.page.theme-light .home-app-card h2 {
    color: #111827;
}

.page.theme-light .home-app-card p,
.page.theme-light .home-app-card li {
    color: #4b5563;
}

.page.theme-light .home-app-card .home-cta-secondary,
.page.theme-light .home-app-header .home-cta-secondary {
    background: #fff;
    color: #9a3412;
    border-color: #fed7aa;
}

.home-auth-shell .home-app-header {
    border-radius: 14px;
}

.page.theme-light .home-game-draw-card {
    background: linear-gradient(150deg, #faf5ff 0%, #fff7ed 100%);
    border-color: #a855f7;
    box-shadow: 0 12px 26px rgba(126, 34, 206, 0.12), 0 0 0 1px rgba(168, 85, 247, 0.18);
}

.page.theme-light .home-game-draw-head h2 {
    color: #6b21a8;
}

.page.theme-light .home-timeline-card {
    background: linear-gradient(150deg, #f0fdf4 0%, #ecfeff 100%);
    border-color: #22c55e;
    box-shadow: 0 12px 24px rgba(21, 128, 61, 0.1), 0 0 0 1px rgba(34, 197, 94, 0.16);
}

.page.theme-light .home-timeline-head h3 {
    color: #166534;
}

.page.theme-light .planner-overview-card.home-planner-overview {
    background: linear-gradient(150deg, #ecfeff 0%, #f8fafc 100%);
    border-color: #38bdf8;
    box-shadow: 0 12px 24px rgba(3, 105, 161, 0.1), 0 0 0 1px rgba(56, 189, 248, 0.16);
}

.sidebar {
    width: 260px;
    transition: width 0.12s cubic-bezier(.2, .8, .2, 1);
    will-change: width;
    overflow: hidden;
    background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #1f1810 70%);
    position: sticky;
    top: 0;
    height: 100vh;
}

.page.sidebar-collapsed .sidebar {
    width: 76px;
}

main {
    flex: 1;
    min-width: 0;
    min-height: 100dvh;
}

.page.theme-dark main {
    background:
        radial-gradient(1200px 600px at 100% -10%, rgba(224, 122, 95, 0.22), transparent),
        radial-gradient(800px 420px at 0% 10%, rgba(242, 166, 90, 0.14), transparent),
        #16110d;
}

.page.theme-light main {
    background: #f8fafc;
}

#blazor-error-ui {
    align-items: center;
    background: rgba(255, 251, 235, 0.98);
    bottom: 0;
    box-shadow: 0 -12px 30px rgba(15, 23, 42, 0.16);
    color: #7c2d12;
    display: none;
    left: 0;
    gap: 0.4rem;
    padding: 0.9rem 3rem 1rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 10000;
}

#blazor-error-ui::before {
    content: "";
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 999px;
    background: #f97316;
    box-shadow: 0 0 0 0.35rem rgba(249, 115, 22, 0.16);
    flex: 0 0 auto;
}

#blazor-error-ui .reload {
    color: #c2410c;
    font-weight: 700;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

#components-reconnect-modal {
    align-items: center;
    background: rgba(15, 23, 42, 0.42);
    bottom: 0;
    display: none;
    justify-content: center;
    left: 0;
    padding: 1rem;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 9999;
}

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
}

#components-reconnect-modal.components-reconnect-hide {
    display: none;
}

#components-reconnect-modal .reconnect-card {
    background: linear-gradient(145deg, #fff7ed 0%, #ffffff 100%);
    border: 1px solid rgba(251, 146, 60, 0.35);
    border-radius: 1.25rem;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
    color: #431407;
    max-width: 25rem;
    padding: 1.5rem;
    text-align: center;
}

#components-reconnect-modal .reconnect-card p {
    color: #7c2d12;
    margin: 0.55rem 0 0;
}

#components-reconnect-modal.components-reconnect-failed .reconnect-card strong,
#components-reconnect-modal.components-reconnect-rejected .reconnect-card strong {
    color: #b91c1c;
}

#components-reconnect-modal .reconnect-spinner {
    animation: reconnect-spin 0.8s linear infinite;
    border: 3px solid rgba(249, 115, 22, 0.2);
    border-top-color: #f97316;
    border-radius: 999px;
    height: 2.25rem;
    margin: 0 auto 0.9rem;
    width: 2.25rem;
}

@keyframes reconnect-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Empty layout */
.empty-layout-lang {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100;
}

.empty-layout-skeleton {
    min-height: 100vh;
    background: linear-gradient(135deg, #e07a5f 0%, #f2a65a 100%);
}

/* Language selector */
.lang-selector {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(224,122,95,0.08);
    border-radius: 20px;
    padding: 3px;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.75rem;
    border: none;
    border-radius: 16px;
    background: transparent;
    color: #4b5563;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
    white-space: nowrap;
}

.lang-btn:hover:not(.lang-btn-active) {
    background: rgba(224,122,95,0.12);
    color: #e07a5f;
}

.lang-btn-active {
    background: linear-gradient(135deg, #e07a5f 0%, #f2a65a 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(224,122,95,0.35);
}

/* Router loading */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(224, 122, 95, 0.2);
    border-top-color: #e07a5f;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Nav menu */
.nav-wrapper {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.nav-wrapper:not(.nav-collapsed) .nav-link {
    gap: 0.65rem;
}

.nav-wrapper.nav-collapsed .nav-link {
    justify-content: center;
    text-align: center;
    gap: 0;
}

.nav-wrapper.nav-collapsed .nav-icon {
    margin: 0;
}

.nav-wrapper.nav-collapsed .navbar-brand {
    display: none;
}

.nav-wrapper.nav-collapsed .sidebar-toggle-btn {
    margin-left: 0.25rem;
}

.nav-toggle-link {
    width: 100%;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
}

.nav-toggle-desktop-wrap {
    display: none;
}

.nav-favorites-collapsed {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    padding: 0.25rem 0 0.5rem;
}

.nav-favorite-icon-link {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.08);
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.nav-favorite-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-favorite-icon-fallback {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e53e3e;
}

.top-row {
    height: 4.5rem;
    background-color: rgba(0,0,0,0.4);
    position: sticky;
    top: 0;
    z-index: 1200;
}

.container-fluid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 0.5rem;
    min-width: 0;
}

.sidebar-toggle-btn {
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    line-height: 1;
    flex-shrink: 0;
}

.navbar-brand {
    font-size: 1.1rem;
}

.nav-icon {
    width: 1.2rem;
    height: 1.2rem;
    color: #fff;
    flex-shrink: 0;
}

.nav-item {
    font-size: 0.9rem;
    padding-bottom: 0.5rem;
}

.nav-item:first-of-type {
    padding-top: 1rem;
}

.nav-item:last-of-type {
    padding-bottom: 1rem;
}

.nav-item .nav-link {
    color: #d7d7d7;
    background: none;
    border: none;
    border-radius: 4px;
    height: 3rem;
    display: flex;
    align-items: center;
    line-height: 3rem;
    width: 100%;
}

.nav-item a.active {
    background-color: rgba(255,255,255,0.37);
    color: white;
}

.nav-item .nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}



@media (min-width: 769px) {
    .nav-wrapper.nav-collapsed .top-row {
        display: none;
    }

    .nav-wrapper.nav-collapsed .nav-toggle-desktop-wrap {
        display: block;
    }

    .page.sidebar-collapsed.sidebar-hover-expanded .sidebar {
        width: 260px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar {
        transition: none;
    }
}

.nav-scrollable {
    display: block;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.nav-footer {
    min-height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.12);
    padding: 0.5rem;
}

.nav-footer-links {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    text-align: center;
    box-sizing: border-box;
    padding-inline: 0.5rem;
}

.nav-footer-link {
    color: inherit;
    text-decoration: none;
}

.nav-footer-theme-row {
    width: 100%;
    display: flex;
    justify-content: center;
}

.nav-footer-bottom-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

@media (min-width: 769px) {
    .nav-wrapper:not(.nav-collapsed) .nav-footer-bottom-row {
        flex-wrap: wrap;
        row-gap: 0.4rem;
    }

    .nav-wrapper:not(.nav-collapsed) .nav-footer-bottom-row .nav-theme-btn {
        flex: 0 0 100%;
        max-width: 120px;
        margin: 0 auto;
    }

    .nav-wrapper:not(.nav-collapsed) .nav-footer-bottom-row .lang-selector,
    .nav-wrapper:not(.nav-collapsed) .nav-footer-bottom-row form {
        flex: 0 0 auto;
    }
}

.nav-wrapper:not(.nav-collapsed) .nav-footer {
    flex-direction: column;
    height: auto;
}

.nav-wrapper.nav-collapsed .nav-footer {
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    min-height: 96px;
    padding: 0.45rem 0.35rem;
    gap: 0.35rem;
}

.nav-wrapper.nav-collapsed .nav-footer form {
    display: flex;
    justify-content: center;
    width: 100%;
}

.nav-wrapper.nav-collapsed .nav-theme-icon-btn,
.nav-wrapper.nav-collapsed .nav-logout-icon-btn {
    width: 38px;
    height: 38px;
}

.nav-logout-btn,
.nav-logout-icon-btn {
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(220,38,38,0.85);
    color: #fff;
    border-radius: 8px;
    height: 34px;
    padding: 0 0.75rem;
    font-weight: 600;
}

.nav-logout-icon-btn {
    width: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 641px) {
    .nav-scrollable {
        display: block;
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }
}

/* PDF page layout tweaks */
article.content {
    padding: 0 !important;
    overflow: hidden;
}

/* Home page */
.home-page {
    height: 100%;
    min-height: 100dvh;
    overflow: auto;
    overflow-x: clip;
    padding: 1.4rem;
    background:
        radial-gradient(1200px 600px at 100% -10%, rgba(224, 122, 95, 0.25), transparent),
        radial-gradient(800px 420px at 0% 10%, rgba(242, 166, 90, 0.18), transparent),
        #16110d;
}

.home-lang-switch {
    width: min(920px, calc(100% - 1rem));
    margin: 0 auto;
    display: flex;
    justify-content: flex-end;
}

.home-lang-toggle {
    display: inline-flex;
    gap: 0.35rem;
    padding: 0.28rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(15, 23, 42, 0.58);
}

.home-lang-btn {
    appearance: none;
    -webkit-appearance: none;
    min-width: 46px;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    color: #94a3b8;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

.home-lang-btn.active {
    color: #fff;
    background: linear-gradient(135deg, #fb923c 0%, #fbbf80 100%);
    box-shadow: 0 6px 16px rgba(251, 146, 60, 0.45);
}

.home-reveal {
    opacity: 1;
    transform: none;
    filter: none;
}

.home-reveal-ready .home-reveal {
    opacity: 0;
    transform: translateY(30px) scale(0.985);
    filter: blur(2px);
    transition:
        opacity 260ms cubic-bezier(.2, .72, .24, 1),
        transform 260ms cubic-bezier(.2, .72, .24, 1),
        filter 260ms cubic-bezier(.2, .72, .24, 1);
    transition-delay: calc(var(--reveal-order, 0) * 16ms);
    will-change: opacity, transform, filter;
}

.home-reveal-ready .home-reveal.is-visible,
.home-reveal.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

@media (prefers-reduced-motion: reduce) {
    .home-reveal {
        opacity: 1;
        transform: none;
        filter: none;
        transition: none;
    }
}

@media (max-width: 768px) {
    .home-reveal-ready .home-reveal,
    .home-reveal-ready .home-reveal.is-visible,
    .home-reveal {
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        filter: none !important;
        transition: none !important;
    }
}

.home-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 1rem;
    color: #fff;
    border-radius: 20px;
    padding: 1.4rem;
    border: 1px solid rgba(251, 191, 128, 0.25);
    background: linear-gradient(140deg, rgba(17, 24, 39, 0.95) 0%, rgba(124, 45, 18, 0.9) 50%, rgba(124, 45, 18, 0.92) 100%);
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.55);
}

.home-hero-content {
    min-width: 0;
}

.home-hero-badge {
    display: inline-flex;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.26);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.home-hero h1 {
    margin: 0.85rem 0 0.5rem;
    font-size: clamp(1.6rem, 2.7vw, 2.45rem);
    line-height: 1.12;
}

.home-hero p {
    margin: 0;
    opacity: 0.92;
    max-width: 760px;
    color: #e5e7eb;
    line-height: 1.6;
}

.home-hero-actions {
    margin-top: 1.1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.home-cta {
    text-decoration: none;
    border-radius: 12px;
    padding: 0.58rem 0.9rem;
    font-size: 0.88rem;
    font-weight: 700;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.home-cta:hover {
    transform: translateY(-1px);
}

.home-cta-primary {
    background: linear-gradient(135deg, #fb923c 0%, #fbbf80 100%);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.16);
    box-shadow: 0 8px 20px rgba(251, 146, 60, 0.45);
}

.home-cta-secondary {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.24);
}

.home-hero-glass {
    margin-top: 0.9rem;
    display: inline-flex;
    align-items: center;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.23);
    border-radius: 999px;
    padding: 0.38rem 0.78rem;
    font-size: 0.79rem;
    font-weight: 600;
    color: #fff3e6;
}

.home-hero-pills {
    margin-top: 0.8rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.home-pill {
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.06);
    color: #dbeafe;
    padding: 0.26rem 0.58rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.home-hero-panel {
    display: grid;
    gap: 0.75rem;
    align-content: start;
}

.home-terminal {
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(2, 6, 23, 0.7);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.home-terminal-head {
    display: flex;
    gap: 0.3rem;
    padding: 0.52rem 0.7rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.home-terminal-head span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
}

.home-terminal-head span:first-child { background: #f87171; }
.home-terminal-head span:nth-child(2) { background: #facc15; }
.home-terminal-head span:nth-child(3) { background: #4ade80; }

.home-terminal-body {
    padding: 0.75rem;
    display: grid;
    gap: 0.45rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.74rem;
    color: #d1d5db;
}

.home-terminal-ok {
    color: #86efac;
}

.home-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}

.home-kpi-card {
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.07);
    padding: 0.65rem;
}

.home-kpi-card strong {
    display: block;
    color: #fed7aa;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

.home-kpi-card span {
    display: block;
    margin-top: 0.35rem;
    color: #e5e7eb;
    font-size: 0.78rem;
    line-height: 1.4;
}

.home-features {
    margin-top: 1.05rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.8rem;
}

.home-feature-card {
    background: linear-gradient(155deg, rgba(15, 23, 42, 0.82), rgba(30, 41, 59, 0.75));
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 10px 28px rgba(2, 6, 23, 0.34);
}

.home-feature-card h3 {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    color: #f8fafc;
}

.home-feature-card p {
    margin: 0;
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.55;
}

.home-steps {
    margin-top: 1.1rem;
}

.home-steps h2 {
    margin: 0 0 0.6rem;
    font-size: 1.08rem;
    color: #f3f4f6;
}

.home-steps-timeline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.home-step-card {
    background: rgba(15, 23, 42, 0.58);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 0.9rem;
    position: relative;
    box-shadow: 0 8px 24px rgba(2, 6, 23, 0.28);
}

.home-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e07a5f 0%, #f2a65a 100%);
    color: #fff;
    font-weight: 800;
    font-size: 0.82rem;
    margin-bottom: 0.45rem;
}

.home-step-card h3 {
    margin: 0 0 0.3rem;
    font-size: 0.98rem;
    color: #f8fafc;
}

.home-step-card p {
    margin: 0;
    color: #cbd5e1;
    font-size: 0.88rem;
    line-height: 1.45;
}

.home-pricing-preview {
    margin-top: 1.2rem;
    background: linear-gradient(155deg, rgba(17, 24, 39, 0.82), rgba(30, 27, 75, 0.78));
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 18px;
    padding: 1rem;
    box-shadow: 0 12px 30px rgba(2, 6, 23, 0.34);
}

.home-pricing-head h2 {
    margin: 0;
    color: #f3f4f6;
    font-size: 1.1rem;
}

.home-pricing-head p {
    margin: 0.35rem 0 0;
    color: #cbd5e1;
    font-size: 0.9rem;
}

.home-pricing-grid {
    margin-top: 0.9rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
}

.home-pricing-card {
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    padding: 0.9rem;
    background: rgba(15, 23, 42, 0.62);
}

.home-pricing-card-pro {
    border-color: rgba(251, 191, 128, 0.45);
    background: linear-gradient(160deg, rgba(224,122,95,0.3), rgba(154,52,18,0.32));
}

.home-pricing-card h3 {
    margin: 0;
    color: #f9fafb;
    font-size: 1rem;
}

.home-pricing-price {
    margin: 0.4rem 0 0.7rem;
    color: #f8fafc;
    font-weight: 800;
    font-size: 1.25rem;
}

.home-pricing-price span {
    margin-left: 0.15rem;
    font-size: 0.85rem;
    color: #cbd5e1;
    font-weight: 600;
}

.home-pricing-card ul {
    margin: 0;
    padding-left: 1rem;
    color: #e2e8f0;
    display: grid;
    gap: 0.35rem;
    font-size: 0.88rem;
}

.home-bottom-cta {
    margin-top: 1.1rem;
    border-radius: 18px;
    padding: 1rem;
    background: linear-gradient(130deg, rgba(194, 65, 12, 0.8) 0%, rgba(154, 52, 18, 0.85) 100%);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    box-shadow: 0 14px 32px rgba(154, 52, 18, 0.34);
}

.home-bottom-cta h2 {
    margin: 0;
    font-size: 1.1rem;
}

.home-bottom-cta p {
    margin: 0.4rem 0 0;
    opacity: 0.92;
    max-width: 680px;
}

.home-faq {
    margin-top: 1.1rem;
    border-radius: 18px;
    padding: 1rem;
    border: 1px solid rgba(255,255,255,0.16);
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.88), rgba(30, 41, 59, 0.72));
    box-shadow: 0 14px 32px rgba(2, 6, 23, 0.32);
}

.home-faq-head h2 {
    margin: 0;
    color: #f8fafc;
    font-size: 1.1rem;
}

.home-faq-head p {
    margin: 0.35rem 0 0;
    color: #cbd5e1;
    line-height: 1.55;
    font-size: 0.92rem;
}

.home-faq-list {
    margin-top: 0.85rem;
    display: grid;
    gap: 0.6rem;
}

.home-faq-item {
    border: 1px solid rgba(251, 191, 128, 0.24);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.58);
    overflow: hidden;
}

.home-faq-item summary {
    cursor: pointer;
    list-style: none;
    padding: 0.85rem 0.95rem;
    color: #fff7ed;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.home-faq-item summary::-webkit-details-marker {
    display: none;
}

.home-faq-item summary::after {
    content: "+";
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: #fff;
    background: linear-gradient(135deg, #c2410c, #f2a65a);
}

.home-faq-item[open] summary::after {
    content: "−";
}

.home-faq-item p {
    margin: 0;
    padding: 0 0.95rem 0.9rem;
    color: #e2e8f0;
    line-height: 1.65;
    font-size: 0.92rem;
}

/* Home v2 layout */
.home-page {
    display: grid;
    gap: 1.1rem;
}

.home-intro-card,
.home-pricing-preview,
.home-bottom-cta,
.home-faq,
.home-app-header {
    width: min(920px, calc(100% - 1rem));
    margin-inline: auto;
}

.home-intro-card {
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.24);
    background: linear-gradient(145deg, rgba(30, 27, 75, 0.94), rgba(124, 45, 18, 0.88));
    box-shadow: 0 26px 54px rgba(2, 6, 23, 0.55), 0 0 0 1px rgba(251, 191, 128, 0.35) inset;
    padding: 1.5rem 1.55rem;
    position: relative;
    overflow: hidden;
}

.home-wordmark {
    display: block;
    width: min(280px, 92%);
    height: auto;
    margin-bottom: 0.75rem;
}

.home-intro-kicker {
    display: inline-flex;
    margin-bottom: 0.7rem;
    padding: 0.28rem 0.62rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.34);
    background: rgba(255,255,255,0.1);
    color: #fff7ed;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.home-intro-card::after {
    content: "";
    position: absolute;
    inset: -40% auto auto -10%;
    width: 340px;
    height: 340px;
    background: radial-gradient(circle, rgba(251, 191, 128, 0.2), transparent 70%);
    pointer-events: none;
}

.home-intro-card h1 {
    margin: 0;
    color: #f8fafc;
    font-size: clamp(1.55rem, 2.5vw, 2.2rem);
    line-height: 1.2;
    text-shadow: 0 8px 28px rgba(154, 52, 18, 0.35);
}

.home-intro-title {
    font-size: clamp(1.18rem, 1.9vw, 1.8rem) !important;
}

@media (min-width: 700px) {
    .home-intro-title {
        white-space: nowrap;
    }
}

.home-intro-card p {
    margin: 0.85rem 0 0;
    color: #dbeafe;
    font-size: 1.04rem;
    line-height: 1.7;
}

.home-intro-main-actions {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.home-cta-highlight {
    box-shadow: 0 10px 22px rgba(251, 146, 60, 0.5);
}

.home-cta-highlight-secondary {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.44);
}

.home-flow {
    position: relative;
    width: min(920px, calc(100% - 1rem));
    margin: 0 auto;
    display: grid;
    gap: 1.15rem;
    padding: 0.2rem 0.25rem;
    --home-flow-axis-x: clamp(0.5rem, 1.8vw, 2.5rem);
    --home-flow-gap-axis-to-card: clamp(0.85rem, 2.2vw, 1.95rem);
    --home-flow-connector-len: clamp(0.7rem, 1.8vw, 1.45rem);
}

.home-flow::before {
    content: "";
    position: absolute;
    left: var(--home-flow-axis-x);
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 99px;
    background: linear-gradient(180deg, rgba(251, 191, 128, 0.9), rgba(251, 146, 60, 0.24));
    box-shadow: 0 0 16px rgba(251, 146, 60, 0.35);
}

.home-flow-card {
    width: min(800px, calc(100% - (var(--home-flow-axis-x) + var(--home-flow-gap-axis-to-card) + 0.35rem)));
    margin: 0 0 0 auto;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.2);
    background: linear-gradient(155deg, rgba(15, 23, 42, 0.86), rgba(56, 37, 121, 0.64));
    padding: 1.25rem 1.25rem 1.2rem;
    position: relative;
    box-shadow: 0 16px 34px rgba(2, 6, 23, 0.38);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.home-flow-card::before {
    content: "";
    position: absolute;
    left: calc(-1 * var(--home-flow-gap-axis-to-card));
    top: 50%;
    width: var(--home-flow-connector-len);
    height: 2px;
    transform: translateY(-50%);
    background: linear-gradient(90deg, rgba(251, 191, 128, 0.95), rgba(251, 191, 128, 0.1));
}

.home-flow-card:hover {
    transform: translateY(-3px);
    border-color: rgba(196, 181, 253, 0.55);
    box-shadow: 0 24px 45px rgba(2, 6, 23, 0.45);
}

.home-flow-card {
    display: flex;
    align-items: center;
    gap: 0.95rem;
}

.home-flow-index {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 2px solid rgba(255,255,255,0.34);
    background: linear-gradient(135deg, #fb923c 0%, #fbbf80 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    margin-bottom: 0;
    box-shadow: 0 0 0 6px rgba(224, 122, 95, 0.15);
    flex: 0 0 auto;
}

.home-flow-body {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 1rem;
    width: 100%;
    min-width: 0;
}

.home-flow-emoji {
    font-size: 1.4rem;
    line-height: 1;
    flex: 0 0 auto;
    filter: drop-shadow(0 4px 10px rgba(251, 191, 128, 0.35));
}

.home-flow-gif {
    width: 240px;
    height: 136px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(3, 7, 18, 0.55);
    padding: 3px;
    box-shadow: 0 8px 18px rgba(2, 6, 23, 0.35);
    flex: 0 0 auto;
}

.home-flow-card h3 {
    margin: 0;
    color: #f8fafc;
    font-size: 1.1rem;
    line-height: 1.4;
    min-height: 136px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.home-pricing-stack {
    margin-top: 0.9rem;
    display: grid;
    gap: 0.9rem;
}

.home-pricing-stack .home-pricing-card {
    padding: 1.1rem 1.15rem;
    border-radius: 16px;
}

.home-plan-note {
    margin: 0.25rem 0 0.55rem;
    color: #fed7aa;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.45;
}

.home-pricing-card-pro .home-plan-note {
    color: #fff7ed;
}

.home-app-grid {
    width: min(980px, calc(100% - 1rem));
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 0.9rem;
}

.home-auth-shell {
    width: min(var(--app-page-max-width, 1200px), calc(100% - 3rem));
    margin: 0 auto;
    display: grid;
    gap: 0.75rem;
}

.home-auth-shell .home-app-header,
.home-auth-shell .home-app-grid,
.home-auth-shell .home-timeline-card,
.home-auth-shell .home-game-draw-card,
.home-auth-shell .home-planner-overview {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.home-auth-shell .home-app-header {
    margin: 0.5rem 0 0.75rem;
}

.planner-overview-card.home-planner-overview {
    border-radius: 18px 18px 18px 0;
    border: 1px solid rgba(56, 189, 248, 0.42);
    background: linear-gradient(155deg, rgba(15, 23, 42, 0.86), rgba(30, 41, 59, 0.72));
    box-shadow: 0 14px 28px rgba(2, 6, 23, 0.34), 0 0 0 1px rgba(56, 189, 248, 0.1);
    padding: 1rem 1.05rem;
}

.home-planner-overview .planner-overview-head h3 {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.22rem;
    letter-spacing: 0.01em;
}

.home-planner-overview .planner-overview-head-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, #06b6d4 0%, #38bdf8 100%);
    box-shadow: 0 6px 14px rgba(6, 182, 212, 0.35);
    flex: 0 0 auto;
}

.home-planner-overview .planner-overview-kpis {
    margin-top: 0.65rem;
    gap: 0.7rem;
}

.home-planner-overview .planner-overview-kpi {
    border-color: rgba(251, 146, 60, 0.28);
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.62), rgba(30, 41, 59, 0.42));
    box-shadow: 0 10px 20px rgba(30, 64, 175, 0.12);
}

.home-planner-overview .planner-overview-kpi:nth-child(1) {
    background:
        linear-gradient(90deg, rgba(56, 189, 248, 0) 0%, rgba(56, 189, 248, 0.5) 100%),
        linear-gradient(145deg, rgba(15, 23, 42, 0.62), rgba(30, 41, 59, 0.42));
}

.home-planner-overview .planner-overview-kpi:nth-child(2) {
    background:
        linear-gradient(90deg, rgba(242, 166, 90, 0) 0%, rgba(242, 166, 90, 0.5) 100%),
        linear-gradient(145deg, rgba(15, 23, 42, 0.62), rgba(30, 41, 59, 0.42));
}

.home-planner-overview .planner-overview-kpi:nth-child(3) {
    background:
        linear-gradient(90deg, rgba(34, 197, 94, 0) 0%, rgba(34, 197, 94, 0.46) 100%),
        linear-gradient(145deg, rgba(15, 23, 42, 0.62), rgba(30, 41, 59, 0.42));
}

.home-planner-overview .planner-overview-kpi:nth-child(4) {
    background:
        linear-gradient(90deg, rgba(245, 158, 11, 0) 0%, rgba(245, 158, 11, 0.52) 100%),
        linear-gradient(145deg, rgba(15, 23, 42, 0.62), rgba(30, 41, 59, 0.42));
}

.home-planner-overview .planner-overview-top-btn {
    border-color: rgba(251, 146, 60, 0.28);
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.58), rgba(30, 41, 59, 0.36));
    text-decoration: none;
    justify-content: flex-start;
    align-items: center;
    gap: 0.7rem;
}

.home-planner-overview .planner-overview-top-thumb {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: cover;
    flex: 0 0 42px;
    border: 1px solid rgba(251, 146, 60, 0.35);
}

.home-planner-overview .planner-overview-top-thumb-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #e2e8f0;
    background: linear-gradient(135deg, #1e293b, #c2410c);
}

.home-planner-overview .planner-overview-top-content {
    min-width: 0;
    display: grid;
    gap: 0.15rem;
}

.home-planner-overview .planner-overview-top-name {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.home-planner-overview .planner-overview-top-name-icon {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #67e8f9;
    background: rgba(6, 182, 212, 0.16);
    flex: 0 0 auto;
}

.home-timeline-card {
    border-radius: 18px 18px 18px 0;
    border: 1px solid rgba(34, 197, 94, 0.42);
    background: linear-gradient(145deg, rgba(8, 47, 73, 0.52), rgba(30, 27, 75, 0.46));
    box-shadow: 0 14px 26px rgba(2, 6, 23, 0.28), 0 0 0 1px rgba(34, 197, 94, 0.1);
    padding: 0.9rem 1rem;
}

.home-timeline-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.7rem;
}

.home-timeline-head h3 {
    margin: 0;
    color: #f8fafc;
    font-size: 1.02rem;
}

.home-timeline-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.55rem;
    position: relative;
}

.home-timeline-row::before {
    content: "";
    position: absolute;
    left: 28px;
    right: 28px;
    top: 22px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.4), rgba(251, 191, 128, 0.45));
    pointer-events: none;
}

.home-timeline-item {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    gap: 0.3rem;
    text-decoration: none;
    color: inherit;
    padding: 0.2rem 0.2rem 0.1rem;
}

.home-timeline-thumb {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(251, 146, 60, 0.55);
    background: #0f172a;
    box-shadow: 0 8px 16px rgba(30, 64, 175, 0.22);
}

.home-timeline-thumb-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff3e6;
    font-size: 0.95rem;
    font-weight: 800;
    background: linear-gradient(135deg, #e07a5f, #f2a65a);
}

.home-timeline-title {
    max-width: 100%;
    color: #e2e8f0;
    font-size: 0.76rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-timeline-date {
    color: #93c5fd;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.home-app-header {
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: linear-gradient(150deg, rgba(13, 25, 48, 0.94), rgba(26, 38, 62, 0.88));
    box-shadow: 0 6px 16px rgba(59, 130, 246, .08);
    padding: 1rem 1.15rem;
    min-height: 0 !important;
    height: auto !important;
}

.home-app-header-kicker {
    display: inline-flex;
    margin-bottom: 0.45rem;
    padding: 0.22rem 0.56rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.28);
    background: rgba(255,255,255,0.08);
    color: #fed7aa;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.home-app-header h1 {
    margin: 0;
    color: #f8fafc;
    font-size: clamp(1.24rem, 1.8vw, 1.55rem);
    line-height: 1.25;
}

.home-app-header p {
    margin: 0.28rem 0 0;
    color: #cbd5e1;
    font-size: 0.9rem;
    max-width: 720px;
}

.home-app-header-actions {
    margin-top: 0.7rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.home-app-card {
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.14);
    background: linear-gradient(155deg, rgba(15, 23, 42, 0.86), rgba(30, 41, 59, 0.72));
    padding: 0.95rem 1rem;
    display: grid;
    gap: 0.52rem;
    align-content: start;
    min-height: 0 !important;
    height: auto !important;
}

.home-app-card h2 {
    margin: 0;
    color: #f8fafc;
    font-size: 1.05rem;
    line-height: 1.35;
}

.home-app-card p,
.home-app-card li {
    color: #cbd5e1;
    line-height: 1.45;
    font-size: 0.9rem;
}

.home-app-card ul {
    margin: 0.1rem 0 0.2rem;
    padding-left: 1.15rem;
    display: grid;
    gap: 0.22rem;
}

/* ============================================================
   Shared page shell - unified spacing & empty states
   Used by: DocumentList, Planner, BoardGameNews and any page
   that opts in by adding the class `app-page-shell` or by using
   the shared CSS custom properties below.
   ============================================================ */
:root {
    --app-page-max-width: 1200px;
    --app-page-padding-x: 1.5rem;
    --app-page-padding-y: 1.5rem;
    --app-page-gap: 1.25rem;
    --app-page-header-radius: 14px;
}

.app-page-shell {
    max-width: var(--app-page-max-width);
    margin: 0 auto;
    padding: var(--app-page-padding-y) var(--app-page-padding-x);
    display: flex;
    flex-direction: column;
    gap: var(--app-page-gap);
}

.app-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 3rem 1rem;
    color: #6b7280;
    font-size: 1rem;
    text-align: center;
}

.app-empty-state svg {
    opacity: 0.35;
}

.app-empty-state-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: #475569;
    margin: 0;
}

.app-empty-state-message {
    margin: 0;
    max-width: 440px;
    line-height: 1.45;
}

.app-empty-state-actions {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.page.theme-dark .app-empty-state {
    color: #cbd5e1;
}

.page.theme-dark .app-empty-state-title {
    color: #f1f5f9;
}

@media (max-width: 640px) {
    :root {
        --app-page-padding-x: 1rem;
        --app-page-padding-y: 1rem;
        --app-page-gap: 1rem;
    }
}

.home-app-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.home-app-card .home-cta {
    width: fit-content;
}

.home-auth-shell .home-app-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    align-items: start;
}

.home-auth-shell .home-app-card .home-cta {
    padding: 0.5rem 0.76rem;
    font-size: 0.82rem;
}

.home-bottom-cta .home-hero-actions {
    margin-top: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile / tablet layout */
@media (max-width: 768px) {
    .page {
        flex-direction: column;
        min-height: 100dvh;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: sticky;
        top: 0;
        z-index: 1100;
    }

    .page:not(.sidebar-collapsed) .sidebar {
        height: 100dvh;
    }

    .page.sidebar-collapsed .sidebar {
        width: 100%;
    }

    .page.sidebar-collapsed.nav-local-open .sidebar {
        height: 100dvh;
    }

    .nav-wrapper.nav-collapsed .container-fluid {
        justify-content: space-between;
        padding-right: 0.5rem;
    }

    .nav-wrapper.nav-collapsed .navbar-brand {
        display: inline-flex;
        align-items: center;
    }

    .nav-wrapper.nav-collapsed .navbar-brand-logo-wordmark {
        display: inline-block;
        height: 38px;
        width: auto;
        max-width: clamp(160px, 48vw, 220px);
        object-fit: contain;
    }

    .nav-wrapper.nav-collapsed .navbar-brand-logo-mark {
        display: none;
    }

    .nav-wrapper.nav-collapsed .sidebar-toggle-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: 0;
        margin-right: 0.3rem;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .nav-wrapper.nav-collapsed .top-row {
        display: flex;
    }

    .nav-wrapper.nav-collapsed .navbar-brand {
        display: inline-flex;
        align-items: center;
        font-size: 0.95rem;
        opacity: 0.9;
    }

    .nav-wrapper.nav-collapsed .nav-toggle-desktop-wrap {
        display: none;
    }

    .nav-wrapper {
        min-height: auto;
    }

    .page:not(.sidebar-collapsed) .nav-wrapper {
        min-height: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .page.sidebar-collapsed.nav-local-open .nav-wrapper {
        min-height: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .nav-scrollable {
        height: auto;
        max-height: 55dvh;
    }

    .page:not(.sidebar-collapsed) .nav-scrollable {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        overflow-y: auto;
    }

    .nav-wrapper.nav-collapsed .nav-scrollable {
        display: none;
    }

    .page.sidebar-collapsed.nav-local-open .nav-wrapper.nav-collapsed .nav-scrollable {
        display: block;
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        overflow-y: auto;
    }

    .nav-footer {
        position: static;
        background: rgba(10, 20, 55, 0.96);
        backdrop-filter: blur(4px);
        z-index: 2;
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
    }

    .page:not(.sidebar-collapsed) .nav-footer {
        margin-top: auto;
        padding-top: 0.85rem;
        gap: 0.55rem;
    }

    .page:not(.sidebar-collapsed) .nav-footer-links {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
        margin-bottom: 0.2rem;
        text-align: center;
    }

    .page:not(.sidebar-collapsed) .nav-footer-bottom-row {
        display: flex;
        align-items: center;
        justify-content: center !important;
        gap: 0.3rem;
        flex-wrap: nowrap;
        width: fit-content;
        max-width: 100%;
        margin-inline: auto;
        padding-inline: 0.2rem;
    }

    .page:not(.sidebar-collapsed) .nav-footer-bottom-row .lang-selector {
        min-width: 0;
    }

    .page:not(.sidebar-collapsed) .nav-footer-bottom-row form {
        display: flex;
        width: auto;
        margin: 0;
    }

    .page:not(.sidebar-collapsed) .nav-footer-bottom-row .nav-theme-btn,
    .page:not(.sidebar-collapsed) .nav-footer-bottom-row .nav-logout-btn {
        height: 32px;
        padding: 0 0.55rem;
        font-size: 0.75rem;
        white-space: nowrap;
    }

    .page:not(.sidebar-collapsed) .nav-footer-bottom-row .lang-btn {
        padding: 0.26rem 0.42rem;
        font-size: 0.74rem;
    }

    .page.theme-light .nav-footer {
        background: rgba(255, 255, 255, 0.96);
        border-top: 1px solid #e3dccf;
    }

    .nav-wrapper.nav-collapsed .nav-footer {
        display: none;
    }

    main {
        min-height: 0;
    }

    article.content {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        padding-bottom: calc(3.15rem + env(safe-area-inset-bottom));
        overflow-x: clip;
    }

    .home-page {
        padding: 0.8rem 0.35rem 1rem;
    }

    .home-hero {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .home-hero-glass {
        display: block;
        width: 100%;
        border-radius: 10px;
    }

    .home-kpi-grid {
        grid-template-columns: 1fr;
    }

    .home-terminal-body {
        font-size: 0.7rem;
    }

    .home-pricing-preview,
    .home-bottom-cta {
        padding: 0.85rem;
    }

    .home-intro-card,
    .home-pricing-preview,
    .home-bottom-cta,
    .home-app-header,
    .home-flow,
    .home-app-grid,
    .home-lang-switch,
    .home-auth-shell {
        width: 100%;
    }

    .home-auth-shell .home-app-grid {
        grid-template-columns: 1fr;
    }

    .home-auth-shell,
    .home-dash-grid,
    .home-dash-card,
    .home-invite-card,
    .home-invite-form {
        max-width: 100%;
        min-width: 0;
    }

    .home-dash-head h2,
    .home-dash-card > p,
    .home-invite-card h2,
    .home-invite-card p {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .home-invite-form {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 0.55rem;
    }

    .home-invite-form input[type="email"] {
        width: 100%;
        min-width: 0;
    }

    .home-invite-form .home-cta,
    .home-dash-actions .home-cta {
        max-width: 100%;
    }

    .home-flow {
        overflow: hidden;
        overflow-x: clip;
        padding-left: 0;
        --home-flow-axis-x: clamp(0.38rem, 1.6vw, 0.6rem);
        --home-flow-gap-axis-to-card: clamp(0.95rem, 4vw, 1.4rem);
        --home-flow-connector-len: clamp(0.52rem, 3vw, 1.05rem);
    }

    .home-flow::before {
        left: var(--home-flow-axis-x);
        width: 2px;
    }

    .home-flow-card,
    .home-flow-card.home-reveal,
    .home-flow-card:hover {
        width: calc(100% - (var(--home-flow-axis-x) + var(--home-flow-gap-axis-to-card) + 0.2rem));
        margin-left: calc(var(--home-flow-axis-x) + var(--home-flow-gap-axis-to-card));
        transform: none;
    }

    .home-flow-card::before,
    .home-flow-card.home-reveal::before,
    .home-flow-card:hover::before {
        content: "" !important;
        display: block !important;
        left: calc(-1 * var(--home-flow-gap-axis-to-card));
        width: var(--home-flow-connector-len);
        height: 2px;
        top: 50%;
        transform: translateY(-50%);
        background: linear-gradient(90deg, rgba(251, 191, 128, 0.95), rgba(251, 191, 128, 0.1));
    }

    .home-flow-index {
        width: 34px;
        height: 34px;
        margin-bottom: 0.44rem;
    }

    .home-flow-card h3 {
        font-size: 1.03rem;
    }

    .home-flow-body {
        grid-template-columns: 1fr;
        justify-items: center;
        align-items: center;
        gap: 0.55rem;
    }

    .home-flow-gif {
        width: min(100%, 240px);
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .home-flow-card h3 {
        min-height: 0;
    }
}

/* ============================================================
   Home dashboard (control-center style)
   Shown to authenticated users - aggregates shortcuts and
   live fragments from different parts of the system.
   ============================================================ */
.home-game-draw-card {
    width: min(1140px, calc(100% - 1rem));
    margin: 0 auto 0.9rem;
    border-radius: 18px 18px 18px 0;
    border: 1px solid rgba(168, 85, 247, 0.5);
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.76), rgba(49, 46, 129, 0.58));
    box-shadow: 0 18px 38px rgba(2, 6, 23, 0.4), 0 0 0 1px rgba(168, 85, 247, 0.14);
    padding: 1rem;
    overflow: hidden;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    filter: none !important;
}

.home-game-draw-head h2 {
    margin: 0;
    color: #f8fafc;
    font-size: 1.08rem;
    text-align: center;
}

.home-game-draw-head p {
    margin: 0.35rem 0 0;
    color: #cbd5e1;
    font-size: 0.9rem;
    text-align: center;
}

.home-game-draw-machine {
    margin-top: 0.9rem;
    position: relative;
}

.home-game-draw-viewport {
    width: calc((112px * 5) + (12px * 4));
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    padding: 0.2rem 0;
    min-height: 146px;
}

.home-game-draw-track {
    display: flex;
    gap: 12px;
    align-items: stretch;
    min-height: 146px;
    transition-property: transform;
    transition-timing-function: cubic-bezier(0.16, 0.88, 0.2, 1);
    will-change: transform;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

.home-game-draw-item {
    position: relative;
    display: block;
    flex: 0 0 112px;
    width: 112px;
    min-width: 112px;
    height: 146px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(15, 23, 42, 0.55);
    box-shadow: 0 10px 18px rgba(2, 6, 23, 0.35);
    backface-visibility: hidden;
    transform: translateZ(0);
}

.home-game-draw-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    z-index: 1;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
}

.home-game-draw-title-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    box-sizing: border-box;
    padding: 0.75rem 0.42rem 0.36rem;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1.15;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
    background: linear-gradient(to top, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    max-height: none;
}

.home-game-draw-fallback {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 0;
    color: #fff;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.25;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
    overflow: hidden;
    z-index: 2;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.88) 0%, rgba(15, 23, 42, 0.2) 46%, rgba(15, 23, 42, 0) 75%), var(--draw-fallback-bg);
}

.home-game-draw-item.is-winner {
    border-color: rgba(251, 146, 60, 0.95);
    box-shadow: 0 0 0 2px rgba(251, 146, 60, 0.65), 0 14px 24px rgba(194, 65, 12, 0.35);
}

.home-game-draw-pointer {
    position: absolute;
    left: 50%;
    top: -2px;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 11px solid transparent;
    border-right: 11px solid transparent;
    border-top: 14px solid #f59e0b;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.45));
    z-index: 2;
}

.home-game-draw-actions {
    margin-top: 0.9rem;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.home-game-draw-result {
    color: #fdba74;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid rgba(251, 146, 60, 0.3);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    background: rgba(15, 23, 42, 0.42);
    max-width: 100%;
}

.home-game-draw-result span {
    color: #fff3e6;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
}

@media (max-width: 730px) {
    .home-game-draw-viewport {
        width: 100%;
    }

    .home-game-draw-card {
        padding-inline: 0.75rem;
    }

    .home-game-draw-result {
        max-width: 100%;
    }

    .home-game-draw-result span {
        max-width: min(72vw, 240px);
    }
}

.home-dash-grid {
    width: min(1140px, calc(100% - 1rem));
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.9rem;
}

/* Default - each card spans 2 of 6 columns (i.e. 3 per row). */
.home-dash-card {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 1rem 1.05rem 1.05rem !important;
    position: relative;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.home-dash-card::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--dash-accent, #fb923c), transparent 85%);
    opacity: 0.95;
    pointer-events: none;
}

.home-dash-card:hover {
    transform: translateY(-2px);
    border-color: rgba(196, 181, 253, 0.55);
    box-shadow: 0 22px 42px rgba(2, 6, 23, 0.45);
}

/* Featured (news) - full row. */
.home-dash-card--feature {
    grid-column: span 6;
}

/* Compact (security / bgg) - smaller block, 2 per row on desktop. */
.home-dash-card--compact {
    grid-column: span 3;
    padding: 0.9rem 1rem 0.95rem !important;
}

@media (max-width: 900px) {
    .home-dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home-dash-card,
    .home-dash-card--feature,
    .home-dash-card--compact { grid-column: span 2; }

    .home-timeline-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .home-timeline-row::before {
        display: none;
    }
}

@media (max-width: 560px) {
    .home-dash-grid { grid-template-columns: 1fr; }
    .home-dash-card,
    .home-dash-card--feature,
    .home-dash-card--compact { grid-column: span 1; }

    .home-timeline-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* --- Head --- */
.home-dash-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.1rem;
    min-width: 0;
}

.home-dash-head h2 {
    margin: 0;
    font-size: 1.02rem !important;
    line-height: 1.3;
    min-width: 0;
}

.home-dash-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--dash-accent, #fb923c) 0%, var(--dash-accent-2, #fbbf80) 100%);
    color: #fff;
    flex: 0 0 auto;
    box-shadow: 0 6px 14px color-mix(in srgb, var(--dash-accent, #fb923c) 40%, transparent);
}

/* Per-card accent colors */
.home-dash-card--news     { --dash-accent: #e07a5f; --dash-accent-2: #f2a65a; }
.home-dash-card--library  { --dash-accent: #f2a65a; --dash-accent-2: #fbbf80; }
.home-dash-card--fav      { --dash-accent: #ec4899; --dash-accent-2: #f472b6; }
.home-dash-card--planner  { --dash-accent: #06b6d4; --dash-accent-2: #38bdf8; }
.home-dash-card--plan     { --dash-accent: #f59e0b; --dash-accent-2: #fbbf24; }
.home-dash-card--security { --dash-accent: #10b981; --dash-accent-2: #34d399; }
.home-dash-card--bgg      { --dash-accent: #f97316; --dash-accent-2: #fb923c; }

/* --- Paragraph --- */
.home-dash-card > p {
    margin: 0;
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* --- Stats row --- */
.home-dash-stats {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 0.45rem;
    margin: 0.1rem 0 0.05rem;
}

.home-dash-stat {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.55rem 0.65rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.55), rgba(30, 41, 59, 0.35));
}

.home-dash-stat strong {
    color: #f8fafc;
    font-size: 1.35rem;
    line-height: 1.05;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.home-dash-stat span {
    color: #94a3b8;
    font-size: 0.7rem;
    line-height: 1.25;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

/* --- List (recent docs / top games) --- */
.home-dash-list {
    list-style: none;
    padding: 0;
    margin: 0.1rem 0 0.15rem;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(15, 23, 42, 0.28);
    overflow: hidden;
}

.home-dash-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.7rem;
    font-size: 0.88rem;
    min-width: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.15s ease;
}

.home-dash-list li:last-child {
    border-bottom: none;
}

.home-dash-list li:hover {
    background: rgba(251, 146, 60, 0.08);
}

.home-dash-list li a {
    color: #fff3e6;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1 1 auto;
}

.home-dash-list li a:hover {
    color: #ffffff;
}

.home-dash-list-meta {
    color: #fdba74;
    font-size: 0.78rem;
    font-weight: 700;
    flex: 0 0 auto;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: rgba(251, 146, 60, 0.14);
    font-variant-numeric: tabular-nums;
}

.home-dash-list-arrow {
    color: #fdba74;
    flex: 0 0 auto;
    opacity: 0.65;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.home-dash-list li:hover .home-dash-list-arrow {
    opacity: 1;
    transform: translateX(2px);
}

/* --- Empty state --- */
.home-dash-empty {
    margin: 0.1rem 0;
    padding: 0.55rem 0.7rem;
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.16);
    color: #cbd5e1;
    font-size: 0.85rem;
    background: rgba(15, 23, 42, 0.25);
    line-height: 1.45;
}

/* --- Favourites chips --- */
.home-dash-fav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.05rem 0 0.1rem;
}

.home-dash-fav-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.7rem 0.3rem 0.35rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.14), rgba(242, 166, 90, 0.14));
    color: #f5d0fe;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    max-width: 100%;
    min-width: 0;
    transition: transform 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.home-dash-fav-chip:hover {
    border-color: rgba(236, 72, 153, 0.5);
    color: #ffffff;
    transform: translateY(-1px);
}

.home-dash-fav-chip img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
    border: 1px solid rgba(255,255,255,0.18);
}

.home-dash-fav-chip span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.home-dash-fav-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ec4899, #fbbf80);
    flex: 0 0 auto;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.1);
}

/* --- Actions row --- */
.home-dash-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: auto;
    padding-top: 0.35rem;
}

/* --- Plan card extras --- */
.home-dash-plan-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0.1rem 0 0.05rem;
}

.home-dash-plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.home-dash-plan-free {
    background: rgba(148, 163, 184, 0.18);
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.35);
}

.home-dash-plan-pro {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: #1f1300;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 6px 14px rgba(245, 158, 11, 0.35);
}

.home-dash-plan-usage {
    display: inline-flex;
    align-items: baseline;
    gap: 0.3rem;
    color: #f8fafc;
    font-weight: 800;
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
}

.home-dash-plan-usage small {
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.home-dash-progress {
    height: 6px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
    overflow: hidden;
    margin: 0.15rem 0 0.15rem;
}

.home-dash-progress > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    border-radius: inherit;
    transition: width 0.3s ease;
}

/* ================== Light theme overrides ================== */
.page.theme-light .home-dash-card {
    border-color: #f0e3cb;
    box-shadow: 0 10px 22px rgba(30, 41, 59, 0.08);
}

.page.theme-light .home-planner-overview {
    border-color: #f0e3cb;
    background: linear-gradient(145deg, #ffffff, #fffaf0);
    box-shadow: 0 12px 24px rgba(30, 41, 59, 0.08);
}

.page.theme-light .home-planner-overview .planner-overview-head h3 {
    color: #0f172a;
}

.page.theme-light .home-planner-overview .planner-overview-head-icon {
    color: #082f49;
    background: linear-gradient(135deg, #7dd3fc 0%, #bae6fd 100%);
    box-shadow: 0 6px 14px rgba(14, 116, 144, 0.2);
}

.page.theme-light .home-planner-overview .planner-small {
    color: #64748b;
}

.page.theme-light .home-planner-overview .planner-overview-kpi {
    border-color: #f0e3cb;
    background: linear-gradient(145deg, #ffffff, #fff7ed);
    box-shadow: 0 8px 18px rgba(59, 130, 246, 0.1);
}

.page.theme-light .home-planner-overview .planner-overview-kpi:nth-child(1) {
    background:
        linear-gradient(90deg, rgba(37, 99, 235, 0) 0%, rgba(37, 99, 235, 0.26) 100%),
        linear-gradient(145deg, #ffffff, #fff7ed);
}

.page.theme-light .home-planner-overview .planner-overview-kpi:nth-child(2) {
    background:
        linear-gradient(90deg, rgba(147, 51, 234, 0) 0%, rgba(147, 51, 234, 0.24) 100%),
        linear-gradient(145deg, #ffffff, #fff7ed);
}

.page.theme-light .home-planner-overview .planner-overview-kpi:nth-child(3) {
    background:
        linear-gradient(90deg, rgba(22, 163, 74, 0) 0%, rgba(22, 163, 74, 0.24) 100%),
        linear-gradient(145deg, #ffffff, #fff7ed);
}

.page.theme-light .home-planner-overview .planner-overview-kpi:nth-child(4) {
    background:
        linear-gradient(90deg, rgba(217, 119, 6, 0) 0%, rgba(217, 119, 6, 0.26) 100%),
        linear-gradient(145deg, #ffffff, #fff7ed);
}

.page.theme-light .home-planner-overview .planner-overview-kpi strong {
    color: #0f172a;
}

.page.theme-light .home-planner-overview .planner-overview-kpi span {
    color: #334155;
}

.page.theme-light .home-planner-overview .planner-overview-top-title {
    color: #475569;
}

.page.theme-light .home-planner-overview .planner-overview-top-btn {
    border-color: #f0e3cb;
    background: linear-gradient(145deg, #ffffff, #fffaf0);
    text-decoration: none;
}

.page.theme-light .home-planner-overview .planner-overview-top-thumb {
    border-color: #fed7aa;
}

.page.theme-light .home-planner-overview .planner-overview-top-thumb-fallback {
    color: #431407;
    background: linear-gradient(135deg, #dbeafe, #fed7aa);
}

.page.theme-light .home-planner-overview .planner-overview-top-name {
    color: #0f172a;
}

.page.theme-light .home-planner-overview .planner-overview-top-meta {
    color: #64748b;
}

.page.theme-light .home-planner-overview .planner-overview-top-name-icon {
    color: #0c4a6e;
    background: rgba(2, 132, 199, 0.12);
}

.page.theme-light .home-timeline-card {
    border-color: #cfe7ff;
    background: linear-gradient(145deg, #ffffff, #fffaf0);
    box-shadow: 0 12px 24px rgba(30, 41, 59, 0.08);
}

.page.theme-light .home-timeline-head h3 {
    color: #0f172a;
}

.page.theme-light .home-timeline-title {
    color: #1e293b;
}

.page.theme-light .home-timeline-date {
    color: #9a3412;
}

.page.theme-light .home-dash-card:hover {
    border-color: #fdba74;
    box-shadow: 0 18px 34px rgba(194, 65, 12, 0.14);
}

.page.theme-light .home-dash-card > p {
    color: #4b5563;
}

.page.theme-light .home-dash-stat {
    background: #fffaf0;
    border-color: #f0e3cb;
}

.page.theme-light .home-dash-stat strong {
    color: #111827;
}

.page.theme-light .home-dash-stat span {
    color: #6b7280;
}

.page.theme-light .home-dash-list {
    background: #ffffff;
    border-color: #f0e3cb;
}

.page.theme-light .home-dash-list li {
    border-bottom-color: #fff7ed;
}

.page.theme-light .home-dash-list li:hover {
    background: #fffbf2;
}

.page.theme-light .home-dash-list li a {
    color: #9a3412;
}

.page.theme-light .home-dash-list li a:hover {
    color: #7c2d12;
}

.page.theme-light .home-dash-list-meta {
    color: #c2410c;
    background: #fff7ed;
}

.page.theme-light .home-dash-list-arrow {
    color: #e07a5f;
}

.page.theme-light .home-dash-empty {
    color: #4b5563;
    border-color: #fed7aa;
    background: #fff7ed;
}

.page.theme-light .home-dash-fav-chip {
    background: #fdf2f8;
    border-color: #fbcfe8;
    color: #9d174d;
}

.page.theme-light .home-dash-fav-chip:hover {
    border-color: #ec4899;
    color: #831843;
}

.page.theme-light .home-dash-fav-chip img {
    border-color: #fbcfe8;
}

.page.theme-light .home-dash-plan-free {
    background: #fff7ed;
    color: #9a3412;
    border-color: #fed7aa;
}

.page.theme-light .home-dash-plan-usage {
    color: #111827;
}

.page.theme-light .home-dash-plan-usage small {
    color: #6b7280;
}

.page.theme-light .home-dash-progress {
    background: #fde68a;
}

/* ============================================================
   Guest landing page polish (hero badges + features grid)
   ============================================================ */
.home-intro-badges {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.home-intro-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff7ed;
    font-size: 0.78rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.home-intro-badge svg {
    color: #fed7aa;
}

.home-intro-badge--news svg     { color: #93c5fd; }
.home-intro-badge--ai svg       { color: #f0abfc; }
.home-intro-badge--planner svg  { color: #67e8f9; }

.home-features-grid {
    width: min(920px, calc(100% - 1rem));
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}

@media (max-width: 980px) {
    .home-features-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .home-features-grid {
        grid-template-columns: 1fr;
    }
}

.home-feature-tile {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: linear-gradient(155deg, rgba(15, 23, 42, 0.82), rgba(30, 27, 75, 0.58));
    padding: 1rem 1.05rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.home-feature-tile::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--ftile-accent, #fbbf80), transparent 85%);
}

.home-feature-tile:hover {
    transform: translateY(-3px);
    border-color: rgba(196, 181, 253, 0.5);
    box-shadow: 0 22px 42px rgba(2, 6, 23, 0.5);
}

.home-feature-tile-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ftile-accent, #fb923c) 0%, var(--ftile-accent-2, #fbbf80) 100%);
    color: #fff;
    box-shadow: 0 8px 18px color-mix(in srgb, var(--ftile-accent, #fb923c) 35%, transparent);
    margin-bottom: 0.15rem;
}

.home-feature-tile h3 {
    margin: 0;
    color: #f8fafc;
    font-size: 1.02rem;
    line-height: 1.3;
}

.home-feature-tile p {
    margin: 0;
    color: #cbd5e1;
    font-size: 0.88rem;
    line-height: 1.5;
}

.home-feature-tile--news     { --ftile-accent: #e07a5f; --ftile-accent-2: #f2a65a; }
.home-feature-tile--library  { --ftile-accent: #f2a65a; --ftile-accent-2: #fbbf80; }
.home-feature-tile--ai       { --ftile-accent: #d946ef; --ftile-accent-2: #f472b6; }
.home-feature-tile--bgg      { --ftile-accent: #22c55e; --ftile-accent-2: #86efac; }
.home-feature-tile--planner  { --ftile-accent: #06b6d4; --ftile-accent-2: #38bdf8; }
.home-feature-tile--stats    { --ftile-accent: #6366f1; --ftile-accent-2: #a78bfa; }

/* Light theme overrides */
.page.theme-light .home-intro-badges {
    /* hero gradient is dark, so keep badges readable */
}

.page.theme-light .home-feature-tile {
    background: linear-gradient(150deg, #ffffff 0%, #fffaf0 100%);
    border-color: #f0e3cb;
    box-shadow: 0 10px 22px rgba(30, 41, 59, 0.08);
}

.page.theme-light .home-feature-tile:hover {
    border-color: #fdba74;
    box-shadow: 0 18px 34px rgba(194, 65, 12, 0.14);
}

.page.theme-light .home-feature-tile h3 {
    color: #111827;
}

.page.theme-light .home-feature-tile p {
    color: #4b5563;
}




/* === Sidebar / NavMenu: keep DOM stable, swap visibility via CSS only === */
.navbar-brand-logo-mark { display: none; }
.navbar-brand-logo-wordmark { display: inline-block; }
.nav-wrapper.nav-collapsed .navbar-brand-logo-wordmark { display: none; }
.nav-wrapper.nav-collapsed .navbar-brand-logo-mark { display: inline-block; }
.nav-link-label { display: inline-flex; align-items: center; gap: .35rem; min-width: 0; flex: 1; overflow: hidden; }
.nav-wrapper.nav-collapsed .nav-link-label { display: none; }
.nav-wrapper, .nav-wrapper * { will-change: auto; }
.sidebar { will-change: width; transform: translateZ(0); }

/* Final mobile hardening for authenticated home dashboard.
   Kept at the end of file so it wins over earlier generic/home card rules. */
@media (max-width: 768px) {
    .nav-wrapper.nav-collapsed .navbar-brand-logo-wordmark {
        display: inline-block !important;
        height: 38px !important;
        width: auto !important;
        max-width: clamp(160px, 48vw, 220px) !important;
    }

    .nav-wrapper.nav-collapsed .navbar-brand-logo-mark {
        display: none !important;
    }

    .home-auth-shell,
    .home-auth-shell .home-app-grid,
    .home-auth-shell .home-dash-grid,
    .home-auth-shell .home-planner-overview,
    .home-auth-shell .home-timeline-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .home-auth-shell .home-dash-grid {
        margin-inline: 0;
    }

    .home-auth-shell .home-dash-head {
        align-items: flex-start;
        min-width: 0;
    }

    .home-auth-shell .home-dash-head h2,
    .home-auth-shell .home-dash-card > p {
        min-width: 0;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .home-auth-shell .home-dash-list li {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 0.45rem;
        row-gap: 0.2rem;
        align-items: start;
    }

    .home-auth-shell .home-dash-list li a {
        display: block;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.3;
    }

    .home-auth-shell .planner-overview-head {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .home-auth-shell .planner-overview-top-btn {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        justify-content: start;
        align-items: start;
        gap: 0.25rem;
    }

    .home-auth-shell .planner-overview-top-name,
    .home-auth-shell .planner-overview-top-meta {
        min-width: 0;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.25;
    }

    .home-auth-shell .planner-overview-top-meta {
        font-size: 0.78rem;
    }
}

/* === Mobile guard: the desktop rail/icons-only collapse mode must never appear
   on mobile. We hide only the inline desktop-only toggle button (the one that
   lives inside the nav items list and would re-enter the rail state); the
   regular hamburger in the top-row stays visible so the user can still close
   and reopen the menu on mobile. Lives at the very end of the file so it wins
   over earlier `.nav-collapsed` declarations regardless of source order. === */
@media (max-width: 768px) {
    .nav-toggle-desktop-wrap {
        display: none !important;
    }
}



