:root {
  /* ==================== Obsidian & Royal Gold-Violet Raw Tokens ==================== */
  --bg-page-light: #f4f6fb;
  --bg-page-dark: #060813;

  --bg-card-light: rgba(255, 255, 255, 0.84);
  --bg-card-dark: rgba(15, 21, 38, 0.74);

  --bg-elevated-light: rgba(241, 245, 252, 0.92);
  --bg-elevated-dark: rgba(23, 32, 56, 0.78);

  --bg-input-light: rgba(255, 255, 255, 0.96);
  --bg-input-dark: rgba(10, 14, 28, 0.76);

  --bg-glass-nav-light: rgba(255, 255, 255, 0.86);
  --bg-glass-nav-dark: rgba(12, 17, 33, 0.84);

  --text-primary-light: #0f172a;
  --text-primary-dark: #f8fafc;

  --text-muted-light: #526077;
  --text-muted-dark: #94a3b8;

  --border-subtle-light: rgba(15, 23, 42, 0.09);
  --border-subtle-dark: rgba(255, 255, 255, 0.09);

  --border-highlight-light: rgba(99, 102, 241, 0.22);
  --border-highlight-dark: rgba(255, 255, 255, 0.16);

  --brand-primary-light: #5b46f5;
  --brand-primary-dark: #7c5cff;

  --brand-primary-hover-light: #4a35e0;
  --brand-primary-hover-dark: #967dff;

  --gold-accent-light: #b45309;
  --gold-accent-dark: #fbbf24;

  --gold-bg-light: rgba(245, 158, 11, 0.12);
  --gold-bg-dark: rgba(245, 158, 11, 0.15);

  --gold-border-light: rgba(217, 119, 6, 0.32);
  --gold-border-dark: rgba(251, 191, 36, 0.38);

  --success-light: #059669;
  --success-dark: #34d399;

  --warning-light: #d97706;
  --warning-dark: #fbbf24;

  --danger-light: #dc2626;
  --danger-dark: #fb7185;

  --shadow-card-light: 0 12px 34px -8px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.03);
  --shadow-card-dark: 0 18px 42px -10px rgba(0, 0, 0, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.07);

  --scroll-thumb-light: #94a3b8;
  --scroll-thumb-dark: #475569;
  --scroll-track-light: #e2e8f0;
  --scroll-track-dark: #0b1020;

  /* Default (light) values before fallbacks & light-dark() */
  --bg-page: var(--bg-page-light);
  --bg-card: var(--bg-card-light);
  --bg-elevated: var(--bg-elevated-light);
  --bg-input: var(--bg-input-light);
  --bg-glass-nav: var(--bg-glass-nav-light);
  --text-primary: var(--text-primary-light);
  --text-muted: var(--text-muted-light);
  --border-subtle: var(--border-subtle-light);
  --border-highlight: var(--border-highlight-light);
  --brand-primary: var(--brand-primary-light);
  --brand-primary-hover: var(--brand-primary-hover-light);
  --gold-accent: var(--gold-accent-light);
  --gold-bg: var(--gold-bg-light);
  --gold-border: var(--gold-border-light);
  --success: var(--success-light);
  --warning: var(--warning-light);
  --danger: var(--danger-light);
  --shadow-card: var(--shadow-card-light);
  --scroll-thumb: var(--scroll-thumb-light);
  --scroll-track: var(--scroll-track-light);

  /* Fallback for browsers without light-dark() support */
  @media (prefers-color-scheme: dark) {
    --bg-page: var(--bg-page-dark);
    --bg-card: var(--bg-card-dark);
    --bg-elevated: var(--bg-elevated-dark);
    --bg-input: var(--bg-input-dark);
    --bg-glass-nav: var(--bg-glass-nav-dark);
    --text-primary: var(--text-primary-dark);
    --text-muted: var(--text-muted-dark);
    --border-subtle: var(--border-subtle-dark);
    --border-highlight: var(--border-highlight-dark);
    --brand-primary: var(--brand-primary-dark);
    --brand-primary-hover: var(--brand-primary-hover-dark);
    --gold-accent: var(--gold-accent-dark);
    --gold-bg: var(--gold-bg-dark);
    --gold-border: var(--gold-border-dark);
    --success: var(--success-dark);
    --warning: var(--warning-dark);
    --danger: var(--danger-dark);
    --shadow-card: var(--shadow-card-dark);
    --scroll-thumb: var(--scroll-thumb-dark);
    --scroll-track: var(--scroll-track-dark);
  }

  /* Modern automatic light-dark() token binding */
  @supports (color: light-dark(white, black)) {
    --bg-page: light-dark(var(--bg-page-light), var(--bg-page-dark));
    --bg-card: light-dark(var(--bg-card-light), var(--bg-card-dark));
    --bg-elevated: light-dark(var(--bg-elevated-light), var(--bg-elevated-dark));
    --bg-input: light-dark(var(--bg-input-light), var(--bg-input-dark));
    --bg-glass-nav: light-dark(var(--bg-glass-nav-light), var(--bg-glass-nav-dark));
    --text-primary: light-dark(var(--text-primary-light), var(--text-primary-dark));
    --text-muted: light-dark(var(--text-muted-light), var(--text-muted-dark));
    --border-subtle: light-dark(var(--border-subtle-light), var(--border-subtle-dark));
    --border-highlight: light-dark(var(--border-highlight-light), var(--border-highlight-dark));
    --brand-primary: light-dark(var(--brand-primary-light), var(--brand-primary-dark));
    --brand-primary-hover: light-dark(var(--brand-primary-hover-light), var(--brand-primary-hover-dark));
    --gold-accent: light-dark(var(--gold-accent-light), var(--gold-accent-dark));
    --gold-bg: light-dark(var(--gold-bg-light), var(--gold-bg-dark));
    --gold-border: light-dark(var(--gold-border-light), var(--gold-border-dark));
    --success: light-dark(var(--success-light), var(--success-dark));
    --warning: light-dark(var(--warning-light), var(--warning-dark));
    --danger: light-dark(var(--danger-light), var(--danger-dark));
    --shadow-card: light-dark(var(--shadow-card-light), var(--shadow-card-dark));
    --scroll-thumb: light-dark(var(--scroll-thumb-light), var(--scroll-thumb-dark));
    --scroll-track: light-dark(var(--scroll-track-light), var(--scroll-track-dark));
  }

  /* Viewport-wide native UI theming + meta override mapping */
  color-scheme: light dark;

  &:has(> head > meta[name="color-scheme"][content="dark"]) {
    color-scheme: dark;
  }
  &:has(> head > meta[name="color-scheme"][content="light"]) {
    color-scheme: light;
  }

  accent-color: var(--brand-primary);
  /* Paired with scrollbar-width; never transition scrollbar-color */
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}

@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  ::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb);
    border-radius: 999px;
  }
  ::-webkit-scrollbar-track {
    background: var(--scroll-track);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", "IBM Plex Sans Thai", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size-adjust: from-font;
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  text-align: start;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
}

@supports not (font-size-adjust: from-font) {
  body {
    line-height: 1.58;
    font-size: 1rem;
  }
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size-adjust: from-font;
  font-size: 0.85em;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==================== Ambient Luxury Background Mesh ==================== */

.ambient-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(85px);
  opacity: 0.55;
}

.orb-violet {
  width: 380px;
  height: 380px;
  top: -110px;
  left: -90px;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.36), transparent 70%);
}

.orb-gold {
  width: 320px;
  height: 320px;
  top: -70px;
  right: -90px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.22), transparent 70%);
}

.orb-indigo {
  width: 440px;
  height: 440px;
  bottom: -150px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(99, 102, 241, 0.22), transparent 72%);
}

/* ==================== 1. Luxury Auth Gate ==================== */

.auth-view {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-card {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
  border: 1px solid var(--border-highlight);
  border-radius: 26px;
  padding: 30px 24px 24px;
  box-shadow: var(--shadow-card);
}

.auth-glow-crest {
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #a855f7, #fbbf24, #6366f1, transparent);
  opacity: 0.9;
}

.brand-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.brand-logo {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(145deg, #161b33 0%, #0b0f21 100%);
  border: 1px solid rgba(251, 191, 36, 0.35);
  box-shadow: 0 10px 24px -6px rgba(124, 92, 255, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  transition: transform 0.18s ease;
}

.brand-logo:active {
  transform: scale(0.95);
}

.brand-eyebrow {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--gold-accent);
  margin-bottom: 2px;
}

.brand-title {
  margin: 0;
  font-size: 1.48rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-subtitle {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-wrap: pretty;
}

.platform-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.plat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.plat-chip.tiktok svg {
  color: #fe2c55;
  filter: drop-shadow(-1px -0.5px 0 #25f4ee);
}

.plat-chip.shopee svg {
  color: #ee4d2d;
}

.plat-chip.facebook svg {
  color: #1877f2;
}

.plat-chip.youtube svg {
  color: #ff0033;
}

.auth-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 500;
}

.trust-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
}

/* ==================== 2. App Shell & Frosted Sticky Header ==================== */

.app-shell {
  min-height: 100dvh;
  max-width: 700px;
  margin: 0 auto;
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}

.top-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg-glass-nav);
  backdrop-filter: blur(22px) saturate(155%);
  -webkit-backdrop-filter: blur(22px) saturate(155%);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 16px 14px;
}

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

.header-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-logo-sm {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: linear-gradient(145deg, #161b33 0%, #0b0f21 100%);
  border: 1px solid rgba(251, 191, 36, 0.36);
  box-shadow: 0 6px 16px -4px rgba(124, 92, 255, 0.4);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
}

.header-title-wrap {
  min-width: 0;
}

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

.header-title {
  font-weight: 800;
  font-size: 1.04rem;
  letter-spacing: -0.01em;
}

.studio-tag {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.2), rgba(245, 158, 11, 0.2));
  border: 1px solid var(--gold-border);
  color: var(--gold-accent);
}

.license-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
}

.license-pill.is-premium {
  color: var(--gold-accent);
}

.account-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 11px;
}

.account-select-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.account-lead-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--brand-primary);
  pointer-events: none;
}

.account-select {
  padding-left: 36px !important;
  min-height: 40px !important;
  font-weight: 600;
}

/* ==================== 3. Luxury Glass Cards & Step Headers ==================== */

.main-content {
  padding: 16px 14px;
}

.tab-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeSlideUp 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--border-subtle);
  border-radius: 22px;
  padding: 18px 16px;
  box-shadow: var(--shadow-card);
}

.card-launch {
  border-color: var(--border-highlight);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.step-heading,
.section-heading-icon {
  display: flex;
  align-items: center;
  gap: 11px;
}

.step-num {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.18), rgba(245, 158, 11, 0.14));
  border: 1px solid var(--border-highlight);
  color: var(--brand-primary);
  font-size: 0.74rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.section-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.section-icon-badge.violet {
  background: rgba(124, 92, 255, 0.15);
  border: 1px solid rgba(124, 92, 255, 0.3);
  color: var(--brand-primary);
}

.section-icon-badge.gold {
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
  color: var(--gold-accent);
}

.card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.card-hint {
  display: block;
  margin-top: 2px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.sub-heading {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
}

.divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 18px 0;
}

.sub-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 15px;
  padding: 13px;
}

.two-col-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 520px) {
  .two-col-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ==================== 4. Social Connection Cards ==================== */

.connect-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

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

.connect-item {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.connect-item.connected {
  border-color: rgba(52, 211, 153, 0.45);
  box-shadow: inset 0 0 24px rgba(16, 185, 129, 0.05);
}

.connect-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.connect-brand-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.plat-icon-well {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
}

.plat-icon-well.tiktok {
  color: #fe2c55;
}
.plat-icon-well.tiktok svg {
  filter: drop-shadow(-1.2px -0.6px 0 #25f4ee);
}
.plat-icon-well.shopee {
  color: #ee4d2d;
}
.plat-icon-well.facebook {
  color: #1877f2;
}
.plat-icon-well.youtube {
  color: #ff0033;
}

.connect-name {
  font-weight: 800;
  font-size: 0.9rem;
  line-height: 1.2;
}

.connect-user {
  margin-top: 2px;
  font-size: 0.76rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connect-item.connected .connect-user {
  color: var(--success);
  font-weight: 600;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.45);
  display: inline-block;
  flex-shrink: 0;
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.24);
  animation: pulseDot 2.4s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.24);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.08);
  }
}

.connect-actions {
  display: flex;
  gap: 6px;
}

/* ==================== 5. Video Dropzone & 9:16 Cover Preview Cards ==================== */

.upload-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 16px;
  border: 1.5px dashed rgba(124, 92, 255, 0.48);
  border-radius: 18px;
  background: radial-gradient(circle at top, rgba(124, 92, 255, 0.1), transparent 72%), var(--bg-elevated);
  cursor: pointer;
  gap: 6px;
  transition: border-color 0.2s ease, transform 0.15s ease;
}

.upload-dropzone:active {
  transform: scale(0.99);
}

.upload-icon-orb {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.22), rgba(245, 158, 11, 0.16));
  border: 1px solid var(--border-highlight);
  color: var(--brand-primary);
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  box-shadow: 0 8px 20px -6px rgba(124, 92, 255, 0.35);
}

.upload-title {
  font-weight: 800;
  font-size: 0.94rem;
}

.upload-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.clips-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.clip-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 17px;
  padding: 12px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

/* 9:16 Vertical Video Cover Box */
.clip-thumb-box {
  position: relative;
  width: 4.5rem;
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(155deg, #1e1b4b 0%, #311042 52%, #0f172a 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 18px -6px rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
}

.clip-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.clip-thumb-placeholder {
  color: rgba(255, 255, 255, 0.75);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.clip-index-pill {
  position: absolute;
  top: 5px;
  left: 5px;
  font-size: 0.64rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(6, 8, 19, 0.76);
  backdrop-filter: blur(6px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.clip-duration-pill {
  position: absolute;
  bottom: 5px;
  right: 5px;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(6, 8, 19, 0.8);
  color: #f8fafc;
}

.clip-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.clip-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.clip-meta-name {
  flex: 1;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clip-products-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

@media (min-width: 520px) {
  .clip-products-row {
    grid-template-columns: 1fr 1fr;
  }
}

.clip-products-row .select-input {
  min-height: 38px;
  padding: 6px 10px;
  font-size: 0.88rem;
}

/* ==================== 6. Target Platform Cards (Brand Signature Glow) ==================== */

.target-platforms-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

@media (min-width: 560px) {
  .target-platforms-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.target-plat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14px 8px 12px;
  border-radius: 17px;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-elevated);
  cursor: pointer;
  user-select: none;
  gap: 5px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.14s ease;
}

.target-plat-card:active {
  transform: scale(0.98);
}

.target-plat-card input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.plat-check-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-input);
  color: transparent;
  display: grid;
  place-items: center;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.target-plat-emblem {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  margin-bottom: 2px;
}

.target-plat-emblem.tiktok {
  color: #fe2c55;
}
.target-plat-emblem.tiktok svg {
  filter: drop-shadow(-1.3px -0.8px 0 #25f4ee);
}
.target-plat-emblem.shopee {
  color: #ee4d2d;
}
.target-plat-emblem.facebook {
  color: #1877f2;
}
.target-plat-emblem.youtube {
  color: #ff0033;
}

/* Brand Signature Glow States */
.target-plat-card[data-plat="tiktok"]:has(input:checked) {
  border-color: rgba(254, 44, 85, 0.62);
  background: linear-gradient(160deg, rgba(37, 244, 238, 0.08), rgba(254, 44, 85, 0.1));
  box-shadow: 0 8px 24px -8px rgba(254, 44, 85, 0.35);
}
.target-plat-card[data-plat="tiktok"]:has(input:checked) .plat-check-indicator {
  background: linear-gradient(135deg, #25f4ee, #fe2c55);
  border-color: transparent;
  color: #ffffff;
}

.target-plat-card[data-plat="shopee"]:has(input:checked) {
  border-color: rgba(238, 77, 45, 0.68);
  background: linear-gradient(160deg, rgba(238, 77, 45, 0.15), rgba(255, 115, 55, 0.05));
  box-shadow: 0 8px 24px -8px rgba(238, 77, 45, 0.38);
}
.target-plat-card[data-plat="shopee"]:has(input:checked) .plat-check-indicator {
  background: linear-gradient(135deg, #ee4d2d, #ff7337);
  border-color: transparent;
  color: #ffffff;
}

.target-plat-card[data-plat="facebook"]:has(input:checked) {
  border-color: rgba(24, 119, 242, 0.68);
  background: linear-gradient(160deg, rgba(24, 119, 242, 0.14), rgba(24, 119, 242, 0.04));
  box-shadow: 0 8px 24px -8px rgba(24, 119, 242, 0.38);
}
.target-plat-card[data-plat="facebook"]:has(input:checked) .plat-check-indicator {
  background: #1877f2;
  border-color: transparent;
  color: #ffffff;
}

.target-plat-card[data-plat="youtube"]:has(input:checked) {
  border-color: rgba(255, 0, 51, 0.65);
  background: linear-gradient(160deg, rgba(255, 0, 51, 0.13), rgba(255, 0, 51, 0.04));
  box-shadow: 0 8px 24px -8px rgba(255, 0, 51, 0.36);
}
.target-plat-card[data-plat="youtube"]:has(input:checked) .plat-check-indicator {
  background: #ff0033;
  border-color: transparent;
  color: #ffffff;
}

.target-plat-card input:focus-visible + .plat-check-indicator {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.target-plat-name {
  font-weight: 800;
  font-size: 0.88rem;
}

.target-plat-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ==================== 7. Form Controls, Segmented Bars & Luxury Buttons ==================== */

.stack-form,
.form-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.field-hint {
  margin: 5px 0 0;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.input-icon-wrap {
  position: relative;
}

.input-lead-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold-accent);
  pointer-events: none;
}

/* 1rem (16px default) prevents iOS Safari zoom while honoring user root font preferences */
.text-input,
.select-input,
.textarea-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 13px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.text-input.has-lead-icon {
  padding-left: 42px;
}

.text-input:focus,
.select-input:focus,
.textarea-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18);
}

.textarea-input {
  min-height: 78px;
  resize: vertical;
}

.code-input {
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}

.toggle-row input[type="checkbox"] {
  width: 19px;
  height: 19px;
  margin: 0;
  flex-shrink: 0;
  border-radius: 6px;
}

/* Segmented Control */
.segmented-control {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 4px;
  gap: 4px;
}

.segment-option {
  flex: 1;
  position: relative;
  cursor: pointer;
  text-align: center;
}

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

.segment-option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px 8px;
  border-radius: 10px;
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.segment-option input:checked + span {
  background: linear-gradient(135deg, #6d4aff, #8b5cf6);
  color: #ffffff;
  box-shadow: 0 4px 14px -3px rgba(124, 92, 255, 0.5);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 43px;
  padding: 9px 16px;
  border-radius: 13px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.14s ease, box-shadow 0.18s ease, background-color 0.18s ease, opacity 0.18s ease;
}

.btn:active:not(:disabled) {
  transform: scale(0.985);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #6345ff 0%, #8b5cf6 60%, #a855f7 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 22px -6px rgba(124, 92, 255, 0.55);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #7156ff 0%, #996eff 60%, #b569fa 100%);
}

.btn-glow {
  box-shadow: 0 10px 28px -6px rgba(124, 92, 255, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-highlight);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-subtle);
}

.btn-danger-ghost {
  background: rgba(244, 63, 94, 0.08);
  color: var(--danger);
  border-color: rgba(244, 63, 94, 0.28);
}

.btn-lg {
  min-height: 50px;
  font-size: 0.98rem;
  border-radius: 15px;
}

.btn-sm {
  min-height: 37px;
  padding: 6px 12px;
  font-size: 0.82rem;
  border-radius: 11px;
}

.btn-xs {
  min-height: 31px;
  padding: 4px 10px;
  font-size: 0.76rem;
  border-radius: 9px;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.icon-btn-sm {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

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

.flex-1 {
  flex: 1;
}
.justify-center {
  justify-content: center;
}
.text-center {
  text-align: center;
}
.mx-auto {
  margin-left: auto;
  margin-right: auto;
}
.mt-xs {
  margin-top: 6px;
}
.mt-sm {
  margin-top: 12px;
}
.mt-md {
  margin-top: 16px;
}
.mb-sm {
  margin-bottom: 12px;
}

/* ==================== 8. Progress, Schedule Timeline & VIP Membership Pass ==================== */

.upload-progress-box {
  margin-top: 14px;
  padding: 13px;
  border-radius: 15px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-highlight);
}

.progress-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 7px;
}

.progress-track {
  width: 100%;
  height: 9px;
  background: var(--bg-input);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.progress-fill {
  height: 100%;
  width: var(--prog, 0%);
  background: linear-gradient(90deg, #6366f1, #a855f7, #f59e0b);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.timeline-preview {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 11px 13px;
  font-size: 0.79rem;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.timeline-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--border-subtle);
}

.timeline-item:last-child {
  border-bottom: none;
}

/* VIP Digital Membership Pass */
.membership-pass {
  overflow: hidden;
  border-color: var(--gold-border);
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.14), transparent 55%),
    radial-gradient(circle at bottom left, rgba(124, 92, 255, 0.14), transparent 60%),
    var(--bg-card);
}

.pass-aura {
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #fbbf24, #a855f7, transparent);
}

.quota-card {
  background: var(--bg-elevated);
  border: 1px solid var(--gold-border);
  border-radius: 15px;
  padding: 13px;
}

.quota-fill {
  background: linear-gradient(90deg, #f59e0b, #fbbf24, #a855f7);
}

.info-kv-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-kv-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  padding: 8px 11px;
  border-radius: 11px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.tier-crest-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
  color: var(--gold-accent);
}

/* ==================== 9. Live Studio Queue, Visual Stepper & Native Details ==================== */

.jobs-stack,
.history-stack,
.product-list,
.preview-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.job-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-highlight);
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.job-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.job-title-main {
  font-size: 0.92rem;
  font-weight: 800;
}

.job-title-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.job-status-badge {
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}

.job-status-badge.running {
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.4);
  background: rgba(124, 92, 255, 0.14);
}
.job-status-badge.completed {
  color: var(--success);
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(16, 185, 129, 0.12);
}
.job-status-badge.partial,
.job-status-badge.queued {
  color: var(--warning);
  border-color: rgba(251, 191, 36, 0.38);
}
.job-status-badge.failed {
  color: var(--danger);
  border-color: rgba(244, 63, 94, 0.38);
}

/* 4-Stage Visual Stepper */
.job-stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 10px 8px;
  border-radius: 13px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}

.step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  opacity: 0.6;
}

.step-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-elevated);
  display: grid;
  place-items: center;
  font-size: 0.66rem;
  font-weight: 800;
}

.step-node.done {
  opacity: 1;
  color: var(--success);
}
.step-node.done .step-dot {
  background: rgba(16, 185, 129, 0.18);
  border-color: var(--success);
  color: var(--success);
}

.step-node.active {
  opacity: 1;
  color: var(--brand-primary);
}
.step-node.active .step-dot {
  background: rgba(124, 92, 255, 0.22);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18);
}

.job-clips-matrix {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.job-clip-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.81rem;
  padding: 8px 10px;
  border-radius: 11px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}

.plat-status-pills {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
}

.plat-state-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-muted);
}

.plat-state-pill.success {
  color: var(--success);
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(16, 185, 129, 0.11);
}
.plat-state-pill.running {
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.45);
  background: rgba(124, 92, 255, 0.15);
}
.plat-state-pill.failed {
  color: var(--danger);
  border-color: rgba(244, 63, 94, 0.4);
  background: rgba(244, 63, 94, 0.1);
}

/* Native <details> & <summary> Technical Logs Disclosure */
.tech-logs-disclosure {
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  overflow: hidden;
}

.tech-logs-disclosure > summary {
  list-style: none;
  cursor: pointer;
  padding: 9px 12px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.tech-logs-disclosure > summary::-webkit-details-marker {
  display: none;
}

/* Explicit directional cue required when list-style: none hides default triangle */
.tech-logs-disclosure > summary::after {
  content: "▾";
  font-size: 0.85rem;
  transition: transform 0.18s ease;
}

.tech-logs-disclosure[open] > summary::after {
  transform: rotate(180deg);
}

.tech-logs-disclosure[open] > summary {
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.job-logs-box {
  max-height: 140px;
  overflow-y: auto;
  background: #060914;
  color: #cbd5e1;
  padding: 9px 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  line-height: 1.45;
}

.log-line.success {
  color: #34d399;
}
.log-line.warning {
  color: #fbbf24;
}
.log-line.error {
  color: #fb7185;
}

/* Product & History Items */
.product-item,
.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.product-info {
  min-width: 0;
  flex: 1;
}

.product-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-sub {
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-studio-state {
  padding: 24px 16px;
  text-align: center;
  border-radius: 16px;
  background: var(--bg-elevated);
  border: 1px dashed var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.84rem;
}

/* AI Shimmer Skeleton */
.shimmer-card {
  padding: 16px;
  border-radius: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-highlight);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shimmer-line {
  height: 13px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(124, 92, 255, 0.12) 0%,
    rgba(251, 191, 36, 0.28) 50%,
    rgba(124, 92, 255, 0.12) 100%
  );
  background-size: 200% 100%;
  animation: luxuryShimmer 1.5s infinite linear;
}

.shimmer-line.w-60 {
  width: 60%;
}
.shimmer-line.w-90 {
  width: 90%;
}
.shimmer-line.w-75 {
  width: 75%;
}

@keyframes luxuryShimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ==================== 10. Floating Frosted Glass Bottom Navigation ==================== */

.bottom-nav {
  position: fixed;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 520px;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 6px;
  border-radius: 22px;
  background: var(--bg-glass-nav);
  backdrop-filter: blur(24px) saturate(165%);
  -webkit-backdrop-filter: blur(24px) saturate(165%);
  border: 1px solid var(--border-highlight);
  box-shadow: 0 16px 38px -8px rgba(0, 0, 0, 0.42);
}

.nav-item {
  position: relative;
  background: transparent;
  border: none;
  border-radius: 16px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-family: inherit;
  cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.nav-item.active {
  color: #ffffff;
  background: linear-gradient(135deg, #6345ff, #8b5cf6);
  box-shadow: 0 6px 16px -4px rgba(124, 92, 255, 0.55);
}

.nav-icon {
  display: grid;
  place-items: center;
}

.nav-label {
  font-size: 0.7rem;
  font-weight: 700;
}

.nav-badge {
  position: absolute;
  top: 4px;
  right: 16%;
  background: var(--gold-accent);
  color: #090d1f;
  font-size: 0.64rem;
  font-weight: 800;
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 4px;
}

/* ==================== 11. Modal Dialogs (Light-Dismiss + Glass) ==================== */

.modal-dialog {
  width: calc(100% - 22px);
  max-width: 460px;
  max-height: 90dvh;
  border: 1px solid var(--border-highlight);
  border-radius: 24px;
  padding: 0;
  background: var(--bg-page);
  color: var(--text-primary);
  box-shadow: 0 28px 65px rgba(0, 0, 0, 0.55);
}

.modal-dialog.modal-lg {
  max-width: 650px;
}

.modal-dialog::backdrop {
  background-color: rgba(4, 6, 16, 0.68);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-inner {
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 88dvh;
  overflow-y: auto;
}

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

.modal-title {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 800;
}

.modal-footer {
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.login-status-pill {
  display: inline-block;
  margin-top: 5px;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.login-status-pill.waiting {
  background: var(--gold-bg);
  color: var(--gold-accent);
  border: 1px solid var(--gold-border);
}

.login-status-pill.connected {
  background: rgba(16, 185, 129, 0.16);
  color: var(--success);
  border: 1px solid rgba(52, 211, 153, 0.38);
}

/* QR & Remote Browser Panels */
.qr-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.qr-box {
  width: 244px;
  height: 244px;
  background: #ffffff;
  border-radius: 20px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.25);
  display: grid;
  place-items: center;
}

.qr-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-loading {
  color: #334155;
  font-size: 0.84rem;
  font-weight: 600;
}

.qr-instruction {
  margin: 0;
  font-size: 0.83rem;
  color: var(--text-muted);
  max-width: 390px;
}

.remote-screen-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.remote-screen-frame {
  width: 100%;
  background: #050811;
  border-radius: 15px;
  overflow: hidden;
  border: 1px solid var(--border-highlight);
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
}

.remote-screen-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.remote-controls-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-elevated);
  padding: 11px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
}

.remote-type-row,
.copy-url-row {
  display: flex;
  gap: 7px;
}

.remote-keys-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ==================== 12. Toast Notifications ==================== */

.toast-container {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: calc(100% - 28px);
  max-width: 420px;
  pointer-events: none;
}

.toast {
  background: rgba(12, 17, 34, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #f8fafc;
  padding: 12px 15px;
  border-radius: 14px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
  animation: fadeSlideUp 0.2s ease;
}

.toast.success {
  border-left: 4px solid #10b981;
}
.toast.error {
  border-left: 4px solid #f43f5e;
}
.toast.warning {
  border-left: 4px solid #f59e0b;
}

/* ==================== 13. Dual Posting Mode Switcher (Affiliate vs General) ==================== */

.mode-switch-fieldset,
.mood-fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.mode-switch-fieldset {
  margin-bottom: 12px;
}

.mode-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 440px) {
  .mode-cards-grid {
    grid-template-columns: 1fr;
  }
}

.mode-card-option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 13px;
  border-radius: 16px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-subtle);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.mode-card-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-card-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-input);
  color: transparent;
  display: grid;
  place-items: center;
  transition: all 0.18s ease;
}

.mode-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.mode-card-icon.gold {
  background: var(--gold-bg);
  color: var(--gold-accent);
  border: 1px solid var(--gold-border);
}

.mode-card-icon.violet {
  background: rgba(139, 92, 246, 0.14);
  color: var(--brand-primary);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.mode-card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding-right: 18px;
}

.mode-card-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 999px;
}

.mode-card-badge.gold {
  background: var(--gold-bg);
  color: var(--gold-accent);
}

.mode-card-badge.violet {
  background: rgba(139, 92, 246, 0.14);
  color: var(--brand-primary);
}

.mode-card-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
}

.mode-card-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.mode-card-option[data-mode="affiliate"]:has(input:checked) {
  border-color: var(--gold-accent);
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.13), rgba(168, 85, 247, 0.06));
  box-shadow: 0 10px 26px -10px rgba(245, 158, 11, 0.42);
}

.mode-card-option[data-mode="affiliate"]:has(input:checked) .mode-card-check {
  background: var(--gold-accent);
  border-color: var(--gold-accent);
  color: #090d1f;
}

.mode-card-option[data-mode="general"]:has(input:checked) {
  border-color: var(--brand-primary);
  background: linear-gradient(145deg, rgba(124, 92, 255, 0.16), rgba(56, 189, 248, 0.08));
  box-shadow: 0 10px 26px -10px rgba(124, 92, 255, 0.48);
}

.mode-card-option[data-mode="general"]:has(input:checked) .mode-card-check {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #ffffff;
}

/* General Mode Confirmation Banner */
.general-notice-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(124, 92, 255, 0.12));
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: var(--text-primary);
}

.general-notice-banner svg {
  color: var(--success);
  flex-shrink: 0;
  margin-top: 2px;
}

.general-notice-banner div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.general-notice-banner strong {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--success);
}

.general-notice-banner span {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Affiliate Quick Global Product Bar */
.quick-assign-box {
  margin-top: 12px;
  padding: 12px 13px;
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.08), rgba(124, 92, 255, 0.06));
  border: 1px solid var(--gold-border);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.quick-assign-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-assign-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--gold-accent);
}

/* Mood Chips Grid for General Content AI */
.mood-chips-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 4px;
}

.mood-chip-option {
  position: relative;
  cursor: pointer;
}

.mood-chip-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mood-chip-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  border-radius: 11px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  transition: all 0.16s ease;
}

.mood-chip-option input:checked + span {
  background: linear-gradient(135deg, #6345ff, #8b5cf6);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 12px -3px rgba(124, 92, 255, 0.5);
}

/* Job Mode Tag in Queue */
.job-mode-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 5px;
  vertical-align: middle;
}

.job-mode-tag.affiliate {
  background: var(--gold-bg);
  color: var(--gold-accent);
  border: 1px solid var(--gold-border);
}

.job-mode-tag.general {
  background: rgba(139, 92, 246, 0.15);
  color: var(--brand-primary);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

/* ==================== 14. Header Theme Switcher (Crescent Moon / Lightbulb) & Slot Badge ==================== */

.brand-hero {
  position: relative;
}

.brand-hero .theme-cycle-btn {
  margin-left: auto;
  align-self: flex-start;
  flex-shrink: 0;
}

.theme-cycle-btn {
  position: relative;
  overflow: visible;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.theme-cycle-btn[data-theme-mode="dark"] {
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.1);
}

.theme-cycle-btn[data-theme-mode="light"] {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.14);
}

.theme-cycle-btn[data-theme-mode="system"] {
  color: var(--brand-primary);
  border-color: rgba(168, 85, 247, 0.38);
  background: rgba(139, 92, 246, 0.12);
}

.theme-auto-tag {
  position: absolute;
  bottom: -4px;
  right: -4px;
  padding: 1px 4px;
  border-radius: 999px;
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.1;
  background: linear-gradient(135deg, #6345ff, #a855f7);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.slot-limit-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 10px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: var(--gold-accent);
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
  flex-shrink: 0;
}
