.social-snapshot-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  border-color: #3d6d91;
  color: #f7fbff;
  background: #10253a;
  cursor: pointer;
}

.social-snapshot-trigger:hover {
  border-color: #72d4ff;
  background: #173551;
}

.page-actions.has-social-snapshot {
  flex-wrap: wrap;
}

.page-actions.has-social-snapshot .social-snapshot-trigger {
  flex: 1 0 100%;
  order: 999;
  width: 100%;
  margin-top: 2px;
  border-color: #6f7fff;
  background: #5364e8;
  color: #fff;
}

.page-actions.has-social-snapshot .social-snapshot-trigger:hover {
  border-color: #a8b0ff;
  background: #6676f2;
}

.social-snapshot-dialog {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  background: rgba(2, 8, 18, 0.86);
  backdrop-filter: blur(10px);
}

body.social-snapshot-open {
  overflow: hidden;
}

.social-snapshot-panel {
  width: min(900px, 100%);
  padding: 18px;
  border: 1px solid #29405a;
  border-radius: 8px;
  background: #07111e;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.58);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}

.social-snapshot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 2px 2px 16px;
}

.social-snapshot-head > div {
  display: grid;
  gap: 4px;
}

.social-snapshot-head span {
  color: #74cfff;
  font-family: var(--mono, ui-monospace, SFMono-Regular, Consolas, monospace);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.social-snapshot-head strong {
  color: #f5f9ff;
  font-size: 1.18rem;
}

.social-snapshot-close {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #2d4763;
  border-radius: 6px;
  color: #eaf3ff;
  background: #0d1a2a;
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
}

.social-snapshot-preview {
  display: block;
  aspect-ratio: 1200 / 630;
  overflow: hidden;
  border: 1px solid #29405a;
  border-radius: 6px;
  background: #050d18;
}

.social-snapshot-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.social-snapshot-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.social-snapshot-actions button,
.social-snapshot-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid #31506e;
  border-radius: 6px;
  color: #f7fbff;
  background: #0c1a2a;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.social-snapshot-actions button:first-child,
.social-snapshot-actions a:last-child {
  border-color: #3f7a9f;
  background: #12304a;
}

.social-snapshot-actions button:hover,
.social-snapshot-actions a:hover,
.social-snapshot-close:hover {
  border-color: #71cffc;
  background: #173551;
}

.social-snapshot-actions button:focus-visible,
.social-snapshot-actions a:focus-visible,
.social-snapshot-close:focus-visible,
.social-snapshot-trigger:focus-visible {
  outline: 2px solid #72d4ff;
  outline-offset: 2px;
}

.social-snapshot-actions button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.social-snapshot-status {
  min-height: 20px;
  margin: 12px 2px 0;
  color: #8fa6bc;
  font-size: 0.78rem;
}

.social-snapshot-status[data-state="success"] {
  color: #55e0ad;
}

.social-snapshot-status[data-state="fallback"] {
  color: #f2c777;
}

.social-snapshot-status[data-state="error"] {
  color: #ff8094;
}

@media (max-width: 720px) {
  .page-actions.has-social-snapshot .social-snapshot-trigger {
    width: 100%;
    min-height: 48px;
  }

  .social-snapshot-dialog {
    align-items: start;
    padding: 12px;
  }

  .social-snapshot-panel {
    margin-top: max(8px, env(safe-area-inset-top));
    padding: 12px;
  }

  .social-snapshot-head {
    padding-bottom: 12px;
  }

  .social-snapshot-head strong {
    font-size: 1rem;
  }

  .social-snapshot-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .social-snapshot-actions button,
  .social-snapshot-actions a {
    min-height: 44px;
    padding: 0 8px;
    font-size: 0.78rem;
  }
}
