/* ExNiLingo Share — uses FluentCommunity colour variables, so it follows
   your theme colours and dark mode automatically. */

.exn_share_li { cursor: pointer; }
.exn_share_li .exn_share_icon { font-size: 18px; }
.exn_share_li .exn_share_label { margin-left: 4px; font-size: 14px; }
.exn_share_li:focus-visible { outline: 2px solid var(--fcom-text-link, #2271b1); outline-offset: 2px; border-radius: 6px; }

html.exn_share_open, html.exn_share_open body { overflow: hidden; }

.exn_share_backdrop {
  --exn-bg: var(--fcom-primary-bg, #ffffff);
  --exn-bg-2: var(--fcom-secondary-bg, #f0f2f5);
  --exn-text: var(--fcom-primary-text, #19283a);
  --exn-muted: var(--fcom-secondary-text, #525866);
  --exn-border: var(--fcom-primary-border, #e3e8ee);
  --exn-btn: var(--fcom-primary-button, #2b2e33);
  --exn-btn-text: var(--fcom-primary-button-text, #ffffff);

  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 14, 20, 0);
  transition: background .2s ease;
}
.exn_share_backdrop.is_visible { background: rgba(10, 14, 20, .5); }

.exn_share_sheet {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--exn-bg);
  color: var(--exn-text);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
  padding: 18px 18px 20px;
  transform: translateY(12px) scale(.98);
  opacity: 0;
  transition: transform .2s ease, opacity .2s ease;
  font-size: 14px;
  line-height: 1.4;
}
.exn_share_backdrop.is_visible .exn_share_sheet { transform: none; opacity: 1; }

.exn_share_head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.exn_share_head h3 { margin: 0; font-size: 17px; font-weight: 650; color: var(--exn-text); }
.exn_share_close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: var(--exn-bg-2); color: var(--exn-text); cursor: pointer; padding: 0;
}
.exn_share_close:hover { filter: brightness(.95); }

.exn_share_hint { margin: 0 0 6px; font-size: 12px; color: var(--exn-muted); }

/* Link preview card — mimics how chat apps render it */
.exn_share_preview {
  border: 1px solid var(--exn-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--exn-bg-2);
}
.exn_share_preview_img { aspect-ratio: 1.91 / 1; background: var(--exn-border); }
.exn_share_preview_img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.exn_share_preview_meta { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 12px; }
.exn_share_host { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--exn-muted); }
.exn_share_ptitle {
  font-size: 15px; font-weight: 650; color: var(--exn-text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.exn_share_pdesc {
  font-size: 13px; color: var(--exn-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.exn_share_note {
  margin: 10px 0 0; padding: 8px 10px; border-radius: 8px;
  font-size: 12.5px; background: var(--exn-bg-2); color: var(--exn-muted);
  border-left: 3px solid #dba617;
}

.exn_share_grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 6px 4px;
  margin: 16px 0 14px;
}
.exn_share_net {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 6px 2px; border: 0; border-radius: 10px; background: transparent;
  color: var(--exn-text); text-decoration: none; cursor: pointer; font: inherit;
}
.exn_share_net:hover, .exn_share_net:focus-visible { background: var(--exn-bg-2); color: var(--exn-text); text-decoration: none; }
.exn_share_net_icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 50%;
}
.exn_share_net_icon svg { width: 26px; height: 26px; }
.exn_share_net_label { font-size: 12px; text-align: center; line-height: 1.2; }

.exn_share_copy {
  display: flex; gap: 6px; padding: 5px; border-radius: 10px;
  border: 1px solid var(--exn-border); background: var(--exn-bg-2);
}
.exn_share_copy input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--exn-text);
  font-size: 13px; padding: 6px 8px; outline: none; box-shadow: none;
}
.exn_share_copy_btn {
  border: 0; border-radius: 7px; padding: 7px 14px; cursor: pointer;
  background: var(--exn-btn); color: var(--exn-btn-text); font-weight: 600; font-size: 13px;
}
.exn_share_copy_btn:hover { filter: brightness(1.08); }

.exn_share_status {
  position: sticky; bottom: 0; margin-top: 0; text-align: center;
  font-size: 13px; font-weight: 600; color: var(--exn-text);
  max-height: 0; overflow: hidden; transition: max-height .2s ease, margin .2s ease;
}
.exn_share_status.is_visible { max-height: 90px; margin-top: 10px; }

/* Phones: bottom sheet */
@media (max-width: 640px) {
  .exn_share_backdrop { align-items: flex-end; padding: 0; }
  .exn_share_sheet {
    max-width: none;
    border-radius: 18px 18px 0 0;
    padding: 14px 16px calc(18px + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
    max-height: 92vh;
  }
  .exn_share_sheet::before {
    content: ""; display: block; width: 38px; height: 4px; border-radius: 4px;
    background: var(--exn-border); margin: 0 auto 10px;
  }
  .exn_share_grid { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .exn_share_backdrop, .exn_share_sheet { transition: none; }
}
