:root {
    --brand: #cc1f7a;
    --dark: #171412;
    --ink: #171717;
    --muted: #6c665f;
    --line: rgba(23, 23, 23, 0.05);
    --shadow-soft: 0 16px 34px rgba(25, 20, 18, 0.08);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

body.public-app-layout {
    background: #f8fafc;
}

/* Common Header Styles */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    background: rgba(255, 255, 255, 0.84);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brand-lockup {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.brand-name {
    font-size: 29px;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--brand);
}

.brand-caption {
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(23, 23, 23, 0.42);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.text-link, .ghost-link, .brand-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
}

.text-link { color: rgba(23, 23, 23, 0.62); }
.text-link.active-link { color: var(--brand); }
.ghost-link {
    padding: 12px 18px;
    border: 1px solid rgba(23, 23, 23, 0.1);
    background: rgba(255, 255, 255, 0.54);
}
.ghost-link.active-link {
    color: var(--brand);
    border-color: rgba(204, 31, 122, 0.18);
    background: rgba(204, 31, 122, 0.08);
}
.brand-button {
    padding: 14px 22px;
    background: linear-gradient(135deg, var(--dark), #2c2522);
    color: #fff;
    box-shadow: 0 12px 28px rgba(17, 17, 17, 0.18);
}

.logout-button {
    border: 0;
    background: transparent;
    color: rgba(23, 23, 23, 0.62);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

/* Mobile Nav */
.mobile-nav { display: none; }
.mobile-app-header,
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    .container {
        padding: 0 14px;
    }

    .public-app-layout .site-header {
        display: none;
    }

    .public-app-layout .app-main {
        min-height: calc(100vh - 132px);
        padding-top: 74px;
        padding-bottom: calc(70px + var(--safe-bottom));
    }

    .public-app-layout .mobile-app-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        display: block;
        z-index: 1200;
        padding-top: env(safe-area-inset-top, 0px);
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        border-bottom: 1px solid rgba(23, 23, 23, 0.06);
    }

    .public-app-layout .mobile-app-header__inner {
        min-height: 74px;
        padding: 0 16px;
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        align-items: center;
        gap: 10px;
    }

    .public-app-layout .mobile-app-brand {
        grid-column: 1 / span 2;
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-width: 0;
    }

    .public-app-layout .mobile-app-brand strong {
        font-size: 20px;
        line-height: 1.1;
        font-weight: 900;
        letter-spacing: -0.04em;
        color: var(--brand);
    }

    .public-app-layout .mobile-app-brand span {
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        color: rgba(23, 23, 23, 0.44);
    }

    .public-app-layout .mobile-app-back,
    .public-app-layout .mobile-app-action {
        width: 44px;
        height: 44px;
        border-radius: 14px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: var(--ink);
        border: 1px solid rgba(23, 23, 23, 0.08);
        background: rgba(255, 255, 255, 0.86);
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    }

    .public-app-layout .mobile-app-title {
        min-width: 0;
        font-size: 17px;
        font-weight: 800;
        letter-spacing: -0.03em;
        color: #111827;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-inner {
        min-height: 68px;
        gap: 10px;
    }

    .brand-name {
        font-size: 18px;
    }

    .brand-caption {
        font-size: 9px;
        letter-spacing: 0.14em;
    }

    .text-link,
    .ghost-link,
    .brand-button,
    .logout-button {
        display: none !important;
    }

    .header-actions {
        gap: 8px;
        margin-left: auto;
    }

    .mobile-nav { display: block; position: relative; }
    .mobile-nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 12px;
        border: 1px solid rgba(23, 23, 23, 0.1);
        background: rgba(255, 255, 255, 0.7);
        color: var(--ink);
        font-size: 16px;
        cursor: pointer;
    }
    .mobile-nav-panel {
        position: absolute;
        top: calc(100% + 12px);
        right: 0;
        min-width: 220px;
        padding: 14px;
        border-radius: 20px;
        background: rgba(255, 250, 242, 0.98);
        border: 1px solid rgba(23, 23, 23, 0.08);
        box-shadow: var(--shadow-soft);
        display: grid;
        gap: 8px;
        z-index: 1001;
    }
    .mobile-nav-panel a {
        padding: 10px;
        font-weight: 700;
        color: var(--ink);
    }

    .public-app-layout .mobile-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: stretch;
        gap: 0;
        padding: 8px 0 calc(8px + var(--safe-bottom));
        z-index: 1250;
        background: rgba(255, 255, 255, 0.98);
        border-top: 1px solid rgba(23, 23, 23, 0.08);
        box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.06);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    .public-app-layout .mobile-bottom-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        min-height: 54px;
        color: #64748b;
        font-size: 11px;
        font-weight: 800;
        letter-spacing: -0.02em;
    }

    .public-app-layout .mobile-bottom-nav a i {
        font-size: 17px;
    }

    .public-app-layout .mobile-bottom-nav a.active {
        color: var(--brand);
    }

    .public-app-layout .site-footer {
        padding: 48px 0 120px;
        margin-top: 28px;
    }

    .public-app-layout .footer-brand-name {
        font-size: 20px;
        margin-bottom: 10px;
    }

    .public-app-layout .footer-text,
    .public-app-layout .footer-links a,
    .public-app-layout .footer-bottom {
        font-size: 13px;
    }
}

/* Common Footer Styles */
.site-footer {
    padding: 80px 0;
    background: #fff;
    border-top: 1px solid var(--line);
    margin-top: 50px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 48px;
    margin-bottom: 60px;
}

.footer-brand-name {
    font-size: 24px;
    font-weight: 800;
    color: var(--brand);
    margin-bottom: 16px;
}

.footer-text {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.7;
    max-width: 360px;
}

.footer-heading {
    font-size: 15px;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 24px;
}

.footer-links {
    display: grid;
    gap: 12px;
}

.footer-links a {
    font-size: 14px;
    color: var(--muted);
    transition: color 0.2s;
}

.footer-links a:hover { color: var(--brand); }

.footer-bottom {
    font-size: 13px;
    color: rgba(23, 23, 23, 0.4);
    line-height: 1.8;
}

@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; gap: 40px; }
}
