.share-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 6, 10, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
}

.share-overlay.open {
    display: flex;
}

.share-modal {
    width: 100%;
    max-width: 420px;
    background: linear-gradient(160deg, var(--curtain), #150d11);
    border: 1px solid var(--border);
    border-radius: 12px;
    position: relative;
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(212, 175, 55, 0.06);
    padding: clamp(24px, 4vw, 32px);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    overflow-x: hidden;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.35s;
}

.share-overlay.open .share-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.share-modal-close {
    position: absolute;
    top: 16px;
    right: 18px;
    background: none;
    border: none;
    color: var(--cream-dim);
    font-size: 24px;
    line-height: 1;
    transition: color .2s;
    padding: 4px;
}

.share-modal-close:hover { color: var(--cream); }

.share-title {
    font-size: clamp(20px, 2.4vw, 24px);
    margin: 0 0 16px;
    padding-right: 24px;
}

.share-canvas-wrap {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    margin-bottom: 16px;
    line-height: 0;
}

.share-canvas {
    display: block;
    width: 100%;
    height: auto;
}

.share-link-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.share-link-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--cream-dim);
    font-size: 13px;
    padding: 10px 12px;
}

.share-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}


.share-actions .btn-primary,
.share-actions .btn-ghost,
.share-link-row .btn-ghost {
    flex: none;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    white-space: normal;
    overflow-wrap: break-word;
    line-height: 1.3;
}


.share-actions .btn-ghost:not([hidden]),
.share-link-row .btn-ghost:not([hidden]) {
    display: inline-flex;
}

.share-note {
    color: var(--cream-dim);
    font-size: 12px;
    margin-top: 10px;
    min-height: 16px;
}

@media (max-width: 480px) {
    .share-overlay { align-items: flex-end; }
    .share-modal { max-width: 100%; border-radius: 18px 18px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
    .share-modal { transition: none !important; }
}
