.social-share-trigger,
.social-sheet :is(button,a) {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  border: 1px solid var(--line); border-radius: 11px; padding: 9px 13px;
  font: 650 14px/1.3 system-ui, sans-serif; color: var(--ink); background: var(--surface);
  text-decoration: none; cursor: pointer;
}
.social-share-trigger { color: var(--accent); background: var(--surface); }
.social-share-trigger svg, .social-sheet svg {
  width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor;
  stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8;
}
.social-share-trigger.social-share-compact {
  width: 44px; height: 44px; padding: 0; border-radius: 50%; flex: none;
}
.social-share-compact > span { display: none; }
.social-share-trigger:focus-visible, .social-sheet :is(button,a,textarea):focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px;
}
.social-share-trigger:hover, .social-sheet :is(button,a):hover { border-color: var(--accent); }
html:has(.social-sheet[open]) { overflow: hidden; }
.social-sheet {
  width: min(94vw, 580px); max-width: 100%; max-height: min(92dvh, 870px);
  padding: clamp(18px, 3vw, 28px); margin: auto;
  border: 1px solid var(--line); border-radius: 22px;
  color: var(--ink); background: var(--surface); overscroll-behavior: contain;
  box-shadow: 0 20px 70px #0917223d;
}
.social-sheet::backdrop { background: #0a1b2bb5; }
.social-sheet [hidden] { display: none; }
.social-heading { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 0 14px; margin-bottom: 18px; }
.social-heading h2 { margin: 0; font-size: clamp(23px, 4vw, 32px); letter-spacing: -.045em; }
.social-heading .social-close { width: 44px; padding: 0; border-radius: 50%; }
.social-subject {
  margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; grid-column: 1/-1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.social-layout {
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  grid-template-rows: auto 1fr; gap: 14px 20px; align-items: start;
}
.social-preview {
  grid-row: 1/span 2; display: grid; place-items: center; width: 100%; aspect-ratio: 9 / 16;
  align-self: stretch; min-width: 0; overflow: hidden; padding: 10px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft);
}
.social-preview img { grid-area: 1/1; display: block; width: 100%; height: auto; object-fit: contain; border-radius: 5px; }
.social-loading { grid-area: 1/1; font-size: 13px; text-align: center; color: var(--muted); }
.social-choices { display: grid; gap: 7px; }
.social-choices .social-format { width: 100%; justify-content: start; padding-inline: 12px; }
.social-format small { margin-inline-start: auto; font-size: 12px; font-weight: 500; color: var(--muted); }
.social-format svg { color: var(--warm); }
.social-format[data-platform="tiktok"] svg { color: var(--ink); }
.social-format[aria-pressed="true"], .social-channel[aria-pressed="true"] {
  background: var(--selected-surface); color: var(--accent); border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.social-image-actions { display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-width: 0; }
.social-hint { color: var(--muted); margin: 0 0 6px; font-size: 13px; line-height: 1.5; }
.social-sheet .social-primary { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.social-channels {
  display: flex; flex-wrap: wrap; gap: 7px; border-top: 1px solid var(--line);
  margin-top: 18px; padding-top: 16px;
}
.social-channels .social-channel { flex: 1 1 auto; padding-inline: 9px; font-size: 13px; }
.social-channels svg { color: var(--accent); }
.social-message-options { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 10px; }
.social-status:not(:empty) { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.social-status:empty { margin: 0; }
.social-local { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.social-sheet .social-local-link { display: inline; margin-inline-start: .4em; padding: 0; border: 0; color: var(--accent); font: inherit; text-decoration: underline; }
.social-copy-field {
  width: 100%; margin-top: 12px; padding: 8px; color: var(--ink); background: var(--surface-soft);
  border: 1px solid var(--line); border-radius: 8px; font: 400 16px/1.4 system-ui, sans-serif;
}
@media (max-width: 560px) {
  .social-sheet {
    width: min(100%, 460px); max-height: 94dvh; margin: auto auto 0; border-radius: 20px 20px 0 0;
    padding: 17px max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }
  .social-heading { margin-bottom: 14px; }
  .social-layout { grid-template-columns: minmax(90px,.68fr) minmax(0,1.32fr); gap: 12px; }
  .social-preview { grid-row: 1; padding: 5px; aspect-ratio: auto; }
  .social-preview img { max-height: 160px; max-width: 100%; width: auto; }
  .social-preview[data-format="post"] img { width: 100%; }
  .social-choices { align-self: center; }
  .social-image-actions { grid-column: 1/-1; flex-direction: row; flex-wrap: wrap; }
  .social-hint { width: 100%; margin-bottom: 2px; }
  .social-image-actions a, .social-image-actions button { flex: 1 1 auto; }
  .social-channels { margin-top: 13px; padding-top: 10px; }
}
@media (max-height: 500px) and (min-width: 561px) {
  .social-preview { aspect-ratio: auto; height: 200px; }
  .social-preview img { height: 100%; width: 100%; min-height: 0; }
}
