/* ExNiLingo External Sharing — follows FluentCommunity's colours, so light and dark mode match the site. */
body {
    --exsh-bg: var(--fcom-primary-bg, #ffffff);
    --exsh-soft: var(--fcom-secondary-bg, #f3f4f6);
    --exsh-text: var(--fcom-primary-text, #1d2327);
    --exsh-muted: var(--fcom-secondary-text, #6b7280);
    --exsh-line: var(--fcom-primary-border, #e3e6ea);
    --exsh-hover: var(--fcom-active-bg, #f0f2f5);
    --exsh-accent: var(--fcom-text-link, #6d4fd8);
    --exsh-shadow: 0 18px 50px rgba(17, 12, 46, .18), 0 2px 8px rgba(17, 12, 46, .08);
}
html.dark body { --exsh-shadow: 0 18px 50px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .4); }
html.exsh-locked { overflow: hidden; }

/* ---------- button on the right of the footer ---------- */
.fcom_feed_footer_meta.exsh-has-share { display: flex; align-items: center; gap: 4px; }
.feed_footer > .exsh-slot { margin-left: auto; }
.exsh-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; margin: 0 -6px 0 0;
    border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; font-size: 14px; cursor: pointer;
    transition: background .2s, color .2s;
}
.exsh-btn:hover, .exsh-btn[aria-expanded="true"] { background: var(--exsh-hover); color: var(--exsh-accent); }
.exsh-btn:focus-visible, .exsh-action:focus-visible, .exsh-close:focus-visible { outline: 2px solid var(--exsh-accent); outline-offset: 2px; }
.exsh-btn .exsh-icon svg { width: 19px; height: 19px; }
@media (max-width: 480px) { .exsh-btn__label { display: none; } }
.exsh-icon { display: inline-grid; place-items: center; line-height: 0; }

/* ---------- panel ---------- */
.exsh-panel {
    position: fixed; z-index: 100000; width: 380px; max-width: calc(100vw - 24px);
    padding: 14px; border-radius: 16px; border: 1px solid var(--exsh-line);
    background: var(--exsh-bg); color: var(--exsh-text); box-shadow: var(--exsh-shadow);
    font-size: 14px; line-height: 1.45; animation: exsh-pop .16s ease-out;
}
.exsh-panel.is-sheet {
    left: 0; right: 0; bottom: 0; top: auto; width: 100%; max-width: none; max-height: 85vh; overflow-y: auto;
    border-radius: 20px 20px 0 0; border-bottom: 0; padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
    animation: exsh-up .2s ease-out;
}
.exsh-panel.is-leaving { opacity: 0; transition: opacity .15s; }
.exsh-scrim { position: fixed; inset: 0; z-index: 99999; background: rgba(15, 12, 30, .45); }
@keyframes exsh-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@keyframes exsh-up { from { transform: translateY(30px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .exsh-panel, .exsh-panel.is-sheet { animation: none; } }

.exsh-panel__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.exsh-panel__head strong { font-size: 15px; font-weight: 650; }
.exsh-close { width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--exsh-muted); font-size: 22px; line-height: 1; cursor: pointer; }
.exsh-close:hover { background: var(--exsh-hover); color: var(--exsh-text); }

/* preview of what's shared */
.exsh-card { display: flex; gap: 12px; padding: 10px; border: 1px solid var(--exsh-line); border-radius: 12px; background: var(--exsh-soft); }
.exsh-card.no-media { display: block; }
.exsh-media { position: relative; flex-shrink: 0; width: 92px; height: 92px; border-radius: 10px; overflow: hidden; background: var(--exsh-line); }
.exsh-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.exsh-media.is-default { width: 128px; height: auto; aspect-ratio: 1200 / 630; align-self: center; }
.exsh-play { position: absolute; inset: 0; margin: auto; width: 34px; height: 34px; border-radius: 50%; background: rgba(0, 0, 0, .55); }
.exsh-play::after { content: ""; position: absolute; left: 13px; top: 10px; border-left: 11px solid #fff; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.exsh-more { position: absolute; right: 5px; bottom: 5px; padding: 1px 7px; border-radius: 999px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; font-weight: 600; }
.exsh-card__text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.exsh-card__text p { margin: 0; font-size: 13.5px; color: var(--exsh-text); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.exsh-card__text small { color: var(--exsh-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exsh-url { opacity: .85; }
.exsh-note { margin: 8px 2px 0; color: var(--exsh-muted); font-size: 12px; }

/* actions */
.exsh-actions { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); row-gap: 4px; gap: 0; margin: 10px -6px 0; }
.exsh-action {
    display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 6px 2px 5px;
    border: 0; border-radius: 10px; background: transparent; color: var(--exsh-text);
    font: inherit; font-size: 11px; font-weight: 500; line-height: 1.2; text-align: center; letter-spacing: -.01em; cursor: pointer;
    transition: background .15s;
}
.exsh-action span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exsh-action:hover { background: var(--exsh-hover); }
.exsh-action .exsh-icon { width: 36px; height: 36px; border-radius: 50%; color: #fff; flex-shrink: 0; transition: transform .15s; }
.exsh-action:hover .exsh-icon { transform: scale(1.06); }
.exsh-action .exsh-icon svg { width: 19px; height: 19px; }
.exsh-action--whatsapp .exsh-icon { background: #1fa855; }
.exsh-action .exsh-icon.has-logo { background: transparent !important; border: 0 !important; overflow: hidden; }
.exsh-action .exsh-icon.has-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.exsh-action--telegram .exsh-icon { background: #229ed9; }
.exsh-action--facebook .exsh-icon { background: #1b6fe0; }
.exsh-action--x .exsh-icon { background: #14171a; }
.exsh-action--linkedin .exsh-icon { background: #0a66c2; }
.exsh-action--gmail .exsh-icon { background: #d93a2b; }
.exsh-action--applemail .exsh-icon { background: #1a82f7; }
.exsh-action--youtube .exsh-icon { background: #e02424; }
.exsh-action--copy .exsh-icon, .exsh-action--native .exsh-icon { background: var(--exsh-soft); color: var(--exsh-text); border: 1px solid var(--exsh-line); }
html.dark .exsh-action--x .exsh-icon { background: #3a3d42; }
.exsh-action.is-busy { opacity: .55; cursor: progress; }

/* toasts */
.exsh-toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100001; display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 32px); }
.exsh-toast { padding: 10px 16px; border-radius: 12px; background: #1d1b2e; color: #fff; font-size: 14px; box-shadow: var(--exsh-shadow); }
.exsh-toast.is-leaving { opacity: 0; transition: opacity .4s; }
html.dark .exsh-toast { background: #f2f0fa; color: #1d1b2e; }
