/* Bottom sheet shared by both pages: a sticky bar along the bottom of a one-column
   layout that opens a panel sliding up from the bottom edge. */

/* ── Sticky bar ── */
.sheet-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: none;
    border-top: 2px solid var(--accent-warning);
    box-shadow: 0 -2px 8px rgba(0,0,0,0.3);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 52px;
}

/* Brief highlight when the bar's summary changes */
.sheet-bar.is-updated { animation: sheet-bar-flash 0.6s ease-out; }
@keyframes sheet-bar-flash { from { background: #4a5f7a; } }

/* ── Sheet ── */
.sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 85vh;
    max-height: 85dvh;
    background: var(--bg-secondary);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
    z-index: 101;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

/* Slide up on open ([hidden] toggles display, so animate from a starting style) */
@starting-style {
    .sheet { transform: translateY(100%); }
}

/* [hidden] must beat the display rules above on pages without a global [hidden] rule */
.sheet-bar[hidden],
.sheet[hidden],
.sheet-backdrop[hidden] { display: none; }

/* Lock page scroll behind the open sheet */
body:has(.sheet:not([hidden])) { overflow: hidden; }

.sheet-handle-area {
    padding: 10px 16px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.sheet-handle {
    width: 40px;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    margin-bottom: 10px;
}

.sheet-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.sheet-title {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
}

.sheet-close {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 0.78rem;
    min-height: 36px;
    display: flex;
    align-items: center;
    transition: background 0.15s;
}

.sheet-close:hover { background: #4a5f7a; color: #fff; }

.sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px 20px;
}

.sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 100;
}

@media (prefers-reduced-motion: reduce) {
    .sheet { transition: none; }
    .sheet-bar.is-updated { animation: none; }
}
