/* ================================================================
   FriendsByChance — components/sheet.css
   FBC.ui.Sheet — the generic overlay shell (.fbc-sheet-* namespace).
   z-index is set inline by JS so sheets can stack above one another.
   ================================================================ */

.fbc-sheet-overlay {
    position:        fixed;
    inset:           0;
    background:      rgba(0, 0, 0, 0.42);
    display:         flex;
    align-items:     center;
    justify-content: center;
    padding:         16px;
}

.fbc-sheet {
    background:     var(--color-bg);
    border-radius:  10px;
    width:          min(460px, 100%);
    max-height:     85vh;
    display:        flex;
    flex-direction: column;
    box-shadow:     0 8px 36px rgba(0, 0, 0, 0.26);
    overflow:       hidden;
}

/* Wide, as tall as what it holds (a layout of several panes to fill: the
   Chat page's ARRANGE) — never scrolled where the window has the room. */
.fbc-sheet--wide {
    width:      min(760px, 100%);
    max-height: 94vh;
}

/* "Almost as big as the editor overlay" — for the date/time picker, whose
   wheels need the room to stay touch-sized. */
.fbc-sheet--large {
    width:      min(560px, 100%);
    height:     min(620px, 88vh);
    max-height: 88vh;
}

/* Full screen on a phone is the whole screen: no margin of backdrop round
   it (the tag editor's and picker's, which this matches). */
.fbc-sheet-overlay--full { padding: 0; }
.fbc-sheet--full {
    width:         100%;
    max-width:     100%;
    height:        100%;
    max-height:    100%;
    border-radius: 0;
}

/* ── Header ──────────────────────────────────────────────────────── */

/* ── Header (FBC.ui.overlayHead — every overlay's header) ─────── */
.fbc-overlay-head {
    display:       flex;
    align-items:   center;
    gap:           6px;
    padding:       8px 10px 8px 16px;
    min-height:    48px;
    border-bottom: 1px solid var(--color-divider);
    background:    var(--color-surface);
    flex-shrink:   0;
}
.fbc-overlay-title {
    flex:          1;
    min-width:     0;
    font-weight:   600;
    font-size:     1rem;
    color:         var(--color-text);
    overflow:      hidden;
    text-overflow: ellipsis;
    white-space:   nowrap;
}
.fbc-overlay-actions {
    display:     flex;
    gap:         6px;
    flex-shrink: 0;
}

/* ── Body ────────────────────────────────────────────────────────── */

/* Scrolls up and down, never sideways: what is in a sheet wraps to its
   width. */
.fbc-sheet-body {
    flex:       1;
    overflow-y: auto;
    overflow-x: hidden;
    padding:    16px;
    min-height: 0;
}

/* ── Footer ──────────────────────────────────────────────────────── */

.fbc-sheet-footer {
    display:         flex;
    align-items:     center;
    justify-content: flex-end;
    gap:             8px;
    padding:         10px 16px;
    border-top:      1px solid var(--color-divider);
    flex-shrink:     0;
}

.fbc-sheet-btn {
    /* 44px high: the minimum comfortable touch target. */
    min-height:    44px;
    padding:       0 18px;
    font:          inherit;
    font-size:     0.92rem;
    border:        1px solid var(--color-divider);
    border-radius: 8px;
    background:    var(--color-surface);
    color:         var(--color-text);
    cursor:        pointer;
}
.fbc-sheet-btn:hover { background: var(--color-hover); }
.fbc-sheet-btn--primary {
    background:   var(--color-primary);
    border-color: var(--color-primary);
    color:        var(--color-text-on-primary);
}
.fbc-sheet-btn--danger {
    background:   var(--color-danger);
    border-color: var(--color-danger);
    color:        #fff;
}
