@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&family=Tajawal:wght@400;500;700&display=swap');

:root {
  --brand-primary: #9333ea;
  --brand-secondary: #ec4899;
  --brand-accent: #ffffff;
  --brand-ink: #1a202c;
  --brand-bg: #f7f7fb;
  --brand-card: #ffffff;
  --brand-border: #e6e8f0;
  --brand-muted: #6b7280;
  --brand-success: #16a34a;
  --brand-warning: #f59e0b;
  --brand-danger: #ef4444;
  --shadow-soft: 0 10px 30px rgba(147, 51, 234, 0.12);
  --shadow-card: 0 12px 30px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 115%;
}

body {
  margin: 0;
  font-family: 'Cairo', system-ui, -apple-system, Segoe UI, sans-serif;
  color: var(--brand-ink);
  background: var(--brand-bg);
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-page {
  overflow-x: hidden;
}

.app-content {
  flex: 1;
  min-width: 0;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  background: var(--brand-card);
  border-bottom: 1px solid var(--brand-border);
  position: sticky;
  top: 0;
  z-index: 9;
}

.header-title {
  font-weight: 800;
  font-size: 18px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.report-notifications {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 24px 0;
}
.report-notice {
  background: #f8fafc;
  border: 1px solid var(--brand-border);
  border-left: 4px solid var(--brand-primary);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.report-notice.refunded { border-left-color: #22c55e; }
.report-notice.declined { border-left-color: #ef4444; }
.report-notice-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--brand-ink, #1e293b);
  margin-bottom: 4px;
}
.report-notice-body {
  font-size: 0.85rem;
  color: var(--brand-muted, #64748b);
  line-height: 1.4;
}
.report-notice-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--brand-muted, #64748b);
}

.header-credits {
  display: flex;
  gap: 6px;
  align-items: center;
}

.header-credits .credit-pill {
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(147, 51, 234, 0.12);
}

.icon-button {
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.sidebar {
  width: 238px;
  background: var(--brand-card);
  border-right: 1px solid var(--brand-border);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100vh;
  font-size: 122%;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-header .brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.06);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.sidebar-header .brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-close {
  display: none;
}

.brand-switcher-slot {
  position: sticky;
  top: 0;
  background: var(--brand-card);
  padding-bottom: 10px;
  z-index: 2;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-muted);
  font-weight: 700;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--brand-ink);
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.nav-item:hover {
  background: rgba(147, 51, 234, 0.12);
}

.nav-item.active {
  background: rgba(147, 51, 234, 0.16);
  color: var(--brand-primary);
}

.nav-icon {
  width: 16px;
  height: 16px;
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stage-icon {
  width: 14px;
  height: 14px;
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.inline-icon {
  width: 14px;
  height: 14px;
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
}

.create-cta {
  padding: 14px 26px;
  font-size: 16px;
  font-weight: 800;
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(147, 51, 234, 0.2);
  background: #111827;
  color: #ffffff;
  border: 1px solid rgba(17, 24, 39, 0.12);
}

.create-panel {
  margin: 16px 0 20px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(147, 51, 234, 0.04);
  border: 1px solid var(--brand-border);
}

.create-panel.hidden {
  display: none;
}

.nav-credits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.credit-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(147, 51, 234, 0.08);
  font-weight: 700;
  position: relative;
}

.credit-pill::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translate(-50%, 4px);
  background: #111827;
  color: #ffffff;
  font-size: 11px;
  padding: 6px 8px;
  border-radius: 8px;
  max-width: 320px;
  min-width: 140px;
  white-space: normal;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s ease, transform 0.1s ease;
  z-index: 5;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.2);
}

.credit-pill::before {
  content: '';
  position: absolute;
  left: 50%;
  top: calc(100% + 2px);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: #111827;
  opacity: 0;
  transition: opacity 0.1s ease;
  pointer-events: none;
  z-index: 5;
}

.credit-pill:hover::after,
.credit-pill:focus-visible::after,
.credit-pill:hover::before,
.credit-pill:focus-visible::before {
  opacity: 1;
  transform: translate(-50%, 8px);
}

.credit-icon {
  width: 16px;
  height: 16px;
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.credit-value {
  font-size: 13px;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-footer .select,
.sidebar-footer .button.link {
  color: #111827;
}

.sidebar-footer .lang-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.sidebar-footer .lang-icon {
  color: #6b7280;
  flex-shrink: 0;
}

.sidebar-footer .lang-picker .lang-select {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  color: inherit;
  box-shadow: none !important;
  border-radius: 0 !important;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.sidebar-footer .select {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  max-width: 100%;
  box-sizing: border-box;
}

.sidebar-footer .button.link {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: #9ca3af;
}

.footer-links a {
  color: #6b7280;
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--brand-primary, #B8860B);
  text-decoration: underline;
}

.footer-sep {
  color: #d1d5db;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  opacity: 0;
  pointer-events: none;
  display: none;
  transition: opacity 0.2s ease;
  z-index: 40;
}

.mobile-credits {
  display: none;
  gap: 8px;
  align-items: center;
  max-width: 100%;
  overflow: visible;
  scrollbar-width: none;
}

.mobile-credits .credit-pill {
  padding: 4px 6px;
  border-radius: 8px;
  background: rgba(147, 51, 234, 0.12);
  white-space: nowrap;
}

.mobile-credits .credit-value {
  font-size: 11px;
}

.mobile-credits .credit-icon {
  width: 14px;
  height: 14px;
}

.mobile-credits-more {
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1;
  border-radius: 999px;
}

.mobile-credits::-webkit-scrollbar {
  height: 0;
}

.mobile-credits::-webkit-scrollbar-thumb {
  background: transparent;
}

@media (max-width: 960px) {
  .app-header {
    padding: 12px 16px;
    gap: 8px;
  }

  .header-left {
    gap: 8px;
  }

  .header-actions {
    margin-left: 6px;
    gap: 6px;
  }

  .mobile-credits {
    gap: 6px;
  }
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 50;
    height: 100vh;
    max-height: 100vh;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .rtl .sidebar {
    left: auto;
    right: 0;
    transform: translateX(100%);
  }

  .sidebar-close {
    display: inline-grid;
  }

  .job-details-card {
    position: static;
  }

  .sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  display: block;
  }

  .nav-credits {
    display: none;
  }

  .header-credits {
    display: none;
  }

  .mobile-credits {
    display: flex;
  }

  .header-actions {
    min-width: 0;
    flex: 1;
    justify-content: flex-end;
  }

  .user-greeting {
    display: none;
  }

  .user-name {
    font-size: 14px;
  }

  .user-chip {
    padding: 6px 10px;
    gap: 8px;
  }

  .user-avatar {
    width: 24px;
    height: 24px;
  }

  .sidebar-header .brand-title {
    font-size: 11px;
    line-height: 1.1;
  }
}

@media (min-width: 961px) {
  #nav-toggle {
    display: none;
  }

  .nav-credits {
    display: none;
  }

  .sidebar-close {
    display: none !important;
  }

  #user-chip {
    display: inline-flex;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.topbar {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  color: var(--brand-on-primary, var(--brand-accent));
  padding: 18px 28px;
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.brand-switcher {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(6px);
}

.brand-switcher .select {
  background: #ffffff;
  color: var(--brand-ink);
  border: 1px solid var(--brand-border);
  min-width: 0;
}

.add-brand-button {
  width: 100%;
  height: 40px;
  font-size: 14px;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
  align-self: stretch;
  margin-top: 2px;
  background: #111827;
  color: #ffffff;
  border: 1px solid rgba(17, 24, 39, 0.12);
  box-shadow: 0 10px 18px rgba(17, 24, 39, 0.18);
}

.add-brand-button:hover,
.create-cta:hover {
  background: #1f2937;
  color: #ffffff;
}

.header-pill {
  margin-left: 12px;
  background: rgba(255, 255, 255, 0.25);
  color: var(--brand-on-primary, var(--brand-accent));
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.brand-switcher-logo {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.35);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.brand-switcher-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-switcher .select {
  min-width: 180px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-logo-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-accent, #6366f1), #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-title {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.4px;
}

.brand-subtitle {
  font-size: 13px;
  opacity: 0.85;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--brand-on-primary, var(--brand-accent));
  font-weight: 700;
  text-decoration: none;
  backdrop-filter: blur(6px);
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.app-header .user-chip {
  background: #ffffff;
  border: 1px solid var(--brand-border);
  color: var(--brand-ink);
}

.app-header .user-avatar {
  background: rgba(15, 23, 42, 0.08);
  color: var(--brand-ink);
}

.user-chip-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-chip-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.user-greeting {
  font-weight: 600;
  color: var(--brand-ink);
}

.user-name {
  font-weight: 700;
  color: var(--brand-ink);
}

.user-chip-edit {
  width: 14px;
  height: 14px;
  color: var(--brand-muted);
  flex-shrink: 0;
}

.user-chip:hover {
  background: rgba(255, 255, 255, 0.28);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}


.user-chip-caret {
  font-size: 14px;
  opacity: 0.7;
  margin-left: 2px;
  display: inline-block;
}

.rtl .user-chip-caret {
  transform: scaleX(-1);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.35);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--brand-on-primary, var(--brand-accent));
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


.plan-inline {
  font-size: 11px;
  font-weight: 600;
  color: #b45309;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.plan-inline.trial {
  color: #b91c1c;
}

.credit-mini {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(147, 51, 234, 0.12);
  color: var(--brand-ink);
  font-size: 11px;
  font-weight: 700;
}

.credit-mini .credit-value {
  font-size: 11px;
}

.select {
  background: var(--brand-card);
  border: 1px solid #e5e7eb;
  color: var(--brand-ink);
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Tajawal', 'Cairo', system-ui, -apple-system, Segoe UI, sans-serif;
  min-width: 180px;
  backdrop-filter: blur(6px);
}

.select option {
  background: #ffffff;
  color: #111827;
}

.container {
  max-width: 1120px;
  margin: 28px auto 60px;
  padding: 0 24px;
  width: 100%;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 24px;
}

.full-width {
  grid-column: 1 / -1;
}

.jobs-main-grid {
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
}

.jobs-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.job-details-col {
  display: block;
}


.jobs-list-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--brand-card);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid var(--brand-border);
  box-shadow: var(--shadow-card);
}

.card h2 {
  margin: 0 0 12px;
  font-size: 22px;
}

.card p {
  margin: 0 0 16px;
  color: var(--brand-muted);
}

.job-details-card {
  position: sticky;
  top: 16px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

.section-toggle {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 999px;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.jobs-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.jobs-title-logo {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: rgba(147, 51, 234, 0.12);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
}

.jobs-title-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#ugc-settings .field {
  margin-bottom: 14px;
}

#ugc-settings .field:last-child {
  margin-bottom: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Radio group for options like before/after order */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-group.horizontal {
  flex-direction: row;
  flex-wrap: wrap;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.15s ease;
}

.radio-option:hover {
  background: var(--hover);
}

.radio-option input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.radio-option input[type="radio"]:checked + span {
  font-weight: 600;
  color: var(--primary);
}

/* Compact form fields */
#create-form .field {
  margin-bottom: 2px;
}

#create-form .stack {
  gap: 8px;
}

.field label {
  font-weight: 600;
  font-size: 14px;
}

.required-star {
  color: #e53935;
  font-weight: 700;
}

.required-label {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #b91c1c;
  background: #fee2e2;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.required-field input,
.required-field textarea,
.required-field select {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(254, 242, 242, 0.4);
}

.required-field input:focus,
.required-field textarea:focus,
.required-field select:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.optional-label {
  color: var(--brand-text-muted);
  font-weight: 400;
  font-size: 12px;
}

.field input,
.field textarea,
.field select {
  border: 1px solid var(--brand-border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.color-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-input-row input[type="color"] {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--brand-border);
  background: #fff;
}

.color-input-row .color-code-input {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.15);
}

.field textarea {
  min-height: 110px;
  resize: vertical;
  width: 100%;
}

.field textarea.full-width {
  width: 100%;
}

#creative-direction-field {
  width: 100%;
}

#creative-direction-field label,
#creative-direction-field textarea {
  display: block;
  width: 100%;
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.ugc-inline-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}

.ugc-inline-row .field select {
  display: block;
  width: 100%;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.button {
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  color: var(--brand-on-primary, #ffffff);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.button:hover {
  background: linear-gradient(135deg, var(--brand-secondary), var(--brand-primary));
  color: var(--brand-on-primary, #ffffff);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.16);
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  filter: grayscale(0.2);
}

.button.loading {
  position: relative;
  padding-right: 42px;
}

.button.loading::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.button.secondary.loading::after {
  border: 2px solid rgba(147, 51, 234, 0.35);
  border-top-color: var(--brand-primary);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(147, 51, 234, 0.1);
  color: var(--brand-primary);
  font-weight: 700;
  font-size: 13px;
}

.loading-with-tip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
}

.loading-tip {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted, #6b7280);
}

.loading-pill.error-pill {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.error-text {
  color: #dc2626;
  font-weight: 500;
}

.elapsed-timer {
  font-weight: 400;
  opacity: 0.8;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.loading-hourglass {
  display: inline-block;
  animation: hourglass 1.2s ease-in-out infinite;
}

@keyframes hourglass {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(180deg); }
  100% { transform: rotate(360deg); }
}

.button.secondary {
  background: var(--brand-card);
  color: var(--brand-primary);
  border: 1px solid var(--brand-primary);
  box-shadow: none;
}

.button.secondary:hover {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  color: #ffffff;
  border-color: transparent;
}

.button.compact {
  padding: 4px 10px;
  font-size: 12px;
  min-height: auto;
  line-height: 1.4;
}

.button.publish {
  background: linear-gradient(135deg, #f59e0b, #f97316, #ec4899);
  color: #fff7ed;
  border: none;
  box-shadow: 0 12px 28px rgba(249, 115, 22, 0.35);
  position: relative;
  overflow: hidden;
}

#add-multi-product {
  margin-top: 16px;
}

.button.publish::before {
  content: '';
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0) 60%);
  animation: publishGlow 2.2s ease-in-out infinite;
}

.button.publish:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(249, 115, 22, 0.45);
}

.button.publish:active {
  transform: translateY(1px) scale(0.99);
}

@keyframes publishGlow {
  0%, 100% { transform: translateX(-10%); opacity: 0.6; }
  50% { transform: translateX(10%); opacity: 0.9; }
}
.button.link {
  background: rgba(255, 255, 255, 0.12);
  color: var(--brand-on-primary, #ffffff);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: none;
  padding: 9px 14px;
  font-weight: 600;
}

.button.link:hover {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  color: #ffffff;
  border-color: transparent;
}

.topbar-actions .button.link {
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
}

.topbar-actions .button.link:hover {
  background: rgba(255, 255, 255, 0.28);
}

.hint {
  font-size: 12px;
  color: var(--brand-muted);
}

.language-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.language-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--brand-border);
  background: #fff;
  cursor: pointer;
  font-weight: 600;
}

.language-option input {
  accent-color: var(--brand-primary);
}

.checkbox-line {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--brand-ink);
  cursor: pointer;
}

#contact-prefs-panel .contact-prefs-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-top: 8px;
}

#contact-prefs-panel .contact-prefs-inline .checkbox-line {
  margin-top: 0;
}

.checkbox-line input {
  accent-color: var(--brand-primary);
}

/* Carousel mode selector */
.carousel-mode-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.carousel-mode-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--brand-border);
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.carousel-mode-option:has(input:checked) {
  border-color: var(--brand-primary);
  background: rgba(147, 51, 234, 0.08);
}

.carousel-mode-option input {
  accent-color: var(--brand-primary);
}

/* Carousel slide preview */
#carousel-preview-section {
  margin-top: 16px;
}

#carousel-preview-section .alert,
#multi-products-section .alert {
  margin-bottom: 16px;
}

#generate-carousel-preview {
  margin-top: 8px;
}

.section-subtitle {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-ink);
  margin-bottom: 8px;
}

.carousel-slide-item {
  background: #f9f9fb;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
}

.carousel-slide-item[data-slide="0"] {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.08) 0%, rgba(147, 51, 234, 0.02) 100%);
  border-color: rgba(147, 51, 234, 0.3);
}

.carousel-slide-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.carousel-slide-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.carousel-slide-remove {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--brand-muted);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s ease;
}

.carousel-slide-remove:hover {
  color: #dc2626;
}

.carousel-slide-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--brand-border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

.carousel-slide-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1);
}

.carousel-slide-input.cover-input {
  font-weight: 600;
  font-size: 15px;
}

.carousel-slide-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.carousel-slide-count {
  font-size: 12px;
  color: var(--brand-muted);
}

#carousel-ai-status {
  margin-top: 8px;
}

#carousel-ai-status.loading {
  color: var(--brand-primary);
}

#carousel-ai-status.error {
  color: #dc2626;
}

.carousel-cta-field {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--brand-border);
}

.carousel-cta-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

/* Auto toggle row - flex container to align checkbox */
.auto-toggle-row {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 8px;
}

/* Auto toggle - the actual checkbox label */
.auto-toggle-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--brand-muted);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(147, 51, 234, 0.08);
  transition: all 0.2s ease;
  width: fit-content;
}

.auto-toggle-inline:hover {
  background: rgba(147, 51, 234, 0.15);
}

.auto-toggle-inline input {
  accent-color: var(--brand-primary);
  width: 16px;
  height: 16px;
}

.auto-toggle-inline input:checked + span {
  color: var(--brand-primary);
  font-weight: 600;
}

/* Spacing below style grid */
.brief-style-grid {
  margin-bottom: 16px;
}

/* Verbatim toggle - below textarea */
.verbatim-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--brand-ink);
  cursor: pointer;
  margin-top: 8px;
  margin-bottom: 4px;
}

/* Hint after verbatim toggle needs extra spacing below */
.verbatim-toggle + .hint {
  margin-bottom: 24px;
}

.verbatim-toggle input {
  accent-color: var(--brand-primary);
  width: 16px;
  height: 16px;
}

.verbatim-toggle input:checked + span {
  color: var(--brand-primary);
  font-weight: 500;
}

/* Disabled textarea style */
textarea:disabled {
  background: var(--brand-bg);
  color: var(--brand-muted);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Brief Style Grid */
.brief-style-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

@media (max-width: 768px) {
  .brief-style-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.brief-style-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 8px;
  border: 2px solid var(--brand-border);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.brief-style-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.brief-style-emoji {
  font-size: 24px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.brief-style-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-muted);
  transition: color 0.2s ease;
}

.brief-style-option:hover {
  border-color: var(--brand-primary);
  transform: translateY(-2px);
}

.brief-style-option.selected {
  border-color: var(--brand-primary);
  background: var(--brand-primary);
  box-shadow: 0 4px 12px rgba(147, 51, 234, 0.25);
}

.brief-style-option.selected .brief-style-emoji {
  transform: scale(1.15);
}

.brief-style-option.selected .brief-style-label {
  color: #fff;
  font-weight: 700;
}

/* Style help icon (?) for tooltips */
.style-help {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(100, 116, 139, 0.15);
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  z-index: 2;
  transition: all 0.2s ease;
}
[dir="rtl"] .style-help {
  left: auto;
  right: 4px;
}
.style-help:hover {
  background: var(--brand-primary);
  color: #fff;
  transform: scale(1.1);
}
.style-tooltip-popup {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  max-width: 200px;
  white-space: normal;
  text-align: center;
  z-index: 2000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  animation: tooltipFade 0.2s ease;
}
.style-tooltip-popup::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: #1e293b;
}
@keyframes tooltipFade {
  from { opacity: 0; transform: translateX(-50%) translateY(-4px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.brief-style-option,
.style-option {
  position: relative;
}

/* Ensure style-help tooltips render above neighboring option cards (mobile stacking contexts) */
.brief-style-option.tooltip-open,
.style-option.tooltip-open {
  z-index: 1500;
}

.upload-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 120px;
  border: 1.5px dashed rgba(147, 51, 234, 0.4);
  background: rgba(147, 51, 234, 0.04);
  border-radius: 14px;
  padding: 18px 20px;
  cursor: pointer;
  text-align: center;
  transition: border 0.2s ease, background 0.2s ease;
}

.upload-box-small {
  min-height: 80px;
  padding: 12px 16px;
}

/* Before/After uploads grid */
.ba-uploads-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.ba-uploads-grid .upload-preview {
  max-height: 150px;
}

.ba-uploads-grid .upload-preview img {
  max-height: 140px;
  object-fit: contain;
}

.upload-input {
  display: none;
}

.upload-box:hover {
  border-color: var(--brand-primary);
  background: rgba(147, 51, 234, 0.08);
}

.upload-box.has-file {
  border-color: var(--brand-primary);
  background: rgba(147, 51, 234, 0.1);
}

.upload-box-title {
  font-weight: 700;
  color: var(--brand-ink);
  font-size: 15px;
}

.upload-box-subtitle {
  font-size: 12px;
  color: var(--brand-muted);
  margin-top: 6px;
}

.upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.upload-thumb {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--brand-border);
  background: #ffffff;
  min-width: 160px;
}

.upload-thumb .remove-thumb,
.upload-thumb .upload-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  border: none;
  background: #ef4444;
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  line-height: 1;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: background 0.15s, transform 0.15s;
  z-index: 1;
}

.upload-thumb .upload-remove:hover {
  background: #dc2626;
  transform: scale(1.1);
}

.upload-thumb img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid #e2e8f0;
}

.upload-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.upload-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-ink);
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.logo-option-card {
  border: 1px solid var(--brand-border);
  border-radius: 16px;
  padding: 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.logo-option-card img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: #f7f7fb;
  border-radius: 12px;
  border: 1px solid #edf0f7;
}

.copy-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.copy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.copy-icon {
  border: 1px solid rgba(147, 51, 234, 0.35);
  background: rgba(147, 51, 234, 0.08);
  color: var(--brand-primary);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 14px;
}

.copy-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.copy-icon:hover {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  color: #fff;
  border-color: transparent;
}

.logo-option-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.logo-edit-box {
  display: flex;
  gap: 8px;
  flex-direction: column;
}

.logo-edit-box input {
  width: 100%;
}

.brand-list-item {
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.brand-list-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-list-left .section-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-list-left.compact {
  align-items: flex-start;
}

.brand-list-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(147, 51, 234, 0.12);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-weight: 700;
  color: var(--brand-primary);
}

.brand-list-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-list-logo.small {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.brand-list-actions {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.brand-list-actions.compact {
  width: 100%;
  justify-content: flex-start;
  flex-wrap: wrap;
  align-items: center;
}

.brand-list-actions.compact .button {
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 10px;
  white-space: nowrap;
}

.brand-list-actions.compact .button span {
  white-space: nowrap;
}

.brand-list-actions .button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.action-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.action-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.inline-actions {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.section-header .inline-actions {
  flex-wrap: nowrap;
}

.section-header .inline-actions .button {
  white-space: nowrap;
}

.section-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.section-header .section-title {
  white-space: nowrap;
}

.section-header .inline-actions {
  margin-top: 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 12px 0 18px;
}

.stat-card {
  background: rgba(147, 51, 234, 0.08);
  border: 1px solid rgba(147, 51, 234, 0.2);
  border-radius: 14px;
  padding: 12px 14px;
}

.stats-grid-icons .stat-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stat-icon {
  width: 24px;
  height: 24px;
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.stat-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-label {
  font-size: 12px;
  color: var(--brand-muted);
  font-weight: 600;
}

.stat-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--brand-ink);
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
}


.plan-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.plan-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.plan-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  color: var(--brand-muted);
  font-weight: 600;
  font-size: 13px;
  flex-wrap: wrap;
}

.plan-tier {
  color: var(--brand-primary);
  font-weight: 800;
  letter-spacing: 0.03em;
}

.inline-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-actions .button {
  white-space: nowrap;
  font-size: 14px;
  padding: 10px 18px;
}

[dir="rtl"] .plan-panel-header {
  flex-direction: row-reverse;
}

[dir="rtl"] .plan-meta {
  flex-direction: row-reverse;
}

[dir="rtl"] .inline-actions {
  flex-direction: row-reverse;
}

@media (max-width: 768px) {
  .plan-panel-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  
  .inline-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .inline-actions .button {
    width: 100%;
    justify-content: center;
  }
  
  [dir="rtl"] .plan-panel-header {
    flex-direction: column;
  }
}

.plan-credits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.plan-credit-card {
  border-radius: 16px;
  background: rgba(147, 51, 234, 0.1);
  padding: 14px 12px;
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
}

.plan-limits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.plan-limit-card {
  background: rgba(147, 51, 234, 0.06);
  border: 1px solid rgba(147, 51, 234, 0.16);
  border-radius: 14px;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.plan-referral-row {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--brand-border);
  border-radius: 14px;
  background: var(--brand-card);
}

.upgrade-cta {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(124, 58, 237, 0.3);
  background: rgba(124, 58, 237, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.upgrade-cta.hidden {
  display: none;
}

.plan-limit-label {
  font-size: 12px;
  color: var(--brand-muted);
  font-weight: 600;
}

.plan-limit-value {
  font-size: 14px;
  font-weight: 800;
  color: var(--brand-ink);
}

.plan-credit-icon {
  width: 20px;
  height: 20px;
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.plan-credit-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.plan-credit-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--brand-ink);
}

.plan-credit-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-muted);
}

.plan-trial-note {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-muted);
}

.payment-welcome-card {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 24px 28px;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 2px solid #86efac;
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.08);
  animation: slideDown 0.4s ease-out;
}

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

.payment-welcome-icon {
  font-size: 40px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.payment-welcome-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.payment-welcome-title {
  font-size: 20px;
  line-height: 1.4;
  color: #065f46;
  font-weight: 700;
  margin: 0;
}

.payment-welcome-message {
  font-size: 14px;
  line-height: 1.6;
  color: #047857;
  font-weight: 400;
  margin: 0;
}

.payment-welcome-card .button {
  align-self: flex-start;
  padding: 10px 20px;
  font-size: 14px;
  background: #10b981;
  color: #ffffff;
  border: none;
  font-weight: 600;
  margin-top: 2px;
}

.payment-welcome-card .button:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

[dir="rtl"] .payment-welcome-card {
  text-align: right;
}

[dir="rtl"] .payment-welcome-card .button {
  align-self: flex-start;
}

@media (max-width: 640px) {
  .payment-welcome-card {
    flex-direction: column;
    gap: 14px;
    padding: 20px 18px;
    align-items: center;
    text-align: center;
  }
  
  .payment-welcome-icon {
    font-size: 36px;
    margin-top: 0;
  }
  
  .payment-welcome-title {
    font-size: 18px;
  }
  
  .payment-welcome-message {
    font-size: 13px;
  }
  
  .payment-welcome-card .button {
    width: 100%;
    align-self: stretch;
    margin-top: 4px;
  }
  
  [dir="rtl"] .payment-welcome-card {
    text-align: center;
  }
}


.plan-trial-info {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  margin-bottom: 24px;
}

.plan-trial-info-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}

.plan-trial-info-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.plan-trial-info-title {
  font-size: 14px;
  line-height: 1.55;
  color: #1e3a8a;
  font-weight: 500;
  margin: 0;
}

.plan-trial-info .button.small {
  align-self: flex-start;
  padding: 8px 16px;
  font-size: 13px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  font-weight: 600;
  white-space: nowrap;
}

.plan-trial-info .button.small:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

[dir="rtl"] .plan-trial-info {
  text-align: right;
}

[dir="rtl"] .plan-trial-info .button.small {
  align-self: flex-start;
}

@media (max-width: 640px) {
  .plan-trial-info {
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    align-items: center;
    text-align: center;
  }
  
  .plan-trial-info-icon {
    font-size: 20px;
    margin-top: 0;
  }
  
  .plan-trial-info-title {
    font-size: 13px;
  }
  
  .plan-trial-info .button.small {
    width: 100%;
    align-self: stretch;
    padding: 10px 16px;
    font-size: 13px;
  }
  
  [dir="rtl"] .plan-trial-info {
    text-align: center;
  }
}


.usage-card {
  margin-top: 16px;
}

.usage-chart {
  width: 100%;
  margin-top: 12px;
  min-height: 140px;
  position: relative;
}

.usage-chart svg {
  width: 100%;
  height: 180px;
  display: block;
}

.usage-dot {
  cursor: pointer;
}

.usage-tooltip {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -6px);
  padding: 6px 10px;
  background: #111827;
  color: #ffffff;
  font-size: 12px;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
  z-index: 2;
}

.usage-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.usage-control {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--brand-muted);
}

.usage-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.usage-sort {
  cursor: pointer;
  user-select: none;
}

.usage-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--brand-muted);
  font-weight: 600;
}

.usage-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.usage-legend-item.inactive {
  opacity: 0.4;
  text-decoration: line-through;
}

.usage-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.usage-table-wrap {
  margin-top: 16px;
  overflow-x: auto;
}

.usage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.usage-table th,
.usage-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--brand-border);
  text-align: left;
}

.usage-table th {
  color: var(--brand-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.brand-logo-warning {
  margin: 16px 24px 0;
  padding: 16px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.1));
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #92400e;
}

.brand-logo-warning .warning-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo-warning .warning-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  color: #d97706;
}

.brand-logo-warning .warning-text {
  flex: 1;
}

.brand-logo-warning .warning-text strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #78350f;
  margin-bottom: 4px;
}

.brand-logo-warning .warning-text p {
  margin: 0;
  font-size: 13px;
  color: #92400e;
  line-height: 1.4;
}

.brand-logo-warning .button {
  flex-shrink: 0;
  white-space: nowrap;
}

.no-logo-theme .sidebar-footer .select,
.no-logo-theme .sidebar-footer .button.link {
  color: var(--brand-ink);
}

.no-logo-theme .sidebar-footer .select {
  background: #ffffff;
  border: 1px solid var(--brand-border);
}

.default-theme .sidebar-footer .select,
.default-theme .sidebar-footer .button.link {
  color: var(--brand-ink);
}

.default-theme .sidebar-footer .select {
  background: #ffffff;
  border: 1px solid var(--brand-border);
}

@media (max-width: 720px) {
  .plan-panel-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.pricing-page {
  --brand-primary: #6d28d9;
  --brand-secondary: #ec4899;
  --brand-on-primary: #ffffff;
  --brand-ink: #1f2430;
  --brand-border: #e4e7f3;
  --brand-card: #ffffff;
}

.pricing-page #pay-method-paypal,
.pricing-page .button.secondary.selected {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--brand-on-primary);
  box-shadow: 0 12px 26px rgba(109, 40, 217, 0.22);
}

.pricing-page #pay-method-paypal:hover,
.pricing-page .button.secondary.selected:hover {
  background: #5b21b6;
  border-color: #5b21b6;
}

.pricing-page .pricing-card {
  border-color: #e6e9f4;
  background: linear-gradient(180deg, #ffffff 0%, #fbfaff 100%);
  box-shadow: 0 18px 40px rgba(22, 24, 35, 0.08);
  overflow: hidden;
}

.pricing-page .pricing-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--plan-accent, #7c3aed);
}

.pricing-page .pricing-card.highlight {
  border-color: rgba(124, 58, 237, 0.35);
  box-shadow: 0 22px 48px rgba(124, 58, 237, 0.18);
}

.pricing-page .pricing-card[data-tier="starter"] {
  --plan-accent: #7c3aed;
  --plan-accent-dark: #5b21b6;
}

.pricing-page .pricing-card[data-tier="growth"] {
  --plan-accent: #0ea5e9;
  --plan-accent-dark: #0284c7;
}

.pricing-page .pricing-card[data-tier="pro"] {
  --plan-accent: #f59e0b;
  --plan-accent-dark: #d97706;
}

.pricing-page .pricing-card[data-tier="agency"] {
  --plan-accent: #10b981;
  --plan-accent-dark: #059669;
}

.pricing-page .pricing-card .pricing-cta {
  background: var(--plan-accent);
  color: #ffffff;
  border: none;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
}

.pricing-page .pricing-card .pricing-cta:hover {
  background: var(--plan-accent-dark);
  color: #ffffff;
}

.pricing-page .pricing-card .section-title {
  font-size: 22px;
}

.pricing-page .pricing-card .muted {
  font-size: 14px;
}

.pricing-page .pricing-card:hover {
  border-color: rgba(124, 58, 237, 0.25);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.12);
}

.pricing-card {
  border: 1px solid var(--brand-border);
  border-radius: 22px;
  padding: 20px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 460px;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: var(--shadow-card);
}

.plan-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--plan-accent, var(--brand-primary));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.2px;
}

.pricing-card:hover {
  transform: translateY(-4px);
  border-color: rgba(147, 51, 234, 0.5);
  box-shadow: 0 18px 40px rgba(147, 51, 234, 0.18);
}

.pricing-card.highlight {
  border-color: var(--brand-primary);
  box-shadow: 0 12px 28px rgba(147, 51, 234, 0.15);
}

.pricing-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 20px;
  font-weight: 800;
  color: var(--brand-ink);
}

.price-value {
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -1px;
}

.price-cycle {
  font-size: 18px;
  color: var(--brand-muted);
  font-weight: 600;
}

.pricing-list {
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--brand-muted);
  font-size: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pricing-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: normal;
}

.pricing-list li::before {
  content: '✓';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--plan-accent, #7c3aed);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.pricing-note {
  font-size: 13px;
  color: var(--brand-muted);
}

.pricing-cta {
  margin-top: auto;
}

.pricing-custom {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(124, 58, 237, 0.2);
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.08) 0%, rgba(124, 58, 237, 0.02) 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.pricing-custom .section-title {
  font-size: 18px;
}

.pricing-custom .muted {
  font-size: 13px;
  max-width: 520px;
}

.pricing-custom-cta {
  white-space: nowrap;
}

@media (max-width: 900px) {
  .pricing-custom {
    flex-direction: column;
    align-items: flex-start;
  }
}

.pricing-trust .trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.trust-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid var(--brand-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
}

.pricing-trust-simple .trust-grid {
  padding: 0;
}

.pricing-trust-simple .trust-item {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.trust-icon {
  width: 28px;
  height: 28px;
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.trust-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trust-title {
  font-weight: 700;
  font-size: 16px;
}

.pricing-trust-top {
  margin-bottom: 20px;
}

.pricing-trust-icons .trust-icons-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 12px 0;
}

.pricing-trust-icons .trust-icon-pill {
  min-width: 120px;
  padding: 6px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  border: none;
  box-shadow: none;
}

.pricing-trust-icons .trust-icon {
  font-size: 20px;
}

.pricing-trust-icons .trust-icon-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-ink);
  text-align: left;
}

.pricing-credits .credits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.credits-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(147, 51, 234, 0.08);
  font-size: 13px;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  overflow: auto;
  padding: 20px;
}

body.modal-open {
  overflow: hidden;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.modal-card {
  position: relative;
  width: min(720px, 92vw);
  background: var(--brand-card);
  border-radius: 24px;
  padding: 24px;
  z-index: 1;
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.25);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.job-details-modal .modal-card {
  width: min(96vw, 720px);
  max-height: 92vh;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--brand-border);
  border-radius: 20px;
  background: var(--brand-card);
}

.job-details-modal {
  z-index: 60;
}

#image-modal {
  z-index: 70;
}

#image-modal .modal-card {
  max-width: min(92vw, 960px);
  max-height: 92vh;
  overflow: auto;
  padding-top: 44px;
  position: relative;
}

#image-modal .modal-close,
#card-lightbox-preview .modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

.rtl #image-modal .modal-close,
.rtl #card-lightbox-preview .modal-close {
  left: 12px;
  right: auto;
}

#card-lightbox-preview .card-lightbox-modal-card {
  position: relative;
  max-width: min(92vw, 960px);
  max-height: 92vh;
  overflow: auto;
  padding-top: 44px;
}

#card-lightbox-preview .lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, 0.8);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 32px;
  color: #ffffff;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

#card-lightbox-preview .lightbox-nav:hover:not(:disabled) {
  background: rgba(15, 23, 42, 0.95);
}

#card-lightbox-preview .lightbox-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

#card-lightbox-preview .lightbox-nav.prev {
  left: 16px;
}

#card-lightbox-preview .lightbox-nav.next {
  right: 16px;
}

.rtl #card-lightbox-preview .lightbox-nav.prev {
  left: auto;
  right: 16px;
}

.rtl #card-lightbox-preview .lightbox-nav.next {
  right: auto;
  left: 16px;
}

.job-details-modal .job-details-modal-body {
  max-height: 92vh;
  overflow-y: auto;
}

.job-details-modal .job-details-card {
  border: none;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  position: static;
  width: 100%;
}

.job-details-modal .job-header {
  padding-right: 44px;
}

.rtl .job-details-modal .job-header {
  padding-right: 0;
  padding-left: 44px;
}

.job-details-modal .modal-close {
  top: 8px;
  right: 8px;
  z-index: 2;
  background: #ffffff;
  border: 1px solid var(--brand-border);
}

.rtl .job-details-modal .modal-close {
  left: 8px;
  right: auto;
}

/* Pricing: trial/payment modal close button should be on the left in RTL */
html[dir="rtl"] #plan-modal .modal-close,
[dir="rtl"] #plan-modal .modal-close,
.rtl #plan-modal .modal-close {
  left: 16px;
  right: auto;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: none;
  background: rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  font-size: 14px;
  cursor: pointer;
}

.modal-title {
  font-size: 22px;
  font-weight: 800;
}

.credits-modal-body {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  overflow-x: hidden;
}

.credits-modal-actions {
  margin-top: 16px;
  display: flex;
  gap: 8px;
}

#credits-modal .modal-card {
  /* Allow credit-pill tooltips to render outside the card (bottom rows were clipped) */
  overflow: visible;
}

/* Credits modal: make credit pills compact (avoid tall "tiles") */
#credits-modal .credits-modal-body {
  justify-content: flex-start;
}

/* RTL: keep items aligned to the visual "start" (right) */
html[dir="rtl"] #credits-modal .credits-modal-body,
[dir="rtl"] #credits-modal .credits-modal-body,
.rtl #credits-modal .credits-modal-body {
  direction: rtl;
  justify-content: flex-start;
}

#credits-modal .credit-pill {
  height: 72px;
  padding: 10px 12px;
  border-radius: 18px;
  justify-content: center;
}

/* Credits modal: use inline info (no floating tooltips inside the modal) */
#credits-modal .credit-pill::before,
#credits-modal .credit-pill::after {
  display: none;
}

.credits-modal-info {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px dashed rgba(147, 51, 234, 0.35);
  background: rgba(147, 51, 234, 0.06);
  color: var(--brand-ink);
  font-size: 13px;
  min-height: 0;
  display: none;
}

.credits-modal-info.visible {
  display: block;
}

/* Credits modal: in RTL move close button to the left so it doesn't overlap title */
html[dir="rtl"] #credits-modal .modal-close,
[dir="rtl"] #credits-modal .modal-close {
  left: 16px;
  right: auto;
}

.modal-subtitle {
  color: var(--brand-muted);
  margin-top: 4px;
}

.modal-plan {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--brand-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(147, 51, 234, 0.06);
}

.trial-badge {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.15);
  color: var(--brand-success);
  font-weight: 700;
  font-size: 12px;
}

.modal-actions {
  margin-top: 16px;
}

.modal-payment {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px dashed var(--brand-border);
}

.modal-note {
  font-size: 13px;
  color: var(--brand-muted);
  margin: 10px 0 16px;
}

.modal-checkout {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--brand-border);
  background: rgba(255, 255, 255, 0.6);
}

.card-tight {
  align-self: stretch;
}

.section-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-header-left {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.section-header-left .section-title {
  margin-bottom: 0;
}

.admin-details {
  margin-top: 10px;
}

.admin-table {
  display: grid;
  gap: 8px;
}

.admin-table-header,
.admin-table-row {
  display: grid;
  grid-template-columns: 2.2fr 0.6fr 0.8fr 0.8fr 0.7fr 1.2fr 0.8fr;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
}

.admin-table-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--brand-muted);
  background: #f8fafc;
  border: 1px solid var(--brand-border);
}

.admin-table-row {
  background: #fff;
  border: 1px solid var(--brand-border);
}

.admin-cell.main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

@media (max-width: 980px) {
  .jobs-split {
    grid-template-columns: 1fr;
  }
  .jobs-split {
    grid-template-columns: 1fr;
  }
  .jobs-split,
  .jobs-list-col,
  .job-details-col {
    max-width: 100%;
    overflow-x: hidden;
  }
  .job-details-card {
    width: 100%;
  }
  .job-details-modal .job-details-modal-body {
    overflow-y: auto;
    overflow-x: hidden;
  }
  .job-details-modal .job-details-card {
    max-height: 92vh;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .job-details-modal .image-preview.compact {
    max-height: 50vh;
    width: auto;
    max-width: 100%;
    object-fit: contain;
  }
  .admin-table-header {
    display: none;
  }
  .admin-table-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

.admin-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-user-row > button {
  margin-left: auto;
}

.library-items.collapsed {
  display: none !important;
}

/* Publish Section */
.publish-section {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.05) 0%, rgba(236, 72, 153, 0.05) 100%);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
}

.publish-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.publish-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.publish-row .button.publish {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.schedule-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.schedule-group input[type="datetime-local"] {
  padding: 10px 14px;
  border: 1px solid var(--brand-border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: var(--brand-surface);
  color: var(--brand-text);
  min-width: 200px;
  height: 42px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.schedule-group input[type="datetime-local"]:hover {
  border-color: rgba(124, 58, 237, 0.3);
}

.schedule-group input[type="datetime-local"]:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

/* Style the calendar icon */
.schedule-group input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  opacity: 0.6;
  transition: opacity 0.2s ease;
  filter: invert(40%) sepia(90%) saturate(2000%) hue-rotate(240deg) brightness(90%) contrast(100%);
}

.schedule-group input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  background: rgba(124, 58, 237, 0.1);
}

.schedule-group .button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 42px;
}

.publish-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(124, 58, 237, 0.1);
}

.publish-actions .action-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.publish-actions .action-pill:hover {
  background: rgba(124, 58, 237, 0.1);
  border-color: rgba(124, 58, 237, 0.3);
}


.publish-actions .loading-pill {
  margin: 0;
}

/* Ensure icons show in publish section */
.publish-section .icon,
.publish-section .action-icon svg,
.publish-row .icon,
.publish-actions .icon {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.publish-row .button.publish .icon {
  width: 16px;
  height: 16px;
}

.publish-row .field {
  margin: 0;
}

/* Responsive publish section */
@media (max-width: 600px) {
  .publish-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .schedule-group {
    flex-direction: column;
    align-items: stretch;
  }
  
  .schedule-group input[type="datetime-local"] {
    width: 100%;
  }
  
  .publish-actions {
    flex-direction: column;
  }
  
  .publish-actions .action-pill {
    justify-content: center;
  }
}


.hidden {
  display: none;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(147, 51, 234, 0.1);
  color: var(--brand-primary);
}

.new-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(34, 197, 94, 0.18);
  color: #15803d;
  text-transform: uppercase;
}

.style-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(139, 92, 246, 0.15);
  color: #7c3aed;
  text-transform: capitalize;
  letter-spacing: 0.04em;
}

.lang-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(100, 116, 139, 0.12);
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lang-badge .lang-icon {
  width: 10px !important;
  height: 10px !important;
  min-width: 10px;
  max-width: 10px;
  opacity: 0.7;
  flex-shrink: 0;
}

.status-pill.published {
  background: rgba(34, 197, 94, 0.16);
  color: #15803d;
}

.job-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 112%;
}

.jobs-toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.jobs-toolbar .input {
  flex: 1 1 220px;
  padding: 10px 12px;
  border: 1px solid var(--brand-border);
  border-radius: 12px;
  font-family: inherit;
}

.jobs-toolbar .select {
  background: var(--brand-card);
  color: var(--brand-ink);
  border: 1px solid var(--brand-border);
  border-radius: 12px;
  padding: 10px 12px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
}

[dir="rtl"] .pagination {
  flex-direction: row-reverse;
}

.job-item {
  border: 1px solid var(--brand-border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.2s ease, border 0.2s ease;
}

.job-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.job-item-header .muted {
  font-size: 13.1px;
}

.job-item-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.job-item-title strong {
  font-size: 0.636em;
}

.size-indicator {
  display: inline-block;
  border: 2px solid rgba(147, 51, 234, 0.5);
  border-radius: 4px;
  background: rgba(147, 51, 234, 0.08);
  box-sizing: border-box;
  vertical-align: middle;
  margin-left: 6px;
}

.size-indicator.square {
  width: 14px;
  height: 14px;
}

.size-indicator.rect {
  width: 11px;
  height: 18px;
}

.size-indicator.multi {
  width: 11px;
  height: 11px;
  border-radius: 2.5px;
  position: relative;
}

.size-indicator.multi::before,
.size-indicator.multi::after {
  content: '';
  position: absolute;
  width: 11px;
  height: 11px;
  border: 2px solid rgba(147, 51, 234, 0.45);
  border-radius: 2.5px;
  background: rgba(147, 51, 234, 0.08);
  box-sizing: border-box;
}

.size-indicator.multi::before {
  left: 5px;
  top: -5px;
}

.size-indicator.multi::after {
  left: -5px;
  top: 5px;
}

.job-item.selected {
  border-color: var(--brand-primary);
  box-shadow: 0 12px 24px rgba(147, 51, 234, 0.2);
  background: rgba(147, 51, 234, 0.06);
}

.job-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.job-thumbs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.job-thumb {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--brand-border);
  background: #ffffff;
}

.job-thumb.text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-primary);
  background: rgba(147, 51, 234, 0.12);
}

.job-thumb.video-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
  color: #fff;
}

.image-preview {
  width: 100%;
  max-height: 70vh;
  border-radius: 16px;
  border: 1px solid var(--brand-border);
  cursor: pointer;
  box-shadow: var(--shadow-card);
  object-fit: contain;
}

.image-preview.compact {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 60vh;
  object-fit: contain;
  display: block;
}

.design-preview-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.design-preview-box {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}

.image-download-box {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(17, 24, 39, 0.78);
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.2);
  transition: transform 0.15s ease, background 0.15s ease;
}

.image-download-box:hover {
  transform: translateY(-1px);
  background: rgba(17, 24, 39, 0.92);
}

.design-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.design-thumb {
  border: 1px solid var(--brand-border);
  background: #ffffff;
  border-radius: 10px;
  padding: 3px;
  width: 64px;
  height: 64px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.design-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 7px;
  display: block;
}

.design-thumb.active {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px rgba(147, 51, 234, 0.2);
}

.view-full-image {
  align-self: flex-start;
}

.design-preview-animate {
  animation: copyPulse 0.6s ease-out;
}

.edit-pending-note {
  margin-top: 8px;
  text-align: end;
}

/* Publish Type Modal */
.publish-type-card {
  max-width: 460px;
  /* Ensure the modal uses the same per-language font as the rest of the app */
  font-family: inherit;
}

/* Buttons don't reliably inherit font-family across browsers; force it here */
.publish-type-card button,
.publish-type-card .publish-type-option {
  font-family: inherit;
}

.publish-type-card .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--brand-border);
  margin-bottom: 16px;
}

.publish-type-card .modal-header h3 {
  margin: 0;
  font-size: 18px;
}

.publish-type-subtitle {
  color: var(--color-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.publish-type-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.publish-platform-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.publish-platform-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid var(--brand-border);
  background: #fff;
  font-weight: 600;
  color: var(--brand-ink);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.publish-platform-option .action-icon {
  width: 16px;
  height: 16px;
  opacity: 0;
}

.publish-platform-option.selected {
  border-color: var(--brand-primary);
  background: var(--brand-light);
  color: var(--brand-ink);
}

.publish-platform-option.selected .action-icon {
  opacity: 1;
}

.publish-type-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  border: 2px solid var(--brand-border);
  border-radius: 14px;
  background: var(--brand-light);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.publish-type-option:hover:not(.disabled) {
  border-color: var(--brand-primary);
  background: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(147, 51, 234, 0.15);
}

.publish-type-option.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.publish-type-option.confirmed {
  border-color: #f59e0b;
  background: #fefce8;
}

.publish-type-icon {
  margin-bottom: 12px;
}

.publish-type-icon.size-indicator {
  margin-left: 0;
  border-width: 3px;
  border-radius: 12px;
  border-color: color-mix(in srgb, var(--brand-primary) 55%, transparent);
  background: color-mix(in srgb, var(--brand-primary) 10%, transparent);
}

.publish-type-icon.size-indicator.square {
  width: 44px;
  height: 44px;
}

.publish-type-icon.size-indicator.rect {
  width: 32px;
  height: 52px;
}

.publish-type-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}

.publish-type-desc {
  font-size: 13px;
  color: var(--color-muted);
}

.publish-type-disabled-note {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  color: #ef4444;
  font-weight: 600;
}

.publish-type-warning-box {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  background: #fefce8;
  border: 2px solid #f59e0b;
  border-radius: 12px;
  animation: warningPulse 0.3s ease-out;
}

@keyframes warningPulse {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.publish-type-warning-box .warning-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.publish-type-warning-box .warning-content {
  flex: 1;
}

.publish-type-warning-box .warning-title {
  font-weight: 700;
  color: #92400e;
  font-size: 14px;
  margin-bottom: 4px;
}

.publish-type-warning-box .warning-text {
  color: #a16207;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.publish-type-warning-box .warning-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #92400e;
  margin-bottom: 12px;
}

.publish-type-warning-box .warning-checkbox input {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #f59e0b;
}

.publish-type-confirm-btn {
  width: 100%;
  background: #f59e0b !important;
  color: white !important;
  border: none !important;
}

.publish-type-confirm-btn:disabled {
  background: #d1d5db !important;
  cursor: not-allowed;
}

.publish-type-confirm-btn:not(:disabled):hover {
  background: #d97706 !important;
}

.publish-type-option.selected {
  border-color: var(--brand-primary);
  background: white;
}

.publish-type-option.dimmed {
  opacity: 0.4;
  pointer-events: none;
}

@media (min-width: 480px) {
  .publish-type-options {
    flex-direction: row;
  }
  
  .publish-type-option {
    flex: 1;
  }
}

/* Edit History for users */
.edit-history-section {
  margin-top: 16px;
  border-top: 1px solid var(--brand-border);
  padding-top: 12px;
}

.edit-history-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--brand-light);
  border: 1px solid var(--brand-border);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  transition: background 0.2s;
}

.edit-history-toggle:hover {
  background: var(--brand-border);
}

.toggle-icon {
  font-size: 12px;
  transition: transform 0.2s;
}

.edit-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  max-height: 400px;
  overflow-y: auto;
}

.edit-history-list.collapsed {
  display: none;
}

.edit-history-item {
  background: var(--brand-light);
  border-radius: 10px;
  padding: 12px;
  border-left: 3px solid var(--brand-primary);
}

.edit-history-item.completed {
  border-left-color: #22c55e;
}

.edit-history-item.failed {
  border-left-color: #ef4444;
  background: #fef2f2;
}

.edit-history-item.pending {
  border-left-color: #f59e0b;
  background: #fefce8;
}

.edit-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
}

.edit-number {
  font-weight: 700;
  color: var(--color-text);
}

.edit-time {
  color: var(--color-muted);
  font-size: 11px;
}

.edit-request-text {
  font-size: 13px;
  color: var(--color-text);
  font-style: italic;
  margin-bottom: 8px;
  line-height: 1.5;
}

.edit-error {
  font-size: 12px;
  color: #dc2626;
  background: white;
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.edit-result-thumb {
  width: 100%;
  max-width: 180px;
  border-radius: 8px;
  margin-top: 4px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.edit-result-thumb:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.edit-result-thumb.clickable-thumb {
  cursor: zoom-in;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}

.modal.open {
  display: flex;
}

.modal-card {
  background: var(--brand-card);
  border-radius: 20px;
  max-width: 900px;
  width: 100%;
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.admin-user-modal {
  max-width: 960px;
}

.crm-table-wrap {
  width: 100%;
  overflow: auto;
}

.crm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.crm-table th,
.crm-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--brand-border);
  text-align: left;
  white-space: nowrap;
}

.crm-table th {
  position: sticky;
  top: 0;
  background: var(--brand-card);
  z-index: 1;
}

.crm-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.crm-metric {
  border: 1px solid var(--brand-border);
  border-radius: 12px;
  padding: 8px 10px;
  background: var(--brand-surface);
}

.cancel-modal {
  max-width: 760px;
}

.cancel-step.hidden {
  display: none;
}

.cancel-impact {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}

.cancel-impact-row {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
}

.cancel-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.cancel-preview-grid img,
.cancel-preview-grid video {
  width: 100%;
  height: 92px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--brand-border);
  background: var(--brand-surface);
}

.cancel-impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.cancel-impact-card {
  border: 1px solid var(--brand-border);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--brand-surface);
}

.cancel-impact-card .value {
  font-size: 18px;
  font-weight: 700;
}

.cancel-warning-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.button.danger {
  background: #ef4444;
  color: #fff;
  border: none;
}

.modal-card img {
  width: 100%;
  border-radius: 16px;
}

.social-preview {
  border: 1px solid var(--brand-border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  background: #ffffff;
}

.social-preview.facebook {
  border-radius: 16px;
}

.social-header.facebook {
  background: #f8fafc;
}

.social-actions.facebook {
  justify-content: space-between;
  font-size: 14px;
  color: var(--brand-muted);
}

.social-actions.facebook span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 12px 0;
  flex-wrap: nowrap;
  align-items: center;
  overflow-x: auto;
}

.tab-button {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--brand-border);
  background: #ffffff;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Cairo', 'Tajawal', system-ui, -apple-system, Segoe UI, sans-serif;
}

.tab-button .social-logo {
  width: 18px;
  height: 18px;
  margin: 0;
}

.tab-button.published-tab {
  cursor: default;
}

.tab-button.published-tab .action-icon,
.tab-button.published-tab .action-icon svg {
  width: 12px;
  height: 12px;
}

.tab-link .social-logo {
  width: 28px;
  height: 28px;
}

.tab-links {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.tab-links-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.tab-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.publish-links-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.publish-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand-primary);
  font-weight: 600;
  text-decoration: none;
}

.publish-link:hover {
  text-decoration: underline;
}

.tab-step.published-links {
  gap: 10px;
}

.tab-step {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.tab-connector {
  width: 16px;
  height: 2px;
  background: var(--brand-border);
  border-radius: 999px;
}

.tab-connector.published-connector {
  background: rgba(34, 197, 94, 0.5);
}

.tab-step.completed .tab-button:not(.active) {
  border-color: var(--brand-success);
  background: rgba(34, 197, 94, 0.14);
  color: var(--brand-success);
}

.tab-step.completed .tab-button.active {
  border-color: var(--brand-success);
  background: rgba(34, 197, 94, 0.18);
  color: var(--brand-success);
}

.tab-step.completed .tab-connector {
  background: linear-gradient(90deg, var(--brand-success), #4ade80);
}
.tab-button.active {
  border-color: var(--brand-primary);
  background: rgba(147, 51, 234, 0.1);
  color: var(--brand-primary);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.job-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.job-stage-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.job-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--brand-muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.job-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.job-meta-label {
  font-weight: 600;
}

.job-meta-value {
  font-weight: 700;
  color: var(--brand-ink);
}

.job-number {
  font-weight: 700;
  opacity: 0.5;
}

.job-stage {
  font-weight: 700;
}

.brand-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  direction: ltr;
  text-align: left;
}

.brand-summary {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-summary-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(147, 51, 234, 0.12);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-weight: 800;
  color: var(--brand-primary);
}

.brand-summary-logo.large {
  width: 72px;
  height: 72px;
  border-radius: 18px;
}

.brand-summary-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-summary-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brand-summary-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--brand-ink);
  padding-left: 56px;
  padding-right: 56px;
  text-align: left;
}

.brand-summary-name + .brand-summary-row {
  margin-top: 4px;
}

.brand-summary-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-direction: row;
  justify-content: flex-start;
}

.brand-summary-row.rtl-row {
  flex-direction: row-reverse;
  justify-content: flex-start;
  text-align: right;
}

.brand-summary-meta {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-muted);
}

.brand-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-card-header.rtl-row {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

.brand-summary-details.rtl-row {
  text-align: right;
}

.brand-card.rtl-card {
  direction: rtl;
  text-align: right;
}

.brand-card.rtl-card .brand-summary-row {
  flex-direction: row-reverse;
  justify-content: flex-end;
}

.brand-card.rtl-card .brand-summary-name {
  padding-left: 56px;
  padding-right: 0;
  text-align: right;
}

.brand-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.brand-card-body {
  position: relative;
}

.brand-summary-card {
  position: relative;
}

.brand-summary-compact {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding-right: 56px;
  padding-left: 56px;
}

.brand-summary-card.brand-summary-rtl .brand-summary-compact {
  justify-content: flex-end;
  text-align: right;
}

.brand-summary-compact-logo {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(147, 51, 234, 0.12);
  color: var(--brand-primary);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-summary-compact-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-summary-compact-name {
  font-weight: 700;
  color: var(--brand-ink);
}

.brand-edit-floating {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
}

.brand-summary-card.brand-summary-rtl .brand-edit-floating {
  right: auto;
  left: 56px;
}

.brand-summary-card.brand-summary-rtl .brand-collapse-toggle {
  left: 16px;
  right: auto;
}

.brand-collapse-toggle {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
}

.brand-summary-card.brand-collapsed #brand-summary {
  display: none;
}

.brand-summary-card.brand-collapsed {
  padding-bottom: 16px;
  min-height: 64px;
  background: rgba(147, 51, 234, 0.06);
}


.brand-desc-wrap {
  position: relative;
  padding-bottom: 24px;
  margin-top: 4px;
  min-height: 56px;
}

.brand-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.6;
  color: var(--brand-muted);
}

.brand-card-body.collapsed .brand-desc {
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.brand-card-body.collapsed .brand-actions,
.brand-card-body.collapsed .status-pill {
  display: none;
}

.brand-card-body.collapsed .brand-desc-wrap::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 32px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), var(--brand-card));
}

.brand-expand-arrow {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--brand-border);
  display: grid;
  place-items: center;
  font-size: 16px;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.brand-summary-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 14px;
  text-align: left;
}

.brand-summary-header .section-title {
  margin: 0;
  text-align: left;
}

.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.brand-action-card {
  border: 1px solid rgba(147, 51, 234, 0.25);
  background: rgba(147, 51, 234, 0.08);
  color: var(--brand-ink);
  padding: 10px 12px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border 0.2s ease;
  width: 100%;
  max-width: 100%;
  justify-content: center;
}

.brand-action-card:hover {
  transform: translateY(-1px);
  border-color: var(--brand-primary);
  box-shadow: 0 10px 20px rgba(147, 51, 234, 0.15);
}

.brand-action-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(147, 51, 234, 0.15);
  display: grid;
  place-items: center;
  font-size: 14px;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 16px;
  max-width: 100%;
}

@media (min-width: 1200px) {
  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .posts-grid {
    grid-template-columns: 1fr;
  }
}

.post-card {
  border: 1px solid var(--brand-border);
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.post-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.post-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}

.post-status {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
  background: rgba(148, 163, 184, 0.2);
  color: #475569;
  height: fit-content;
}

.post-status.published {
  background: rgba(34, 197, 94, 0.16);
  color: #15803d;
}

.post-status.pending {
  background: rgba(249, 115, 22, 0.16);
  color: #c2410c;
}

.post-status.cancelled {
  background: rgba(239, 68, 68, 0.16);
  color: #b91c1c;
}

.post-details {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--brand-ink);
}

.post-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.post-details-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--brand-ink-muted);
  text-align: right;
}

html[dir="ltr"] .post-details-compact {
  text-align: right;
}

html[dir="rtl"] .post-details-compact {
  text-align: left;
}

.post-date-item {
  white-space: nowrap;
}

.post-preview {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
  align-items: start;
}

.post-preview-image,
.post-preview-video {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--brand-border);
  background: #f7f7fb;
  flex-shrink: 0;
}

.post-preview-video {
  cursor: pointer;
}

.post-preview-video::-webkit-media-controls-panel {
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.4));
}

.post-preview-image.video-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  background: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
  border: none;
  color: white;
}

.post-preview-copy {
  font-size: 13px;
  line-height: 1.5;
  color: var(--brand-ink);
  white-space: pre-wrap;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

@media (max-width: 720px) {
  .post-preview {
    grid-template-columns: 1fr;
  }
  .post-preview-image {
    width: 100%;
    height: auto;
  }
}

.post-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.button.small {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 10px;
}

.library-grid {
  display: grid;
  gap: 18px;
}

.library-items {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  align-items: start;
}

#generated-copies.library-items,
#generated-copies {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

#generated-copies .library-item.copy-item {
  width: 100%;
  max-width: none;
  padding: 10px;
}

.library-item {
  border: 1px solid var(--brand-border);
  border-radius: 14px;
  padding: 12px;
  background: rgba(147, 51, 234, 0.04);
  width: 100%;
  max-width: 220px;
}

.library-image {
  width: 100%;
  border-radius: 12px;
  display: block;
  cursor: pointer;
}

.library-video {
  width: 100%;
  border-radius: 12px;
}

.library-copy {
  white-space: pre-wrap;
  font-size: 14px;
  color: var(--brand-ink);
}

.leads-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.copy-icon.small {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--brand-border);
  background: #fff;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lead-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.link-icon {
  font-size: 12px;
  color: var(--brand-muted);
}

.button-icon-primary {
  background: var(--brand-primary);
  color: white;
  border: none;
  border-radius: 10px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(147, 51, 234, 0.2);
}

.button-icon-primary:hover {
  background: var(--brand-primary-dark);
  box-shadow: 0 4px 8px rgba(147, 51, 234, 0.3);
  transform: translateY(-1px);
}

.button-icon-primary svg {
  display: block;
}

.multi-products-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.multi-product-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--brand-ink);
  margin-bottom: 8px;
}

.multi-product-price {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.price-current {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand-primary);
}

.price-old {
  font-size: 15px;
  color: var(--brand-muted);
  text-decoration: line-through;
}

.multi-product-notes {
  font-size: 14px;
  color: var(--brand-muted);
  margin-bottom: 8px;
  line-height: 1.4;
}

.status-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(147, 51, 234, 0.1);
  color: var(--brand-primary);
  text-transform: capitalize;
  margin-top: 8px;
}

.status-complete {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.social-image-container {
  position: relative;
  width: 100%;
}

.carousel-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--brand-primary);
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  opacity: 0.7;
}

.carousel-nav-btn:hover {
  background: var(--brand-primary-dark);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: translateY(-50%) scale(1.08);
  opacity: 1;
}

.carousel-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.carousel-nav-btn svg {
  display: block;
}

.carousel-prev {
  left: 12px;
}

.carousel-next {
  right: 12px;
}

[dir="rtl"] .carousel-prev {
  left: auto;
  right: 12px;
}

[dir="rtl"] .carousel-next {
  right: auto;
  left: 12px;
}

[dir="rtl"] .carousel-nav-btn svg {
  transform: scaleX(-1);
}

.carousel-counter {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  z-index: 10;
}

[dir="rtl"] .carousel-counter {
  right: auto;
  left: 12px;
}

.multi-preview-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--brand-background);
  border-radius: 8px;
}

.multi-prev-btn,
.multi-next-btn {
  background: var(--brand-primary);
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.multi-prev-btn:hover,
.multi-next-btn:hover {
  opacity: 0.8;
}

.multi-prev-btn:disabled,
.multi-next-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.multi-preview-counter {
  font-weight: 600;
  color: var(--brand-ink);
  min-width: 50px;
  text-align: center;
}

.preview-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.preview-item {
  display: none;
}

.preview-item.active {
  display: block;
}

.multi-product-row {
  display: flex;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--brand-border);
  border-radius: 12px;
  background: #fff;
  align-items: flex-start;
}

.multi-image-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.multi-image-preview {
  width: 100px;
  height: 100px;
  border-radius: 12px;
  border: 2px dashed var(--brand-border);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8f9fc 0%, #e8eaf0 100%);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.multi-image-preview:hover {
  border-color: var(--brand-primary);
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.multi-image-preview.has-image {
  border-style: solid;
  border-color: var(--brand-primary);
  background: #fff;
}

.multi-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.multi-image-placeholder {
  color: var(--brand-muted);
  opacity: 0.7;
  display: flex;
  align-items: center;
  justify-content: center;
}

.multi-image-placeholder svg {
  width: 36px;
  height: 36px;
}

.multi-image-upload {
  cursor: pointer;
}

.multi-image-upload .button {
  font-size: 13px;
  padding: 8px 16px;
  white-space: nowrap;
}

.multi-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  flex: 1;
}

.multi-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--brand-muted);
}

.multi-field input,
.multi-field textarea {
  border-radius: 10px;
  border: 1px solid var(--brand-border);
  padding: 8px 10px;
  font-family: inherit;
}

.multi-field.full {
  grid-column: 1 / -1;
}

.multi-remove {
  align-self: flex-start;
  margin-top: 24px;
}

@media (max-width: 768px) {
  .multi-product-row {
    flex-direction: column;
  }
  .multi-image-section {
    flex-direction: row;
    width: 100%;
    justify-content: flex-start;
  }
  .multi-fields {
    grid-template-columns: 1fr 1fr;
  }
  .multi-remove {
    align-self: flex-end;
    margin-top: 0;
  }
}

.multi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.multi-card {
  border: 1px solid var(--brand-border);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.multi-card-image {
  aspect-ratio: 1 / 1;
  background: #f3f4f6;
  display: grid;
  place-items: center;
  overflow: hidden;
}

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

.multi-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.multi-card-actions{
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.multi-edit-box{
  margin-top: 8px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.18);
}

.multi-edit-text{
  width: 100%;
  min-height: 84px;
  resize: vertical;
}

.multi-edit-actions{
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.tips-carousel-note{
  margin-top: 8px;
  font-size: 13px;
}

.strike {
  text-decoration: line-through;
  color: var(--brand-muted);
}

.social-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
}

.social-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f1f5;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.social-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.social-handle {
  font-weight: 700;
}

.social-meta {
  font-size: 12px;
  color: var(--brand-muted);
}

.social-image {
  width: 100%;
  display: block;
  object-fit: contain;
  background: #f3f4f6;
  max-height: 60vh;
}

.social-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

.social-actions span {
  cursor: default;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.social-actions svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.social-caption {
  padding: 0 16px 16px;
  font-size: 14px;
  white-space: pre-wrap;
}

.rtl {
  direction: rtl;
  text-align: right;
  font-family: 'Tajawal', 'Cairo', system-ui, -apple-system, Segoe UI, sans-serif;
}

.ad-copy-card {
  animation: copyPulse 0.6s ease-out;
}

@keyframes copyPulse {
  0% {
    transform: translateY(6px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.social-likes {
  padding: 0 16px;
  font-weight: 700;
  font-size: 13px;
}

.job-item:hover {
  transform: translateY(-2px);
  border-color: var(--brand-primary);
}

.muted {
  color: var(--brand-muted);
  font-size: 13px;
}

.job-item > .muted {
  font-size: 13.9px;
}

.job-message {
  margin-bottom: -16px;
}

.copy-prompt-btn {
  background: none;
  border: none;
  padding: 2px 4px;
  cursor: pointer;
  color: var(--brand-muted);
  opacity: 0.6;
  transition: opacity 0.2s, color 0.2s;
  display: inline;
  vertical-align: middle;
  margin-inline-start: 4px;
}

.copy-prompt-btn:hover {
  opacity: 1;
  color: var(--brand-primary);
}

.copy-prompt-btn.copied {
  color: #22c55e;
  opacity: 1;
}

.copy-prompt-btn .copy-icon {
  width: 14px;
  height: 14px;
}

.action-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.action-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.action-pill.undo-button {
  color: var(--brand-muted);
  border-color: var(--brand-border);
}

.action-pill.undo-button:hover {
  color: var(--brand-text);
  border-color: var(--brand-primary);
}

/* Create video button disabled state */
#create-video-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

/* Video Size Modal */
.video-size-modal {
  max-width: 420px;
  padding: 24px;
  font-family: 'Cairo', 'Tajawal', system-ui, -apple-system, sans-serif;
}
.video-size-modal .modal-title {
  margin: 0 0 20px;
  font-size: 1.25rem;
  text-align: center;
  font-weight: 800;
}
.video-style-section {
  margin: 16px 0 18px;
}
.video-style-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 10px;
}
.video-style-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.video-style-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--brand-border);
  border-radius: 10px;
  background: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
  position: relative;
}
.video-style-option:hover {
  border-color: var(--brand-primary);
  background: rgba(147, 51, 234, 0.04);
}
.video-style-option.selected {
  border-color: var(--brand-primary);
  background: rgba(147, 51, 234, 0.08);
  box-shadow: 0 0 0 1px rgba(147, 51, 234, 0.2);
}
.video-style-hint {
  font-size: 12px;
  color: var(--brand-muted);
  cursor: help;
}
.video-duration-section {
  margin: 16px 0 12px;
}
.video-duration-options {
  display: flex;
  gap: 10px;
}
.video-duration-option {
  padding: 8px 12px;
  border: 1px solid var(--brand-border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 0.9rem;
}
.video-duration-option.selected {
  border-color: var(--brand-primary);
  background: rgba(147, 51, 234, 0.08);
  box-shadow: 0 0 0 1px rgba(147, 51, 234, 0.2);
}
@media (max-width: 520px) {
  .video-style-grid {
    grid-template-columns: 1fr;
  }
}
.video-size-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.video-size-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 2px solid var(--brand-border);
  border-radius: 12px;
  background: var(--brand-card);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  width: 100%;
  font-family: inherit;
}
.rtl .video-size-option {
  text-align: right;
  flex-direction: row-reverse;
}
.video-size-option:hover {
  border-color: var(--brand-primary);
  background: rgba(147, 51, 234, 0.04);
}
.video-size-preview {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.video-size-preview.reel {
  aspect-ratio: 9/16;
  height: 48px;
  width: 27px;
}
.video-size-preview.square {
  aspect-ratio: 1/1;
  width: 40px;
  height: 40px;
}
.video-size-preview .video-icon {
  width: 20px;
  height: 20px;
  color: white;
}
.video-size-info {
  flex: 1;
}
.video-size-name {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 2px;
}
.video-size-desc {
  font-size: 12px;
  color: var(--brand-muted);
}
.modal-disclaimer {
  margin-bottom: 20px;
  padding: 12px 16px;
  background: rgba(147, 51, 234, 0.05);
  border: 1px solid rgba(147, 51, 234, 0.1);
  border-radius: 12px;
  font-size: 13px;
  color: var(--brand-muted);
  line-height: 1.5;
  text-align: center;
}
.video-size-option:hover {
  border-color: var(--brand-primary);
  background: var(--brand-surface);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.video-size-preview {
  flex-shrink: 0;
  background: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-size-preview.reel {
  width: 36px;
  height: 64px;
}
.video-size-preview.square {
  width: 50px;
  height: 50px;
}
.video-size-preview::after {
  content: '▶';
  color: white;
  font-size: 14px;
  opacity: 0.9;
}
.video-size-info {
  flex: 1;
}
.video-size-name {
  font-weight: 600;
  color: var(--brand-text);
  margin-bottom: 4px;
}
.video-size-desc {
  font-size: 0.85rem;
  color: var(--brand-muted);
}

.loading-pill.video-loading {
  background: linear-gradient(135deg, #7c3aed20 0%, #ec489920 100%);
  border: 1px solid #7c3aed40;
  color: #7c3aed;
  margin-top: 16px;
}

/* Video Preview Section */
.video-preview-section {
  margin-top: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #7c3aed10 0%, #ec489910 100%);
  border: 1px solid #7c3aed30;
  border-radius: 12px;
}
.video-preview-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #7c3aed;
  margin-bottom: 12px;
}
.video-preview {
  width: 100%;
  max-width: 300px;
  border-radius: 8px;
  background: #000;
}

/* Video job preview in job details */
.video-preview-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.video-preview-wrap .video-preview {
  width: 100%;
  max-width: 100%;
  max-height: 60vh;
  border-radius: 12px;
  border: 1px solid var(--brand-border);
}
.video-download-btn {
  width: 100%;
  justify-content: center;
}
.video-download-btn {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.undo-row {
  margin-top: 12px;
  justify-content: flex-start;
}

.feedback-box {
  display: none;
}

.feedback-box.is-open {
  display: block;
}

.job-danger-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.job-danger-button {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.job-danger-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.job-danger-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Job Actions Row (report + cancel/delete) */
.job-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--brand-border, #e2e8f0);
}

.job-report-button {
  font-size: 1.08rem;
  padding: 0;
  border: none;
  background: transparent;
  opacity: 1;
  cursor: pointer;
  transition: transform 0.2s;
}
.job-report-button:hover {
  transform: scale(1.1);
}

/* Job Report Modal */
.report-modal {
  max-width: 480px;
  padding: 24px;
}
.report-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.report-modal-icon {
  font-size: 1.28rem;
}
.report-modal .modal-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand-ink, #1e293b);
}
.rtl .report-modal .modal-close {
  left: 16px;
  right: auto;
}
.report-modal-subtitle {
  color: var(--brand-muted, #64748b);
  font-size: 0.9rem;
  margin: 0 0 20px;
  line-height: 1.5;
}
.report-reasons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.report-reason-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--brand-border, #e2e8f0);
  border-radius: 10px;
  background: var(--brand-surface, #fff);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}
.report-reason-option:hover {
  border-color: var(--brand-primary, #6366f1);
  background: var(--brand-surface-hover, #f8fafc);
}
.report-reason-option.selected {
  border-color: var(--brand-primary, #6366f1);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}
.report-reason-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}
.report-reason-label {
  font-size: 0.9rem;
  color: var(--brand-ink, #1e293b);
}
.report-details-section {
  margin-bottom: 16px;
}
.report-details-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-ink, #1e293b);
  margin-bottom: 8px;
}
.report-details-input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--brand-border, #e2e8f0);
  border-radius: 8px;
  font-size: 0.9rem;
  resize: vertical;
  font-family: inherit;
}
.report-details-input:focus {
  outline: none;
  border-color: var(--brand-primary, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.report-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}
.report-modal-footer {
  margin: 16px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--brand-border, #e2e8f0);
  font-size: 0.85rem;
  color: var(--brand-muted, #64748b);
  text-align: center;
}

.auth-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.12), rgba(236, 72, 153, 0.12));
}

.auth-card {
  width: min(480px, 100%);
  background: var(--brand-card);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--brand-border);
}

.auth-card .button,
.auth-card a.button {
  text-align: center;
  justify-content: center;
  display: flex;
}

.auth-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--brand-border);
  display: flex;
  justify-content: center;
}

.auth-footer .lang-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 6px 12px;
}

.auth-footer .lang-icon {
  color: #6b7280;
  flex-shrink: 0;
}

.auth-footer .lang-select {
  font-size: 13px;
  padding: 0;
  min-width: 100px;
  background: transparent;
  color: #111827;
  border: none;
  cursor: pointer;
  outline: none;
}

.auth-divider {
  text-align: center;
  color: var(--brand-muted);
  font-size: 13px;
  position: relative;
  margin: 6px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 36%;
  height: 1px;
  background: var(--brand-border);
}

.auth-divider::before {
  left: 0;
}

.auth-divider::after {
  right: 0;
}

.google-button {
  background: #ffffff;
  color: #111827;
  border: 1px solid var(--brand-border);
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.08);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.google-button:hover {
  border-color: rgba(147, 51, 234, 0.4);
  box-shadow: 0 12px 26px rgba(147, 51, 234, 0.18);
}

.social-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.auth-card h1 {
  margin: 0 0 8px;
}

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
}

.alert.error {
  background: rgba(239, 68, 68, 0.12);
  color: var(--brand-danger);
}

.job-status-notice {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.12);
  color: #1f2937;
  font-weight: 600;
  font-size: 16px;
  margin-top: 8px;
}

.job-status-notice.success {
  background: rgba(22, 163, 74, 0.12);
  color: var(--brand-success);
}

.job-status-notice.error {
  background: rgba(239, 68, 68, 0.12);
  color: var(--brand-danger);
}

.alert.success {
  background: rgba(22, 163, 74, 0.12);
  color: var(--brand-success);
}

.alert.warning {
  background: rgba(245, 158, 11, 0.12);
  color: #92400e;
}

.alert.info {
  background: rgba(59, 130, 246, 0.12);
  color: #1f2937;
}

.multi-variants-confirm-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}

#toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  max-width: 360px;
}

.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #111827;
  color: #f9fafb;
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.25);
  animation: toastIn 0.2s ease-out;
}

.toast.success {
  background: #065f46;
}

.toast.error {
  background: #7f1d1d;
}

.toast-message {
  font-size: 14px;
  font-weight: 600;
}

.toast-close {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
}

.toast.hide {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.landing-card {
  border: 1px solid var(--brand-border);
  border-radius: 16px;
  padding: 16px;
  background: var(--brand-card);
  box-shadow: var(--shadow-card);
}

.landing-card + .landing-card {
  margin-top: 12px;
}

.landing-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.landing-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand-ink);
}

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

.landing-actions .button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.landing-danger-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.landing-danger-button {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.landing-edit {
  margin-top: 16px;
}

.landing-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--brand-border);
  background: var(--brand-card);
}

.landing-summary + .landing-summary {
  margin-top: 10px;
}

.leads-table {
  display: block;
}

.leads-header,
.leads-row {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr 1fr;
  gap: 16px;
  align-items: center;
  padding: 12px 8px;
}

.leads-header {
  font-weight: 600;
  border-bottom: 1px solid var(--brand-border);
  color: var(--brand-ink);
}

.leads-row {
  border-bottom: 1px solid #e2e8f0;
  font-size: 14px;
}

.lead-name {
  font-weight: 600;
  color: var(--brand-ink);
}

.brand-summary-logo.small {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.06);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-weight: 700;
  font-size: 13px;
  color: var(--brand-ink);
}

.brand-summary-logo.small img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.business-card-preview {
  padding: 6px;
}

.business-card-preview.preview-warning {
  padding: 0;
}

.phone-frame {
  background: #0f1222;
  border-radius: 36px;
  padding: 18px 16px 22px;
  box-shadow: 0 24px 60px rgba(15, 18, 34, 0.35);
  max-width: 380px;
  margin: 12px auto 0;
}

.phone-frame.preview-warning {
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.phone-notch {
  width: 120px;
  height: 16px;
  background: #0f1222;
  border-radius: 0 0 14px 14px;
  margin: 0 auto 10px;
}

.phone-frame.preview-warning .phone-notch {
  display: none;
}

.phone-screen {
  background: #f5f6fb;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.phone-frame.preview-warning .phone-screen {
  background: transparent;
  border: none;
}

.business-card {
  border: 1px solid #e5e7f2;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 18, 30, 0.08);
}

.business-card-header {
  background: linear-gradient(120deg, var(--brand-primary), var(--brand-secondary));
  color: var(--brand-on-primary);
  padding: 18px;
  text-align: center;
}

.business-card-cover {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 12px;
}

.business-card-logo {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 0 auto 10px;
  font-weight: 700;
}

.business-card-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.business-card-title {
  font-size: 22px;
  font-weight: 700;
}

.business-card-subtitle {
  margin-top: 6px;
  opacity: 0.9;
}

.business-card-body {
  padding: 16px 18px;
  display: grid;
  gap: 12px;
}

.business-card .action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.business-card .action-tile {
  padding: 10px;
  border-radius: 14px;
  border: 1px solid #e0e3ef;
  text-decoration: none;
  color: #1e2430;
  background: #f7f8fd;
  font-weight: 600;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  min-height: 82px;
  justify-content: center;
}

.business-card .action-tile.primary {
  background: var(--brand-primary);
  color: var(--brand-on-primary);
  border: none;
}

.business-card .action-tile.whatsapp {
  background: #f7f8fd;
  color: #1e2430;
  border: 1px solid #e0e3ef;
}

.business-card .action-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.business-card .action-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.business-card .action-text {
  line-height: 1.2;
  word-break: break-word;
}

@media (max-width: 720px) {
  .business-card .action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.business-card .card-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
}

.business-card .card-gallery img {
  width: 100%;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid #e3e6f2;
  aspect-ratio: 1 / 1;
  cursor: pointer;
}

.business-card .card-footer {
  padding: 10px 16px 14px;
  text-align: center;
  font-size: 11px;
  color: #8a90a5;
  border-top: 1px solid #edf0f7;
}

.business-card .card-footer a {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

@media (max-width: 720px) {
  /* Leads page: prevent header actions from overflowing on mobile */
  .leads-card-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .leads-card-header .leads-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .leads-card-header .leads-actions .button {
    width: 100%;
    min-width: 0;
    justify-content: center;
    padding: 10px 10px;
    font-size: 13px;
  }

  html[dir="rtl"] .leads-card-header,
  [dir="rtl"] .leads-card-header,
  .rtl .leads-card-header {
    text-align: right;
  }

  .leads-header,
  .leads-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .leads-header {
    display: none;
  }
  .leads-row {
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 12px;
  }
}

@media (max-width: 960px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .topbar-center {
    width: 100%;
    justify-content: flex-start;
  }
  .brand-switcher {
    width: 100%;
    justify-content: space-between;
  }
  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Knowledge Base Styles */
.knowledge-base-page .container {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
}

.knowledge-base-intro {
  margin-bottom: 24px;
  padding: 32px;
  text-align: center;
}

.knowledge-base-intro h1 {
  margin: 0 0 12px;
  font-size: 32px;
  font-weight: 800;
}

.knowledge-base-toc {
  margin-bottom: 32px;
  padding: 24px;
}

.knowledge-base-toc h2 {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 700;
}

.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toc-nav a {
  color: var(--brand-primary);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.2s;
}

.toc-nav a:hover {
  background: rgba(147, 51, 234, 0.1);
}

.knowledge-base-section {
  margin-bottom: 32px;
}

.knowledge-base-section .card {
  padding: 32px;
}

.knowledge-base-section h2 {
  margin: 0 0 24px;
  font-size: 28px;
  font-weight: 800;
  color: var(--brand-ink);
  border-bottom: 2px solid var(--brand-border);
  padding-bottom: 12px;
}

.knowledge-base-section h3 {
  margin: 32px 0 16px;
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-ink);
}

.knowledge-base-section h4 {
  margin: 24px 0 12px;
  font-size: 18px;
  font-weight: 600;
  color: var(--brand-ink);
}

.knowledge-base-section p {
  line-height: 1.7;
  margin-bottom: 16px;
}

.knowledge-base-section ul,
.knowledge-base-section ol {
  margin: 16px 0;
  padding-left: 24px;
  line-height: 1.8;
}

.knowledge-base-section li {
  margin-bottom: 8px;
}

.job-type-card {
  margin: 32px 0;
  padding: 24px;
  background: var(--brand-bg);
  border-radius: 12px;
  border: 1px solid var(--brand-border);
}

.job-type-card h3 {
  margin-top: 0;
  color: var(--brand-primary);
}

.kb-details {
  margin: 16px 0;
  padding: 16px;
  background: var(--brand-card);
  border-radius: 8px;
  border-left: 3px solid var(--brand-primary);
}

.kb-details strong {
  display: block;
  margin-bottom: 8px;
  color: var(--brand-ink);
}

.kb-details ul {
  margin: 8px 0;
  padding-left: 20px;
}

.kb-image-placeholder {
  margin: 24px 0;
  padding: 40px;
  background: var(--brand-bg);
  border: 2px dashed var(--brand-border);
  border-radius: 12px;
  text-align: center;
}

.kb-image-placeholder p {
  margin: 0;
  color: var(--brand-muted);
  font-style: italic;
}

.kb-tip {
  margin: 20px 0;
  padding: 16px;
  background: rgba(16, 163, 74, 0.1);
  border-left: 3px solid var(--brand-success);
  border-radius: 8px;
}

.kb-tip strong {
  color: var(--brand-success);
}

.plan-comparison {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 32px 0;
}

.plan-card {
  padding: 24px;
  background: var(--brand-card);
  border: 2px solid var(--brand-border);
  border-radius: 12px;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.plan-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.plan-card.highlight {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-soft);
}

.plan-card h3 {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 800;
}

.plan-price {
  font-size: 32px;
  font-weight: 800;
  color: var(--brand-primary);
  margin-bottom: 8px;
}

.plan-price span {
  font-size: 16px;
  color: var(--brand-muted);
  font-weight: 400;
}

.plan-card ul {
  margin: 16px 0;
  list-style: none;
  padding: 0;
}

.plan-card li {
  padding: 8px 0;
  border-bottom: 1px solid var(--brand-border);
}

.plan-card li:last-child {
  border-bottom: none;
}

.troubleshooting-item {
  margin: 24px 0;
  padding: 20px;
  background: var(--brand-bg);
  border-radius: 8px;
  border-left: 3px solid var(--brand-warning);
}

.troubleshooting-item h4 {
  margin-top: 0;
  color: var(--brand-warning);
}

.knowledge-base-footer {
  margin-top: 48px;
  padding: 24px;
  text-align: center;
  background: var(--brand-bg);
}

@media (max-width: 720px) {
  .knowledge-base-page .container {
    padding: 16px;
  }

  .knowledge-base-intro {
    padding: 24px 16px;
  }

  .knowledge-base-intro h1 {
    font-size: 24px;
  }

  .knowledge-base-section .card {
    padding: 20px;
  }

  .knowledge-base-section h2 {
    font-size: 22px;
  }

  .knowledge-base-section h3 {
    font-size: 18px;
  }

  .plan-comparison {
    grid-template-columns: 1fr;
  }

  .job-type-card {
    padding: 16px;
  }
}

/* Sidebar Brand Add Button */
.brand-switcher {
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
}

.brand-switcher.has-search {
  display: grid !important;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "search search"
    "select add";
  align-items: center !important;
}

.brand-switcher .brand-select-search {
  grid-area: search;
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--brand-border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--brand-ink);
  font-family: inherit;
}

.brand-switcher.has-search .nav-brand-add-btn {
  grid-area: add;
  align-self: center;
}

.brand-switcher .select {
  grid-area: select;
  flex: 1;
  min-width: 0 !important;
}

.nav-brand-add-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  border-radius: 50% !important;
  background: var(--brand-accent) !important; /* Dynamic brand color */
  color: #ffffff !important;
  text-decoration: none !important;
  font-size: 24px !important;
  line-height: 1 !important;
  font-weight: bold !important;
  transition: transform 0.2s, background 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 10;
}

.nav-brand-add-btn:hover {
  background: var(--brand-accent-hover, var(--brand-accent));
  transform: scale(1.05);
  color: #ffffff;
}

[dir="rtl"] .nav-brand-add-btn {
  margin-right: 0;
  margin-left: 0;
}

/* ========================================
   Mobile Optimizations
   ======================================== */

@media (max-width: 640px) {
  /* Mobile header bar: keep it fixed (some mobile browsers can break sticky) */
  .app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
  }

  /* Offset content under the fixed header */
  .app-content {
    padding-top: 64px;
  }

  /* Modals on mobile: respect safe-areas (notch) so the close button is always visible */
  .modal {
    /* When the modal-card is taller than the viewport, flexbox centering can make the top unreachable.
       Always anchor to the top on mobile so users can scroll from the very top. */
    align-items: flex-start;
    -webkit-overflow-scrolling: touch;
    padding-top: max(12px, env(safe-area-inset-top));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    padding-left: max(12px, env(safe-area-inset-left));
  }

  .modal-close {
    /* Pin close button to the viewport so it's never hidden by scroll/centering */
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    z-index: 90;
  }

  html[dir="rtl"] .modal-close,
  [dir="rtl"] .modal-close,
  .rtl .modal-close {
    left: max(12px, env(safe-area-inset-left));
    right: auto;
  }

  /* Job details modal has its own close positioning; ensure it also respects safe-areas */
  .job-details-modal .modal-close {
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
  }

  html[dir="rtl"] .job-details-modal .modal-close,
  [dir="rtl"] .job-details-modal .modal-close,
  .rtl .job-details-modal .modal-close {
    left: max(12px, env(safe-area-inset-left));
    right: auto;
  }

  /* Job details modal: remove nested height clamps on mobile; rely on outer modal scroll so top/bottom are always reachable */
  .job-details-modal .modal-card {
    max-height: none;
    overflow: visible;
  }

  .job-details-modal .job-details-modal-body {
    max-height: none;
    overflow: visible;
  }

  /* Mobile scroll safety: never lock global scrolling */
  html,
  body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto;
  }

  /* When overlays are open, never allow the page behind to scroll */
  body.modal-open,
  body.sidebar-open {
    overflow: hidden !important;
  }

  /* Posts page: 2 posts per row on mobile */
  .posts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  /* Pricing page: trust icon pills should wrap and never overflow on mobile (esp RTL) */
  .pricing-trust-icons .trust-icons-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding-inline: 12px;
  }

  .pricing-trust-icons .trust-icon-pill {
    min-width: 0;
    flex: 1 1 calc(50% - 10px);
    max-width: 100%;
    padding: 10px 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--brand-border);
  }

  .pricing-trust-icons .trust-icon-text {
    white-space: normal;
    text-align: center;
    line-height: 1.25;
  }

  /* Leads page: prevent header action buttons from overflowing on mobile */
  .leads-card-title {
    min-width: 0;
    white-space: normal;
  }

  .section-header .leads-actions {
    min-width: 0;
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .section-header .leads-actions .button {
    min-width: 0;
    flex: 1 1 calc(50% - 8px);
    padding: 10px 10px;
    font-size: 13px;
    justify-content: center;
  }

  html[dir="rtl"] .section-header .leads-actions,
  [dir="rtl"] .section-header .leads-actions,
  .rtl .section-header .leads-actions {
    justify-content: flex-end;
  }

  /* Reduce container side margins for full-width feel on mobile */
  .container {
    padding: 0;
    margin: 20px 0 40px;
  }

  /* Titles outside cards: add natural side padding on mobile without affecting card layouts */
  .container > .section-header,
  .container > .section-title,
  .container > h1,
  .container > h2,
  .container > h3,
  .container > .stack > .section-header,
  .container > .stack > .section-title,
  .container > .stack > h1,
  .container > .stack > h2,
  .container > .stack > h3 {
    padding-inline: 12px;
  }

  /* Mobile RTL: ensure top-of-page headers stack (title above description) and align to the right */
  .container > .section-header,
  .container > .stack > .section-header {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 6px;
  }

  .container > .section-header > .muted,
  .container > .stack > .section-header > .muted {
    width: 100%;
  }

  html[dir="rtl"] .container > .section-header,
  [dir="rtl"] .container > .section-header,
  .rtl .container > .section-header,
  html[dir="rtl"] .container > .stack > .section-header,
  [dir="rtl"] .container > .stack > .section-header,
  .rtl .container > .stack > .section-header {
    align-items: flex-end;
    text-align: right;
    direction: rtl;
  }

  html[dir="rtl"] .container > .section-header > .muted,
  [dir="rtl"] .container > .section-header > .muted,
  .rtl .container > .section-header > .muted,
  html[dir="rtl"] .container > .stack > .section-header > .muted,
  [dir="rtl"] .container > .stack > .section-header > .muted,
  .rtl .container > .stack > .section-header > .muted {
    text-align: right;
  }

  /* Mobile RTL: explicitly right-align the title line inside top-of-page headers */
  html[dir="rtl"] .container > .section-header > .section-title,
  [dir="rtl"] .container > .section-header > .section-title,
  .rtl .container > .section-header > .section-title,
  html[dir="rtl"] .container > .stack > .section-header > .section-title,
  [dir="rtl"] .container > .stack > .section-header > .section-title,
  .rtl .container > .stack > .section-header > .section-title {
    width: 100%;
    text-align: right !important;
    direction: rtl;
  }

  /* Mobile RTL: standalone titles outside cards should align to the right too */
  html[dir="rtl"] .container > .section-title,
  [dir="rtl"] .container > .section-title,
  .rtl .container > .section-title,
  html[dir="rtl"] .container > h1,
  [dir="rtl"] .container > h1,
  .rtl .container > h1,
  html[dir="rtl"] .container > h2,
  [dir="rtl"] .container > h2,
  .rtl .container > h2,
  html[dir="rtl"] .container > h3,
  [dir="rtl"] .container > h3,
  .rtl .container > h3,
  html[dir="rtl"] .container > .stack > .section-title,
  [dir="rtl"] .container > .stack > .section-title,
  .rtl .container > .stack > .section-title,
  html[dir="rtl"] .container > .stack > h1,
  [dir="rtl"] .container > .stack > h1,
  .rtl .container > .stack > h1,
  html[dir="rtl"] .container > .stack > h2,
  [dir="rtl"] .container > .stack > h2,
  .rtl .container > .stack > h2,
  html[dir="rtl"] .container > .stack > h3,
  [dir="rtl"] .container > .stack > h3,
  .rtl .container > .stack > h3 {
    text-align: right;
  }
  
  /* Job items - reduce internal padding slightly but keep readable */
  .job-item {
    padding: 12px;
  }
  
  /* Card containers - reduce padding on mobile */
  .card {
    padding: 16px;
  }
  
  /* Modal cards - ensure they use full available width */
  .modal {
    padding: 12px;
  }
  
  .modal-card {
    max-width: 100%;
    margin: 0;
  }
  
  /* Brief cards and form sections */
  .brief-section {
    padding: 16px;
  }

  /* Create panel (job creator): reduce title size and hide long subtitle on mobile */
  .create-panel h2[data-i18n="app_create_job_title"] {
    display: none;
  }

  .create-panel p[data-i18n="app_create_job_subtitle"] {
    display: none;
  }

  /* Language selector pills: keep in ONE row on mobile */
  .language-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .language-option {
    width: 100%;
    justify-content: center;
    gap: 6px;
    padding: 8px 8px;
    font-size: 13px;
    white-space: nowrap;
  }

  .language-option span {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Jobs toolbar (search + 2 filters): 1 row on mobile, each gets 1/3 width (no overflow) */
  .jobs-toolbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    align-items: center;
  }

  .jobs-toolbar .input,
  .jobs-toolbar .select {
    width: 100%;
    min-width: 0;
    font-size: 13px;
    padding: 10px 10px;
  }

  .jobs-toolbar .select {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Jobs page: hide inline details panel on mobile (use modal only) */
  .job-details-col {
    display: none;
  }

  /* Job details (open job): keep action buttons inside viewport on mobile */
  .job-details-modal .action-row,
  .job-details-modal .publish-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .job-details-modal .action-row .button,
  .job-details-modal .publish-actions .button {
    width: 100%;
    justify-content: center;
  }

  /* Job details modal: make the stage title (e.g., "Creating design") 50% smaller on mobile */
  .job-details-modal .job-stage {
    font-size: 65%;
    line-height: 1.2;
  }

  /* Announcement personality grid: 3 per row on mobile */
  .brief-style-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  /* Brand summary (collapsed) RTL: reserve space for BOTH left-side buttons so name doesn't wrap under them */
  #brand-summary-card.brand-collapsed .brand-summary-compact {
    min-width: 0;
  }

  #brand-summary-card.brand-collapsed .brand-summary-compact-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  html[dir="rtl"] #brand-summary-card.brand-collapsed .brand-summary-compact,
  [dir="rtl"] #brand-summary-card.brand-collapsed .brand-summary-compact,
  .rtl #brand-summary-card.brand-collapsed .brand-summary-compact {
    padding-left: 112px;
    padding-right: 12px;
  }

  /* Image previews should use full width */
  .image-preview {
    border-radius: 12px;
  }
  
  .design-preview-box {
    width: 100%;
  }
  
  /* Brand Library - Images/Videos: 3 per row on mobile */
  .library-items {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  
  .library-item {
    max-width: 100%;
    padding: 8px;
  }
  
  /* Brand Library - Ad Copies: 2 per row on mobile (override) */
  #generated-copies.library-items,
  #generated-copies {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .library-item.copy-item {
    grid-column: span 1;
  }
  
  .library-copy {
    font-size: 13px;
  }

  /* Nav profile avatar: reduce size on mobile (does not affect desktop) */
  #user-chip .user-avatar {
    width: 16px;
    height: 16px;
  }

  /* Nav user pill (profile + name): make it match other compact controls */
  #user-chip.user-chip {
    padding: 4px 8px;
    gap: 6px;
  }

  #user-chip .user-chip-text {
    gap: 1px;
  }

  #user-chip .user-name {
    font-size: 13px;
    line-height: 1.1;
  }

  /* Credits modal: make it taller on mobile so bottom tooltips don't appear below the fold */
  #credits-modal .modal-card {
    max-height: calc(100vh - 24px);
    padding: 20px 16px;
    overflow-y: auto;
    overflow-x: visible;
  }

  /* Credits modal: keep it compact (inline info appears above the grid) */
  #credits-modal-body.credits-modal-body,
  #credits-modal .credits-modal-body {
    min-height: 0;
    padding-bottom: 0;
  }
}
