.app-bar__right {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.account-trigger,
.account-signin {
    flex: 0 0 auto;
}

.account-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 40px;
    padding: 0.25rem 0.65rem 0.25rem 0.3rem;
    border: 1px solid rgba(245, 240, 229, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--hub-ivory);
    font: inherit;
    cursor: pointer;
}

.account-trigger:hover,
.account-trigger:focus-visible {
    background: rgba(255, 255, 255, 0.11);
    outline: none;
}

.account-trigger img {
    width: 31px;
    height: 31px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(197, 170, 111, 0.7);
}

.account-trigger span {
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-trigger b {
    color: rgba(245, 240, 229, 0.6);
    font-weight: 400;
}

.account-signin {
    padding: 0.55rem 0.8rem;
    border: 1px solid rgba(197, 170, 111, 0.52);
    color: var(--hub-ivory);
    text-decoration: none;
}

.profile-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(2, 8, 6, 0.56);
    backdrop-filter: blur(3px);
}

.profile-drawer {
    position: absolute;
    inset: 0 0 0 auto;
    width: min(430px, calc(100vw - 18px));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    background: linear-gradient(155deg, #10261f, #0b1c17 64%, #091510);
    color: var(--hub-ivory);
    border-left: 1px solid rgba(181, 154, 101, 0.4);
    box-shadow: -24px 0 70px rgba(0, 0, 0, 0.42);
}

.profile-drawer__header {
    min-height: 84px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem 0.9rem 1.35rem;
    border-bottom: 1px solid rgba(245, 240, 229, 0.11);
    background: rgba(255, 255, 255, 0.02);
}

.profile-drawer__header span,
.profile-google__heading > div > span {
    display: block;
    margin-bottom: 0.15rem;
    color: rgba(245, 240, 229, 0.58);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.profile-drawer__header h2 {
    margin: 0;
    color: var(--hub-ivory);
    font-size: 1.65rem;
}

.profile-drawer__close {
    width: 40px;
    height: 40px;
    border: 0;
    background: transparent;
    color: rgba(245, 240, 229, 0.72);
    font-size: 1.7rem;
    cursor: pointer;
}

.profile-drawer__body {
    overflow-y: auto;
    padding: 1.1rem 1.15rem 2rem;
}

.profile-drawer__identity {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
    padding: 0.25rem 0 1.2rem;
}

.profile-drawer__identity img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(181, 154, 101, 0.65);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.34);
}

.profile-drawer__identity strong,
.profile-drawer__identity small,
.profile-drawer__row strong,
.profile-drawer__row small,
.profile-drawer__links strong,
.profile-drawer__links small,
.profile-drawer__photo strong,
.profile-drawer__photo small {
    display: block;
}

.profile-drawer__identity strong {
    font: 500 1.35rem var(--font-display);
}

.profile-drawer__identity small,
.profile-drawer__row small,
.profile-drawer__links small,
.profile-drawer__photo small {
    margin-top: 0.18rem;
    color: rgba(245, 240, 229, 0.58);
    font-size: 0.75rem;
    line-height: 1.35;
}

.profile-drawer__row,
.profile-drawer__links a {
    width: 100%;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.7rem;
    min-height: 62px;
    padding: 0.7rem 0.65rem;
    border: 0;
    border-top: 1px solid rgba(245, 240, 229, 0.09);
    background: transparent;
    color: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.profile-drawer__row:hover,
.profile-drawer__links a:hover {
    background: rgba(255, 255, 255, 0.045);
}

.profile-drawer__glyph {
    color: #c5aa6f;
    font-size: 1.05rem;
    text-align: center;
}

.profile-drawer__row b,
.profile-drawer__links b {
    color: rgba(245, 240, 229, 0.4);
    font-weight: 400;
}

.profile-drawer__editor,
.profile-drawer__photo,
.profile-google,
.profile-account-actions {
    margin: 0.8rem 0 1rem;
    padding: 1rem;
    border: 1px solid rgba(245, 240, 229, 0.1);
    background: rgba(255, 255, 255, 0.025);
}

.profile-drawer__editor label,
.account-form label {
    display: grid;
    gap: 0.38rem;
    color: rgba(245, 240, 229, 0.76);
    font-size: 0.76rem;
    font-weight: 650;
}

.profile-drawer__editor input,
.account-form input {
    width: 100%;
    min-height: 44px;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(181, 154, 101, 0.4);
    background: rgba(2, 8, 6, 0.48);
    color: var(--hub-ivory);
    font: inherit;
}

.profile-drawer__editor p {
    margin: 0.65rem 0 0.85rem;
    color: rgba(245, 240, 229, 0.58);
    font-size: 0.75rem;
    line-height: 1.5;
}

.profile-drawer__photo {
    display: grid;
    gap: 0.8rem;
}

.profile-drawer__photo input[type="file"] {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    opacity: 0;
    pointer-events: none;
}

.profile-drawer__button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.drawer-primary,
.drawer-secondary,
.profile-drawer__signout,
.profile-drawer__delete,
.profile-drawer__danger button,
.profile-google__disconnect button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(181, 154, 101, 0.46);
    background: transparent;
    color: var(--hub-ivory);
    font: inherit;
    font-size: 0.76rem;
    text-decoration: none;
    cursor: pointer;
}

.drawer-primary {
    background: #a9854e;
    border-color: #c5aa6f;
    color: #0e1e18;
    font-weight: 750;
}

.drawer-secondary:hover,
.profile-drawer__signout:hover {
    background: rgba(255, 255, 255, 0.06);
}

.profile-drawer__status,
.profile-drawer__quiet {
    margin: 0.65rem 0 1rem;
    padding: 0.65rem 0.75rem;
    border-left: 2px solid #8c9d6c;
    background: rgba(140, 157, 108, 0.08);
    color: rgba(245, 240, 229, 0.78);
    font-size: 0.76rem;
    line-height: 1.45;
}

.profile-drawer__status.is-error {
    border-left-color: #c07868;
    background: rgba(192, 120, 104, 0.08);
}

.profile-drawer__links {
    border-bottom: 1px solid rgba(245, 240, 229, 0.09);
}

.profile-google__heading {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
}

.profile-google__heading h3,
.profile-drawer__danger h3 {
    margin: 0;
    font: 500 1.35rem var(--font-display);
}

.google-state {
    padding: 0.25rem 0.45rem;
    border: 1px solid rgba(245, 240, 229, 0.13);
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.google-state.is-connected {
    color: #c9d6ae;
    border-color: rgba(154, 177, 112, 0.45);
}

.google-state.is-warning {
    color: #e5c987;
    border-color: rgba(217, 180, 95, 0.5);
}

.google-state.is-off {
    color: rgba(245, 240, 229, 0.56);
}

.profile-google__message,
.profile-drawer__danger p {
    color: rgba(245, 240, 229, 0.62);
    font-size: 0.76rem;
    line-height: 1.5;
}

.google-health {
    display: grid;
    margin: 0.85rem 0;
    border-top: 1px solid rgba(245, 240, 229, 0.08);
}

.google-health > div {
    display: grid;
    grid-template-columns: 12px 1fr;
    gap: 0.15rem 0.5rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid rgba(245, 240, 229, 0.08);
}

.google-health small {
    grid-column: 2;
    color: rgba(245, 240, 229, 0.52);
    font-size: 0.7rem;
    line-height: 1.35;
}

.health-dot {
    width: 8px;
    height: 8px;
    margin-top: 0.35rem;
    border-radius: 50%;
    background: #6d746d;
}

.health-dot.is-healthy { background: #91a56e; }
.health-dot.is-warning { background: #d2aa59; }
.health-dot.is-fault { background: #b66f62; }

.profile-google__disconnect {
    margin-top: 0.75rem;
}

.profile-google__disconnect button,
.profile-drawer__delete {
    padding-left: 0;
    border: 0;
    color: rgba(245, 240, 229, 0.5);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.profile-account-actions {
    display: grid;
    gap: 0.65rem;
}

.profile-drawer__signout {
    width: 100%;
}

.profile-drawer__delete {
    justify-self: start;
    color: #d1978c;
}

.profile-drawer__danger {
    display: grid;
    gap: 0.65rem;
    padding: 0.85rem;
    border: 1px solid rgba(202, 118, 103, 0.34);
    background: rgba(111, 35, 28, 0.12);
}

.profile-drawer__danger form button {
    width: 100%;
    border-color: rgba(202, 118, 103, 0.62);
    color: #f0c4bc;
}

.account-gate {
    width: min(520px, calc(100% - 2rem));
    margin: clamp(2rem, 8vh, 6rem) auto;
    padding: clamp(1.5rem, 4vw, 2.7rem);
    border: 1px solid rgba(39, 42, 38, 0.15);
    background: var(--hub-paper);
    box-shadow: 0 24px 70px rgba(24, 53, 45, 0.1);
}

.account-gate__mark {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin-bottom: 1.25rem;
    border-radius: 50%;
    border: 1px solid var(--hub-brass);
    color: var(--hub-forest);
    font: 600 1.55rem var(--font-display);
}

.account-gate h1 {
    color: var(--hub-forest-deep);
    font-size: clamp(2.6rem, 7vw, 4.2rem);
}

.account-gate__lede {
    color: var(--hub-muted);
    line-height: 1.55;
}

.account-gate__error {
    padding: 0.7rem 0.8rem;
    border-left: 3px solid #a45e50;
    background: rgba(164, 94, 80, 0.07);
    color: #753e34;
    font-size: 0.86rem;
}

.account-form {
    display: grid;
    gap: 0.9rem;
    margin-top: 1.4rem;
}

.account-form label {
    color: var(--hub-ink);
}

.account-form input {
    background: #fffef9;
    color: var(--hub-ink);
    border-color: rgba(39, 42, 38, 0.22);
}

.account-form small {
    color: var(--hub-muted);
    font-weight: 400;
}

.account-primary,
.account-google {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1rem;
    text-decoration: none;
    font: inherit;
    cursor: pointer;
}

.account-primary {
    border: 1px solid var(--hub-forest-deep);
    background: var(--hub-forest-deep);
    color: var(--hub-ivory);
    font-weight: 700;
}

.account-google {
    margin-top: 0.75rem;
    border: 1px solid rgba(39, 42, 38, 0.22);
    color: var(--hub-forest-deep);
}

.account-gate__switch {
    margin: 1rem 0 0;
    color: var(--hub-muted);
    font-size: 0.82rem;
    text-align: center;
}

.room-entry-page {
    min-height: calc(100vh - 58px);
    display: grid;
    place-items: center;
    padding: 2rem;
    background: #0b1712;
    color: var(--hub-ivory);
}

.room-entry-page > div {
    max-width: 42rem;
    text-align: center;
}

.room-entry-page p {
    color: rgba(245, 240, 229, 0.66);
    line-height: 1.6;
}

.room-entry-page a {
    display: inline-block;
    margin-top: 1rem;
    color: #d2ba83;
}

@media (max-width: 900px) {
    .app-bar__right {
        width: 100%;
        justify-content: space-between;
    }

    .account-trigger span {
        display: none;
    }
}

@media (max-width: 760px) {
    .app-bar__right {
        align-items: flex-start;
        gap: 0.55rem;
    }

    .account-trigger {
        min-height: 38px;
    }

    .profile-drawer {
        width: calc(100vw - 8px);
    }
}
