:root {
  --swsocial-accent: #0ea5e9;
  --swsocial-text: #0f172a;
  --swsocial-muted: #64748b;
  --swsocial-border: rgba(15, 23, 42, 0.12);
  --swsocial-soft: rgba(15, 23, 42, 0.04);
  --swsocial-white: #ffffff;
}

.swsocial-share,
.swsocial-share * {
  box-sizing: border-box;
}

.swsocial-share {
  width: 100%;
  margin: clamp(20px, 4vw, 34px) 0;
  font-family: inherit;
  color: var(--swsocial-text);
}

.swsocial-card {
  display: grid;
  grid-template-columns: minmax(96px, 180px) 1fr;
  gap: clamp(14px, 2.4vw, 22px);
  align-items: center;
  padding: clamp(14px, 2vw, 20px);
  margin-bottom: 16px;
  border: 1px solid var(--swsocial-border);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--swsocial-accent) 18%, transparent), transparent 36%),
    linear-gradient(135deg, rgba(255,255,255,0.96), rgba(248,250,252,0.96));
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.swsocial-card-image {
  aspect-ratio: 16 / 10;
  border-radius: 18px;
  overflow: hidden;
  background: var(--swsocial-soft);
}

.swsocial-card-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.swsocial-card-body {
  min-width: 0;
}

.swsocial-card-kicker {
  display: inline-flex;
  margin-bottom: 5px;
  color: var(--swsocial-accent);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.swsocial-card strong {
  display: block;
  margin: 0;
  color: var(--swsocial-text);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.25;
}

.swsocial-card p {
  margin: 8px 0 0;
  color: var(--swsocial-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.swsocial-heading {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--swsocial-text);
}

.swsocial-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.swsocial-button {
  --swsocial-button-bg: #0f172a;
  --swsocial-button-color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0.68rem 1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--swsocial-button-bg);
  color: var(--swsocial-button-color) !important;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none !important;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
  transform: translateY(0);
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease, background-color 180ms ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.swsocial-button:hover,
.swsocial-button:focus-visible {
  color: var(--swsocial-button-color) !important;
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.18);
  opacity: 0.94;
  outline: none;
}

.swsocial-button:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--swsocial-accent) 28%, transparent), 0 16px 30px rgba(15, 23, 42, 0.18);
}

.swsocial-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  flex: 0 0 auto;
}

.swsocial-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}

.swsocial-icon-only {
  width: 44px;
  min-width: 44px;
  padding-left: 0;
  padding-right: 0;
}

.swsocial-style-rounded .swsocial-button { border-radius: 14px; }
.swsocial-style-square .swsocial-button { border-radius: 4px; }
.swsocial-style-circle .swsocial-button { width: 46px; min-width: 46px; border-radius: 999px; padding-left: 0; padding-right: 0; }
.swsocial-style-circle .swsocial-label-text { display: none; }

.swsocial-size-small .swsocial-button { min-height: 36px; padding: 0.55rem 0.8rem; font-size: 0.82rem; }
.swsocial-size-large .swsocial-button { min-height: 50px; padding: 0.85rem 1.15rem; font-size: 1rem; }

.swsocial-theme-brand .swsocial-facebook { --swsocial-button-bg: #1877f2; }
.swsocial-theme-brand .swsocial-x { --swsocial-button-bg: #111827; }
.swsocial-theme-brand .swsocial-threads { --swsocial-button-bg: #000000; }
.swsocial-theme-brand .swsocial-linkedin { --swsocial-button-bg: #0a66c2; }
.swsocial-theme-brand .swsocial-pinterest { --swsocial-button-bg: #bd081c; }
.swsocial-theme-brand .swsocial-reddit { --swsocial-button-bg: #ff4500; }
.swsocial-theme-brand .swsocial-bluesky { --swsocial-button-bg: #1185fe; }
.swsocial-theme-brand .swsocial-whatsapp { --swsocial-button-bg: #25d366; --swsocial-button-color: #052e16; }
.swsocial-theme-brand .swsocial-email { --swsocial-button-bg: #475569; }
.swsocial-theme-brand .swsocial-native { --swsocial-button-bg: var(--swsocial-accent); }
.swsocial-theme-brand .swsocial-copy { --swsocial-button-bg: #334155; }

.swsocial-theme-dark .swsocial-button { --swsocial-button-bg: #0f172a; --swsocial-button-color: #ffffff; }
.swsocial-theme-accent .swsocial-button { --swsocial-button-bg: var(--swsocial-accent); --swsocial-button-color: #ffffff; }
.swsocial-theme-light .swsocial-button {
  --swsocial-button-bg: #ffffff;
  --swsocial-button-color: #0f172a;
  border-color: var(--swsocial-border);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.swsocial-floating {
  position: fixed;
  z-index: 99990;
  left: 16px;
  top: 50%;
  width: auto;
  max-width: 58px;
  margin: 0;
  transform: translateY(-50%);
}

.swsocial-floating .swsocial-buttons {
  flex-direction: column;
  gap: 8px;
}

.swsocial-floating .swsocial-button {
  width: 46px;
  min-width: 46px;
  min-height: 46px;
  padding: 0;
  border-radius: 999px;
}

.swsocial-floating .swsocial-label-text,
.swsocial-floating .swsocial-heading,
.swsocial-floating .swsocial-card {
  display: none;
}

@supports not (color: color-mix(in srgb, #000 50%, #fff)) {
  .swsocial-card {
    background: #ffffff;
  }
}

@media (max-width: 780px) {
  .swsocial-share {
    margin: 22px 0;
  }

  .swsocial-card {
    grid-template-columns: 1fr;
    border-radius: 20px;
  }

  .swsocial-card-image {
    aspect-ratio: 16 / 9;
  }

  .swsocial-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .swsocial-button {
    width: 100%;
    min-width: 0;
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }

  .swsocial-icon-only,
  .swsocial-style-circle .swsocial-button {
    width: 100%;
    min-width: 0;
  }

  .swsocial-floating {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    transform: none;
    background: rgba(255, 255, 255, 0.94);
    border-top: 1px solid var(--swsocial-border);
    backdrop-filter: blur(14px);
  }

  .swsocial-floating .swsocial-buttons {
    display: flex;
    flex-direction: row;
    justify-content: center;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .swsocial-floating .swsocial-buttons::-webkit-scrollbar {
    display: none;
  }

  .swsocial-floating .swsocial-button {
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    min-height: 44px;
  }
}

@media (max-width: 420px) {
  .swsocial-buttons {
    grid-template-columns: 1fr;
  }

  .swsocial-card {
    padding: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .swsocial-button {
    transition: none;
  }

  .swsocial-button:hover,
  .swsocial-button:focus-visible {
    transform: none;
  }
}

/* v1.1 layout hardening: image/excerpt carry-over and mobile readability */
.swsocial-share {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.swsocial-card-body:only-child {
  grid-column: 1 / -1;
}

.swsocial-card strong,
.swsocial-card p {
  overflow-wrap: anywhere;
  word-break: normal;
}

.swsocial-card p {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.swsocial-card-image img {
  max-width: none;
}

.swsocial-buttons {
  max-width: 100%;
}

.swsocial-button {
  max-width: 100%;
  white-space: nowrap;
}

.swsocial-label-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 781px) {
  .swsocial-buttons {
    row-gap: 11px;
  }

  .swsocial-card-image {
    min-height: 112px;
  }
}

@media (max-width: 780px) {
  .swsocial-card strong {
    font-size: clamp(1rem, 4vw, 1.2rem);
  }

  .swsocial-card p {
    -webkit-line-clamp: 5;
  }

  .swsocial-button {
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .swsocial-card {
    gap: 12px;
  }

  .swsocial-card-image {
    border-radius: 14px;
  }

  .swsocial-card-kicker {
    font-size: 0.72rem;
  }
}

/* v1.2 caption carry-over: copy full post text before opening social composer */
.swsocial-caption-preview {
  display: none;
}

.swsocial-copytext {
  --swsocial-button-bg: var(--swsocial-accent);
  --swsocial-button-color: #ffffff;
}

.swsocial-copied {
  opacity: 0.96;
}

.swsocial-status {
  height: 0;
  margin-top: 0;
  overflow: hidden;
  color: var(--swsocial-text);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.4;
  transition: height 180ms ease, margin-top 180ms ease;
}

.swsocial-status-visible {
  height: auto;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(14, 165, 233, 0.25);
  border-radius: 12px;
  background: rgba(14, 165, 233, 0.08);
}

.swsocial-status-error {
  border-color: rgba(220, 38, 38, 0.25);
  background: rgba(220, 38, 38, 0.08);
  color: #991b1b;
}

.swsocial-dialog {
  position: fixed;
  z-index: 999999;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.58);
}

.swsocial-dialog-panel {
  position: relative;
  width: min(640px, 100%);
  padding: 24px;
  border-radius: 22px;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}

.swsocial-dialog-panel strong {
  display: block;
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.swsocial-dialog-panel p {
  margin: 0 0 14px;
  color: #475569;
}

.swsocial-dialog-panel textarea {
  width: 100%;
  min-height: 180px;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 14px;
  color: #0f172a;
  font: inherit;
  line-height: 1.45;
  resize: vertical;
}

.swsocial-dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 780px) {
  .swsocial-status-visible {
    text-align: center;
  }

  .swsocial-dialog {
    align-items: end;
    padding: 12px;
  }

  .swsocial-dialog-panel {
    border-radius: 18px;
    padding: 22px 16px 16px;
  }

  .swsocial-dialog-panel textarea {
    min-height: 220px;
    font-size: 16px;
  }
}

/* v1.5 Facebook Smart Share guided composer */
.swsocial-guided-dialog .swsocial-guide-panel {
  width: min(720px, 100%);
}

.swsocial-guide-note {
  max-width: 60ch;
}

.swsocial-guide-preview {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 14px;
  align-items: center;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.95);
}

.swsocial-guide-image {
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.06);
}

.swsocial-guide-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.swsocial-guide-copy {
  min-width: 0;
}

.swsocial-guide-copy span {
  display: block;
  font-weight: 900;
  line-height: 1.25;
  color: #0f172a;
}

.swsocial-guide-copy small {
  display: -webkit-box;
  margin-top: 5px;
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.45;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.swsocial-guide-label {
  display: block;
  margin: 12px 0 6px;
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #334155;
}

.swsocial-guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.swsocial-guide-copy-button,
.swsocial-guide-open-button {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.swsocial-guide-copy-button {
  background: #0f172a;
  color: #fff;
}

.swsocial-guide-open-button {
  background: #1877f2;
  color: #fff;
}

@media (max-width: 520px) {
  .swsocial-guide-preview {
    grid-template-columns: 1fr;
  }

  .swsocial-guide-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .swsocial-guide-copy-button,
  .swsocial-guide-open-button {
    width: 100%;
  }
}

/* v1.6.0 mobile compact icon row: small rounded icon buttons on one responsive line */
@media (max-width: 640px) {
  .swsocial-share:not(.swsocial-floating) .swsocial-buttons {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 2px 1px 5px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .swsocial-share:not(.swsocial-floating) .swsocial-buttons::-webkit-scrollbar {
    display: none;
  }

  .swsocial-share:not(.swsocial-floating) .swsocial-button,
  .swsocial-share:not(.swsocial-floating) .swsocial-icon-only,
  .swsocial-share:not(.swsocial-floating).swsocial-style-circle .swsocial-button {
    flex: 0 0 clamp(34px, 10.2vw, 42px) !important;
    width: clamp(34px, 10.2vw, 42px) !important;
    min-width: clamp(34px, 10.2vw, 42px) !important;
    max-width: clamp(34px, 10.2vw, 42px) !important;
    height: clamp(34px, 10.2vw, 42px) !important;
    min-height: clamp(34px, 10.2vw, 42px) !important;
    max-height: clamp(34px, 10.2vw, 42px) !important;
    padding: 0 !important;
    border-radius: 13px !important;
    box-shadow: 0 7px 16px rgba(15, 23, 42, 0.14) !important;
    aspect-ratio: 1 / 1;
  }

  .swsocial-share:not(.swsocial-floating).swsocial-style-circle .swsocial-button {
    border-radius: 999px !important;
  }

  .swsocial-share:not(.swsocial-floating).swsocial-style-square .swsocial-button {
    border-radius: 9px !important;
  }

  .swsocial-share:not(.swsocial-floating) .swsocial-label-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }

  .swsocial-share:not(.swsocial-floating) .swsocial-icon,
  .swsocial-share:not(.swsocial-floating) .swsocial-icon svg {
    width: clamp(15px, 4.5vw, 18px) !important;
    height: clamp(15px, 4.5vw, 18px) !important;
  }

  .swsocial-share:not(.swsocial-floating) .swsocial-heading {
    margin-bottom: 9px;
  }
}

@media (max-width: 390px) {
  .swsocial-share:not(.swsocial-floating) .swsocial-buttons {
    gap: 5px !important;
  }

  .swsocial-share:not(.swsocial-floating) .swsocial-button,
  .swsocial-share:not(.swsocial-floating) .swsocial-icon-only,
  .swsocial-share:not(.swsocial-floating).swsocial-style-circle .swsocial-button {
    flex-basis: clamp(31px, 9.5vw, 36px) !important;
    width: clamp(31px, 9.5vw, 36px) !important;
    min-width: clamp(31px, 9.5vw, 36px) !important;
    max-width: clamp(31px, 9.5vw, 36px) !important;
    height: clamp(31px, 9.5vw, 36px) !important;
    min-height: clamp(31px, 9.5vw, 36px) !important;
    max-height: clamp(31px, 9.5vw, 36px) !important;
    border-radius: 11px !important;
  }

  .swsocial-share:not(.swsocial-floating).swsocial-style-circle .swsocial-button {
    border-radius: 999px !important;
  }

  .swsocial-share:not(.swsocial-floating).swsocial-style-square .swsocial-button {
    border-radius: 8px !important;
  }
}

/* v1.7.0 mobile modal hardening: bottom sheet, safe areas, no viewport overflow */
html.swsocial-dialog-open,
body.swsocial-dialog-open {
  overflow: hidden !important;
  overscroll-behavior: contain;
}

.swsocial-dialog {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}

.swsocial-dialog-panel {
  max-height: min(92vh, 760px);
  max-height: min(92dvh, 760px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.swsocial-guided-dialog .swsocial-guide-panel {
  display: flex;
  flex-direction: column;
}

.swsocial-dialog-panel textarea,
.swsocial-guide-panel textarea {
  font-size: 16px;
  min-height: 150px;
  max-height: 34vh;
  max-height: 34dvh;
}

.swsocial-guide-actions {
  position: sticky;
  bottom: -24px;
  z-index: 2;
  margin-left: -24px;
  margin-right: -24px;
  margin-bottom: -24px;
  padding: 14px 24px 24px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), #ffffff 34%);
}

.swsocial-guide-copy-button,
.swsocial-guide-open-button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 780px) {
  .swsocial-dialog {
    align-items: end;
    place-items: end center;
    padding: 10px 10px max(10px, env(safe-area-inset-bottom));
  }

  .swsocial-dialog-panel {
    width: 100%;
    max-width: 100%;
    max-height: calc(100vh - 20px - env(safe-area-inset-top));
    max-height: calc(100dvh - 20px - env(safe-area-inset-top));
    padding: 20px 14px 14px;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -18px 60px rgba(15, 23, 42, 0.34);
  }

  .swsocial-dialog-panel strong {
    padding-right: 44px;
    font-size: clamp(1rem, 4.2vw, 1.12rem);
    line-height: 1.22;
  }

  .swsocial-dialog-panel p,
  .swsocial-guide-note {
    font-size: 0.94rem;
    line-height: 1.45;
  }

  .swsocial-dialog-close {
    top: 10px;
    right: 10px;
    width: 42px;
    height: 42px;
    font-size: 28px;
  }

  .swsocial-guide-preview {
    grid-template-columns: 76px 1fr;
    gap: 10px;
    margin: 10px 0;
    padding: 9px;
    border-radius: 14px;
  }

  .swsocial-guide-image {
    border-radius: 10px;
  }

  .swsocial-guide-copy span {
    font-size: 0.95rem;
  }

  .swsocial-guide-copy small {
    -webkit-line-clamp: 2;
    font-size: 0.82rem;
  }

  .swsocial-guide-label {
    margin-top: 10px;
    font-size: 0.72rem;
  }

  .swsocial-dialog-panel textarea,
  .swsocial-guide-panel textarea {
    min-height: 132px;
    max-height: 28vh;
    max-height: 28dvh;
    border-radius: 12px;
  }

  .swsocial-guide-actions {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-left: -14px;
    margin-right: -14px;
    margin-bottom: -14px;
    bottom: -14px;
    padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
  }

  .swsocial-guide-copy-button,
  .swsocial-guide-open-button {
    min-height: 48px;
    padding: 0 12px;
    border-radius: 14px;
    font-size: 0.94rem;
  }
}

@media (max-width: 520px) {
  .swsocial-guide-preview {
    grid-template-columns: 70px 1fr;
  }

  .swsocial-guide-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .swsocial-guide-copy-button,
  .swsocial-guide-open-button {
    width: 100%;
  }
}

@media (max-width: 360px) {
  .swsocial-dialog {
    padding-left: 6px;
    padding-right: 6px;
  }

  .swsocial-dialog-panel {
    padding-left: 12px;
    padding-right: 12px;
  }

  .swsocial-guide-preview {
    grid-template-columns: 1fr;
  }

  .swsocial-guide-image {
    max-height: 126px;
  }

  .swsocial-guide-actions {
    grid-template-columns: 1fr;
    margin-left: -12px;
    margin-right: -12px;
  }
}

@media (max-height: 620px) and (max-width: 900px) {
  .swsocial-dialog-panel {
    max-height: calc(100vh - 12px);
    max-height: calc(100dvh - 12px);
  }

  .swsocial-guide-note {
    margin-bottom: 8px;
  }

  .swsocial-guide-preview {
    grid-template-columns: 68px 1fr;
    margin: 8px 0;
  }

  .swsocial-guide-image {
    aspect-ratio: 1 / 1;
  }

  .swsocial-dialog-panel textarea,
  .swsocial-guide-panel textarea {
    min-height: 86px;
    max-height: 22vh;
    max-height: 22dvh;
  }
}

@media (max-width: 420px) {
  .swsocial-share:not(.swsocial-floating) .swsocial-buttons {
    display: flex !important;
    grid-template-columns: none !important;
  }
}
