:root {
    --fp-header-content-height: 3.5rem;
    --fp-app-header-height: calc(var(--fp-header-content-height) + env(safe-area-inset-top, 0px) + 1px);
}

body:has(.fp-photo-upload-sheet) {
    overflow: hidden;
    overscroll-behavior: none;
}

body:has(.fp-photo-upload-sheet) .k-overlay {
    position: fixed;
    top: var(--fp-app-header-height);
    bottom: 0;
    z-index: 10000 !important;
}

body:has(.fp-photo-upload-sheet) header.fp-nav-translucent {
    pointer-events: none;
}

.fp-photo-upload-sheet.k-window {
    position: fixed !important;
    top: var(--fp-app-header-height) !important;
    bottom: 0 !important;
    left: 50% !important;
    width: min(100%, 32rem) !important;
    max-width: 100vw;
    height: calc(100dvh - var(--fp-app-header-height)) !important;
    max-height: calc(100dvh - var(--fp-app-header-height));
    margin: 0;
    transform: translateX(-50%) !important;
    z-index: 10001 !important;
    overflow: hidden;
    border: 1px solid hsl(var(--fp-border));
    border-bottom: 0;
    border-radius: 1.25rem 1.25rem 0 0;
    background: hsl(var(--fp-grouped-background));
    color: hsl(var(--fp-foreground));
    animation: fp-photo-sheet-rise 240ms ease-out both;
}

.fp-photo-upload-sheet .k-window-titlebar {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    padding: 0;
    border: 0;
}

.fp-photo-upload-sheet .k-window-content {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0;
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    background: inherit;
    color: inherit;
    -webkit-overflow-scrolling: touch;
}

.fp-photo-sheet-header {
    display: grid;
    gap: 0.75rem;
    padding: 1rem 1rem 0;
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
}

.fp-photo-sheet-header h1 {
    margin: 0;
}

.fp-photo-sheet-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: start;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid hsl(var(--fp-border));
    border-radius: 50%;
    background: hsl(var(--fp-surface));
    color: hsl(var(--fp-foreground));
    cursor: pointer;
}

.fp-photo-sheet-close:focus-visible {
    outline: 2px solid hsl(var(--fp-ring));
    outline-offset: 3px;
}

.fp-photo-sheet-close:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.fp-photo-sheet-guidance {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: hsl(var(--fp-secondary-label));
}

.fp-correspondence-sheet .k-window-content {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.fp-correspondence-sheet-content {
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
    min-height: 0;
}

.fp-correspondence-compose {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding-top: 1rem;
}

.fp-correspondence-compose textarea {
    min-height: 16rem;
}

.fp-correspondence-discard {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid hsl(var(--fp-border));
    border-radius: 0.875rem;
    background: hsl(var(--fp-surface));
    color: hsl(var(--fp-foreground));
}

@keyframes fp-photo-sheet-rise {
    from { translate: 0 100%; }
    to { translate: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
    .fp-photo-upload-sheet.k-window {
        animation: none;
    }
}
