:root {
    --sheetgenie-topbar-offset: 108px;
}

.landing-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(11, 28, 49, 0.78);
    border-bottom: 1px solid rgba(77, 114, 160, 0.22);
    box-shadow: 0 10px 26px rgba(3, 12, 24, 0.22);
    backdrop-filter: blur(16px);
}

.landing-topbar-inner {
    width: min(1240px, calc(100vw - 24px));
    min-height: 74px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.landing-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #eef6ff;
    font-weight: 800;
    text-decoration: none;
    flex-shrink: 0;
}

.landing-brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(135deg, #4b80f4, #3568df);
    box-shadow: 0 12px 24px rgba(27, 76, 160, 0.28);
}

.landing-brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.landing-brand-text {
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.landing-nav {
    display: flex;
    align-items: center;
    gap: clamp(12px, 1.35vw, 20px);
    justify-content: center;
    flex: 1 1 auto;
    min-width: 0;
}

.landing-nav a {
    color: #a9bfdc;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.landing-nav a:hover,
.landing-nav a[aria-current="page"] {
    color: #f2f8ff;
}

.landing-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    position: relative;
}

.modechrome-lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    border: 1px solid rgba(96, 142, 201, 0.34);
    background: rgba(24, 52, 85, 0.72);
    box-shadow: 0 10px 20px rgba(3, 12, 24, 0.14);
}

.modechrome-lang-btn {
    min-width: 34px;
    height: 30px;
    border: 0;
    border-radius: 999px;
    padding: 0 10px;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: #d2e4ff;
    background: transparent;
    transition: background 0.2s ease, color 0.2s ease;
}

.modechrome-lang-btn.is-active,
.modechrome-lang-btn.active {
    color: #ffffff;
    background: linear-gradient(135deg, #4278f1, #3164de);
}

.landing-btn {
    min-height: 44px;
    padding: 0 18px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 0.96rem;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.landing-btn:hover {
    transform: translateY(-1px);
}

.landing-btn-primary {
    color: #ffffff;
    background: linear-gradient(135deg, #4278f1, #3164de);
    box-shadow: 0 12px 22px rgba(61, 115, 239, 0.22);
}

.landing-btn-secondary {
    color: #eef6ff;
    background: rgba(24, 52, 85, 0.72);
    border: 1px solid rgba(96, 142, 201, 0.34);
    box-shadow: 0 10px 20px rgba(3, 12, 24, 0.14);
}

.landing-menu-btn {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(116, 167, 225, 0.28);
    background: rgba(13, 32, 54, 0.78);
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-direction: column;
    cursor: pointer;
}

.landing-mobile-topbar-cta.landing-btn {
    display: none !important;
}

.landing-menu-btn span {
    width: 18px;
    height: 2px;
    border-radius: 99px;
    background: #eaf4ff;
}

.landing-mobile-menu {
    display: none;
}

.landing-mobile-menu[hidden] {
    display: none !important;
}

.topbar-account-wrap {
    position: relative;
}

.topbar-account {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 168px;
    padding: 8px 12px;
    border-radius: 14px;
    border: 1px solid rgba(96, 142, 201, 0.24);
    background: rgba(18, 44, 74, 0.54);
    box-shadow: 0 10px 20px rgba(3, 12, 24, 0.12);
    cursor: pointer;
}

.topbar-account-copy {
    display: grid;
    gap: 2px;
    text-align: left;
}

.topbar-account-label {
    color: #c8dbf2;
    font-size: 0.72rem;
    line-height: 1.2;
}

.topbar-account-value {
    color: #f4f9ff;
    font-size: 0.88rem;
    line-height: 1.25;
    font-weight: 800;
}

.topbar-account-avatar,
.topbar-menu-avatar {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3f8bf5, #3164de);
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.topbar-account-caret {
    color: #d9e8ff;
    font-size: 0.78rem;
    margin-left: auto;
}

.topbar-account-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: min(360px, calc(100vw - 24px));
    padding: 12px;
    border-radius: 18px;
    border: 1px solid rgba(87, 128, 181, 0.28);
    background: rgba(10, 25, 44, 0.96);
    box-shadow: 0 22px 48px rgba(2, 10, 20, 0.34);
    backdrop-filter: blur(18px);
}

.topbar-account-menu[hidden] {
    display: none;
}

.topbar-menu-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding: 10px 10px 12px;
    border-radius: 16px;
    border: 1px solid rgba(87, 128, 181, 0.24);
    background: rgba(18, 44, 74, 0.54);
}

.topbar-menu-copy {
    display: grid;
    gap: 3px;
}

.topbar-menu-name {
    color: #f3f9ff;
    font-size: 0.98rem;
}

.topbar-menu-plan {
    color: #c8dbf2;
    font-size: 0.82rem;
}

.topbar-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(87, 128, 181, 0.2);
    background: rgba(16, 38, 63, 0.72);
    color: inherit;
    text-decoration: none;
    text-align: left;
}

.topbar-menu-item[hidden] {
    display: none !important;
}

.topbar-menu-item:first-of-type {
    margin-top: 0;
}

.topbar-menu-item--danger {
    background: rgba(73, 23, 34, 0.82);
}

.topbar-menu-item:hover {
    background: rgba(25, 58, 94, 0.82);
}

.topbar-menu-item--danger:hover {
    background: rgba(108, 28, 48, 0.92);
}

.topbar-menu-icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    border: 1px solid rgba(100, 142, 198, 0.26);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #eaf4ff;
    font-size: 1.02rem;
    line-height: 1;
    flex-shrink: 0;
}

.topbar-menu-text {
    display: grid;
    gap: 2px;
}

.topbar-menu-text strong {
    color: #f3f9ff;
    font-size: 0.9rem;
}

.topbar-menu-text small {
    color: #b5cde8;
    font-size: 0.74rem;
}

@media (max-width: 1100px) {
    .landing-topbar-inner {
        min-height: 72px;
        gap: 10px;
    }

    .landing-nav {
        gap: 10px;
    }

    .landing-nav a {
        font-size: 0.82rem;
    }

    .landing-topbar-actions {
        gap: 8px;
    }

    .landing-topbar-actions .landing-btn {
        min-height: 40px;
        padding: 0 12px;
        font-size: 0.84rem;
    }
}

@media (max-width: 1180px) {
    .landing-nav {
        display: none;
    }

    .landing-menu-btn {
        display: inline-flex !important;
        flex-shrink: 0;
    }
}

@media (max-width: 860px) {
    :root {
        --sheetgenie-topbar-offset: 128px;
    }
}

@media (max-width: 760px) {
    :root {
        --sheetgenie-topbar-offset: 92px;
    }

    .landing-topbar-inner {
        width: min(100vw - 24px, 620px);
        min-height: 64px;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        padding: 8px 0;
    }

    .landing-brand {
        min-width: 0;
        flex: 1 1 auto;
        gap: 10px;
    }

    .landing-brand-mark {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        flex: 0 0 auto;
    }

    .landing-brand-text {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 1rem;
    }

    .landing-mobile-topbar-cta.landing-btn {
        display: inline-flex !important;
        order: 2;
        min-height: 42px;
        padding: 0 14px;
        border-radius: 13px;
        font-size: 0.86rem;
        white-space: nowrap;
        flex: 0 0 auto;
    }

    .landing-menu-btn {
        display: inline-flex;
        order: 3;
        margin-left: 0;
        flex-shrink: 0;
    }

    .landing-nav {
        display: none;
    }

    .landing-topbar-actions {
        display: none;
    }

    .landing-mobile-menu {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        width: min(100vw - 24px, 620px);
        max-height: calc(100dvh - 84px);
        overflow-y: auto;
        overscroll-behavior: contain;
        margin: 8px auto 12px;
        padding: 12px;
        border-radius: 20px;
        border: 1px solid rgba(109, 154, 211, 0.18);
        background:
            linear-gradient(180deg, rgba(14, 36, 63, 0.97), rgba(10, 26, 49, 0.97)),
            radial-gradient(circle at top right, rgba(120, 168, 255, 0.16), transparent 28%);
        box-shadow: 0 18px 36px rgba(3, 10, 20, 0.34);
    }

    .landing-mobile-menu a {
        min-height: 46px;
        border-radius: 13px;
        border: 1px solid rgba(115, 160, 218, 0.12);
        background: rgba(16, 39, 66, 0.78);
        display: inline-flex;
        align-items: center;
        justify-content: flex-start;
        color: #dbeaff;
        text-decoration: none;
        font-size: 0.88rem;
        font-weight: 750;
        line-height: 1.25;
        padding: 11px 12px;
    }

    .landing-mobile-menu a[aria-current="page"] {
        color: #ffffff;
        border-color: rgba(84, 153, 244, 0.42);
        background: rgba(49, 100, 222, 0.28);
    }

    .landing-mobile-menu-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .landing-mobile-menu-actions .landing-btn {
        width: 100%;
    }

    .landing-mobile-account {
        display: grid;
        gap: 10px;
        padding: 12px;
        border-radius: 14px;
        border: 1px solid rgba(96, 142, 201, 0.2);
        background: rgba(18, 44, 74, 0.5);
    }

    .landing-mobile-account-summary {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .landing-mobile-account-avatar {
        width: 38px;
        height: 38px;
        border-radius: 12px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, #3f8bf5, #3164de);
        color: #ffffff;
        font-weight: 800;
    }

    .landing-mobile-account-copy {
        display: grid;
        gap: 2px;
        min-width: 0;
    }

    .landing-mobile-account-copy strong {
        color: #f4f9ff;
        font-size: 0.94rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .landing-mobile-account-copy span {
        color: #c8dbf2;
        font-size: 0.8rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .landing-mobile-account-links {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .landing-mobile-account-links a,
    .landing-mobile-logout {
        min-height: 40px;
        border-radius: 12px;
        border: 1px solid rgba(86, 126, 181, 0.24);
        background: rgba(16, 39, 66, 0.78);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: #dbeaff;
        text-decoration: none;
        font-size: 0.84rem;
        font-weight: 700;
        padding: 0 10px;
        text-align: center;
    }

    .landing-mobile-logout {
        cursor: pointer;
        background: rgba(106, 31, 55, 0.24);
        color: #ffe3ea;
    }

    .landing-mobile-lang-switch {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        margin-left: auto;
    }
}

@media (max-width: 540px) {
    :root {
        --sheetgenie-topbar-offset: 84px;
    }

    .landing-topbar-inner {
        width: calc(100vw - 20px);
    }

    .landing-mobile-menu {
        width: calc(100vw - 20px);
        padding: 10px;
        border-radius: 18px;
    }

    .landing-mobile-topbar-cta.landing-btn {
        min-height: 40px;
        padding: 0 12px;
        font-size: 0.82rem;
    }

    .landing-brand-text {
        display: inline;
        font-size: 0.95rem;
    }

    .landing-mobile-menu-actions,
    .landing-mobile-account-links {
        grid-template-columns: 1fr;
    }
}
