.dialog {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: var(--topbar-h);
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    background: var(--paper);
    color: var(--ink);
    overflow: hidden;
}

.dialog[open] {
    display: flex;
    flex-direction: column;
}

.dialog::backdrop {
    background: rgba(36, 19, 4, 0.55);
}

.dialog-panel {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
    border-top: none;
}

.dialog-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.dialog-head h2 {
    flex: 1;
    font-size: 27px;
}

.dialog h3 {
    font-size: 16px;
    letter-spacing: 0.1em;
    margin: 16px 0 6px;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 2px solid var(--ink);
    margin-bottom: 14px;
}

.auth-tab {
    min-height: 44px;
    padding: 10px 6px 8px;
    font-family: var(--display);
    font-size: 19px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: none;
    border: none;
    color: var(--ink);
    cursor: pointer;
}

.auth-tab.active {
    background: var(--ink);
    color: var(--paper);
}

@media (min-width: 860px) {
    .dialog {
        top: 50%;
        bottom: auto;
        transform: translateY(-50%);
        max-width: 620px;
        margin: 0 auto;
        border: 3px solid var(--ink);
        max-height: 86svh;
    }

    .dialog-wide {
        max-width: 760px;
    }

    .dialog-panel {
        max-height: 86svh;
        padding: 18px 24px 26px;
        border-top: none;
    }
}
