/* Shared share menu (includes/share-panel.php): guides, tools library, software page.
   A popover next to the button on larger screens, a bottom sheet on phones.
   Keyboard-accessible, no third-party widgets. */
.cs-share[hidden] { display: none !important; }
.cs-share { position: fixed; z-index: 1060; width: 360px; padding: 18px; border: 1px solid #e3d9ec; border-radius: 16px; background: #fff; color: #343044; box-shadow: 0 18px 54px rgba(44,27,67,.24); max-height: calc(100vh - 24px); overflow-y: auto; box-sizing: border-box; font-family: 'Source Sans Pro', 'Segoe UI', Arial, sans-serif; font-size: 14px; line-height: 1.4; text-align: left; animation: csShareIn .16s ease-out; }
.cs-share *, .cs-share *:before, .cs-share *:after { box-sizing: border-box; }
@keyframes csShareIn { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.cs-share__grip { display: none; }

.cs-share__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cs-share__titles { min-width: 0; }
.cs-share__titles strong { display: block; font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif; font-size: 15px; font-weight: 600; color: #2a2140; }
.cs-share__name { display: block; margin-top: 2px; font-size: 12.5px; color: #857c92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-share__name:empty { display: none; }
.cs-share__close { flex: none; display: grid; place-items: center; width: 30px; height: 30px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: #f3eff7; color: #6c597b; font-size: 13px; cursor: pointer; transition: background .15s, color .15s; }
.cs-share__close:hover { background: #794fb4; color: #fff; }

/* the link with its Copy button: the action most people want */
.cs-share__copy { display: flex; align-items: center; gap: 8px; padding: 5px 5px 5px 12px; border: 1px solid #ded5e6; border-radius: 10px; background: #faf8fc; transition: border-color .15s, box-shadow .15s; }
.cs-share__copy:focus-within { border-color: #794fb4; box-shadow: 0 0 0 3px rgba(121,79,180,.14); }
.cs-share__copy > i { flex: none; color: #a497b3; font-size: 14px; }
.cs-share__copy input { flex: 1 1 auto; min-width: 0; width: auto; height: 34px; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; outline: 0; font: inherit; font-size: 13px; color: #5a466b; text-overflow: ellipsis; }
.cs-share__copy button { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; margin: 0; padding: 0 14px; border: 0; border-radius: 7px; background: #794fb4; color: #fff; font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s; }
.cs-share__copy button:hover { background: #63409a; }
.cs-share__copy button.copied { background: #1a9e57; }

/* apps */
.cs-share__apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 14px; }
.cs-share__apps a, .cs-share__apps button { display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; margin: 0; padding: 10px 2px 8px; border: 0; border-radius: 10px; background: transparent; color: #4d4558; font: inherit; font-size: 12px; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; transition: background .15s, color .15s; }
.cs-share__apps a:hover, .cs-share__apps button:hover, .cs-share__apps a:focus-visible, .cs-share__apps button:focus-visible { background: #f5f1fa; color: #2a2140; text-decoration: none; }
.cs-share__ico { --c: #794fb4; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--c); color: #fff; font-size: 20px; transition: transform .15s, box-shadow .15s; }
.cs-share__ico b { font-size: 18px; font-weight: 700; line-height: 1; }
.cs-share__ico--ig { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 62%, #285aeb 92%); }
.cs-share__apps a:hover .cs-share__ico, .cs-share__apps button:hover .cs-share__ico { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(44,27,67,.22); }
.cs-share__touch { display: none !important; }

.cs-share__status { margin: 10px 0 0; font-size: 12.5px; line-height: 1.5; color: #1a7f49; }
.cs-share__status:empty { display: none; }
.cs-share__help { margin: 10px 0 0; padding: 10px 12px; border-radius: 8px; background: #faf0f8; font-size: 12.5px; line-height: 1.55; color: #5a466b; }
.cs-share__help[hidden] { display: none; }
.cs-share__help a { color: #75419b; text-decoration: underline; white-space: nowrap; }
.cs-share :focus-visible, [data-guide-share]:focus-visible { outline: 3px solid #975fc3; outline-offset: 2px; }
.cs-share__copy input:focus-visible { outline: 0; }

/* phones: slide up from the bottom, dim the page behind */
@media (max-width: 600px) {
    .cs-share { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: 100% !important; max-height: 86vh; padding: 10px 16px calc(18px + env(safe-area-inset-bottom, 0px)); border: 0; border-radius: 18px 18px 0 0; box-shadow: 0 0 0 100vmax rgba(24,18,38,.5), 0 -8px 30px rgba(24,18,38,.25); animation: csShareUp .22s ease-out; }
    @keyframes csShareUp { from { transform: translateY(100%); } to { transform: none; } }
    .cs-share__grip { display: block; width: 40px; height: 4px; margin: 0 auto 12px; border-radius: 4px; background: #ddd5e6; }
    .cs-share__copy input { font-size: 16px; } /* stops iOS zooming in on focus */
    .cs-share__copy button { height: 40px; padding: 0 16px; font-size: 13px; }
    .cs-share__apps { grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 16px; }
    .cs-share__apps a, .cs-share__apps button { font-size: 13px; padding: 10px 2px; }
    .cs-share__ico { width: 50px; height: 50px; font-size: 22px; }
    .cs-share__touch { display: flex !important; }
}
@media (prefers-reduced-motion: reduce) { .cs-share { animation: none !important; } }
