#app {
    max-width: 1120px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    padding: clamp(14px, 2.6vw, 24px);
    display: flex;
    flex-direction: column;
}

.home-shell {
    flex: 1;
}

.home-topbar,
.nav-card {
    border-radius: 30px;
}

.home-topbar,
.nav-card {
    padding: clamp(18px, 3vw, 26px);
}

.home-topbar {
    padding: clamp(12px, 2vw, 16px) clamp(16px, 2.6vw, 22px);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(126,182,255,.26);
    background: rgba(126,182,255,.12);
    color: #dceaff;
    font-size: 13px;
    font-weight: 800;
}

.hero-title {
    margin: 10px 0 6px;
    font-size: clamp(30px, 5vw, 48px);
}

.hero-title span {
    color: var(--primary-green);
}

.hero-copy {
    max-width: 760px;
    font-size: 14px;
    line-height: 1.5;
}

.nav-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 330px;
}

.nav-icon {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    background: rgba(255,255,255,.08);
    font-size: 34px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.nav-meta {
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.nav-card h2 {
    margin: 0;
    font-size: clamp(28px, 4vw, 40px);
    letter-spacing: -.05em;
}

.nav-card h2,
.nav-card p,
.nav-meta,
.nav-icon,
.nav-link {
    position: relative;
    z-index: 1;
}

.nav-card p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.68;
}

.home-history {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 10px;
    margin-top: 4px;
    padding: 14px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 20px;
    background: rgba(255,255,255,.055);
}

.home-history-title {
    color: var(--text-main);
    font-size: 15px;
    font-weight: 900;
}

.home-history-list {
    display: grid;
    gap: 8px;
}

.home-history-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,.10);
}

.home-history-row:first-child {
    padding-top: 0;
    border-top: 0;
}

.home-history-main {
    color: var(--text-main);
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-history-sub,
.home-history-empty {
    color: var(--text-muted);
    font-size: 13px;
}

.home-history-badge {
    padding: 6px 9px;
    border-radius: 999px;
    background: var(--input-bg);
    color: var(--primary-green);
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.home-history-badge.pending {
    background: rgba(126,182,255,.13);
    color: #cfe2ff;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    min-height: 56px;
    padding: 0 20px;
    border-radius: 18px;
    background: var(--primary-green);
    color: #102019;
    font-weight: 900;
    box-shadow: 0 0 32px rgba(119,224,182,.22), 0 18px 34px rgba(0,0,0,.30);
}

.nav-link.secondary {
    background: var(--accent);
    color: #10192A;
    box-shadow: 0 0 32px rgba(126,182,255,.18), 0 18px 34px rgba(0,0,0,.30);
}

@media (min-width: 921px) {
    .home-workbench {
        min-height: 360px;
    }
}

@media (max-width: 760px) {
    #app { padding: 14px 12px; }
    .home-topbar,
    .nav-card { border-radius: 24px; }
    .home-topbar,
    .nav-card { padding: 18px; }
    .home-topbar { padding-top: 44px; }
    .nav-card { min-height: auto; }
    .hero-title { margin-top: 8px; }
    .hero-copy { font-size: 15px; }
    .nav-link { min-height: 52px; }
    .home-history-main { white-space: normal; }
}

.top-auth {
    position: absolute;
    top: 14px;
    right: 18px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-auth-link,
.top-auth-status {
    border: 0;
    background: transparent;
    color: #dceaff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    padding: 4px 1px;
}

.top-auth-link:hover {
    color: #9fd8ff;
}

.top-auth-status {
    color: #dceaff;
    cursor: default;
}

#login-entry,
#register-entry {
    color: #8ed8ff;
}

#activate-entry {
    color: #ffe082;
}

#account-entry {
    color: #62f0b6;
}

.top-auth-status#activated-label {
    color: #dceaff;
}

#logout-btn {
    color: #ffb7b7;
}

.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 30;
}

.auth-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 10, 20, 0.42);
    backdrop-filter: blur(2px);
    pointer-events: none;
}

.auth-dialog {
    position: absolute;
    z-index: 1;
    width: min(320px, calc(100vw - 28px));
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 14px;
    border-radius: 18px;
    background: rgba(7, 16, 36, 0.96);
    border: 1px solid rgba(126, 182, 255, 0.2);
    box-shadow: 0 18px 50px rgba(0,0,0,.35);
    backdrop-filter: blur(14px);
}

.auth-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.auth-modal-title {
    color: #8ed8ff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.auth-modal-close {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 50%;
    background: rgba(255,255,255,.05);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.auth-modal-close:hover {
    background: rgba(255,255,255,.1);
}

.auth-status {
    color: #dceaff;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 12px;
}

.auth-form-card,
.redeem-box {
    display: grid;
    gap: 10px;
    padding: 0;
    border: 0;
    background: transparent;
}

.auth-form-card h2 {
    margin: 0;
    font-size: 18px;
}

.info-line {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
    color: rgba(220, 234, 255, 0.72);
    font-size: 13px;
}

.info-line strong {
    display: block;
    margin-bottom: 4px;
    color: #ffffff;
    font-size: 13px;
}

.info-line span {
    color: #dceaff;
    font-weight: 700;
}

.auth-text-btn {
    border: 0;
    background: transparent;
    color: #9fd8ff;
    cursor: pointer;
    padding: 4px 0;
    text-align: left;
    font-weight: 700;
    font-size: 13px;
}

.auth-text-btn:hover {
    color: var(--primary-green);
}

.auth-submit-btn {
    width: 100%;
    border: 0;
    border-radius: 12px;
    padding: 12px 14px;
    color: #07111f;
    font-weight: 800;
    font-size: 14px;
    background: linear-gradient(135deg, #8ed8ff, #62f0b6);
    box-shadow: 0 10px 24px rgba(78, 186, 255, .18);
    cursor: pointer;
    transition: transform .15s ease, filter .15s ease;
}

.auth-submit-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}

.auth-popover input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    padding: 10px 12px;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.nav-link.disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.hidden {
    display: none !important;
}

@media (max-width: 720px) {
    .top-auth {
        top: 10px;
        right: 12px;
        gap: 6px;
        flex-wrap: nowrap;
        width: auto;
        max-width: calc(100vw - 24px);
        justify-content: flex-end;
        overflow-x: auto;
        padding-left: 8px;
    }

    .auth-dialog {
        width: min(320px, calc(100vw - 24px));
    }

    .top-auth-link,
    .top-auth-status {
        font-size: 12px;
        padding: 3px 1px;
        white-space: nowrap;
        flex: 0 0 auto;
    }

    .nav-card {
        margin-top: 12px;
    }
}

@media (orientation: landscape) {
    .home-shell {
        transform: scale(.88);
        transform-origin: top center;
    }

    .nav-card {
        gap: 10px;
        min-height: 250px;
        padding: clamp(14px, 2vw, 18px);
    }

    .nav-card h2 {
        font-size: clamp(24px, 3vw, 32px);
    }

    .nav-card p {
        line-height: 1.5;
    }

    .home-history {
        gap: 8px;
        padding: 12px;
    }

    .nav-link {
        min-height: 48px;
    }
}

@media (orientation: landscape) and (max-height: 560px) {
    .hero-title { font-size: clamp(30px, 5vw, 44px); }
    .nav-card { min-height: 250px; }
    .nav-icon { width: 56px; height: 56px; font-size: 28px; }
}
