/* Social Posts panel. Scoped under #socialPosts (rows) and .social-dialog (modals, which are
   appended to <body> and so cannot rely on a host selector). Colours come from the dashboard
   theme tokens, so no separate light-theme block is needed. */
#socialPosts { min-width: 0; }
.social-toolbar, .social-tabs, .social-actions, .social-dialog-head, .social-dialog-foot { display: flex; align-items: center; gap: 8px; }
.social-toolbar { justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.social-tabs { border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.social-tab { border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); min-height: 40px; padding: 0 14px; font-size: var(--fs-sm); cursor: pointer; }
.social-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--green); }
#socialPosts .search { width: min(320px, 100%); }
.social-table { min-width: 720px; }
.social-table th, .social-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); }
.social-table td { max-width: 340px; overflow-wrap: anywhere; }
.social-table .social-actions { justify-content: flex-end; white-space: nowrap; }
.social-title { color: var(--ink); font-weight: 600; }
.social-meta { margin-top: 4px; color: var(--muted); font-size: var(--fs-xs); }
.social-empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.social-notice { border-left: 3px solid var(--blue); padding: 10px 14px; margin-bottom: 14px; color: var(--muted); font-size: var(--fs-sm); background: var(--paper); }
.social-error { color: var(--coral); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.social-error:empty { display: none; }
.social-dialog { width: min(820px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--white); }
.social-dialog::backdrop { background: #0009; }
.social-dialog form { display: flex; flex-direction: column; max-height: calc(100dvh - 50px); }
.social-dialog-head { padding: 16px 20px; justify-content: space-between; border-bottom: 1px solid var(--line); }
.social-dialog-head h2 { margin: 0; font-size: 18px; }
.social-dialog-body { padding: 20px; overflow-y: auto; display: grid; gap: 18px; }
.social-dialog-foot { flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line); justify-content: flex-end; }
.social-field { display: grid; gap: 7px; min-width: 0; }
.social-field > label, .social-field > span, .social-dialog legend { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.social-dialog .search { width: 100%; color: var(--ink); background: var(--paper); }
.social-dialog textarea { min-height: 130px; color: var(--ink); background: var(--paper); font: inherit; border: 1px solid var(--line); border-radius: 5px; padding: 10px; }
.social-dialog fieldset { margin: 0; padding: 0; border: 0; display: grid; gap: 8px; }
.social-variants { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 10px; }
.social-variants textarea { min-height: 100px; }
.social-destinations { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.social-destination { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 5px; font-size: var(--fs-sm); min-width: 0; overflow-wrap: anywhere; }
.social-destination input { accent-color: var(--green); }
.social-schedule { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.social-preview { white-space: pre-wrap; overflow-wrap: anywhere; border-left: 2px solid var(--line); padding: 8px 12px; color: var(--ink); margin: 8px 0 0; font-size: var(--fs-sm); }
.social-save-activity { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; font-size: 12px; }
.social-save-activity[hidden] { display: none; }
.social-platform { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; }
.social-platform-logo { display: inline-grid; place-items: center; width: 28px; height: 28px; flex: 0 0 28px; border-radius: 4px; background: #fff; border: 1px solid #d3dae2; }
.social-platform-logo img { display: block; width: 18px; height: 18px; }
.social-platform-facebook img, .social-platform-linkedin img { filter: invert(30%) sepia(94%) saturate(1350%) hue-rotate(183deg) brightness(88%); }
#socialTikTokSettings[hidden] { display: none; }
#socialTikTokSettings > label { display: block; margin: 10px 0; font-size: 13px; }
.social-spinner { width: 16px; height: 16px; flex: 0 0 16px; border: 2px solid var(--line); border-top-color: currentColor; border-radius: 50%; animation: social-spin .8s linear infinite; }
@keyframes social-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .social-spinner { animation: none; } }
.social-post-preview { white-space: normal; border: 1px solid var(--line); border-radius: 8px; padding: 0; overflow: hidden; }
.social-preview-header { display: flex; align-items: center; gap: 10px; padding: 14px; }
.social-preview-avatar { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; background: #1877d2; color: #fff; font-weight: 700; }
.social-preview-identity { min-width: 0; flex: 1; }
.social-preview-identity strong { display: block; font-size: 15px; overflow-wrap: anywhere; }
.social-preview-byline { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; margin-top: 3px; }
.social-preview-menu { align-self: flex-start; font-weight: 700; }
.social-post-preview #socialTextPreview { white-space: pre-wrap; padding: 0 14px 14px; }
.social-post-preview #socialPostMediaPreview img, .social-post-preview #socialPostMediaPreview video { width: 100%; max-height: 420px !important; background: #111; }
.social-summary { font-size: var(--fs-xs); color: var(--muted); }
.social-pagination { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 14px; font-size: var(--fs-xs); color: var(--muted); }
#socialPosts button:focus-visible, .social-dialog button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (max-width: 680px) {
  .social-variants, .social-destinations, .social-schedule { grid-template-columns: minmax(0, 1fr); }
  .social-tab { padding-inline: 10px; }
  #socialPosts .search { width: 100%; }
  .social-dialog-body { padding: 16px; }
  .social-dialog-foot { padding: 12px 16px; }
  .social-dialog { max-height: calc(100dvh - 24px); }
}
