/* Scheduled publishing dialog (static/js/publish-schedule.js).
   Own class names, so it looks the same over the Studio and over the Calendar. */
.ps-overlay { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15, 23, 42, .45); }
.ps-overlay[hidden] { display: none; }
.ps-dialog { width: 720px; max-width: 100%; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: #fff; color: #1e293b; border: 1px solid #e2e8f0; border-radius: 18px; box-shadow: 0 24px 60px rgba(15, 23, 42, .25); font-size: 13px; line-height: 1.5; text-align: left; }
.ps-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #eef0f4; }
.ps-title { margin: 0; font-size: 16px; font-weight: 700; color: #0f172a; }
.ps-close { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: #64748b; font-size: 22px; line-height: 1; cursor: pointer; }
.ps-close:hover { background: #f1f5f9; color: #0f172a; }
.ps-body { padding: 16px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.ps-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid #eef0f4; }
.ps-section { display: flex; flex-direction: column; gap: 10px; }
.ps-h { margin: 0; font-size: 13px; font-weight: 700; color: #0f172a; }
.ps-h4 { margin: 0; font-size: 13px; font-weight: 700; color: #4338ca; }
.ps-lead { margin: 0; font-size: 14px; color: #0f172a; }
.ps-hint { margin: 0; font-size: 12px; color: #64748b; }
.ps-warn { margin: 0; font-size: 12px; color: #b45309; }
.ps-label { font-size: 11px; font-weight: 700; color: #475569; }
.ps-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ps-input { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; color: #0f172a; font: inherit; }
.ps-input:focus { outline: 2px solid #6366f1; outline-offset: 1px; border-color: #6366f1; }
.ps-textarea { resize: vertical; min-height: 72px; }
.ps-count { align-self: flex-end; margin-top: -6px; font-size: 11px; color: #94a3b8; }
.ps-count-over { color: #dc2626; font-weight: 700; }
.ps-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ps-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ps-check { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #334155; cursor: pointer; }
.ps-check input, .ps-platform-head input, .ps-account input { width: 16px; height: 16px; accent-color: #4f46e5; }

.ps-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 14px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; color: #0f172a; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.ps-btn:hover { background: #f8fafc; }
.ps-btn:disabled { opacity: .55; cursor: default; }
.ps-btn-primary { border-color: #4f46e5; background: #4f46e5; color: #fff; }
.ps-btn-primary:hover { background: #4338ca; }
.ps-btn-danger { border-color: #fecaca; color: #b91c1c; }
.ps-btn-danger:hover { background: #fef2f2; }
.ps-btn-link { min-height: 0; padding: 0; border: 0; background: transparent; color: #4f46e5; }
.ps-btn-link:hover { background: transparent; text-decoration: underline; }

.ps-video { display: flex; gap: 12px; align-items: flex-start; }
/* A fixed box, so the form does not jump when the video's own size arrives. */
.ps-video video, .ps-video-empty { width: 200px; max-width: 45%; height: 200px; object-fit: contain; border-radius: 12px; background: #0f172a; }
.ps-video-empty { display: flex; align-items: center; justify-content: center; color: #cbd5e1; font-size: 12px; }
.ps-video-meta { display: flex; flex-direction: column; gap: 6px; min-width: 0; word-break: break-word; }
.ps-cover { display: flex; gap: 12px; align-items: flex-start; }
.ps-cover-img, .ps-cover-empty { width: 132px; height: 176px; flex: none; border-radius: 12px; border: 1px solid #e2e8f0; background: #f1f5f9; object-fit: cover; }
.ps-cover-empty { display: flex; align-items: center; justify-content: center; padding: 8px; color: #94a3b8; font-size: 12px; text-align: center; }
.ps-cover-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ps-cover-thumb { width: 54px; height: 72px; border-radius: 8px; border: 1px solid #e2e8f0; object-fit: cover; }
.ps-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
label.ps-btn { position: relative; }
label.ps-btn:focus-within { outline: 2px solid #6366f1; outline-offset: 1px; }
.ps-btn-off { opacity: .55; pointer-events: none; }
.ps-videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.ps-video-option, .ps-list-item { display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.ps-video-option { padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; }
.ps-video-option:hover, .ps-list-item:hover { border-color: #818cf8; background: #eef2ff; }

.ps-platforms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ps-platform, .ps-card { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid #e2e8f0; border-radius: 12px; background: #f8fafc; }
.ps-platform-on { border-color: #818cf8; background: #eef2ff; }
.ps-platform-head { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.ps-accounts { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; border-top: 1px dashed #cbd5e1; }
.ps-account { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; cursor: pointer; }
.ps-account-off { color: #94a3b8; cursor: default; }
.ps-card.ps-row { flex-direction: row; }

.ps-badge, .ps-status { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.ps-badge-auto_publish_supported { background: #dcfce7; color: #166534; }
.ps-badge-approval_required { background: #fef3c7; color: #92400e; }
.ps-badge-manual_publish_only { background: #e2e8f0; color: #334155; }
.ps-badge-not_supported { background: #fee2e2; color: #991b1b; }
.ps-status-draft, .ps-status-cancelled { background: #e2e8f0; color: #334155; }
.ps-status-scheduled { background: #e0f2fe; color: #075985; }
.ps-status-preparing, .ps-status-publishing { background: #e0e7ff; color: #3730a3; }
.ps-status-published { background: #dcfce7; color: #166534; }
.ps-status-failed { background: #fee2e2; color: #991b1b; }
.ps-status-manual_action_required { background: #fef3c7; color: #92400e; }

.ps-when { margin: 0; font-size: 14px; font-weight: 700; color: #0f172a; }
.ps-summary-title { margin: 0; font-weight: 700; }
.ps-summary-text { margin: 0; color: #334155; white-space: pre-wrap; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ps-error { padding: 10px 12px; border: 1px solid #fecaca; border-radius: 12px; background: #fef2f2; color: #991b1b; display: flex; flex-direction: column; gap: 8px; }
.ps-notice { padding: 10px 12px; border: 1px solid #fde68a; border-radius: 12px; background: #fffbeb; color: #92400e; }
.ps-error p, .ps-notice p { margin: 0; }
.ps-detail-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; align-items: baseline; white-space: pre-wrap; word-break: break-word; }
.ps-detail-row a { color: #4f46e5; }
.ps-history { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.ps-history li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 8px; background: #f8fafc; }

/* Calendar: scheduled posts are buttons, and carry their own status. */
#calendar-day-items-list button.calendar-event { width: 100%; cursor: pointer; font: inherit; }
#calendar-day-items-list button.calendar-event:hover { border-color: #818cf8; background: #eef2ff; }
.calendar-key-manual { background: #d97706; }
.calendar-actions { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 640px) {
  .ps-platforms, .ps-grid3 { grid-template-columns: 1fr; }
  .ps-video { flex-direction: column; }
  .ps-cover { flex-direction: column; }
  .ps-video video, .ps-video-empty { width: 100%; max-width: 100%; }
  .ps-detail-row { grid-template-columns: 1fr; gap: 2px; }
  .ps-foot .ps-btn { flex: 1 1 auto; }
}
