/* Sheet layout geometry only. @see docs/ui-surface-truth-model.md */

.ll-surface-host:not(.dialog-overlay) {
    align-items: center;
    box-sizing: border-box;
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 0.75rem;
    position: fixed;
    z-index: var(--ll-layer-modal-z, 1200);
}

/* Full-bleed backdrop: defer to legacy .dialog-overlay sizing (avoids width/padding conflicts). */
.dialog-overlay.ll-surface-host {
    align-items: flex-start;
    box-sizing: border-box;
    height: auto;
    inset: 0;
    justify-content: center;
    min-height: 100dvh;
    min-height: 100vh;
    width: auto;
}

.dialog-overlay.ll-surface-host > .dialog-content.ll-surface--sheet-confirm {
    align-self: flex-start;
    flex-shrink: 0;
    margin: 0;
    width: min(100%, 560px);
}

.ll-surface--sheet-overlay {
    height: 100%;
    max-height: 100%;
}

.ll-surface-host:not(.dialog-overlay) .ll-surface--sheet-panel[data-ll-surface-attach='center'] {
    margin: auto;
    max-height: min(90vh, 40rem);
    max-width: min(100%, 26rem);
}

.ll-surface-host:not(.dialog-overlay) .ll-surface--sheet-panel[data-ll-surface-attach='bottom'] {
    align-self: flex-end;
    max-height: 85vh;
    width: 100%;
}

.ll-surface-host:not(.dialog-overlay) .ll-surface--sheet-panel[data-ll-surface-attach='anchor'] {
    margin: 0;
    max-width: min(100%, 20rem);
}

.dialog-overlay.ll-surface-host > .ll-surface--sheet-panel[data-ll-surface-attach='center'] {
    align-self: center;
    margin: auto;
    max-height: min(90vh, 40rem);
    width: min(100%, 26rem);
}

.dialog-overlay.ll-surface-host > .ll-surface--sheet-overlay {
    height: auto;
    max-height: min(92vh, 40rem);
    width: min(100%, 560px);
}

.ll-surface-host:not(.dialog-overlay) .ll-surface--sheet-confirm {
    margin: auto;
    max-width: min(100% - 1.5rem, 26rem);
    width: 100%;
}
