/* ── SVP Modal — mobile bottom sheet + desktop centered modal ── */

.svp-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.svp-modal-backdrop.hidden {
    display: none;
}

.svp-modal-panel {
    width: 100%;
    max-height: 85dvh;
    background: var(--background-color);
    border-radius: 14px 14px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.svp-modal-handle {
    width: 40px;
    height: 5px;
    background: var(--border-color);
    border-radius: 3px;
    margin: 10px auto 6px;
    flex-shrink: 0;
    cursor: grab;
    -webkit-tap-highlight-color: transparent;
    touch-action: pan-y;
}
.svp-modal-handle:active {
    cursor: grabbing;
}

.svp-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 4px 10px 16px;
    border-bottom: 1px solid var(--divider-color);
    flex-shrink: 0;
}

.svp-modal-title {
    font-family: 'Zilla Slab', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.svp-modal-close {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1.5px solid var(--border-color);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.15rem;
    line-height: 1;
    padding: 0;
    border-radius: 50%;
    transition: background 0.15s, color 0.15s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.svp-modal-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-color);
}

.svp-modal-close:active {
    background: rgba(0, 0, 0, 0.12);
    color: var(--text-color);
}

.svp-modal-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
}

.svp-modal-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--divider-color);
    flex-shrink: 0;
}

body.svp-modal-open {
    overflow: hidden;
}

/* ── Desktop: centered modal ──────────────────────────────────── */
@media screen and (min-width: 481px) {
    .svp-modal-backdrop {
        align-items: center;
    }

    .svp-modal-panel {
        width: 100%;
        max-width: 480px;
        max-height: 80dvh;
        border-radius: 12px;
        margin: 0 16px;
    }

    .svp-modal-handle {
        display: none;
    }
}
