/* ================================================================
   SHARE CARD — action sheet (pairs with share-card.js)
   Mobile-first: full-width bottom sheet on phones, centred popover
   modal from 768px up. Uses your existing --charcoal / --orange
   design tokens, falls back to literal values if they're not in
   scope on a given page.
================================================================ */

.sc-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    padding: 0;
}
.sc-sheet-backdrop.is-open { opacity: 1; }

.sc-sheet {
    width: 100%;
    max-width: 480px;
    background: var(--charcoal, #2f3339);
    border: 1px solid var(--charcoal-border, rgba(255, 255, 255, 0.1));
    border-bottom: none;
    border-radius: 16px 16px 0 0;
    padding: 10px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
    transition: transform 0.25s cubic-bezier(.32, .72, 0, 1);
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}
.sc-sheet-backdrop.is-open .sc-sheet { transform: translateY(0); }

.sc-sheet-handle {
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 6px auto 14px;
}

.sc-sheet-title {
    font-family: var(--font-display, sans-serif);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--charcoal-text, #f2f2f2);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin: 0 0 2px;
}
.sc-sheet-sub {
    font-size: 0.8rem;
    color: var(--charcoal-text-dim, #a9adb3);
    margin: 0 0 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sc-sheet-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px; /* comfortably above the 44px tap-target floor */
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--charcoal-border, rgba(255, 255, 255, 0.1));
    border-radius: 10px;
    color: var(--charcoal-text, #f2f2f2);
    text-align: left;
    font-family: inherit;
    cursor: pointer;
    margin-bottom: 8px;
    transition: background 0.15s, border-color 0.15s, opacity 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.sc-sheet-option:hover,
.sc-sheet-option:focus-visible {
    background: rgba(255, 90, 31, 0.08);
    border-color: rgba(255, 90, 31, 0.35);
    outline: none;
}
.sc-sheet-option:active { background: rgba(255, 90, 31, 0.14); }
.sc-sheet-option:disabled,
.sc-sheet-option.is-busy { opacity: 0.55; cursor: wait; }

.sc-sheet-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 90, 31, 0.12);
    color: var(--orange, #ff5a1f);
}
.sc-sheet-option.is-busy .sc-sheet-icon svg { animation: scSpin 0.8s linear infinite; }
@keyframes scSpin { to { transform: rotate(360deg); } }

.sc-sheet-label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sc-sheet-label strong { font-size: 0.88rem; font-weight: 600; }
.sc-sheet-label small {
    font-size: 0.72rem;
    color: var(--charcoal-text-dim, #a9adb3);
    line-height: 1.3;
    white-space: normal;
}

.sc-sheet-cancel {
    width: 100%;
    min-height: 48px;
    margin-top: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--charcoal-border, rgba(255, 255, 255, 0.1));
    border-radius: 10px;
    color: var(--charcoal-text-dim, #a9adb3);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.sc-sheet-cancel:hover { background: rgba(255, 255, 255, 0.1); color: var(--charcoal-text, #f2f2f2); }

.sc-sheet-error {
    font-size: 0.76rem;
    color: #ff8a65;
    background: rgba(255, 90, 31, 0.08);
    border: 1px solid rgba(255, 90, 31, 0.2);
    border-radius: 8px;
    padding: 8px 10px;
    margin: 10px 0 0;
}
.sc-sheet-error.is-success {
    color: #34d399;
    background: rgba(52, 211, 153, 0.08);
    border-color: rgba(52, 211, 153, 0.25);
}

/* Locks the page behind the sheet without the iOS "rubber band" scroll leak */
body.sc-scroll-locked { overflow: hidden; width: 100%; }

/* ── Desktop / tablet: centred popover instead of a bottom sheet ── */
@media (min-width: 768px) {
    .sc-sheet-backdrop { align-items: center; padding: 24px; }
    .sc-sheet {
        border-radius: 16px;
        border-bottom: 1px solid var(--charcoal-border, rgba(255, 255, 255, 0.1));
        transform: translateY(16px) scale(0.98);
        opacity: 0;
        padding: 18px 20px 20px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    }
    .sc-sheet-backdrop.is-open .sc-sheet { transform: translateY(0) scale(1); opacity: 1; }
    .sc-sheet-handle { display: none; }
}

/* ── Respect reduced-motion preference ── */
@media (prefers-reduced-motion: reduce) {
    .sc-sheet-backdrop, .sc-sheet { transition: none; }
}

/* ── Small-phone safety net (iPhone SE / 360px-wide Android) ── */
@media (max-width: 360px) {
    .sc-sheet { padding-left: 12px; padding-right: 12px; }
    .sc-sheet-label small { display: none; } /* keep rows compact on the smallest screens */
    .sc-sheet-option { min-height: 52px; }
}
