/* ============================================================================
 * Universal flow shell — shared tokens for /universal_form and /universal_result
 * Loaded globally from base.html so both pages share the same bento aesthetic
 * (card surfaces, progress stepper, sticky summary, sticky footer CTA).
 * Prefijo `.uf-` reservado para este sistema; cualquier uso fuera de los
 * templates universal_* es no intencional.
 * ========================================================================== */

.uf-page-topbar.progressive-topbar {
  margin-bottom: 0.75rem;
}

.uf-page-shell {
  max-width: 1020px;
  margin: 0 auto;
  padding: 0 16px 24px;
}

/* ===== Hero (header card compartido) ===== */
.uf-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  background: var(--card-bg-dark);
  border: 1px solid rgba(187, 134, 252, 0.28);
  border-radius: 18px;
  padding: 22px 24px;
  margin-bottom: 18px;
}
body.light-mode .uf-hero {
  background: var(--card-bg-light);
  border-color: rgba(124, 77, 255, 0.18);
}
.uf-hero-title {
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-dark);
  transition: color 0.3s;
}
body.light-mode .uf-hero-title { color: var(--text-light); }
.uf-hero-subtitle {
  margin: 4px 0 0;
  color: rgba(var(--text-dark-rgb), 0.72);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.3s;
}
body.light-mode .uf-hero-subtitle { color: rgba(var(--text-light-rgb), 0.68); }
.uf-hero-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--brand-color-light);
  text-decoration: none;
}
.uf-hero-link:hover { text-decoration: underline; }
.uf-hero-art {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
}
.uf-hero-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ===== Progress stepper (solo universal_form) ===== */
.uf-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px 18px;
}
.uf-progress-step {
  background: transparent;
  border: 0;
  padding: 6px 4px;
  display: flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  font: inherit;
  border-radius: 6px;
}
.uf-progress-step.is-active { color: #ffffff; }
.uf-progress-step.is-complete .uf-progress-dot {
  background: linear-gradient(135deg, #bb86fc 0%, #7c4dff 100%);
  color: #fff;
  border-color: transparent;
}
.uf-progress-step:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.35);
}
body.light-mode .uf-progress-step { color: rgba(17, 24, 39, 0.55); }
body.light-mode .uf-progress-step.is-active { color: #111827; }
.uf-progress-dot {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid #36363A;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  background: #1C1C1E;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
body.light-mode .uf-progress-dot {
  background: #ffffff;
  border-color: rgba(17, 24, 39, 0.15);
  color: #111827;
}
.uf-progress-label { font-size: 0.85rem; font-weight: 600; }
.uf-progress-bar {
  flex: 1;
  height: 3px;
  background: #36363A;
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}
.uf-progress-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 0;
  background: linear-gradient(90deg, #bb86fc 0%, #7c4dff 100%);
  border-radius: inherit;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.uf-progress-bar.is-filled::before { width: 100%; }
/* Barra que lleva al paso Imagen (opcional): relleno ámbar, no violeta. */
.uf-progress-bar--optional::before {
  background: linear-gradient(90deg, #ffb45a 0%, #ff9f0a 100%);
}
body.light-mode .uf-progress-bar { background: rgba(17, 24, 39, 0.12); }
@media (prefers-reduced-motion: reduce) {
  .uf-progress-bar::before { transition: none; }
}

/* ===== Step card (base bento del wizard y de los platform cards del result) ===== */
.uf-step {
  background: var(--card-bg-dark);
  border: 1px solid #36363A;
  border-radius: 18px;
  padding: 24px;
  transition: background-color 0.3s, border-color 0.3s;
  animation: ufStepIn 0.28s cubic-bezier(0.4, 0, 0.2, 1) both;
}
body.light-mode .uf-step {
  background: var(--card-bg-light);
  border-color: rgba(17, 24, 39, 0.1);
}
.uf-step[hidden] { display: none !important; }
.uf-step-title {
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
  color: var(--text-dark);
  transition: color 0.3s;
}
body.light-mode .uf-step-title { color: var(--text-light); }
.uf-step-optional { opacity: 0.6; font-weight: 500; font-size: 0.85em; }
.uf-step-lead {
  margin: 0 0 18px;
  color: rgba(var(--text-dark-rgb), 0.72);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.3s;
}
body.light-mode .uf-step-lead { color: rgba(var(--text-light-rgb), 0.68); }
.uf-step-hint-instagram {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(225, 48, 108, 0.08);
  border: 1px solid rgba(225, 48, 108, 0.22);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
}
body.light-mode .uf-step-hint-instagram {
  background: rgba(225, 48, 108, 0.06);
  border-color: rgba(225, 48, 108, 0.18);
  color: #111827;
}
.uf-step-hint-instagram[hidden] { display: none !important; }

/* ===== Manual compose — secciones en canvas (sin mega-cards apiladas) ===== */
.uf-compose-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 8px;
}

.uf-compose-section {
  padding: 28px 0;
  animation: ufStepIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.uf-compose-section:nth-child(1) { animation-delay: 0.02s; }
.uf-compose-section:nth-child(2) { animation-delay: 0.08s; }
.uf-compose-section:nth-child(3) { animation-delay: 0.14s; }

.uf-compose-section + .uf-compose-section {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

body.light-mode .uf-compose-section + .uf-compose-section {
  border-top-color: rgba(17, 24, 39, 0.08);
}

.uf-compose-section-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.uf-compose-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: linear-gradient(135deg, #bb86fc 0%, #7c4dff 100%);
  box-shadow: 0 2px 8px rgba(124, 77, 255, 0.28);
}

body.light-mode .uf-compose-step {
  background: linear-gradient(135deg, #E1306C 0%, #F77737 100%);
  box-shadow: 0 2px 8px rgba(225, 48, 108, 0.22);
}

.uf-compose-section-copy {
  flex: 1;
  min-width: 0;
}

.uf-compose-section-title {
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
  color: var(--text-dark);
  line-height: 1.25;
}

body.light-mode .uf-compose-section-title {
  color: var(--text-light);
}

.uf-compose-section-lead {
  margin: 0;
  color: rgba(var(--text-dark-rgb), 0.68);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.45;
}

body.light-mode .uf-compose-section-lead {
  color: rgba(var(--text-light-rgb), 0.65);
}

.uf-compose-section-body {
  padding-left: 46px;
}

.uf-compose-section-body .uf-step-hint-instagram:not([hidden]) {
  margin-top: 0;
  margin-bottom: 14px;
}

@media (max-width: 520px) {
  .uf-compose-section-body {
    padding-left: 0;
  }
}

.uf-caption-textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 16px 18px;
  font-size: 1rem;
  line-height: 1.55;
  font-family: inherit;
  resize: vertical;
  min-height: 160px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dark);
}

body.light-mode .uf-caption-textarea {
  border-color: rgba(17, 24, 39, 0.12);
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-light);
}

.uf-caption-textarea:focus {
  border-color: rgba(187, 134, 252, 0.55);
  box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.18);
}

body.light-mode .uf-caption-textarea:focus {
  border-color: rgba(225, 48, 108, 0.45);
  box-shadow: 0 0 0 3px rgba(225, 48, 108, 0.14);
}

.uf-caption-textarea::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

body.light-mode .uf-caption-textarea::placeholder {
  color: rgba(17, 24, 39, 0.42);
}

.uf-caption-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.5);
}

body.light-mode .uf-caption-meta {
  color: rgba(17, 24, 39, 0.5);
}

.uf-caption-meta.is-near-limit {
  color: #fbbf24;
}

.uf-caption-meta.is-over-limit {
  color: #f87171;
}

.uf-caption-meta-hint {
  font-size: 0.75rem;
  opacity: 0.75;
}

.uf-upload-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 120px;
  padding: 20px 16px;
  border: 2px dashed rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.92rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

body.light-mode .uf-upload-dropzone {
  border-color: rgba(17, 24, 39, 0.16);
  background: rgba(17, 24, 39, 0.02);
  color: rgba(17, 24, 39, 0.72);
}

.uf-upload-dropzone:hover,
.uf-upload-dropzone:focus-within {
  border-color: rgba(187, 134, 252, 0.45);
  background: rgba(187, 134, 252, 0.06);
  transform: translateY(-1px);
}

body.light-mode .uf-upload-dropzone:hover,
body.light-mode .uf-upload-dropzone:focus-within {
  border-color: rgba(225, 48, 108, 0.35);
  background: rgba(225, 48, 108, 0.04);
}

.uf-upload-dropzone i {
  color: #bb86fc;
  opacity: 0.9;
}

body.light-mode .uf-upload-dropzone i {
  color: #E1306C;
}

.uf-upload-dropzone-hint {
  font-size: 0.78rem;
  font-weight: 500;
  opacity: 0.65;
}

.uf-file-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.uf-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(187, 134, 252, 0.12);
  border: 1px solid rgba(187, 134, 252, 0.22);
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
}

body.light-mode .uf-file-chip {
  background: rgba(124, 77, 255, 0.08);
  border-color: rgba(124, 77, 255, 0.18);
  color: #111827;
}

.uf-file-chip i {
  font-size: 0.7rem;
  opacity: 0.75;
}

.uf-form-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 20px 0 calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  bottom: 0;
  z-index: 10;
  background: rgba(var(--surface-dark-rgb, 30, 30, 30), 0.92);
  backdrop-filter: blur(10px);
}

body.light-mode .uf-form-footer {
  border-top-color: rgba(17, 24, 39, 0.08);
  background: rgba(255, 255, 255, 0.94);
}

.uf-form {
  min-width: 0;
}

.uf-compose-summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.uf-compose-summary-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

body.light-mode .uf-compose-summary-label {
  color: rgba(17, 24, 39, 0.65);
}

.uf-compose-summary-text {
  font-size: 0.92rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

body.light-mode .uf-compose-summary-text {
  color: #111827;
}

@media (max-width: 560px) {
  .uf-form-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .uf-form-footer .uf-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .uf-compose-section {
    animation: none;
  }
}

/* ===== Footer (sticky CTA bar, compartido) ===== */
.uf-footer {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px 0 0;
  margin-top: 16px;
}
.uf-footer--center {
  justify-content: center;
}
.uf-footer-spacer { flex: 1; }
.uf-footer-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.uf-footer-title {
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.96);
}
body.light-mode .uf-footer-title { color: #111827; }
.uf-footer-subtitle {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
}
body.light-mode .uf-footer-subtitle { color: rgba(17, 24, 39, 0.65); }
@media (max-width: 991px) {
  .uf-footer {
    position: sticky;
    bottom: 0;
    background: var(--card-bg-dark);
    border-top: 1px solid #36363A;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    z-index: 10;
    margin: 12px -16px 0;
  }
  body.light-mode .uf-footer {
    background: var(--card-bg-light);
    border-top-color: rgba(17, 24, 39, 0.1);
  }
  .uf-footer-info { flex: 1; min-width: 0; }
}

/* ===== Buttons (compartidos) ===== */
.uf-btn {
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 600;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 0.95rem;
  border: 0;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  line-height: 1;
}
.uf-btn:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.35); }
.uf-btn[hidden] { display: none !important; }
.uf-btn-ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid #36363A;
}
body.light-mode .uf-btn-ghost {
  color: #111827;
  border-color: rgba(17, 24, 39, 0.15);
}
.uf-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
body.light-mode .uf-btn-secondary {
  background: rgba(17, 24, 39, 0.04);
  color: #111827;
  border-color: rgba(17, 24, 39, 0.12);
}
.uf-btn-primary {
  background: linear-gradient(135deg, #bb86fc 0%, #7c4dff 100%);
  color: #ffffff;
}
.uf-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(187, 134, 252, 0.35);
  color: #ffffff;
}
body.light-mode .uf-btn-primary {
  background: linear-gradient(135deg, #E1306C 0%, #F77737 100%);
}
body.light-mode .uf-btn-primary:hover {
  box-shadow: 0 8px 20px rgba(225, 48, 108, 0.35);
}
.uf-btn-primary:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

/* ===== Animations ===== */
@keyframes ufStepIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .uf-step { animation: none; }
}

/* ===== Platform picker — horizontal pills (wizard + manual compose) =====
   Scoped to .uf-platform-picker; universal_result rail keeps its own styles.
   ============================================================== */
.uf-platform-picker {
  -webkit-font-smoothing: antialiased;
}

.uf-platform-picker.uf-platform-grid,
.platform-buttons.uf-platform-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  overflow: visible;
}

.uf-platform-picker .platform-btn.uf-platform-chip {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 44px;
  min-width: 0;
  padding: 8px 14px 8px 8px;
  border: 0;
  border-radius: 14px;
  background: var(--card-bg-dark);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.08);
  transition:
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.2s ease,
    background-color 0.2s ease;
}

body.light-mode .uf-platform-picker .platform-btn.uf-platform-chip {
  background: var(--card-bg-light);
  color: rgba(15, 23, 42, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 1px 2px rgba(15, 23, 42, 0.06),
    0 0 0 1px rgba(148, 163, 184, 0.22);
}

.uf-platform-picker .platform-btn.uf-platform-chip:hover {
  transform: translateY(-1px);
  color: rgba(255, 255, 255, 0.95);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 4px 12px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.12);
}

body.light-mode .uf-platform-picker .platform-btn.uf-platform-chip:hover {
  color: rgba(15, 23, 42, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 4px 12px rgba(15, 23, 42, 0.08),
    0 0 0 1px rgba(100, 116, 139, 0.28);
}

.uf-platform-picker .platform-btn.uf-platform-chip:active {
  transform: scale(0.96);
}

.uf-platform-picker .platform-btn.uf-platform-chip:focus-visible {
  outline: 0;
  box-shadow:
    0 0 0 3px rgba(187, 134, 252, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.14);
}

body.light-mode .uf-platform-picker .platform-btn.uf-platform-chip:focus-visible {
  box-shadow:
    0 0 0 3px rgba(225, 48, 108, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 1px 2px rgba(15, 23, 42, 0.06);
}

.uf-platform-picker .uf-platform-chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
}

body.light-mode .uf-platform-picker .uf-platform-chip-icon {
  background: rgba(15, 23, 42, 0.05);
}

.uf-platform-picker .uf-platform-chip-icon i {
  font-size: 18px;
  line-height: 1;
}

.uf-platform-picker .uf-platform-chip-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}

.uf-platform-picker .platform-btn[data-platform="instagram"] .uf-platform-chip-icon {
  background: rgba(225, 48, 108, 0.14);
  color: #E1306C;
}

.uf-platform-picker .platform-btn[data-platform="facebook"] .uf-platform-chip-icon {
  background: rgba(24, 119, 242, 0.14);
  color: #1877F2;
}

.uf-platform-picker .platform-btn[data-platform="linkedin"] .uf-platform-chip-icon {
  background: rgba(10, 102, 194, 0.14);
  color: #0A66C2;
}

.uf-platform-picker .platform-btn[data-platform="x"] .uf-platform-chip-icon {
  background: rgba(156, 163, 175, 0.16);
  color: rgba(255, 255, 255, 0.92);
}

body.light-mode .uf-platform-picker .platform-btn[data-platform="x"] .uf-platform-chip-icon {
  background: rgba(15, 23, 42, 0.08);
  color: #111827;
}

.uf-platform-picker .uf-platform-chip-label,
.uf-platform-picker .uf-chip-label {
  display: block;
  margin: 0;
  font-family: 'Montserrat', 'Roboto', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  text-wrap: balance;
  color: inherit;
}

.uf-platform-picker .uf-platform-chip-check {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #bb86fc, #7c4dff);
  color: #fff;
  font-size: 8px;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--card-bg-dark), 0 2px 5px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: scale(0.4);
  pointer-events: none;
  z-index: 2;
  transition:
    opacity 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

body.light-mode .uf-platform-picker .uf-platform-chip-check {
  box-shadow: 0 0 0 2px var(--card-bg-light), 0 2px 5px rgba(0, 0, 0, 0.18);
}

.uf-platform-picker .platform-btn.selected .uf-platform-chip-check,
.uf-platform-picker .platform-btn.active .uf-platform-chip-check {
  opacity: 1;
  transform: scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .uf-platform-picker .platform-btn.uf-platform-chip,
  .uf-platform-picker .uf-platform-chip-check {
    transition: none;
  }
}

/* Selected — tint + ring per network (label stays readable) */
.uf-platform-picker .platform-btn.selected[data-platform="instagram"],
.uf-platform-picker .platform-btn.active[data-platform="instagram"] {
  background: rgba(225, 48, 108, 0.12);
  color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 2px rgba(225, 48, 108, 0.45), 0 4px 14px rgba(225, 48, 108, 0.12);
}

body.light-mode .uf-platform-picker .platform-btn.selected[data-platform="instagram"],
body.light-mode .uf-platform-picker .platform-btn.active[data-platform="instagram"] {
  background: rgba(225, 48, 108, 0.1);
  color: rgba(15, 23, 42, 0.92);
  box-shadow: 0 0 0 2px rgba(225, 48, 108, 0.4), 0 4px 14px rgba(225, 48, 108, 0.08);
}

.uf-platform-picker .platform-btn.selected[data-platform="facebook"],
.uf-platform-picker .platform-btn.active[data-platform="facebook"] {
  background: rgba(24, 119, 242, 0.12);
  color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.45), 0 4px 14px rgba(24, 119, 242, 0.12);
}

body.light-mode .uf-platform-picker .platform-btn.selected[data-platform="facebook"],
body.light-mode .uf-platform-picker .platform-btn.active[data-platform="facebook"] {
  background: rgba(24, 119, 242, 0.1);
  color: rgba(15, 23, 42, 0.92);
  box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.4), 0 4px 14px rgba(24, 119, 242, 0.08);
}

.uf-platform-picker .platform-btn.selected[data-platform="linkedin"],
.uf-platform-picker .platform-btn.active[data-platform="linkedin"] {
  background: rgba(10, 102, 194, 0.12);
  color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 2px rgba(10, 102, 194, 0.45), 0 4px 14px rgba(10, 102, 194, 0.12);
}

body.light-mode .uf-platform-picker .platform-btn.selected[data-platform="linkedin"],
body.light-mode .uf-platform-picker .platform-btn.active[data-platform="linkedin"] {
  background: rgba(10, 102, 194, 0.1);
  color: rgba(15, 23, 42, 0.92);
  box-shadow: 0 0 0 2px rgba(10, 102, 194, 0.4), 0 4px 14px rgba(10, 102, 194, 0.08);
}

.uf-platform-picker .platform-btn.selected[data-platform="x"],
.uf-platform-picker .platform-btn.active[data-platform="x"] {
  background: rgba(156, 163, 175, 0.14);
  color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 2px rgba(156, 163, 175, 0.45), 0 4px 14px rgba(0, 0, 0, 0.18);
}

body.light-mode .uf-platform-picker .platform-btn.selected[data-platform="x"],
body.light-mode .uf-platform-picker .platform-btn.active[data-platform="x"] {
  background: rgba(15, 23, 42, 0.08);
  color: rgba(15, 23, 42, 0.92);
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.28), 0 4px 14px rgba(15, 23, 42, 0.06);
}

body.light-mode .uf-platform-picker .platform-btn.selected .uf-platform-chip-check,
body.light-mode .uf-platform-picker .platform-btn.active .uf-platform-chip-check {
  background: linear-gradient(135deg, #E1306C, #F77737);
}

/* Dot naranja para redes no conectadas (universal_result) */
.platform-btn-warn-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff9f0a;
  box-shadow: 0 0 6px rgba(255, 159, 10, 0.6);
}
body.light-mode .platform-btn-warn-dot { box-shadow: none; }

/* ===== Responsive tweaks compartidos ===== */
@media (max-width: 480px) {
  .uf-hero {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .uf-hero-art { width: 72px; height: 72px; }
  .uf-progress-label { display: none; }
}

/* Variante del chip grid para /universal_result: 4 cols en desktop,
   2x2 en mobile (no tiene el botón "Todas las redes"). */
.uf-platform-grid.uf-platform-grid-result {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.uf-platform-grid.uf-platform-grid-result .platform-btn[data-platform="all"] {
  grid-column: auto;
}
@media (max-width: 720px) {
  .uf-platform-grid.uf-platform-grid-result { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ===== Create post hub (choice cards) ===== */
.uf-hub-page,
.uf-tpl-page {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.uf-hub-shell,
.uf-tpl-shell {
  max-width: 1160px;
  margin-left: auto;
  margin-right: auto;
}

.uf-hub-page .uf-hub-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.uf-hub-page .uf-hub-hero {
  width: 100%;
}

.uf-hub-eyebrow {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(var(--text-dark-rgb), 0.52);
}
body.light-mode .uf-hub-eyebrow {
  color: rgba(var(--text-light-rgb), 0.48);
}

.uf-hub-title,
.uf-tpl-title {
  text-wrap: balance;
}

.uf-hub-subtitle,
.uf-tpl-subtitle {
  text-wrap: pretty;
  max-width: 34ch;
}

.uf-hub-secondary-link {
  margin-top: 10px;
}

.uf-hub-art img {
  outline: 1px solid rgba(255, 255, 255, 0.1);
  outline-offset: -1px;
  border-radius: 16px;
}
body.light-mode .uf-hub-art img {
  outline-color: rgba(0, 0, 0, 0.1);
}

@keyframes ufChoiceIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.uf-hub-hero {
  animation: ufChoiceIn 0.42s cubic-bezier(0.2, 0, 0, 1) backwards;
}

.uf-hub-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  width: min(100%, 1080px);
  margin: 12px auto 0;
}
@media (min-width: 768px) {
  .uf-hub-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-top: 20px;
  }
}

.uf-hub-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  min-height: 210px;
  padding: 28px 24px 24px;
  border-radius: 24px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  background: var(--card-bg-dark);
  color: inherit;
  text-decoration: none;
  box-shadow: none;
  transition-property: transform, box-shadow, border-color, background-color;
  transition-duration: 0.22s;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
  animation: ufChoiceIn 0.48s cubic-bezier(0.2, 0, 0, 1) backwards;
  animation-delay: calc(0.06s + (var(--uf-hub-stagger, 0) * 0.07s));
}
.uf-hub-grid .uf-hub-card:nth-child(1) { --uf-hub-stagger: 0; }
.uf-hub-grid .uf-hub-card:nth-child(2) { --uf-hub-stagger: 1; }
.uf-hub-grid .uf-hub-card:nth-child(3) { --uf-hub-stagger: 2; }

body.light-mode .uf-hub-card {
  background: #fff;
  border: 2.5px solid rgba(17, 24, 39, 0.88);
  box-shadow: 0 2px 0 rgba(17, 24, 39, 0.04);
}

.uf-hub-card:hover {
  transform: translateY(-3px);
  border-color: rgba(187, 134, 252, 0.45);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  text-decoration: none;
  color: inherit;
}

body.light-mode .uf-hub-card:hover {
  border-color: rgba(17, 24, 39, 0.95);
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.08);
}

.uf-hub-card:active {
  transform: translateY(0) scale(0.98);
}

.uf-hub-card:focus-visible {
  outline: 2px solid #bb86fc;
  outline-offset: 3px;
}

.uf-hub-card-icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 0;
  font-size: 1.2rem;
  box-shadow: none;
}
.uf-hub-card--violet .uf-hub-card-icon {
  color: #7c4dff;
  background: rgba(187, 134, 252, 0.18);
}
.uf-hub-card--amber .uf-hub-card-icon {
  color: #d97706;
  background: rgba(251, 191, 36, 0.22);
}
.uf-hub-card--green .uf-hub-card-icon {
  color: #059669;
  background: rgba(52, 211, 153, 0.2);
}

body.light-mode .uf-hub-card--violet .uf-hub-card-icon {
  color: #6d28d9;
  background: #ede9fe;
}
body.light-mode .uf-hub-card--amber .uf-hub-card-icon {
  color: #b45309;
  background: #fef3c7;
}
body.light-mode .uf-hub-card--green .uf-hub-card-icon {
  color: #047857;
  background: #d1fae5;
}

.uf-hub-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 0;
}

.uf-hub-card-title {
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.3;
  text-wrap: balance;
  color: var(--text-dark);
}
body.light-mode .uf-hub-card-title { color: #111827; }

.uf-hub-card-desc {
  font-size: 0.95rem;
  line-height: 1.5;
  text-wrap: pretty;
  color: rgba(var(--text-dark-rgb), 0.72);
}
body.light-mode .uf-hub-card-desc { color: rgba(17, 24, 39, 0.62); }

.uf-hub-card-arrow {
  display: none;
}

/* ===== Template gallery (neo-brutalist Flu catalog) ===== */
.uf-tpl-page {
  padding-bottom: 48px;
}
body.light-mode .uf-tpl-page {
  background: #faf9f6;
}

.uf-tpl-shell {
  max-width: 1200px;
}

.uf-tpl-header {
  margin-bottom: 24px;
  animation: ufChoiceIn 0.42s cubic-bezier(0.2, 0, 0, 1) backwards;
}

.uf-tpl-title {
  margin: 0;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: clamp(1.65rem, 2.6vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  text-wrap: balance;
  color: var(--text-dark);
}
body.light-mode .uf-tpl-title { color: #111827; }

.uf-tpl-lead {
  margin: 8px 0 0;
  max-width: 42ch;
  font-size: 0.95rem;
  line-height: 1.5;
  text-wrap: pretty;
  color: rgba(var(--text-dark-rgb), 0.62);
}
body.light-mode .uf-tpl-lead { color: rgba(17, 24, 39, 0.58); }

.uf-tpl-toolbar {
  margin-bottom: 28px;
  animation: ufChoiceIn 0.46s cubic-bezier(0.2, 0, 0, 1) backwards;
  animation-delay: 0.04s;
}

.uf-tpl-filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.uf-tpl-filters-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px;
}

.uf-tpl-select-wrap {
  display: block;
  flex: 0 0 auto;
}

.uf-tpl-platform-wrap,
.uf-tpl-category-wrap {
  min-width: min(100%, 240px);
  max-width: 320px;
}

/* ===== Combobox (TryPost-style filters) ===== */
.uf-combobox {
  position: relative;
  flex: 0 0 auto;
  min-width: min(100%, 240px);
  max-width: 320px;
}

.uf-combobox-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  background: var(--card-bg-dark);
  color: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition-property: transform, box-shadow, border-color;
  transition-duration: 0.18s;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}
body.light-mode .uf-combobox-trigger {
  border: 2.5px solid rgba(17, 24, 39, 0.88);
  background: #fff;
  box-shadow: 4px 4px 0 #111827;
}

.uf-combobox-trigger:focus {
  outline: none;
  border-color: rgba(187, 134, 252, 0.55);
  box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.14);
}
body.light-mode .uf-combobox-trigger:focus {
  border-color: rgba(17, 24, 39, 0.95);
  box-shadow: 4px 4px 0 #111827, 0 0 0 3px rgba(225, 48, 108, 0.12);
}

.uf-combobox.is-open .uf-combobox-trigger {
  border-color: rgba(187, 134, 252, 0.45);
}
body.light-mode .uf-combobox.is-open .uf-combobox-trigger {
  border-color: rgba(17, 24, 39, 0.95);
}

.uf-combobox-trigger-value {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.uf-combobox-trigger-placeholder {
  flex: 1;
  min-width: 0;
  color: rgba(var(--text-dark-rgb), 0.52);
}
body.light-mode .uf-combobox-trigger-placeholder {
  color: rgba(17, 24, 39, 0.48);
}

.uf-combobox-trigger-label,
.uf-combobox-option-label {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uf-combobox-trigger-meta,
.uf-combobox-option-meta {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(var(--text-dark-rgb), 0.52);
}
body.light-mode .uf-combobox-trigger-meta,
body.light-mode .uf-combobox-option-meta {
  color: rgba(17, 24, 39, 0.48);
}

.uf-combobox-chevron {
  flex-shrink: 0;
  font-size: 0.72rem;
  opacity: 0.55;
  transition: transform 0.18s cubic-bezier(0.2, 0, 0, 1);
}
.uf-combobox.is-open .uf-combobox-chevron {
  transform: rotate(180deg);
}

.uf-combobox-option-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  font-size: 0.72rem;
}
body.light-mode .uf-combobox-option-icon {
  border-color: rgba(17, 24, 39, 0.88);
  background: #fff;
}

.uf-combobox-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  min-width: 100%;
  width: max(100%, 280px);
  max-width: min(100vw - 32px, 360px);
  padding: 8px;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  background: var(--card-bg-dark);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}
body.light-mode .uf-combobox-panel {
  border: 2.5px solid rgba(17, 24, 39, 0.88);
  background: #fff;
  box-shadow: 4px 4px 0 #111827, 0 18px 36px rgba(17, 24, 39, 0.08);
}

.uf-combobox-search {
  position: relative;
  display: block;
  margin-bottom: 6px;
}
.uf-combobox-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.42;
  pointer-events: none;
  font-size: 0.82rem;
}
.uf-combobox-search input {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px 8px 2.1rem;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font-size: 0.86rem;
}
body.light-mode .uf-combobox-search input {
  border-color: rgba(17, 24, 39, 0.12);
  background: rgba(17, 24, 39, 0.03);
}
.uf-combobox-search input:focus {
  outline: none;
  border-color: rgba(187, 134, 252, 0.45);
}

.uf-combobox-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 280px;
  overflow-y: auto;
}

.uf-combobox-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.uf-combobox-option[hidden] {
  display: none;
}
.uf-combobox-option:hover,
.uf-combobox-option.is-active {
  background: rgba(187, 134, 252, 0.12);
}
body.light-mode .uf-combobox-option:hover,
body.light-mode .uf-combobox-option.is-active,
body.light-mode .uf-combobox-option.is-selected {
  background: #ede9fe;
}

.uf-combobox-option.is-selected {
  background: rgba(187, 134, 252, 0.16);
}

.uf-combobox-check {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.78rem;
  opacity: 0;
}
.uf-combobox-option.is-selected .uf-combobox-check {
  opacity: 1;
}

.uf-tpl-search-input:focus {
  outline: none;
  border-color: rgba(187, 134, 252, 0.55);
  box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.14);
}
body.light-mode .uf-tpl-search-input:focus {
  border-color: rgba(17, 24, 39, 0.95);
  box-shadow: 4px 4px 0 #111827, 0 0 0 3px rgba(225, 48, 108, 0.12);
}

.uf-tpl-search-field {
  position: relative;
  display: block;
  flex: 1 1 220px;
  min-width: min(100%, 280px);
}
.uf-tpl-search-field i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.42;
  pointer-events: none;
  font-size: 0.88rem;
}
.uf-tpl-search-input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px 10px 2.35rem;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  background: var(--card-bg-dark);
  color: inherit;
  font-size: 0.9rem;
  transition-property: box-shadow, border-color;
  transition-duration: 0.18s;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}
body.light-mode .uf-tpl-search-input {
  border: 2.5px solid rgba(17, 24, 39, 0.88);
  background: #fff;
  box-shadow: 4px 4px 0 #111827;
}

.uf-tpl-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 640px) {
  .uf-tpl-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }
}
@media (min-width: 1024px) {
  .uf-tpl-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
  }
}

.uf-tpl-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 220px;
  padding: 20px 20px 18px;
  border-radius: 18px;
  text-decoration: none;
  color: inherit;
  background: var(--card-bg-dark);
  border: 2px solid rgba(255, 255, 255, 0.14);
  transition-property: transform, box-shadow, border-color;
  transition-duration: 0.22s;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
  animation: ufChoiceIn 0.48s cubic-bezier(0.2, 0, 0, 1) backwards;
  animation-delay: calc(0.06s + (var(--uf-tpl-stagger, 0) * 0.045s));
}
body.light-mode .uf-tpl-card {
  background: #fff;
  border: 2.5px solid rgba(17, 24, 39, 0.88);
  box-shadow: 4px 4px 0 #111827;
}

.uf-tpl-card--instagram { --uf-tpl-accent: #e1306c; --uf-tpl-accent-soft: rgba(225, 48, 108, 0.16); }
.uf-tpl-card--facebook { --uf-tpl-accent: #3b5998; --uf-tpl-accent-soft: rgba(59, 89, 152, 0.18); }
.uf-tpl-card--linkedin { --uf-tpl-accent: #0e76a8; --uf-tpl-accent-soft: rgba(14, 118, 168, 0.18); }
.uf-tpl-card--x { --uf-tpl-accent: #64748b; --uf-tpl-accent-soft: rgba(100, 116, 139, 0.18); }

.uf-tpl-card:hover {
  transform: translateY(-3px);
  border-color: rgba(187, 134, 252, 0.45);
  text-decoration: none;
  color: inherit;
}
body.light-mode .uf-tpl-card:hover {
  border-color: rgba(17, 24, 39, 0.95);
  box-shadow: 6px 6px 0 #111827;
}
.uf-tpl-card:active { transform: translateY(0) scale(0.98); }
.uf-tpl-card:focus-visible {
  outline: 2px solid #bb86fc;
  outline-offset: 3px;
}

.uf-tpl-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.uf-tpl-card-platform-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 0.95rem;
  color: var(--uf-tpl-accent);
  background: var(--uf-tpl-accent-soft);
}
body.light-mode .uf-tpl-card-platform-icon {
  background: rgba(17, 24, 39, 0.04);
}

.uf-tpl-card-kind {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(196, 181, 253, 0.95);
  background: rgba(187, 134, 252, 0.12);
  border: 1.5px solid rgba(187, 134, 252, 0.28);
}
body.light-mode .uf-tpl-card-kind {
  color: #5b21b6;
  background: #ede9fe;
  border: 1.5px solid rgba(91, 33, 182, 0.16);
}

.uf-tpl-card-title {
  margin: 0;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.25;
  text-wrap: balance;
  color: var(--text-dark);
}
body.light-mode .uf-tpl-card-title { color: #111827; }

.uf-tpl-card-desc {
  margin: 8px 0 0;
  flex: 1;
  font-size: 0.84rem;
  line-height: 1.5;
  color: rgba(var(--text-dark-rgb), 0.58);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
body.light-mode .uf-tpl-card-desc { color: rgba(17, 24, 39, 0.58); }

.uf-tpl-card-tag {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 12px;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--uf-tpl-accent);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
}
body.light-mode .uf-tpl-card-tag {
  border: 2px solid rgba(17, 24, 39, 0.18);
  color: rgba(17, 24, 39, 0.72);
}

.uf-tpl-card-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #bb86fc 0%, #7c4dff 100%);
  box-shadow: 0 6px 16px rgba(124, 77, 255, 0.22);
}
body.light-mode .uf-tpl-card-cta {
  background: linear-gradient(135deg, #E1306C 0%, #F77737 100%);
  box-shadow: none;
  border: 2px solid rgba(17, 24, 39, 0.88);
}

.uf-tpl-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 48px 24px;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  background: rgba(var(--text-dark-rgb), 0.03);
  animation: ufChoiceIn 0.42s cubic-bezier(0.2, 0, 0, 1) backwards;
}
body.light-mode .uf-tpl-empty {
  background: #fff;
  border: 2.5px solid rgba(17, 24, 39, 0.88);
  box-shadow: 4px 4px 0 #111827;
}

.uf-tpl-empty-visual {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  color: #bb86fc;
  border-radius: 16px;
  border: 2px solid rgba(187, 134, 252, 0.28);
  background: rgba(187, 134, 252, 0.08);
}
body.light-mode .uf-tpl-empty-visual {
  color: #6d28d9;
  border-color: rgba(17, 24, 39, 0.18);
  background: rgba(17, 24, 39, 0.04);
}

.uf-tpl-empty-title {
  margin: 4px 0 0;
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  text-wrap: balance;
}

.uf-tpl-empty-desc {
  margin: 0;
  max-width: 36ch;
  font-size: 0.9rem;
  text-wrap: pretty;
  color: rgba(var(--text-dark-rgb), 0.6);
}
body.light-mode .uf-tpl-empty-desc { color: rgba(17, 24, 39, 0.58); }

.uf-tpl-empty-reset {
  margin-top: 6px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, #bb86fc 0%, #7c4dff 100%);
  transition-property: transform;
  transition-duration: 0.18s;
}
body.light-mode .uf-tpl-empty-reset {
  color: #111827;
  background: #fff;
  border: 2.5px solid rgba(17, 24, 39, 0.88);
  box-shadow: 4px 4px 0 #111827;
}
.uf-tpl-empty-reset:active { transform: scale(0.96); }

@media (prefers-reduced-motion: reduce) {
  .uf-hub-hero,
  .uf-hub-card,
  .uf-tpl-header,
  .uf-tpl-toolbar,
  .uf-tpl-card,
  .uf-tpl-empty {
    animation: none;
  }
  .uf-hub-card,
  .uf-hub-card-arrow,
  .uf-tpl-card,
  .uf-tpl-card-cta,
  .uf-combobox-trigger,
  .uf-combobox-panel,
  .uf-tpl-search-input,
  .uf-tpl-empty-reset {
    transition: none;
  }
  .uf-hub-card:hover,
  .uf-tpl-card:hover {
    transform: none;
  }
}

/* ===== Instant preview — page shell + panel side by side ===== */
.uf-page-with-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

@media (min-width: 1024px) {
  .uf-page-with-preview {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
    gap: 28px;
    max-width: 1420px;
    margin: 0 auto;
    padding: 0 0 24px;
  }

  .uf-page-with-preview > .uf-page-shell {
    max-width: none;
    margin: 0;
    padding: 0 16px 24px;
    min-width: 0;
  }
}

.uf-compose-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

@media (min-width: 1024px) {
  .uf-compose-layout {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    gap: 28px;
  }
}

.uf-compose-main {
  min-width: 0;
}

.uf-instant-preview-panel {
  display: none;
  position: sticky;
  top: 16px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(var(--surface-dark-rgb, 30, 30, 30), 0.72);
  box-shadow: inset 0 0 0 1px rgba(187, 134, 252, 0.14);
  backdrop-filter: blur(12px);
}

body.light-mode .uf-instant-preview-panel {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 0 0 1px rgba(225, 48, 108, 0.12);
}

@media (min-width: 1024px) {
  .uf-instant-preview-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
}

.uf-instant-preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.uf-instant-preview-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(var(--text-dark-rgb), 0.55);
}

body.light-mode .uf-instant-preview-eyebrow {
  color: rgba(var(--text-light-rgb), 0.5);
}

.uf-instant-preview-sub {
  margin: 2px 0 0;
  font-size: 0.88rem;
  color: rgba(var(--text-dark-rgb), 0.72);
}

body.light-mode .uf-instant-preview-sub {
  color: rgba(var(--text-light-rgb), 0.68);
}

.uf-preview-view-toggle {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  gap: 2px;
}

body.light-mode .uf-preview-view-toggle {
  background: rgba(0, 0, 0, 0.06);
}

.uf-preview-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(var(--text-dark-rgb), 0.65);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

body.light-mode .uf-preview-view-btn {
  color: rgba(var(--text-light-rgb), 0.62);
}

.uf-preview-view-btn.is-active {
  background: linear-gradient(135deg, #bb86fc 0%, #7c4dff 100%);
  color: #fff;
}

body.light-mode .uf-preview-view-btn.is-active {
  background: linear-gradient(135deg, #E1306C 0%, #F77737 100%);
}

.uf-preview-view-btn span:last-child {
  display: none;
}

@media (min-width: 1200px) {
  .uf-preview-view-btn span:last-child {
    display: inline;
  }
}

.uf-preview-platform-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.uf-preview-platform-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(var(--text-dark-rgb), 0.78);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, box-shadow 0.18s;
}

body.light-mode .uf-preview-platform-tab {
  background: rgba(0, 0, 0, 0.04);
  color: rgba(var(--text-light-rgb), 0.74);
}

.uf-preview-platform-tab.is-active {
  box-shadow: inset 0 0 0 1px rgba(187, 134, 252, 0.45);
  background: rgba(187, 134, 252, 0.14);
}

body.light-mode .uf-preview-platform-tab.is-active {
  box-shadow: inset 0 0 0 1px rgba(225, 48, 108, 0.35);
  background: rgba(225, 48, 108, 0.08);
}

.uf-instant-preview-stage {
  position: relative;
  min-height: 200px;
}

.uf-instant-preview-mount {
  position: relative;
  z-index: 2;
}

.uf-preview-mode-phone .uf-phone-mockup {
  display: block;
}

.uf-preview-mode-web .uf-phone-mockup {
  display: none;
}

.uf-preview-mode-phone .uf-instant-preview-mount {
  position: absolute;
  left: 50%;
  top: 52px;
  transform: translateX(-50%);
  width: calc(100% - 36px);
  max-width: 290px;
  max-height: calc(100% - 72px);
  overflow: auto;
  scrollbar-width: thin;
}

.uf-preview-mode-web .uf-instant-preview-mount {
  position: static;
  transform: none;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

.uf-preview-mode-web .uf-preview-platform-shell .live-preview-wrap {
  margin-inline: auto;
}

.uf-preview-platform-shell[hidden] {
  display: none !important;
}

.uf-instant-preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 180px;
  padding: 24px 16px;
  text-align: center;
  color: rgba(var(--text-dark-rgb), 0.55);
  font-size: 0.9rem;
}

.uf-instant-preview-empty i {
  font-size: 1.6rem;
  opacity: 0.45;
}

.uf-instant-preview-empty[hidden] {
  display: none !important;
}

.caption-text.is-placeholder {
  opacity: 0.45;
  font-style: italic;
}

[data-uf-lp-media].is-empty-placeholder {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  background: #efefef;
  color: #8e8e8e;
  font-size: 0.82rem;
}

[data-uf-lp-media].is-empty-placeholder::before {
  content: "Sin imagen";
}

[data-uf-lp-media].is-empty-placeholder img {
  display: none;
}

/* Phone mockup frame */
.uf-phone-mockup {
  display: none;
  margin: 0 auto;
  width: min(100%, 320px);
}

.uf-phone-frame {
  border-radius: 36px;
  padding: 10px;
  background: linear-gradient(145deg, #2a2a2e 0%, #111114 100%);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

body.light-mode .uf-phone-frame {
  background: linear-gradient(145deg, #ececef 0%, #d8d8de 100%);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.12),
    inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.uf-phone-screen {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  background: #000;
  min-height: 560px;
}

.uf-phone-statusbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 6px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  z-index: 3;
}

.uf-phone-island {
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  width: 96px;
  height: 26px;
  border-radius: 999px;
  background: #000;
}

.uf-phone-icons {
  font-size: 0.65rem;
  opacity: 0.9;
}

.uf-phone-screen-slot {
  min-height: 480px;
}

.uf-preview-mode-phone .uf-instant-preview-mount .live-preview-wrap,
.uf-preview-mode-phone .uf-result-preview-stage .live-preview-wrap {
  max-width: 100%;
}

.uf-preview-mode-phone .live-preview,
.uf-preview-mode-phone .x-preview {
  border-radius: 0;
  box-shadow: none;
}

/* Mobile FAB + sheet */
.uf-preview-fab {
  position: fixed;
  right: 16px;
  bottom: calc(var(--uf-footer-h, 0px) + 16px + env(safe-area-inset-bottom, 0px));
  z-index: 1040;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #bb86fc 0%, #7c4dff 100%);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 10px 28px rgba(124, 77, 255, 0.35);
  cursor: pointer;
  transition: bottom 0.18s ease;
}

body.light-mode .uf-preview-fab {
  background: linear-gradient(135deg, #E1306C 0%, #F77737 100%);
  box-shadow: 0 10px 28px rgba(225, 48, 108, 0.28);
}

@media (min-width: 1024px) {
  .uf-preview-fab {
    display: none;
  }
}

.uf-preview-sheet[hidden] {
  display: none !important;
}

.uf-preview-sheet {
  position: fixed;
  inset: 0;
  z-index: 1050;
}

.uf-preview-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.uf-preview-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 92vh;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  border-radius: 20px 20px 0 0;
  background: var(--card-bg-dark, #1e1e1e);
  overflow: auto;
}

body.light-mode .uf-preview-sheet-panel {
  background: var(--card-bg-light, #fff);
}

.uf-preview-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.uf-preview-sheet-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  cursor: pointer;
}

.uf-result-preview-controls {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 12px;
}

.uf-result-preview-stage {
  position: relative;
}

/* Phone mode: center the phone like the manual panel (.tp-preview-stage is flex).
   Without flex centering, .tp-phone-frame / .tp-phone-inner are block elements that
   stretch to fill the slot width, leaving a black gap beside the 360px screen —
   the "teléfono fold" (tp-phone-screen 360 < tp-phone-inner ~600). */
.uf-result-preview-stage.uf-preview-mode-phone {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 580px;
}

/* --- Compose char limit pills --- */
.uf-char-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.uf-char-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
}

body.light-mode .uf-char-pill {
  border-color: rgba(17, 24, 39, 0.14);
  background: rgba(17, 24, 39, 0.03);
}

.uf-char-pill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #111;
  color: #fff;
  font-size: 0.65rem;
}

body.light-mode .uf-char-pill-icon {
  background: #111;
}

.uf-char-pill-count strong {
  font-weight: 700;
}

.uf-char-pill-sep,
.uf-char-pill-count {
  opacity: 0.72;
}

.uf-char-pill--ok .uf-char-pill-count strong {
  color: rgba(255, 255, 255, 0.88);
}

body.light-mode .uf-char-pill--ok .uf-char-pill-count strong {
  color: #111827;
}

.uf-char-pill--warn {
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(251, 191, 36, 0.12);
}

.uf-char-pill--warn .uf-char-pill-count strong {
  color: #d97706;
}

body.light-mode .uf-char-pill--warn {
  background: #fffbeb;
  border-color: rgba(217, 119, 6, 0.45);
}

.uf-char-pill--over {
  border-color: rgba(248, 113, 113, 0.65);
  background: rgba(248, 113, 113, 0.14);
}

.uf-char-pill--over .uf-char-pill-count strong {
  color: #dc2626;
}

body.light-mode .uf-char-pill--over {
  background: #fef2f2;
  border-color: rgba(220, 38, 38, 0.45);
}

/* --- Compose actions bar (manual — inside uf-wizard-stage) --- */
.uf-wizard-actions.uf-compose-actions {
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  position: relative;
  animation: ufBarIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.uf-wizard-actions.uf-compose-actions::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(187, 134, 252, 0.5), rgba(124, 77, 255, 0.35), transparent);
  pointer-events: none;
}

body.light-mode .uf-wizard-actions.uf-compose-actions::before {
  background: linear-gradient(90deg, transparent, rgba(225, 48, 108, 0.45), rgba(247, 119, 55, 0.35), transparent);
}

.uf-wizard-stage .uf-compose-stack {
  margin-top: 0;
}

/* Wizard stage — paso activo + acciones en la misma tarjeta */
.uf-wizard-stage {
  background: var(--card-bg-dark);
  border: 1px solid #36363A;
  border-radius: 18px;
  padding: 24px;
  animation: ufStepIn 0.28s cubic-bezier(0.4, 0, 0.2, 1) both;
}

body.light-mode .uf-wizard-stage {
  background: var(--card-bg-light);
  border-color: rgba(17, 24, 39, 0.1);
}

.uf-wizard-stage .uf-step {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  animation: none;
  box-shadow: none;
}

.uf-wizard-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  position: static;
  margin: 20px 0 0;
  padding: 18px 0 0;
  background: transparent;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  z-index: auto;
}

body.light-mode .uf-wizard-actions {
  border-top-color: rgba(17, 24, 39, 0.08);
}

.uf-wizard-actions [data-uf-next],
.uf-wizard-actions [data-uf-submit] {
  margin-left: auto;
}

@media (max-width: 991px) {
  .uf-wizard-actions {
    position: sticky;
    bottom: 0;
    margin: 16px -24px -24px;
    padding: 14px 24px calc(14px + env(safe-area-inset-bottom));
    background: rgba(var(--surface-dark-rgb, 30, 30, 30), 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid #36363A;
    z-index: 5;
  }

  body.light-mode .uf-wizard-actions {
    background: rgba(255, 255, 255, 0.96);
    border-top-color: rgba(17, 24, 39, 0.1);
  }
}

@media (max-width: 560px) {
  .uf-wizard-actions:not(.uf-compose-actions) {
    flex-wrap: nowrap;
  }

  .uf-wizard-actions .uf-btn {
    flex: 0 1 auto;
    min-width: 0;
  }

  .uf-wizard-actions [data-uf-next],
  .uf-wizard-actions [data-uf-submit] {
    flex-shrink: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .uf-wizard-stage {
    animation: none;
  }

  .uf-wizard-actions.uf-compose-actions {
    animation: none;
  }
}

@keyframes ufBarIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* Context strip (left) */
.uf-bar-context {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.uf-bar-clear {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.uf-bar-clear:hover {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.5);
  color: #f87171;
  transform: translateY(-1px);
}
.uf-bar-clear:active { transform: scale(0.94); }
.uf-bar-clear:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.35);
}
body.light-mode .uf-bar-clear {
  border-color: rgba(17, 24, 39, 0.12);
  background: rgba(17, 24, 39, 0.03);
  color: rgba(17, 24, 39, 0.5);
}
body.light-mode .uf-bar-clear:hover {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.45);
  color: #dc2626;
}

.uf-bar-divider {
  flex-shrink: 0;
  width: 1px;
  height: 26px;
  background: rgba(255, 255, 255, 0.12);
}
body.light-mode .uf-bar-divider { background: rgba(17, 24, 39, 0.12); }

.uf-bar-platforms {
  display: flex;
  align-items: center;
  min-width: 0;
}
.uf-bar-platforms:empty { display: none; }

.uf-bar-platform {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(var(--surface-dark-rgb, 30, 30, 30), 0.96);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.78rem;
  margin-left: -8px;
  animation: ufBarAvatarIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: transform 0.2s ease;
}
.uf-bar-platform:first-child { margin-left: 0; }
.uf-bar-platform:hover { transform: translateY(-2px); z-index: 2; }
.uf-bar-platform[data-platform="instagram"] { background: linear-gradient(135deg, #E1306C, #F77737); color: #fff; }
.uf-bar-platform[data-platform="facebook"]  { background: #1877F2; color: #fff; }
.uf-bar-platform[data-platform="linkedin"]  { background: #0A66C2; color: #fff; }
.uf-bar-platform[data-platform="x"]         { background: #111827; color: #fff; }
body.light-mode .uf-bar-platform {
  border-color: rgba(255, 255, 255, 0.96);
}

@keyframes ufBarAvatarIn {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: none; }
}

.uf-bar-media {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.78rem;
  font-weight: 600;
  animation: ufBarAvatarIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.uf-bar-media i { font-size: 0.72rem; opacity: 0.8; }
body.light-mode .uf-bar-media {
  border-color: rgba(17, 24, 39, 0.12);
  background: rgba(17, 24, 39, 0.04);
  color: rgba(17, 24, 39, 0.7);
}

.uf-bar-status {
  margin: 0;
  min-width: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.uf-bar-status:empty { display: none; }
body.light-mode .uf-bar-status { color: rgba(17, 24, 39, 0.5); }

/* Action cluster (right) */
.uf-bar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Shared bar button — same size for Programar & Publicar */
.uf-bar-btn {
  min-height: 48px;
  padding: 13px 22px;
  border-radius: 14px;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease, filter 0.2s ease;
}
.uf-bar-btn-label { line-height: 1; white-space: nowrap; }
.uf-bar-btn:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.6); }
.uf-bar-btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; filter: grayscale(0.3); }

.uf-bar-schedule-chip-wrap {
  position: relative;
  display: inline-flex;
  align-items: stretch;
}

.uf-bar-schedule-btn {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.88);
  white-space: nowrap;
  padding-right: 22px;
}
.uf-bar-schedule-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(187, 134, 252, 0.5);
  color: #fff;
  box-shadow: 0 6px 16px rgba(124, 77, 255, 0.22);
}
.uf-bar-schedule-btn:active { transform: scale(0.97); }
.uf-bar-schedule-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.4);
}
.uf-bar-schedule-btn[aria-expanded="true"] {
  border-color: rgba(187, 134, 252, 0.7);
  color: #fff;
}
body.light-mode .uf-bar-schedule-btn {
  border-color: rgba(17, 24, 39, 0.14);
  background: rgba(17, 24, 39, 0.03);
  color: rgba(17, 24, 39, 0.82);
}
body.light-mode .uf-bar-schedule-btn:hover {
  border-color: rgba(225, 48, 108, 0.5);
  color: #111827;
  box-shadow: 0 6px 16px rgba(225, 48, 108, 0.18);
}
body.light-mode .uf-bar-schedule-btn[aria-expanded="true"] {
  border-color: rgba(225, 48, 108, 0.7);
  color: #111827;
}

.uf-bar-schedule-chip-wrap.is-scheduled .uf-bar-schedule-btn {
  border-color: transparent;
  background: linear-gradient(135deg, rgba(187, 134, 252, 0.28), rgba(124, 77, 255, 0.28));
  color: #fff;
  padding-right: 46px;
}
body.light-mode .uf-bar-schedule-chip-wrap.is-scheduled .uf-bar-schedule-btn {
  background: linear-gradient(135deg, rgba(225, 48, 108, 0.18), rgba(247, 119, 55, 0.18));
  color: #111827;
}

.uf-bar-schedule-clear {
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.22);
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  opacity: 0.9;
  transition: background 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
}
.uf-bar-schedule-clear:hover {
  background: rgba(248, 113, 113, 0.92);
  opacity: 1;
  color: #fff;
  transform: translateY(-50%) scale(1.08);
}
.uf-bar-schedule-clear:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.4);
}
body.light-mode .uf-bar-schedule-clear { background: rgba(17, 24, 39, 0.14); }

.uf-compose-schedule-time {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Primary CTA — mismo tamaño que Programar, variant gradient */
.uf-bar-primary {
  position: relative;
  border: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #bb86fc 0%, #7c4dff 100%);
  color: #fff;
  box-shadow: 0 6px 18px rgba(124, 77, 255, 0.32);
  padding-right: 26px;
}
.uf-bar-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: skewX(-18deg);
  transition: left 0.6s ease;
  pointer-events: none;
}
.uf-bar-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(124, 77, 255, 0.42); }
.uf-bar-primary:hover::after { left: 130%; }
.uf-bar-primary:active { transform: translateY(0) scale(0.98); }
.uf-bar-primary:focus-visible {
  box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.5), 0 12px 26px rgba(124, 77, 255, 0.42);
}
.uf-bar-primary[disabled] { box-shadow: none; }
.uf-bar-primary[disabled]::after { display: none; }
.uf-bar-primary.is-loading { pointer-events: none; opacity: 0.88; }
.uf-bar-primary.is-loading .uf-bar-primary-icon i {
  animation: ufSpin 0.7s linear infinite;
}
body.light-mode .uf-bar-primary {
  background: linear-gradient(135deg, #E1306C 0%, #F77737 100%);
  box-shadow: 0 6px 18px rgba(225, 48, 108, 0.32);
}
body.light-mode .uf-bar-primary:hover { box-shadow: 0 12px 26px rgba(225, 48, 108, 0.42); }
body.light-mode .uf-bar-primary:focus-visible {
  box-shadow: 0 0 0 3px rgba(225, 48, 108, 0.45), 0 12px 26px rgba(225, 48, 108, 0.42);
}

.uf-bar-primary-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.82rem;
  flex-shrink: 0;
}

@keyframes ufSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .uf-bar-primary::after,
  .uf-bar-platform,
  .uf-bar-media,
  .uf-schedule-modal-panel,
  .uf-bar-primary.is-loading .uf-bar-primary-icon i { animation: none; }
}

/* ===== Schedule modal (all-in-one, estilo trypost DialogContent) ===== */
.uf-schedule-modal {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.uf-schedule-modal[hidden] { display: none; }

.uf-schedule-modal-open { overflow: hidden; }

.uf-schedule-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: ufModalFadeIn 0.2s ease both;
}
.uf-schedule-modal.is-closing .uf-schedule-modal-backdrop { animation: ufModalFadeOut 0.18s ease both; }

@keyframes ufModalFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes ufModalFadeOut { from { opacity: 1; } to { opacity: 0; } }

.uf-schedule-modal-panel {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background: var(--card-bg-dark, #1b1b22);
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  animation: ufModalZoomIn 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.uf-schedule-modal.is-closing .uf-schedule-modal-panel { animation: ufModalZoomOut 0.18s cubic-bezier(0.4, 0, 1, 1) both; }

@keyframes ufModalZoomIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes ufModalZoomOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.95); }
}
@media (prefers-reduced-motion: reduce) {
  .uf-schedule-modal-backdrop,
  .uf-schedule-modal-panel { animation: none; }
}

body.light-mode .uf-schedule-modal-panel {
  background: #fff;
  border-color: rgba(17, 24, 39, 0.16);
  box-shadow: 0 24px 60px rgba(17, 24, 39, 0.2);
}

.uf-schedule-modal-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
body.light-mode .uf-schedule-modal-head { border-bottom-color: rgba(17, 24, 39, 0.08); }

.uf-schedule-modal-head-copy { flex: 1 1 auto; min-width: 0; }

.uf-schedule-modal-title {
  margin: 0 0 4px;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 1.18rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
body.light-mode .uf-schedule-modal-title { color: #111827; }

.uf-schedule-modal-desc {
  margin: 0;
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.4;
}
body.light-mode .uf-schedule-modal-desc { color: rgba(17, 24, 39, 0.55); }

.uf-schedule-modal-close {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.uf-schedule-modal-close:hover {
  transform: rotate(-90deg);
  background: rgba(248, 113, 113, 0.18);
  border-color: rgba(248, 113, 113, 0.5);
  color: #f87171;
}
.uf-schedule-modal-close:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.4);
}
body.light-mode .uf-schedule-modal-close {
  border-color: rgba(17, 24, 39, 0.16);
  background: rgba(17, 24, 39, 0.03);
  color: rgba(17, 24, 39, 0.7);
}
body.light-mode .uf-schedule-modal-close:hover {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.45);
  color: #dc2626;
}

.uf-schedule-modal-body {
  padding: 18px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.uf-schedule-section { display: flex; flex-direction: column; gap: 10px; }

.uf-schedule-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.uf-schedule-section-label {
  margin: 0;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}
body.light-mode .uf-schedule-section-label { color: rgba(17, 24, 39, 0.5); }

.uf-schedule-section-hint {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.45);
  text-transform: capitalize;
}
body.light-mode .uf-schedule-section-hint { color: rgba(17, 24, 39, 0.45); }

/* Calendar grid (inside modal) */
.uf-schedule-calendar {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  padding: 14px;
}
body.light-mode .uf-schedule-calendar {
  border-color: rgba(17, 24, 39, 0.1);
  background: rgba(17, 24, 39, 0.02);
}

.uf-schedule-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.uf-schedule-cal-nav-label {
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: capitalize;
  color: rgba(255, 255, 255, 0.9);
}
body.light-mode .uf-schedule-cal-nav-label { color: #111827; }

.uf-schedule-cal-navbtn {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  transition: background 0.16s ease, transform 0.16s ease;
}
.uf-schedule-cal-navbtn:hover { background: rgba(187, 134, 252, 0.2); transform: scale(1.06); }
.uf-schedule-cal-navbtn:active { transform: scale(0.94); }
.uf-schedule-cal-navbtn:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.35); }
body.light-mode .uf-schedule-cal-navbtn { border-color: rgba(17, 24, 39, 0.12); background: rgba(17, 24, 39, 0.03); }
body.light-mode .uf-schedule-cal-navbtn:hover { background: rgba(225, 48, 108, 0.14); }

.uf-schedule-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.uf-schedule-cal-wd {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.5;
  padding: 2px 0 6px;
}

.uf-schedule-cal-day {
  aspect-ratio: 1;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease, color 0.16s ease;
}
.uf-schedule-cal-day.is-empty { background: transparent; cursor: default; pointer-events: none; }
.uf-schedule-cal-day:hover:not(.is-disabled):not(.is-empty) {
  background: rgba(187, 134, 252, 0.18);
  transform: scale(1.06);
}
.uf-schedule-cal-day.is-today {
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.3);
}
.uf-schedule-cal-day.is-selected {
  background: linear-gradient(135deg, #bb86fc 0%, #7c4dff 100%);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(124, 77, 255, 0.4);
}
.uf-schedule-cal-day.is-disabled { opacity: 0.28; cursor: not-allowed; }
body.light-mode .uf-schedule-cal-day.is-today { box-shadow: inset 0 0 0 1.5px rgba(17, 24, 39, 0.25); }
body.light-mode .uf-schedule-cal-day:hover:not(.is-disabled):not(.is-empty) { background: rgba(225, 48, 108, 0.14); }
body.light-mode .uf-schedule-cal-day.is-selected {
  background: linear-gradient(135deg, #E1306C 0%, #F77737 100%);
  box-shadow: 0 4px 12px rgba(225, 48, 108, 0.4);
}

.uf-schedule-modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
body.light-mode .uf-schedule-modal-foot { border-top-color: rgba(17, 24, 39, 0.08); }

.uf-schedule-modal-cancel {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.82);
}
.uf-schedule-modal-cancel:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-1px); }
body.light-mode .uf-schedule-modal-cancel {
  border-color: rgba(17, 24, 39, 0.14);
  background: rgba(17, 24, 39, 0.03);
  color: rgba(17, 24, 39, 0.78);
}
body.light-mode .uf-schedule-modal-cancel:hover { background: rgba(17, 24, 39, 0.07); }

.uf-schedule-modal-confirm {
  position: relative;
  border: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #bb86fc 0%, #7c4dff 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(124, 77, 255, 0.3);
}
.uf-schedule-modal-confirm:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(124, 77, 255, 0.4); }
.uf-schedule-modal-confirm:active { transform: scale(0.97); }
.uf-schedule-modal-confirm:focus-visible { box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.5), 0 10px 22px rgba(124, 77, 255, 0.4); }
body.light-mode .uf-schedule-modal-confirm {
  background: linear-gradient(135deg, #E1306C 0%, #F77737 100%);
  box-shadow: 0 6px 16px rgba(225, 48, 108, 0.3);
}
body.light-mode .uf-schedule-modal-confirm:hover { box-shadow: 0 10px 22px rgba(225, 48, 108, 0.4); }

.uf-image-limit-warning {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fbbf24;
}

body.light-mode .uf-image-limit-warning {
  background: #fffbeb;
  border-color: rgba(217, 119, 6, 0.35);
  color: #b45309;
}

.uf-image-thumb-grid,
.uf-media-thumb-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

/* ===== Multimedia thumb (compose selector) ===== */
.uf-media-thumb {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  animation: ufBarAvatarIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.uf-media-thumb:hover {
  transform: translateY(-2px);
  border-color: rgba(187, 134, 252, 0.5);
  box-shadow: 0 8px 18px rgba(124, 77, 255, 0.22);
}
.uf-media-thumb:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.45);
}
.uf-media-thumb.is-cover {
  border-color: rgba(187, 134, 252, 0.65);
  box-shadow: 0 0 0 2px rgba(187, 134, 252, 0.3), 0 6px 16px rgba(124, 77, 255, 0.28);
}
.uf-media-thumb.is-dragging {
  opacity: 0.5;
  transform: scale(0.96);
}
.uf-media-thumb.is-drop-target {
  border-color: #bb86fc;
  box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.55);
}
body.light-mode .uf-media-thumb {
  background: rgba(17, 24, 39, 0.04);
  border-color: rgba(17, 24, 39, 0.12);
  box-shadow: 0 2px 6px rgba(17, 24, 39, 0.08);
}
body.light-mode .uf-media-thumb:hover {
  border-color: rgba(225, 48, 108, 0.5);
  box-shadow: 0 8px 18px rgba(225, 48, 108, 0.16);
}
body.light-mode .uf-media-thumb.is-cover {
  border-color: rgba(225, 48, 108, 0.7);
  box-shadow: 0 0 0 2px rgba(225, 48, 108, 0.25), 0 6px 16px rgba(225, 48, 108, 0.2);
}

.uf-media-thumb-preview {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.uf-media-thumb-handle {
  position: absolute;
  top: 6px;
  left: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.62rem;
  cursor: grab;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.uf-media-thumb:hover .uf-media-thumb-handle { opacity: 1; }
.uf-media-thumb-handle:active { cursor: grabbing; }

.uf-media-thumb-order {
  position: absolute;
  bottom: 6px;
  left: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  font-family: "Montserrat", system-ui, sans-serif;
}

.uf-media-thumb-cover {
  position: absolute;
  bottom: 6px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #bb86fc 0%, #7c4dff 100%);
  color: #fff;
  font-size: 0.6rem;
  box-shadow: 0 2px 6px rgba(124, 77, 255, 0.4);
}
body.light-mode .uf-media-thumb-cover {
  background: linear-gradient(135deg, #E1306C 0%, #F77737 100%);
  box-shadow: 0 2px 6px rgba(225, 48, 108, 0.4);
}

.uf-media-thumb-video-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.9rem;
  pointer-events: none;
}

.uf-media-thumb-action {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  opacity: 0;
  transition: opacity 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.uf-media-thumb:hover .uf-media-thumb-action { opacity: 1; }
.uf-media-thumb-action:hover { transform: scale(1.1); }
.uf-media-thumb-action:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.5);
  opacity: 1;
}

.uf-media-thumb-edit:hover { background: rgba(187, 134, 252, 0.85); }
.uf-media-thumb-remove:hover { background: rgba(248, 113, 113, 0.9); }

.uf-compose-block-tooltip .tooltip-inner {
  max-width: 280px;
  text-align: left;
  white-space: pre-line;
}

/* ===== Media crop modal (estilo schedule modal) ===== */
.uf-crop-modal {
  position: fixed;
  inset: 0;
  z-index: 4050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.uf-crop-modal[hidden] { display: none; }
.uf-crop-modal-open { overflow: hidden; }

.uf-crop-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: ufModalFadeIn 0.2s ease both;
}
.uf-crop-modal.is-open .uf-crop-modal-panel { animation: ufModalZoomIn 0.22s cubic-bezier(0.22, 1, 0.36, 1) both; }

.uf-crop-modal-panel {
  position: relative;
  width: 100%;
  max-width: 540px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background: var(--card-bg-dark, #1b1b22);
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
body.light-mode .uf-crop-modal-panel {
  background: #fff;
  border-color: rgba(17, 24, 39, 0.16);
  box-shadow: 0 24px 60px rgba(17, 24, 39, 0.2);
}

.uf-crop-modal-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
body.light-mode .uf-crop-modal-head { border-bottom-color: rgba(17, 24, 39, 0.08); }

.uf-crop-modal-head-copy { flex: 1 1 auto; min-width: 0; }

.uf-crop-modal-title {
  margin: 0 0 4px;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 1.12rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
body.light-mode .uf-crop-modal-title { color: #111827; }

.uf-crop-modal-desc {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.4;
}
body.light-mode .uf-crop-modal-desc { color: rgba(17, 24, 39, 0.55); }

.uf-crop-modal-close {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.uf-crop-modal-close:hover {
  transform: rotate(-90deg);
  background: rgba(248, 113, 113, 0.18);
  border-color: rgba(248, 113, 113, 0.5);
  color: #f87171;
}
.uf-crop-modal-close:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.4);
}
body.light-mode .uf-crop-modal-close {
  border-color: rgba(17, 24, 39, 0.16);
  background: rgba(17, 24, 39, 0.03);
  color: rgba(17, 24, 39, 0.7);
}
body.light-mode .uf-crop-modal-close:hover {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.45);
  color: #dc2626;
}

.uf-crop-modal-body {
  padding: 16px 22px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.uf-crop-modal-stage {
  position: relative;
  width: 100%;
  min-height: 240px;
  max-height: 50vh;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.4);
}
body.light-mode .uf-crop-modal-stage { background: rgba(17, 24, 39, 0.05); }

.uf-crop-modal-stage img {
  display: block;
  max-width: 100%;
  max-height: 50vh;
}

.uf-crop-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.uf-crop-preset {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 8px 14px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.82);
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.uf-crop-preset:hover {
  transform: translateY(-1px);
  border-color: rgba(187, 134, 252, 0.5);
  color: #fff;
}
.uf-crop-preset.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, #bb86fc 0%, #7c4dff 100%);
  color: #fff;
}
.uf-crop-preset:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.4);
}
.uf-crop-preset-sub {
  font-size: 0.62rem;
  font-weight: 500;
  opacity: 0.75;
  letter-spacing: 0.02em;
}
body.light-mode .uf-crop-preset {
  border-color: rgba(17, 24, 39, 0.14);
  background: rgba(17, 24, 39, 0.03);
  color: rgba(17, 24, 39, 0.78);
}
body.light-mode .uf-crop-preset:hover {
  border-color: rgba(225, 48, 108, 0.5);
  color: #111827;
}
body.light-mode .uf-crop-preset.is-active {
  background: linear-gradient(135deg, #E1306C 0%, #F77737 100%);
  color: #fff;
}

.uf-crop-modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
body.light-mode .uf-crop-modal-foot { border-top-color: rgba(17, 24, 39, 0.08); }

.uf-crop-modal-cancel {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.82);
}
.uf-crop-modal-cancel:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-1px); }
body.light-mode .uf-crop-modal-cancel {
  border-color: rgba(17, 24, 39, 0.14);
  background: rgba(17, 24, 39, 0.03);
  color: rgba(17, 24, 39, 0.78);
}
body.light-mode .uf-crop-modal-cancel:hover { background: rgba(17, 24, 39, 0.07); }

.uf-crop-modal-apply {
  position: relative;
  border: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #bb86fc 0%, #7c4dff 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(124, 77, 255, 0.3);
}
.uf-crop-modal-apply:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(124, 77, 255, 0.4); }
.uf-crop-modal-apply:active { transform: scale(0.97); }
.uf-crop-modal-apply:focus-visible { box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.5), 0 10px 22px rgba(124, 77, 255, 0.4); }
body.light-mode .uf-crop-modal-apply {
  background: linear-gradient(135deg, #E1306C 0%, #F77737 100%);
  box-shadow: 0 6px 16px rgba(225, 48, 108, 0.3);
}
body.light-mode .uf-crop-modal-apply:hover { box-shadow: 0 10px 22px rgba(225, 48, 108, 0.4); }

@media (max-width: 480px) {
  .uf-crop-modal { padding: 0; align-items: flex-end; }
  .uf-crop-modal-panel {
    max-width: 100%;
    max-height: 94vh;
    border-radius: 18px 18px 0 0;
  }
  .uf-crop-modal.is-open .uf-crop-modal-panel { animation: ufModalSheetUp 0.26s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .uf-crop-modal-foot { flex-direction: column-reverse; }
  .uf-crop-modal-foot .uf-bar-btn { width: 100%; }
}

/* Date popover (compose schedule) */
.uf-date-pop {
  position: fixed;
  z-index: 4001;
  width: 300px;
  max-width: calc(100vw - 16px);
  padding: 14px;
  border-radius: 18px;
  background: #17171c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.uf-date-pop[hidden] { display: none; }

body.light-mode .uf-date-pop {
  background: #fff;
  border-color: rgba(148, 163, 184, 0.35);
}

.uf-date-pop-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.uf-date-pop-label {
  font: 600 0.95rem Montserrat, system-ui, sans-serif;
  text-transform: capitalize;
}

.uf-date-pop-navbtn {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  cursor: pointer;
}

.uf-date-pop-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.uf-date-pop-wd {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0.5;
  padding: 2px 0 6px;
}

.uf-date-pop-day {
  aspect-ratio: 1;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 0.82rem;
  cursor: pointer;
}

.uf-date-pop-day.is-selected {
  background: linear-gradient(135deg, #bb86fc 0%, #7c4dff 100%);
  color: #fff;
  font-weight: 700;
}

body.light-mode .uf-date-pop-day.is-selected {
  background: linear-gradient(135deg, #E1306C 0%, #F77737 100%);
}

.uf-date-pop-day.is-disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

.uf-time-stepper {
  position: relative;
  display: flex;
  align-items: center;
  width: 78px;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.uf-time-stepper:focus-within {
  border-color: rgba(187, 134, 252, 0.55);
  box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.25);
}

body.light-mode .uf-time-stepper {
  border-color: rgba(17, 24, 39, 0.12);
  background: rgba(17, 24, 39, 0.03);
}

body.light-mode .uf-time-stepper:focus-within {
  border-color: rgba(225, 48, 108, 0.5);
  box-shadow: 0 0 0 3px rgba(225, 48, 108, 0.22);
}

.uf-time-value {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  font-family: "Montserrat", system-ui, sans-serif;
  color: inherit;
  padding: 0 30px 0 0;
}

.uf-time-value:focus { outline: 0; }

.uf-time-stepper-arrows {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.uf-time-step {
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.6;
  font-size: 0.6rem;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.16s ease, opacity 0.16s ease, transform 0.16s ease;
}

.uf-time-step:hover { background: rgba(255, 255, 255, 0.1); opacity: 1; }
.uf-time-step:active { transform: scale(0.9); }
.uf-time-step:focus-visible { outline: 0; box-shadow: 0 0 0 2px rgba(187, 134, 252, 0.5); }
body.light-mode .uf-time-step:hover { background: rgba(17, 24, 39, 0.08); }

.uf-time-colon {
  font-weight: 700;
  font-size: 1.05rem;
  opacity: 0.55;
}

/* Compose actions bar — responsive */
@media (max-width: 720px) {
  .uf-wizard-actions.uf-compose-actions {
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 14px;
  }
  .uf-compose-actions .uf-bar-context { order: 1; flex: 1 1 100%; }
  .uf-compose-actions .uf-bar-actions { order: 2; width: 100%; }
  .uf-compose-actions .uf-bar-btn { flex: 1 1 auto; }
}

@media (max-width: 480px) {
  .uf-bar-platforms { flex-wrap: wrap; gap: 2px; }
  .uf-bar-platform { margin-left: 0; }
  .uf-bar-schedule-chip-wrap { flex: 1 1 auto; }
  .uf-bar-schedule-btn { padding-right: 22px; }
  .uf-bar-schedule-chip-wrap.is-scheduled .uf-bar-schedule-btn { padding-right: 46px; }
}

/* Schedule modal — responsive */
@media (max-width: 480px) {
  .uf-schedule-modal { padding: 0; align-items: flex-end; }
  .uf-schedule-modal-panel {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
    animation: ufModalSheetUp 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  .uf-schedule-modal.is-closing .uf-schedule-modal-panel { animation: ufModalSheetDown 0.2s cubic-bezier(0.4, 0, 1, 1) both; }
  @keyframes ufModalSheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
  @keyframes ufModalSheetDown { from { transform: translateY(0); } to { transform: translateY(100%); } }
  .uf-schedule-modal-foot { flex-direction: column-reverse; }
  .uf-schedule-modal-foot .uf-bar-btn { width: 100%; }
}

/* ============================================================================
 * Post history list — TryPost-aligned table (/history)
 * ========================================================================== */

.uf-history-page {
  --uf-history-ink: rgba(255, 255, 255, 0.92);
  --uf-history-muted: rgba(255, 255, 255, 0.58);
  --uf-history-border: rgba(255, 255, 255, 0.22);
  --uf-history-surface: var(--card-bg-dark, #1c1c1e);
  --uf-history-page-bg: transparent;
  --uf-history-cta: #7c4dff;
  --uf-history-cta-text: #fff;
  max-width: min(1280px, 100%);
  margin: 0 auto;
  padding: 8px 0 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  color: var(--uf-history-ink);
}

body.light-mode .uf-history-page {
  --uf-history-ink: #141414;
  --uf-history-muted: rgba(20, 20, 20, 0.58);
  --uf-history-border: #141414;
  --uf-history-surface: #fff;
  --uf-history-page-bg: #faf8f5;
  --uf-history-cta: #7c4dff;
  --uf-history-cta-text: #fff;
}

body.light-mode:has(.uf-history-page) main > .container {
  background: var(--uf-history-page-bg);
  max-width: min(1280px, 100%);
}

.uf-history-title {
  margin: 0;
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 4.5vw, 2.75rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--uf-history-ink);
}

.uf-history-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.uf-history-toolbar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.uf-history-search-form {
  flex: 0 0 256px;
  max-width: 256px;
  width: 256px;
}

.uf-history-search {
  position: relative;
  display: block;
}

.uf-history-search > i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--uf-history-muted);
  pointer-events: none;
  font-size: 0.9rem;
}

.uf-history-search input {
  width: 100%;
  min-height: 44px;
  padding: 0 40px;
  border: 2px solid var(--uf-history-border);
  border-radius: 12px;
  background: var(--uf-history-surface);
  color: var(--uf-history-ink);
  font-size: 0.92rem;
  outline: none;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.08);
}

body:not(.light-mode) .uf-history-search input {
  box-shadow: none;
}

.uf-history-search input:focus {
  border-color: var(--brand-color-dark, #bb86fc);
}

body.light-mode .uf-history-search input:focus {
  border-color: var(--brand-color-light, #e1306c);
}

.uf-history-search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--uf-history-muted);
  text-decoration: none;
}

.uf-history-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.uf-history-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 168px;
}

.uf-history-select-wrap--platform {
  min-width: 150px;
}

.uf-history-select-icon {
  position: absolute;
  left: 12px;
  color: var(--uf-history-muted);
  font-size: 0.82rem;
  pointer-events: none;
  z-index: 1;
}

.uf-history-select-chevron {
  position: absolute;
  right: 12px;
  color: var(--uf-history-muted);
  font-size: 0.7rem;
  pointer-events: none;
}

.uf-history-select {
  width: 100%;
  min-height: 44px;
  padding: 0 34px 0 34px;
  border: 2px solid var(--uf-history-border);
  border-radius: 12px;
  background: var(--uf-history-surface);
  color: var(--uf-history-ink);
  font-size: 0.86rem;
  font-weight: 600;
  appearance: none;
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.08);
}

body:not(.light-mode) .uf-history-select {
  box-shadow: none;
}

.uf-history-new-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 2px solid var(--uf-history-border);
  border-radius: 12px;
  background: var(--uf-history-cta);
  color: var(--uf-history-cta-text);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.14);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.uf-history-new-btn:hover {
  color: var(--uf-history-cta-text);
  transform: translateY(-1px);
}

.uf-history-new-btn--inline {
  margin-top: 4px;
}

.uf-history-table-card {
  border: 2px solid var(--uf-history-border);
  border-radius: 16px;
  background: var(--uf-history-surface);
  overflow: visible;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.08);
}

body:not(.light-mode) .uf-history-table-card {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.uf-history-table-head,
.uf-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, 0.55fr) minmax(150px, 0.62fr) 52px;
  gap: 16px;
  align-items: center;
}

.uf-history-table-head {
  padding: 12px 18px;
  color: var(--uf-history-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--uf-history-border);
}

.uf-history-table-head-actions {
  justify-self: end;
}

.uf-history-row {
  padding: 14px 18px;
  border-bottom: 1px dashed color-mix(in srgb, var(--uf-history-border) 55%, transparent);
  cursor: pointer;
  transition: background 0.15s ease;
}

.uf-history-row:last-child {
  border-bottom: 0;
}

.uf-history-row:hover,
.uf-history-row:focus-visible {
  background: color-mix(in srgb, var(--uf-history-ink) 5%, transparent);
  outline: none;
}

.uf-history-post-cell {
  min-width: 0;
}

.uf-history-post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.uf-history-platform-stack {
  display: inline-flex;
  align-items: center;
}

.uf-history-platform-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-left: -7px;
  border-radius: 999px;
  border: 2px solid var(--uf-history-surface);
  color: #fff;
  font-size: 0.72rem;
  box-shadow: 0 0 0 1px var(--uf-history-border);
}

.uf-history-platform-icon:first-child {
  margin-left: 0;
}

.uf-history-platform-icon--instagram {
  background: linear-gradient(45deg, #833ab4, #fd1d1d, #fcaf45);
}

.uf-history-platform-icon--facebook {
  background: #1877f2;
}

.uf-history-platform-icon--linkedin {
  background: #0a66c2;
}

.uf-history-platform-icon--x {
  background: #141414;
}

.uf-history-platform-more {
  margin-left: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--uf-history-muted);
}

.uf-history-topic-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 8px;
  border: 2px solid var(--uf-history-border);
  border-radius: 8px;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--uf-history-ink);
  background: color-mix(in srgb, var(--uf-history-surface) 92%, var(--uf-history-ink));
}

.uf-history-topic-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #34d399;
  flex-shrink: 0;
}

.uf-history-preview {
  margin: 0;
  color: var(--uf-history-muted);
  font-size: 0.9rem;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uf-history-error {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: #ef4444;
  font-size: 0.78rem;
}

.uf-history-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 8px;
  border: 2px solid var(--uf-history-border);
  border-radius: 8px;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.uf-history-status--draft {
  background: var(--uf-history-surface);
  color: var(--uf-history-ink);
}

.uf-history-status--scheduled {
  background: #ddd6fe;
  color: #4c1d95;
  border-color: #141414;
}

body:not(.light-mode) .uf-history-status--scheduled {
  background: rgba(124, 77, 255, 0.22);
  color: #ddd6fe;
}

.uf-history-status--published {
  background: #bbf7d0;
  color: #166534;
  border-color: #141414;
}

body:not(.light-mode) .uf-history-status--published {
  background: rgba(52, 211, 153, 0.16);
  color: #86efac;
}

.uf-history-status--failed {
  background: #fecaca;
  color: #991b1b;
  border-color: #141414;
}

body:not(.light-mode) .uf-history-status--failed {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
}

.uf-history-date-cell {
  color: var(--uf-history-muted);
  font-size: 0.86rem;
  white-space: nowrap;
}

.uf-history-actions-cell {
  display: flex;
  justify-content: flex-end;
  position: relative;
  overflow: visible;
}

.uf-history-row-menu {
  position: relative;
}

.uf-history-kebab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 2px solid var(--uf-history-border);
  border-radius: 10px;
  background: var(--uf-history-surface);
  color: var(--uf-history-ink);
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.08);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

body.light-mode .uf-history-kebab {
  box-shadow: 2px 2px 0 #141414;
}

.uf-history-kebab:hover {
  background: color-mix(in srgb, #ede9fe 72%, var(--uf-history-surface));
  color: #5b21b6;
}

body:not(.light-mode) .uf-history-kebab:hover {
  background: rgba(124, 77, 255, 0.16);
  color: #ddd6fe;
}

.uf-history-kebab[aria-expanded="true"] {
  background: color-mix(in srgb, #ede9fe 82%, var(--uf-history-surface));
  color: #5b21b6;
  box-shadow: 1px 1px 0 #141414;
  transform: translate(1px, 1px);
}

body:not(.light-mode) .uf-history-kebab[aria-expanded="true"] {
  background: rgba(124, 77, 255, 0.22);
  color: #ddd6fe;
  box-shadow: none;
  transform: none;
}

.uf-history-dropdown.dropdown-menu {
  --uf-dropdown-ink: #141414;
  --uf-dropdown-surface: #fff;
  --uf-dropdown-accent: #ede9fe;
  --uf-dropdown-accent-text: #5b21b6;
  --uf-dropdown-icon: rgba(20, 20, 20, 0.58);
  --uf-dropdown-danger: #e54b4f;
  --uf-dropdown-danger-bg: #ffe4e6;
  --uf-dropdown-danger-text: #be123c;

  min-width: 10.5rem;
  padding: 6px;
  margin-top: 4px !important;
  border: 2px solid var(--uf-dropdown-ink) !important;
  border-radius: 12px !important;
  background: var(--uf-dropdown-surface) !important;
  color: var(--uf-dropdown-ink);
  box-shadow: 4px 4px 0 var(--uf-dropdown-ink);
  z-index: 1080;
  overflow: hidden;
  /* Opacity-only animation: transform breaks Popper positioning */
  animation: ufHistoryDropdownIn 0.16s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body:not(.light-mode) .uf-history-dropdown.dropdown-menu {
  --uf-dropdown-ink: rgba(255, 255, 255, 0.9);
  --uf-dropdown-surface: #1c1c1e;
  --uf-dropdown-accent: rgba(124, 77, 255, 0.2);
  --uf-dropdown-accent-text: #ddd6fe;
  --uf-dropdown-icon: rgba(255, 255, 255, 0.55);
  --uf-dropdown-danger: #f87171;
  --uf-dropdown-danger-bg: rgba(239, 68, 68, 0.16);
  --uf-dropdown-danger-text: #fecaca;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
}

@keyframes ufHistoryDropdownIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.uf-history-dropdown > li {
  margin: 0;
}

.uf-history-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--uf-dropdown-ink);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.uf-history-dropdown .dropdown-item i {
  width: 16px;
  font-size: 0.875rem;
  color: var(--uf-dropdown-icon);
  flex-shrink: 0;
  text-align: center;
  pointer-events: none;
}

.uf-history-dropdown .dropdown-item:hover,
.uf-history-dropdown .dropdown-item:focus,
.uf-history-dropdown .dropdown-item:focus-visible {
  background: var(--uf-dropdown-accent);
  color: var(--uf-dropdown-accent-text);
  outline: none;
}

.uf-history-dropdown .dropdown-item:hover i,
.uf-history-dropdown .dropdown-item:focus i,
.uf-history-dropdown .dropdown-item:focus-visible i {
  color: var(--uf-dropdown-accent-text);
}

.uf-history-dropdown .dropdown-item--danger {
  color: var(--uf-dropdown-danger);
}

.uf-history-dropdown .dropdown-item--danger i {
  color: var(--uf-dropdown-danger);
}

.uf-history-dropdown .dropdown-item--danger:hover,
.uf-history-dropdown .dropdown-item--danger:focus,
.uf-history-dropdown .dropdown-item--danger:focus-visible {
  background: var(--uf-dropdown-danger-bg);
  color: var(--uf-dropdown-danger-text);
}

.uf-history-dropdown .dropdown-item--danger:hover i,
.uf-history-dropdown .dropdown-item--danger:focus i,
.uf-history-dropdown .dropdown-item--danger:focus-visible i {
  color: var(--uf-dropdown-danger-text);
}

.uf-history-dropdown-divider {
  height: 1px;
  margin: 4px -6px;
  padding: 0;
  border: 0;
  background: color-mix(in srgb, var(--uf-dropdown-ink) 12%, transparent);
  opacity: 1;
}

.uf-history-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 18px;
  border-top: 2px solid var(--uf-history-border);
  color: var(--uf-history-muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.uf-history-page-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 2px solid var(--uf-history-border);
  border-radius: 10px;
  color: var(--uf-history-ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.84rem;
}

.uf-history-page-link:hover {
  color: var(--uf-history-ink);
  background: color-mix(in srgb, var(--uf-history-ink) 5%, transparent);
}

.uf-history-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 64px 24px;
  text-align: center;
}

.uf-history-empty-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 2px solid var(--uf-history-border);
  border-radius: 12px;
  font-size: 1.3rem;
  color: var(--uf-history-ink);
}

.uf-history-empty h2 {
  margin: 0;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
}

.uf-history-empty p {
  margin: 0;
  max-width: 460px;
  color: var(--uf-history-muted);
  font-size: 0.92rem;
}

@media (max-width: 900px) {
  .uf-history-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .uf-history-toolbar-left {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .uf-history-search-form {
    flex: 1 1 auto;
    max-width: none;
    width: 100%;
  }

  .uf-history-filter-group {
    width: 100%;
  }

  .uf-history-select-wrap,
  .uf-history-select-wrap--platform {
    flex: 1 1 140px;
    min-width: 0;
  }

  .uf-history-new-btn {
    width: 100%;
  }

  .uf-history-table-head {
    display: none;
  }

  .uf-history-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "post actions"
      "status date";
    gap: 10px 12px;
  }

  .uf-history-post-cell { grid-area: post; }
  .uf-history-status-cell { grid-area: status; }
  .uf-history-date-cell { grid-area: date; justify-self: end; }
  .uf-history-actions-cell { grid-area: actions; }

  .uf-history-preview {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}

@media (max-width: 520px) {
  .uf-history-filter-group {
    flex-direction: column;
  }

  .uf-history-select-wrap,
  .uf-history-select-wrap--platform {
    width: 100%;
  }
}

/* ===== Public preview share modal (Compartir preview) ===== */
.uf-ppm-dialog {
  max-width: 440px;
}

.uf-public-preview-modal {
  --uf-ppm-surface: var(--card-bg-dark, #1c1c1e);
  --uf-ppm-ink: rgba(255, 255, 255, 0.92);
  --uf-ppm-muted: rgba(255, 255, 255, 0.55);
  --uf-ppm-line: rgba(255, 255, 255, 0.1);
  --uf-ppm-field: rgba(255, 255, 255, 0.05);
  --uf-ppm-field-border: rgba(255, 255, 255, 0.12);
  --uf-ppm-accent: #bb86fc;
  --uf-ppm-accent-2: #7c4dff;
  --uf-ppm-danger: #f87171;
  --uf-ppm-ok: #6ee7a8;
  --uf-ppm-warn: #fbbf24;

  background: var(--uf-ppm-surface) !important;
  color: var(--uf-ppm-ink);
  border: 1px solid var(--uf-ppm-line) !important;
  border-radius: 18px !important;
  box-shadow:
    0 0 0 1px rgba(187, 134, 252, 0.06),
    0 24px 64px rgba(0, 0, 0, 0.55) !important;
  overflow: hidden;
}

body.light-mode .uf-public-preview-modal {
  --uf-ppm-surface: #ffffff;
  --uf-ppm-ink: #141414;
  --uf-ppm-muted: rgba(20, 20, 20, 0.55);
  --uf-ppm-line: rgba(20, 20, 20, 0.1);
  --uf-ppm-field: #f6f4f8;
  --uf-ppm-field-border: rgba(20, 20, 20, 0.12);
  --uf-ppm-accent: #7c4dff;
  --uf-ppm-accent-2: #E1306C;
  --uf-ppm-danger: #dc2626;
  --uf-ppm-ok: #059669;
  --uf-ppm-warn: #d97706;
  box-shadow:
    0 0 0 1px rgba(124, 77, 255, 0.06),
    0 24px 64px rgba(20, 20, 20, 0.14) !important;
}

.uf-public-preview-modal .modal-header,
.uf-public-preview-modal .modal-footer {
  display: none;
}

.uf-ppm-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--uf-ppm-line);
  background:
    linear-gradient(180deg, rgba(187, 134, 252, 0.07) 0%, transparent 100%);
}

body.light-mode .uf-ppm-head {
  background: linear-gradient(180deg, rgba(124, 77, 255, 0.05) 0%, transparent 100%);
}

.uf-ppm-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--uf-ppm-accent) 0%, var(--uf-ppm-accent-2) 100%);
  color: #fff;
  font-size: 0.95rem;
  box-shadow: 0 8px 18px rgba(124, 77, 255, 0.28);
}

.uf-ppm-head-copy {
  flex: 1 1 auto;
  min-width: 0;
  padding-top: 1px;
}

.uf-ppm-title {
  margin: 0 0 4px;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--uf-ppm-ink);
  line-height: 1.25;
}

.uf-ppm-desc {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--uf-ppm-muted);
}

.uf-ppm-close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  margin: -4px -6px 0 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--uf-ppm-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.uf-ppm-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--uf-ppm-ink);
}

body.light-mode .uf-ppm-close:hover {
  background: rgba(20, 20, 20, 0.06);
}

.uf-ppm-body {
  padding: 18px 22px 22px !important;
}

.uf-ppm-pane[hidden] {
  display: none !important;
}

.uf-ppm-field {
  margin-bottom: 16px;
}

.uf-ppm-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.uf-ppm-label {
  display: block;
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--uf-ppm-muted);
}

.uf-ppm-label-row .uf-ppm-label {
  margin-bottom: 0;
}

.uf-ppm-hint {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--uf-ppm-muted);
  line-height: 1.4;
}

.uf-ppm-select,
.uf-ppm-link-input {
  border-radius: 12px !important;
  border: 1px solid var(--uf-ppm-field-border) !important;
  background: var(--uf-ppm-field) !important;
  color: var(--uf-ppm-ink) !important;
  font-size: 0.925rem !important;
  min-height: 44px;
  box-shadow: none !important;
}

.uf-ppm-select:focus,
.uf-ppm-link-input:focus {
  border-color: rgba(187, 134, 252, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.15) !important;
}

.uf-ppm-link-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem !important;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uf-ppm-link-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.uf-ppm-link-row .uf-ppm-select,
.uf-ppm-link-row .uf-ppm-link-input {
  flex: 1 1 auto;
  min-width: 0;
}

.uf-ppm-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.06);
  color: var(--uf-ppm-muted);
}

.uf-ppm-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.uf-ppm-status.is-active {
  color: var(--uf-ppm-ok);
  background: rgba(110, 231, 168, 0.1);
  border-color: rgba(110, 231, 168, 0.28);
}

.uf-ppm-status.is-expired {
  color: var(--uf-ppm-warn);
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.28);
}

.uf-ppm-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--uf-ppm-line);
  background: rgba(255, 255, 255, 0.025);
}

body.light-mode .uf-ppm-meta {
  background: rgba(20, 20, 20, 0.025);
}

.uf-ppm-meta-item {
  min-width: 0;
}

.uf-ppm-meta-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--uf-ppm-muted);
  margin-bottom: 4px;
}

.uf-ppm-meta-value {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--uf-ppm-ink);
  line-height: 1.35;
  word-break: break-word;
}

.uf-ppm-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
  padding-top: 4px;
}

.uf-ppm-actions--split {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--uf-ppm-line);
}

.uf-ppm-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.uf-ppm-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 42px;
  padding: 0.55rem 1rem;
  border-radius: 12px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none !important;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.uf-ppm-btn:active {
  transform: scale(0.98);
}

.uf-ppm-btn--compact {
  min-height: 44px;
  flex: 0 0 auto;
  padding-inline: 0.95rem;
}

.uf-ppm-btn--primary {
  background: linear-gradient(135deg, var(--uf-ppm-accent) 0%, var(--uf-ppm-accent-2) 100%);
  color: #fff !important;
  box-shadow: 0 8px 20px rgba(124, 77, 255, 0.32);
}

.uf-ppm-btn--primary:hover {
  filter: brightness(1.05);
  box-shadow: 0 10px 24px rgba(124, 77, 255, 0.4);
}

.uf-ppm-btn--secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--uf-ppm-field-border);
  color: var(--uf-ppm-ink) !important;
}

.uf-ppm-btn--secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

body.light-mode .uf-ppm-btn--secondary {
  background: #fff;
  border-color: rgba(20, 20, 20, 0.14);
}

body.light-mode .uf-ppm-btn--secondary:hover {
  background: #f7f5fb;
}

.uf-ppm-btn--ghost {
  background: transparent;
  color: var(--uf-ppm-muted) !important;
  border-color: transparent;
}

.uf-ppm-btn--ghost:hover {
  color: var(--uf-ppm-ink) !important;
  background: rgba(255, 255, 255, 0.05);
}

body.light-mode .uf-ppm-btn--ghost:hover {
  background: rgba(20, 20, 20, 0.05);
}

.uf-ppm-btn--danger-ghost {
  background: transparent;
  color: var(--uf-ppm-danger) !important;
  border-color: transparent;
}

.uf-ppm-btn--danger-ghost:hover {
  background: rgba(248, 113, 113, 0.1);
}

@media (max-width: 480px) {
  .uf-ppm-dialog {
    margin: 0.75rem;
  }

  .uf-ppm-meta {
    grid-template-columns: 1fr;
  }

  .uf-ppm-actions--split {
    flex-direction: column;
    align-items: stretch;
  }

  .uf-ppm-actions-right {
    margin-left: 0;
    width: 100%;
  }

  .uf-ppm-actions-right .uf-ppm-btn {
    flex: 1 1 auto;
  }

  .uf-ppm-link-row {
    flex-direction: column;
  }

  .uf-ppm-btn--compact {
    width: 100%;
  }
}

/* ===== Ready compose mode (from product ads / creativo ya listo) ===== */
#universalForm.uf-ready-mode .uf-progress {
  display: none !important;
}

#universalForm.uf-ready-mode .uf-step-grid {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

#universalForm.uf-ready-mode .uf-step {
  display: block !important;
  position: static !important;
  opacity: 1 !important;
  transform: none !important;
  pointer-events: auto !important;
}

#universalForm.uf-ready-mode .uf-step[hidden] {
  display: block !important;
}

#universalForm.uf-ready-mode [data-uf-back],
#universalForm.uf-ready-mode [data-uf-next] {
  display: none !important;
}

#universalForm.uf-ready-mode [data-uf-submit] {
  display: inline-flex !important;
  margin-left: auto;
}

#universalForm.uf-ready-mode .uf-media-source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

#universalForm.uf-ready-mode .uf-media-source-btn {
  flex: 1 1 140px;
}

.uf-media-source-row[hidden] {
  display: none !important;
}

/* Adaptive ordered media tray */
.uf-draft-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.uf-draft-status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
  transition: color 160ms ease, transform 160ms ease;
}

.uf-draft-status[data-state="saving"] { color: #fbbf24; }
.uf-draft-status[data-state="saving"] .uf-draft-status-dot { animation: ufDraftPulse 900ms ease-in-out infinite; }
.uf-draft-status[data-state="saved"] { color: #86efac; border-color: rgba(74, 222, 128, 0.2); background: rgba(74, 222, 128, 0.07); }
.uf-draft-status[data-state="offline"] { color: #fdba74; border-color: rgba(251, 146, 60, 0.22); background: rgba(251, 146, 60, 0.07); }
body.light-mode .uf-draft-status { color: rgba(17, 24, 39, 0.58); border-color: rgba(17, 24, 39, 0.1); background: rgba(17, 24, 39, 0.025); }
body.light-mode .uf-draft-status[data-state="saving"] { color: #b45309; }
body.light-mode .uf-draft-status[data-state="saved"] { color: #15803d; border-color: rgba(21, 128, 61, 0.18); background: rgba(21, 128, 61, 0.06); }
body.light-mode .uf-draft-status[data-state="offline"] { color: #c2410c; border-color: rgba(194, 65, 12, 0.18); background: rgba(194, 65, 12, 0.06); }

@keyframes ufDraftPulse {
  50% { opacity: 0.38; transform: scale(0.72); }
}

.uf-media-tray {
  --uf-media-surface: rgba(255, 255, 255, 0.035);
  --uf-media-line: rgba(255, 255, 255, 0.12);
  padding: 18px;
  border: 1px solid var(--uf-media-line);
  border-radius: 18px;
  background: var(--uf-media-surface);
}

body.light-mode .uf-media-tray {
  --uf-media-surface: rgba(17, 24, 39, 0.025);
  --uf-media-line: rgba(17, 24, 39, 0.12);
}

.uf-media-tray-head,
.uf-media-source-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.uf-media-tray-title {
  margin: 0;
  color: rgba(255, 255, 255, 0.96);
  font: 700 0.98rem/1.3 "Montserrat", sans-serif;
}

body.light-mode .uf-media-tray-title { color: #111827; }

.uf-media-tray-status {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.82rem;
}

body.light-mode .uf-media-tray-status { color: rgba(17, 24, 39, 0.62); }

.uf-media-tray-count {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid var(--uf-media-line);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.74rem;
  font-weight: 700;
}

body.light-mode .uf-media-tray-count { color: rgba(17, 24, 39, 0.68); }

.uf-media-tray-error {
  margin-top: 12px;
  padding: 9px 11px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 10px;
  background: rgba(248, 113, 113, 0.08);
  color: #fca5a5;
  font-size: 0.8rem;
}

body.light-mode .uf-media-tray-error { color: #b42318; }

.uf-media-tray-content {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  overflow-x: visible;
}

.uf-media-tray-list { display: contents; }

.uf-media-card,
.uf-media-add-tile {
  position: relative;
  flex: 0 1 176px;
  width: 176px;
  height: auto;
  aspect-ratio: 1 / 1;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--uf-media-line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
}

.uf-media-card {
  cursor: grab;
  transition: transform 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.uf-media-card:active { cursor: grabbing; }
.uf-media-card.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.12) 45%, transparent 70%);
  transform: translateX(-100%);
  animation: ufMediaLoading 1.1s ease-in-out infinite;
}
.uf-media-card.is-error { border-color: rgba(248, 113, 113, 0.65); }
.uf-media-card.is-dragging { opacity: 0.45; transform: scale(0.97); }
.uf-media-card.is-drop-target { border-color: var(--brand-color-dark); box-shadow: 0 0 0 2px rgba(187, 134, 252, 0.22); }
body.light-mode .uf-media-card.is-drop-target { border-color: var(--brand-color-light); box-shadow: 0 0 0 2px rgba(225, 48, 108, 0.18); }

.uf-media-card-visual {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.uf-media-order,
.uf-media-cover {
  position: absolute;
  top: 9px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 15, 18, 0.76);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
}

.uf-media-order {
  left: 9px;
  width: 24px;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 800;
}

.uf-media-cover {
  right: 9px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.uf-media-card-actions {
  position: absolute;
  right: 8px;
  bottom: 8px;
  left: 8px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(15, 15, 18, 0.76);
  backdrop-filter: blur(9px);
}

.uf-media-drag-handle,
.uf-media-action {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
}

.uf-media-drag-handle { margin-right: auto; cursor: grab; }
.uf-media-action { cursor: pointer; }
.uf-media-action:hover:not(:disabled),
.uf-media-action:focus-visible { background: rgba(255, 255, 255, 0.14); outline: 0; }
.uf-media-action:focus-visible { box-shadow: 0 0 0 2px var(--brand-color-dark); }
.uf-media-action:disabled { opacity: 0.28; cursor: default; }
.uf-media-action--remove:hover { color: #fecaca; background: rgba(248, 113, 113, 0.18) !important; }

.uf-media-add-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  border-style: dashed;
  cursor: pointer;
  background: rgba(187, 134, 252, 0.035);
}

.uf-media-add-tile .upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  max-width: 132px;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.25;
}

.uf-media-add-tile .upload-hint {
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.7rem;
  font-weight: 600;
}

body.light-mode .uf-media-add-tile .upload-content { color: rgba(17, 24, 39, 0.9); }
body.light-mode .uf-media-add-tile .upload-hint { color: rgba(17, 24, 39, 0.54); }

body.light-mode .uf-media-add-tile { background: rgba(225, 48, 108, 0.025); }
.uf-media-add-tile:hover,
.uf-media-add-tile:focus-visible,
.uf-media-add-tile.dragging { border-color: var(--brand-color-dark); outline: 0; background: rgba(187, 134, 252, 0.08); }
body.light-mode .uf-media-add-tile:hover,
body.light-mode .uf-media-add-tile:focus-visible,
body.light-mode .uf-media-add-tile.dragging { border-color: var(--brand-color-light); background: rgba(225, 48, 108, 0.06); }

.uf-media-add-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(187, 134, 252, 0.13);
  color: var(--brand-color-dark);
}

body.light-mode .uf-media-add-icon { background: rgba(225, 48, 108, 0.1); color: var(--brand-color-light); }
.uf-media-add-tile .upload-hint { margin: 0; }

.uf-media-source-row {
  justify-content: flex-start;
  margin-top: 12px;
}

.uf-media-source-row .uf-media-source-btn { flex: 0 1 auto; min-height: 40px; padding: 10px 14px; font-size: 0.8rem; }
.uf-media-source-row .media-controls { margin: 0 0 0 auto; }
.uf-media-clear { min-height: 40px; padding: 10px 14px; color: rgba(255, 255, 255, 0.62); font-size: 0.8rem; }
body.light-mode .uf-media-clear { color: rgba(17, 24, 39, 0.62); }
.uf-media-tray.is-limit-reached .uf-media-tray-count { border-color: rgba(251, 191, 36, 0.35); color: #fbbf24; }

@media (max-width: 560px) {
  .uf-media-tray { padding: 14px; }
  .uf-media-tray-content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .uf-media-card,
  .uf-media-add-tile { width: 100%; min-width: 0; }
  .uf-media-source-row { display: grid; grid-template-columns: 1fr 1fr; }
  #universalForm.uf-ready-mode .uf-media-source-row { display: grid; }
  .uf-media-source-row .uf-media-source-btn { width: 100%; padding-inline: 8px; }
  .uf-media-source-row .media-controls { grid-column: 1 / -1; margin: 0; }
  .uf-media-clear { width: 100%; }
  .uf-media-drag-handle { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .uf-media-card { transition: none; }
  .uf-media-card.is-loading::after { animation: none; transform: none; }
}

@keyframes ufMediaLoading {
  to { transform: translateX(100%); }
}

/* Flu media library modal. It owns its backdrop/lifecycle to avoid clashes
   with Bootstrap modals left behind by the Product Ads handoff. */
.uf-flu-media-modal {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: grid;
  place-items: center;
  padding: 1rem;
  isolation: isolate;
}

.uf-flu-media-modal[hidden] {
  display: none !important;
}

.uf-flu-media-backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(8, 8, 12, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.uf-flu-media-dialog {
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 2rem));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 1.25rem;
  border: 1px solid rgba(var(--text-dark-rgb), 0.14);
  border-radius: 22px;
  background: var(--card-bg-dark);
  color: var(--text-dark);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  animation: ufFluMediaIn 180ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

body.light-mode .uf-flu-media-dialog {
  border-color: rgba(var(--text-light-rgb), 0.14);
  background: var(--card-bg-light);
  color: var(--text-light);
  box-shadow: 0 24px 70px rgba(51, 24, 36, 0.2);
}

body.uf-flu-media-open {
  overflow: hidden;
}

.uf-flu-media-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.uf-flu-media-panel-title {
  margin: 0.25rem 0 0;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 750;
  letter-spacing: -0.02em;
}

.uf-flu-media-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--brand-color-dark);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.light-mode .uf-flu-media-kicker {
  color: var(--brand-color-light);
}

.uf-flu-media-close {
  flex-shrink: 0;
  width: 2.5rem;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 999px;
}

.uf-flu-media-lead {
  margin: 0.25rem 0 0;
  opacity: 0.78;
  font-size: 0.9rem;
}

.uf-flu-media-status {
  min-height: 1.25rem;
  margin: 0.25rem 0 0.75rem;
  font-size: 0.88rem;
  opacity: 0.8;
}

.uf-flu-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.65rem;
  max-height: min(58vh, 470px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0.15rem 0.3rem 0.15rem 0.15rem;
}

.uf-flu-media-item {
  position: relative;
  border: 0;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(var(--text-dark-rgb), 0.14);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

body.light-mode .uf-flu-media-item {
  background: rgba(var(--text-light-rgb), 0.035);
  border-color: rgba(var(--text-light-rgb), 0.14);
}

.uf-flu-media-item:hover,
.uf-flu-media-item:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(124, 77, 255, 0.25);
  outline: none;
}

.uf-flu-media-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.uf-flu-media-item-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.35rem 0.4rem;
  font-size: 0.68rem;
  line-height: 1.2;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  color: #fff;
  text-align: left;
}

@keyframes ufFluMediaIn {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 560px) {
  .uf-flu-media-modal { padding: 0.65rem; }
  .uf-flu-media-dialog {
    max-height: calc(100vh - 1.3rem);
    padding: 1rem;
    border-radius: 18px;
  }
  .uf-flu-media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .uf-flu-media-dialog { animation: none; }
}
