@import url('https://fonts.googleapis.com/css2?family=Kantumruy+Pro:ital,wght@0,100..700;1,100..700&family=JetBrains+Mono:ital,wght@0,400..700;1,400..700&display=swap');

:root {
  --bg-base: #06080e;
  --bg-card: rgba(14, 20, 34, 0.75);
  --bg-card-hover: rgba(22, 30, 50, 0.9);
  --bg-elevated: #111827;
  --bg-input: rgba(10, 14, 24, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(99, 102, 241, 0.4);
  --border-focus: #6366f1;
  --accent-primary: #6366f1;
  --accent-secondary: #a855f7;
  --accent-pink: #ec4899;
  --accent-cyan: #06b6d4;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --accent-glow: rgba(99, 102, 241, 0.35);
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;
  --text-faint: #64748b;
  --status-success: #10b981;
  --status-warning: #f59e0b;
  --status-danger: #ef4444;
  --status-info: #06b6d4;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.6);
  --font-body: 'Kantumruy Pro', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-khmer: 'Kantumruy Pro', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-primary: 'Kantumruy Pro', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Kantumruy Pro', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: inherit;
}

html,
body {
  background-color: var(--bg-base);
  background-image:
    radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.14) 0%, transparent 45%),
    radial-gradient(circle at 90% 15%, rgba(236, 72, 153, 0.10) 0%, transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(6, 182, 212, 0.08) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-body) !important;
  font-size: 16.5px;
  font-weight: 450;
  line-height: 1.76;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
a,
label,
li,
button,
input,
select,
textarea,
optgroup,
table,
th,
td,
.portal-brand-title,
.portal-nav-pill,
.hero-title-text,
.portal-greeting-bar,
.modal,
.toast,
.badge,
.status-pill,
.btn {
  font-family: var(--font-body) !important;
}

/* Khmer Typography & Zero-Clipping Accents Enhancement */
.form-label,
.panel-card-title,
.modal-title,
.btn,
.portal-nav-pill {
  line-height: 1.55 !important;
}

.form-input,
.form-textarea {
  line-height: 1.65 !important;
}

code,
pre,
.spec-val,
.mono-font,
.token-val,
.log-output {
  font-family: var(--font-mono) !important;
}

/* Buttons Base */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-sm);
  font-size: 0.98rem;
  font-weight: 600;
  font-family: 'Kantumruy Pro', system-ui, -apple-system, sans-serif !important;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  outline: none;
  user-select: none;
  text-decoration: none;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.07);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-family: 'Kantumruy Pro', system-ui, -apple-system, sans-serif !important;
  font-weight: 600 !important;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
  color: #ffffff;
  border: 1px solid rgba(6, 182, 212, 0.45);
  font-family: 'Kantumruy Pro', system-ui, -apple-system, sans-serif !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1 0%, #0891b2 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.45);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.5);
}

/* =========================================================================
       HEADER (ORGANIZED, SLEEK & COMPACT)
       ========================================================================= */
/* =========================================================================
       UNIFIED PORTAL HEADER (MATCHING USER REFERENCE LAYOUT)
       ========================================================================= */
header.app-header {
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  background: rgba(6, 11, 24, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.65rem 2.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  min-height: 70px;
  box-sizing: border-box;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Left Brand Logo & Title */
.brand-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  text-decoration: none;
  cursor: pointer;
}

.brand-logo-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 10px rgba(6, 182, 212, 0.4));
  transition: transform 0.25s ease;
}

.brand-section:hover .brand-logo-icon {
  transform: scale(1.08) rotate(6deg);
}

.brand-title-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  letter-spacing: -0.01em;
  margin: 0;
}

/* Center Nav Links (Pill Style from Reference) */
.header-center-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.main-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1.15rem;
  border-radius: 9999px;
  background: transparent;
  border: 1.5px solid transparent;
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  text-decoration: none;
}

.main-nav-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.main-nav-tab.active {
  color: #fff;
  background: rgba(6, 182, 212, 0.18);
  border-color: #06b6d4;
  font-weight: 600;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.35);
}

/* Right Action Toolbar */
.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

/* Circular Icon Buttons */
.btn-circle-action {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.btn-circle-action:hover {
  background: rgba(6, 182, 212, 0.2);
  border-color: #06b6d4;
  color: #fff;
  transform: translateY(-1px);
}

/* Language Switcher Pill (KH • EN) */
.lang-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.95rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.lang-pill-btn:hover {
  background: rgba(6, 182, 212, 0.2);
  border-color: #06b6d4;
}

/* Publish Mode Pill (SIMULATION / LIVE) */
.status-pill-mode {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
}

.status-pill-mode:hover {
  background: rgba(245, 158, 11, 0.22);
  transform: scale(1.02);
}

/* =========================================================================
       HEADER USER PROFILE & AUTHENTICATION SYSTEM (MOVED TO TOP NAVBAR)
       ========================================================================= */
.portal-auth-container {
  position: relative;
  display: flex;
  align-items: center;
}

.portal-setting-btn {
  position: relative;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  max-width: 38px !important;
  max-height: 38px !important;
  border-radius: 50% !important;
  padding: 0 !important;
  background: #091322;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

.portal-setting-btn:hover {
  background: #12213a;
  border-color: rgba(6, 182, 212, 0.45);
  color: #38bdf8;
  transform: translateY(-1px);
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.35);
}

.portal-setting-btn svg {
  transition: transform 0.3s ease;
}

.portal-setting-btn:hover svg {
  transform: rotate(45deg);
}

.auth-role-indicator {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fbbf24;
  border: 1.5px solid #091322;
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.7);
  transition: all 0.2s ease;
  pointer-events: none;
}

.portal-user-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 36px;
  padding: 0 12px 0 6px;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.25);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  user-select: none;
  box-sizing: border-box;
}

.portal-user-profile-btn:hover {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(56, 189, 248, 0.55);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.user-avatar-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.user-display-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-khmer), var(--font-primary);
}

.user-role-pill {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.user-role-pill.role-admin {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.4));
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.6);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.user-role-pill.role-user {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(59, 130, 246, 0.3));
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

/* Guest buttons */
.portal-guest-auth-btns {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-guest-login {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  padding: 0 14px;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-guest-login:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.btn-guest-register {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  border: none;
  color: #fff;
  padding: 0 14px;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.35);
  transition: all 0.2s;
}

.btn-guest-register:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.5);
}

/* Profile Dropdown Menu */
.user-profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 300px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 16px;
  padding: 10px 0;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7), 0 0 20px rgba(6, 182, 212, 0.2);
  backdrop-filter: blur(16px);
  z-index: 9999999 !important;
  pointer-events: auto !important;
  animation: fadeInDown 0.2s ease;
}

/* Account Listing Box (Interactive Switcher) */
.profile-accounts-section {
  padding: 0.5rem 0.75rem;
}
.account-listing-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
}
.account-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.18s ease;
  border: 1.5px solid transparent;
  background: rgba(255, 255, 255, 0.03);
}
.account-list-item:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateX(2px);
}
.account-list-item.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.22), rgba(59, 130, 246, 0.22));
  border-color: rgba(6, 182, 212, 0.6);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.25);
}
.account-item-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.account-item-info {
  flex: 1;
  min-width: 0;
}
.account-item-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.account-item-email {
  font-size: 0.68rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-item-badge {
  font-size: 0.64rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9999px;
  flex-shrink: 0;
}
.account-item-badge.admin {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.account-item-badge.creator {
  background: rgba(6, 182, 212, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.4);
}
.account-item-badge.viewer {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.4);
}
.account-item-check {
  color: #10b981;
  font-weight: 900;
  font-size: 0.88rem;
  flex-shrink: 0;
}

body.theme-light .account-listing-box {
  background: rgba(241, 245, 249, 0.8);
  border-color: rgba(0, 0, 0, 0.08);
}
body.theme-light .account-list-item {
  background: #ffffff;
}
body.theme-light .account-item-name {
  color: #1e293b;
}
body.theme-light .account-item-email {
  color: #64748b;
}

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

.profile-avatar-large {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.profile-meta .profile-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.profile-meta .profile-email {
  font-size: 0.72rem;
  color: #94a3b8;
  margin: 2px 0 4px;
  word-break: break-all;
}

.profile-badge-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
}

.profile-badge-pill.role-admin {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.profile-badge-pill.role-user {
  background: rgba(6, 182, 212, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.auth-tabs-nav {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 20px;
}

.auth-tab-btn {
  flex: 1;
  padding: 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab-btn.active {
  color: #38bdf8;
  border-bottom-color: #38bdf8;
}

/* =========================================================================
   AUTH MODAL SCROLLBAR & PANEL RESPONSIBLE SCROLLING
   ========================================================================= */
#auth-modal {
  overflow-y: auto !important;
  padding: 24px 14px !important;
  -webkit-overflow-scrolling: touch;
}

#auth-modal .modal-dialog {
  margin: auto !important;
  width: 100%;
  max-width: 480px;
  max-height: min(85vh, 620px) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(2, 132, 199, 0.25);
  border-radius: 18px;
}

#auth-modal .modal-header,
#auth-modal .auth-tabs-nav {
  flex-shrink: 0 !important;
}

.auth-panel {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  max-height: calc(min(85vh, 620px) - 125px) !important;
  padding: 20px 22px 35px !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #0284c7 rgba(15, 23, 42, 0.6);
}

/* Visible Modern Custom Scrollbar on Sidebar/Modal */
.auth-panel::-webkit-scrollbar {
  width: 8px !important;
  display: block !important;
}

.auth-panel::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6) !important;
  border-radius: 9999px !important;
  margin: 6px 0;
}

.auth-panel::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #0284c7, #38bdf8) !important;
  border-radius: 9999px !important;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.35);
}

.auth-panel::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #0369a1, #0284c7) !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
}

/* Light Theme Auth Panel Scrollbar */
body.theme-light #auth-modal .modal-dialog {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15) !important;
}

body.theme-light .auth-panel {
  scrollbar-color: #0284c7 #f1f5f9 !important;
}

body.theme-light .auth-panel::-webkit-scrollbar-track {
  background: #f1f5f9 !important;
  border-radius: 9999px !important;
  margin: 6px 0;
}

body.theme-light .auth-panel::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #0284c7, #0ea5e9) !important;
  border: 2px solid #ffffff !important;
  border-radius: 9999px !important;
  box-shadow: 0 1px 5px rgba(2, 132, 199, 0.35) !important;
}

body.theme-light .auth-panel::-webkit-scrollbar-thumb:hover {
  background: #0369a1 !important;
}

.btn-sm-preset {
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-sm-preset:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  transform: translateY(-1px);
}

body.theme-light .portal-user-profile-btn,
body.theme-light .portal-lang-pill {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(14, 165, 233, 0.3);
  color: #0f172a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

body.theme-light .portal-setting-btn {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  color: #475569;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

body.theme-light .portal-setting-btn:hover {
  background: #f8fafc;
  border-color: #0284c7;
  color: #0284c7;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

body.theme-light .portal-lang-btn {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  color: #0284c7;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

body.theme-light .portal-lang-btn:hover {
  background: #f8fafc;
  border-color: #0284c7;
  color: #0369a1;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

body.theme-light .portal-circle-btn {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  color: #334155;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

body.theme-light .portal-circle-btn:hover {
  background: #f8fafc;
  border-color: #0284c7;
  color: #0284c7;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

body.theme-light .portal-circle-btn.active {
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  border-color: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.35);
}

/* =========================================================================
       PROMINENT LIGHT & DARK MODE HEADER PILL
       ========================================================================= */
.header-theme-toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  height: 38px;
  padding: 0 13px 0 7px;
  border-radius: 9999px;
  background: linear-gradient(135deg, rgba(20, 29, 47, 0.95), rgba(11, 18, 33, 0.95));
  border: 1.5px solid rgba(148, 163, 184, 0.32);
  color: #f1f5f9;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  user-select: none;
  flex-shrink: 0;
  white-space: nowrap;
}

.header-theme-toggle-pill:hover {
  border-color: #a855f7;
  color: #c084fc;
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(168, 85, 247, 0.35);
}

.theme-pill-icon-badge {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  line-height: 1;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease;
  flex-shrink: 0;
}

.header-theme-toggle-pill:hover .theme-pill-icon-badge {
  transform: scale(1.15) rotate(15deg);
}

.theme-pill-text {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  color: inherit;
}

/* Light Mode States */
body.theme-light .header-theme-toggle-pill,
.header-theme-toggle-pill.theme-is-light {
  background: linear-gradient(135deg, #ffffff, #fef3c7) !important;
  border-color: rgba(245, 158, 11, 0.55) !important;
  color: #0f172a !important;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.18) !important;
}

body.theme-light .header-theme-toggle-pill:hover,
.header-theme-toggle-pill.theme-is-light:hover {
  border-color: #f59e0b !important;
  color: #b45309 !important;
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.4) !important;
}

body.theme-light .theme-pill-icon-badge,
.header-theme-toggle-pill.theme-is-light .theme-pill-icon-badge {
  background: linear-gradient(135deg, #f59e0b, #fbbf24) !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6) !important;
}

body.theme-light .user-display-name {
  color: #0f172a;
}

body.theme-light .user-profile-dropdown {
  background: rgba(255, 255, 255, 0.98);
  border-color: #cbd5e1;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

body.theme-light .profile-meta .profile-name {
  color: #0f172a;
}

/* =========================================================================
       HERO FEATURE BANNER (MATCHING REFERENCE IMAGE 1:1)
       ========================================================================= */
.hero-feature-card {
  position: relative;
  border-radius: 26px;
  overflow: hidden;
  min-height: 400px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.65);
  margin-bottom: 2rem;
  background: #080d1e;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2.4rem 2.6rem;
  box-sizing: border-box;
}

.hero-banner-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: brightness(0.95);
  transition: transform 0.8s ease;
}

.hero-feature-card:hover .hero-banner-img {
  transform: scale(1.02);
}

.hero-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(6, 11, 24, 0.88) 0%, rgba(6, 11, 24, 0.50) 45%, rgba(6, 11, 24, 0.12) 100%);
  pointer-events: none;
}

/* Top Right Equalizer Sound Wave Widget */
.hero-equalizer-badge {
  position: absolute;
  top: 1.5rem;
  right: 1.8rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3.5px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  z-index: 10;
}

.eq-bar {
  width: 3.5px;
  background: #06b6d4;
  border-radius: 3px;
  animation: eqBarPulse 1.2s infinite ease-in-out alternate;
}

.eq-bar:nth-child(1) {
  height: 12px;
  animation-delay: 0.1s;
}

.eq-bar:nth-child(2) {
  height: 22px;
  animation-delay: 0.35s;
}

.eq-bar:nth-child(3) {
  height: 28px;
  animation-delay: 0.2s;
}

.eq-bar:nth-child(4) {
  height: 16px;
  animation-delay: 0.45s;
}

@keyframes eqBarPulse {
  0% {
    transform: scaleY(0.4);
    opacity: 0.7;
  }

  100% {
    transform: scaleY(1.15);
    opacity: 1;
  }
}

/* Hero Text & Actions Overlay */
.hero-content-wrap {
  position: relative;
  z-index: 10;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.95rem;
  border-radius: 9999px;
  background: rgba(6, 182, 212, 0.16);
  border: 1.5px solid #06b6d4;
  color: #38bdf8;
  font-size: 0.84rem;
  font-weight: 700;
  width: fit-content;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.3);
}

.hero-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.hero-title-text {
  font-size: 2.15rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #ffffff 40%, #e0f2fe 80%, #7dd3fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.35;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
  margin: 0;
}

.hero-sub-text {
  font-size: 1.05rem;
  color: #e2e8f0;
  line-height: 1.65;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.hero-action-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

/* =========================================================================
       DUAL-COLUMN CARDS UNDERNEATH (MATCHING REFERENCE IMAGE CARDS)
       ========================================================================= */
.studio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.8rem;
  align-items: start;
}

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

/* Portal Card with Glowing Border */
.panel-card {
  background: rgba(8, 14, 28, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(6, 182, 212, 0.38);
  border-radius: 22px;
  padding: 1.65rem 1.75rem;
  box-shadow: 0 10px 32px rgba(6, 182, 212, 0.08);
  transition: all 0.25s ease;
}

.panel-card:hover {
  border-color: rgba(6, 182, 212, 0.65);
  box-shadow: 0 12px 38px rgba(6, 182, 212, 0.16);
}

.panel-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.4rem;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 1rem;
}

.panel-card-title {
  font-size: 1.28rem;
  font-weight: 750;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* Card Pill Badges (AI GUIDE & ASSESSMENT TIPS from Reference) */
.card-pill-cyan {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.95rem;
  border-radius: 9999px;
  border: 1.5px solid #06b6d4;
  background: rgba(6, 182, 212, 0.14);
  color: #38bdf8;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.3);
}

.card-pill-purple {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.95rem;
  border-radius: 9999px;
  border: 1.5px solid #a855f7;
  background: rgba(168, 85, 247, 0.14);
  color: #c084fc;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* =========================================================================
       FLOATING AI ASSISTANT ROBOT WIDGET (FROM REFERENCE IMAGE RIGHT EDGE)
       ========================================================================= */
.floating-ai-widget {
  position: fixed;
  right: 18px;
  top: 55%;
  transform: translateY(-50%);
  z-index: 60;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(10, 18, 36, 0.92);
  backdrop-filter: blur(12px);
  border: 1.5px solid #06b6d4;
  box-shadow: 0 0 22px rgba(6, 182, 212, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-ai-widget:hover {
  transform: translateY(-50%) scale(1.12);
  border-color: #38bdf8;
  box-shadow: 0 0 32px rgba(6, 182, 212, 0.75);
}

.floating-ai-icon {
  font-size: 1.45rem;
  animation: floatRobot 2.5s infinite ease-in-out alternate;
}

@keyframes floatRobot {
  0% {
    transform: translateY(-2px);
  }

  100% {
    transform: translateY(2px);
  }
}

/* Container for Views */
main.app-viewport {
  max-width: 1480px;
  margin: 0 auto;
  padding: 1.2rem 2rem 4rem;
}

.main-tab-content {
  display: none;
  animation: fadeInTab 0.25s ease-out;
}

.main-tab-content.active {
  display: block;
}

@keyframes fadeInTab {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Panels & Cards */
.panel-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.6rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.panel-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.panel-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.panel-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* =========================================================================
       TAB 1: PUBLISH STUDIO (COMPOSTION & STUDIO PREVIEW)
       ========================================================================= */
.studio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.8rem;
  align-items: start;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.15rem;
}

.form-label {
  font-size: 0.98rem;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 0.45rem;
  display: inline-block;
}

.form-label span.required {
  color: var(--status-danger);
  font-weight: 700;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1.15rem;
  color: #fff;
  font-family: inherit;
  font-size: 1.02rem;
  line-height: 1.6;
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.28);
  background: rgba(14, 20, 36, 0.95);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-faint);
  font-size: 0.95rem;
}

/* Video Source Tabs */
.source-tabs {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.source-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.source-tab-btn.active {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

/* Dropzone */
.dropzone {
  border: 2px dashed rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-md);
  padding: 1.8rem 1.2rem;
  text-align: center;
  cursor: pointer;
  background: rgba(99, 102, 241, 0.04);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
  transform: translateY(-1px);
}

.dropzone-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropzone-icon svg {
  width: 24px;
  height: 24px;
}

/* Target Selector Grid (Balanced 4x2 Layout with Brand Visuals) */
.target-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  margin-top: 0.45rem;
}

@media (max-width: 1100px) {
  .target-selector {
    grid-template-columns: repeat(2, 1fr);
  }
}

.target-checkbox {
  display: none;
}

.target-label {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.65rem;
  padding: 0.65rem 0.95rem;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.65);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  min-height: 44px;
  box-sizing: border-box;
  position: relative;
}

/* Single Symbol Per Target Platform (Official Vector Brand Logo Only) */
.target-label::before {
  content: '';
  display: inline-block;
  width: 22px;
  height: 22px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  flex-shrink: 0;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease, opacity 0.2s ease;
  filter: grayscale(0.45);
  opacity: 0.65;
}

.target-checkbox:checked+.target-label::before {
  filter: none !important;
  opacity: 1 !important;
  transform: scale(1.12);
}

/* Remove redundant second checkmark symbol completely */
.target-label::after,
.target-checkbox:checked+.target-label::after {
  display: none !important;
}

.target-label:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.target-label:hover::before {
  transform: scale(1.15);
}

/* Official Platform Vector Brand Logos in ::before */
label[for="target-yt"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ff0000'%3E%3Cpath d='M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z'/%3E%3C/svg%3E");
}

label[for="target-tt"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2325F4EE'%3E%3Cpath d='M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.24 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z'/%3E%3C/svg%3E");
}

label[for="target-ig"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23E1306C'%3E%3Cpath d='M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z'/%3E%3C/svg%3E");
}

label[for="target-fb"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231877F2'%3E%3Cpath d='M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z'/%3E%3C/svg%3E");
}

label[for="target-fbp"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230866FF'%3E%3Cpath d='M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z'/%3E%3C/svg%3E");
}

label[for="target-tw"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e2e8f0'%3E%3Cpath d='M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z'/%3E%3C/svg%3E");
}

label[for="target-li"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230A66C2'%3E%3Cpath d='M19 0h-14c-2.761 0-5 2.239-5 5v14c0 2.761 2.239 5 5 5h14c2.762 0 5-2.239 5-5v-14c0-2.761-2.238-5-5-5zm-11 19h-3v-11h3v11zm-1.5-12.268c-.966 0-1.75-.79-1.75-1.764s.784-1.764 1.75-1.764 1.75.79 1.75 1.764-.783 1.764-1.75 1.764zm13.5 12.268h-3v-5.604c0-3.368-4-3.113-4 0v5.604h-3v-11h3v1.765c1.396-2.586 7-2.777 7 2.476v6.759z'/%3E%3C/svg%3E");
}

label[for="target-tg"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23229ED9'%3E%3Cpath d='M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0zm5.894 8.221l-1.97 9.28c-.145.658-.537.818-1.084.508l-3-2.21-1.446 1.394c-.14.18-.357.295-.6.295-.002 0-.003 0-.005 0l.213-3.054 5.56-5.022c.24-.213-.054-.334-.373-.121l-6.869 4.326-2.96-.924c-.64-.203-.658-.64.135-.954l11.566-4.458c.538-.196 1.006.128.832.945z'/%3E%3C/svg%3E");
}

/* CTA Presets Chips */
.cta-presets {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.cta-hint-label,
span[data-i18n="ctaPresetsHint"] {
  font-family: 'Kantumruy Pro', system-ui, -apple-system, sans-serif !important;
  font-size: 0.74rem !important;
  font-weight: 600 !important;
  color: #94a3b8 !important;
}

.cta-chip {
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Kantumruy Pro', system-ui, -apple-system, sans-serif !important;
  transition: all 0.2s ease;
}

.cta-chip:hover {
  background: rgba(6, 182, 212, 0.2);
  border-color: var(--accent-cyan);
  color: #fff;
}

/* Target actions buttons (Select All / Deselect All) */
.target-actions-btn,
button[data-i18n="btnSelectAll"],
button[data-i18n="btnDeselectAll"] {
  font-family: 'Kantumruy Pro', system-ui, -apple-system, sans-serif !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  letter-spacing: normal !important;
}

/* Placement Options */
.placement-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

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

.placement-option input[type="radio"] {
  display: none;
}

.placement-card {
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.placement-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.placement-option input:checked+.placement-card {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-primary);
}

.placement-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #fff;
  font-size: 0.84rem;
  font-weight: 700;
}

.placement-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
}

.placement-option input:checked+.placement-card .placement-indicator {
  background: var(--accent-primary);
  box-shadow: 0 0 8px var(--accent-primary);
}

.placement-desc {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.4;
}

/* Link Config Card */
.link-config-card {
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(18, 25, 42, 0.65);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.2rem;
}

.link-config-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.link-badge-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Switch Slider */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: 0.3s;
  border-radius: 34px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.switch-toggle input:checked+.switch-slider {
  background: var(--accent-gradient);
}

.switch-toggle input:checked+.switch-slider:before {
  transform: translateX(20px);
}

/* Video Player Mockup & Specs */
.video-inspect-wrapper {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(12, 17, 30, 0.85);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.inspect-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.inspect-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.inspect-body {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 700px) {
  .inspect-body {
    grid-template-columns: 1fr;
  }
}

.video-player-phone {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: #000;
  position: relative;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.video-screen {
  position: relative;
  width: 100%;
  aspect-ratio: 9/16;
  background: #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-screen video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.replay-overlay {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.replay-overlay.flash {
  display: flex;
  animation: flashReplay 0.6s ease-out;
}

@keyframes flashReplay {
  0% {
    opacity: 0;
    transform: scale(0.6);
  }

  50% {
    opacity: 1;
    transform: scale(1.1);
  }

  100% {
    opacity: 0;
    transform: scale(1);
  }
}

.player-controls-bar {
  background: rgba(14, 20, 34, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem 0.65rem;
}

.player-timeline {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  margin-bottom: 0.4rem;
}

.player-progress {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}

.player-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
}

.ctrl-icon-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
}

.ctrl-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.auto-loop-label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.72rem;
}

.video-specs-panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.specs-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.spec-status-badge {
  font-size: 0.72rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-weight: 700;
}

.specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.spec-item {
  display: flex;
  flex-direction: column;
  font-size: 0.76rem;
}

.spec-label {
  color: var(--text-dim);
}

.spec-val {
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.platform-readiness-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 0.65rem;
}

.readiness-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.spec-badge {
  font-size: 0.72rem;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399;
  font-weight: 600;
}

/* =========================================================================
       LIVE SOCIAL FEED MOCKUP STUDIO (TIKTOK, SHORTS, REELS, TELEGRAM)
       ========================================================================= */
.live-preview-box {
  border: 1.5px solid rgba(56, 189, 248, 0.2);
  background: rgba(15, 23, 42, 0.75);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  transition: all 0.25s ease;
}

/* Platform Switcher Tabs */
.mockup-platform-switcher {
  display: flex;
  gap: 0.45rem;
  padding: 0.35rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  margin-top: 0.85rem;
  margin-bottom: 1.1rem;
  overflow-x: auto;
}

.mockup-tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mockup-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.mockup-tab-btn.active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.25), rgba(99, 102, 241, 0.25));
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.25);
}

.mockup-tab-icon {
  font-size: 0.95rem;
}

/* Smartphone Mockup Frame */
.social-phone-frame {
  max-width: 380px;
  margin: 0 auto;
  background: #000000;
  border-radius: 32px;
  border: 4px solid #1e293b;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
  position: relative;
}

/* Phone Top Bar */
.mockup-phone-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 1.15rem 0.35rem 1.15rem;
  background: rgba(0, 0, 0, 0.85);
  color: #ffffff;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 700;
  position: relative;
  z-index: 5;
}

.phone-dynamic-island {
  width: 76px;
  height: 18px;
  background: #000000;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.phone-icons {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
}

/* Viewport / Screen */
.mockup-viewport {
  position: relative;
  width: 100%;
  height: 480px;
  background: linear-gradient(180deg, #090d16 0%, #030712 100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* Video Player inside Mockup */
.mockup-video-box {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.mockup-video-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mockup-floating-badge {
  position: absolute;
  top: 10px;
  left: 12px;
  background: rgba(0, 0, 0, 0.65);
  color: #38bdf8;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-family: var(--font-mono);
  font-weight: 800;
  letter-spacing: 0.05em;
  border: 1px solid rgba(56, 189, 248, 0.4);
  backdrop-filter: blur(4px);
}

/* Fallback State */
.mockup-video-fallback {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  background: radial-gradient(circle at center, rgba(30, 41, 59, 0.7) 0%, rgba(9, 13, 22, 0.95) 100%);
  color: #94a3b8;
  z-index: 1;
}

.mockup-fallback-pulse {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.12);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  margin-bottom: 0.75rem;
  animation: fallbackPulse 2s infinite ease-in-out;
}

@keyframes fallbackPulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
  }

  50% {
    transform: scale(1.08);
    box-shadow: 0 0 24px rgba(56, 189, 248, 0.45);
  }
}

/* Right Action Sidebar */
.mockup-action-sidebar {
  position: absolute;
  right: 12px;
  bottom: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  z-index: 3;
}

.mockup-action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.mockup-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.mockup-follow-badge {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -8px;
  border: 1.5px solid #000000;
}

.mockup-action-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: #ffffff;
  backdrop-filter: blur(4px);
  transition: transform 0.2s ease;
}

.mockup-action-icon:hover {
  transform: scale(1.15);
}

.mockup-action-counter {
  font-size: 0.68rem;
  font-weight: 700;
  color: #ffffff;
  margin-top: 2px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Spinning Vinyl Record */
.mockup-vinyl-disc {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #111827;
  border: 6px solid #27272a;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  animation: vinylSpin 4s linear infinite;
}

.vinyl-center {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #06b6d4, #a855f7);
}

@keyframes vinylSpin {
  100% {
    transform: rotate(360deg);
  }
}

/* Bottom Overlay */
.mockup-bottom-overlay {
  position: relative;
  z-index: 3;
  padding: 1rem 4.5rem 0.85rem 1rem;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.88) 35%, rgba(0, 0, 0, 0.98) 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mockup-author-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.mockup-author-handle {
  font-size: 0.82rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.mockup-verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #38bdf8;
  color: #0f172a;
  font-size: 0.62rem;
  font-weight: 900;
}

.mockup-follow-btn {
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  margin-left: 0.25rem;
}

.mockup-title-text {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.3;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  font-family: 'Kantumruy Pro', sans-serif !important;
}

.mockup-body-text {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.mockup-comment-box {
  font-size: 0.72rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #e2e8f0;
  margin-top: 2px;
}

.mockup-audio-ticker {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.25rem;
  font-size: 0.7rem;
  color: #cbd5e1;
}

.audio-ticker-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Platform-specific variations */
.social-phone-frame[data-mockup="shorts"] .mockup-avatar {
  background: #ff0000;
}

.social-phone-frame[data-mockup="shorts"] .mockup-follow-btn {
  background: #ff0000;
  border-color: #ff0000;
}

.social-phone-frame[data-mockup="reels"] .mockup-avatar {
  background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af);
}

.social-phone-frame[data-mockup="telegram"] .mockup-avatar {
  background: #229ed9;
}

.social-phone-frame[data-mockup="telegram"] .mockup-action-sidebar {
  display: none;
}

.social-phone-frame[data-mockup="telegram"] .mockup-bottom-overlay {
  padding-right: 1rem;
}

/* =========================================================================
       LIGHT MODE ADAPTATION FOR LIVE MOCKUP STUDIO
       ========================================================================= */
body.theme-light .live-preview-box,
[data-theme="light"] .live-preview-box {
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.06) !important;
}

body.theme-light .mockup-platform-switcher,
[data-theme="light"] .mockup-platform-switcher {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
}

body.theme-light .mockup-tab-btn,
[data-theme="light"] .mockup-tab-btn {
  color: #475569 !important;
}

body.theme-light .mockup-tab-btn:hover,
[data-theme="light"] .mockup-tab-btn:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

body.theme-light .mockup-tab-btn.active,
[data-theme="light"] .mockup-tab-btn.active {
  background: linear-gradient(135deg, #0284c7, #06b6d4) !important;
  border-color: #0284c7 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3) !important;
}

body.theme-light .social-phone-frame,
[data-theme="light"] .social-phone-frame {
  border: 4px solid #cbd5e1 !important;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.05) !important;
}

/* =========================================================================
       TAB 2: SOCIAL ACCOUNTS GRID (8 PLATFORMS)
       ========================================================================= */
.platforms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.platform-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.platform-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.platform-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.platform-logo {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.yt-badge {
  background: #ff0000;
}

.tt-badge {
  background: #000;
  border: 1px solid #333;
}

.ig-badge {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.fb-badge {
  background: #1877f2;
}

.fbp-badge {
  background: #0866ff;
}

.tw-badge {
  background: #000;
  border: 1px solid #333;
}

.li-badge {
  background: #0a66c2;
}

.tg-badge {
  background: #229ed9;
}

.platform-name {
  font-size: 1.02rem;
  font-weight: 700;
  color: #fff;
}

.platform-user {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-top: 2px;
}

.platform-status {
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* =========================================================================
       TAB 3: DASHBOARD & KPIS
       ========================================================================= */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.metric-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.metric-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-value {
  font-size: 2.1rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fff;
  line-height: 1.1;
  margin: 0.2rem 0;
}

.metric-sub {
  font-size: 0.76rem;
  color: var(--text-faint);
}

.terminal-box {
  background: #05070d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #38bdf8;
  max-height: 280px;
  overflow-y: auto;
  line-height: 1.6;
}

.log-line {
  display: flex;
  gap: 0.65rem;
  padding: 0.15rem 0;
}

.log-time {
  color: var(--text-faint);
  flex-shrink: 0;
}

/* =========================================================================
       TAB 4: QUEUE & POSTS LIST
       ========================================================================= */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.post-item {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  transition: all 0.2s ease;
}

.post-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.post-details {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.post-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.post-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-PUBLISHED {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-SCHEDULED {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-PROCESSING {
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.35);
}

.badge-FAILED {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

/* Toast Notifications */
#toast,
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  padding: 0.95rem 1.5rem;
  background: rgba(15, 23, 42, 0.95);
  color: #ffffff;
  border-radius: 14px;
  border: 1.5px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.75), 0 0 18px rgba(56, 189, 248, 0.35);
  display: none;
  z-index: 9999999 !important;
  font-size: 0.94rem;
  font-weight: 600;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: auto;
  animation: slideInToast 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  max-width: calc(100vw - 40px);
}

#toast.show,
.toast.show {
  display: flex !important;
  align-items: center !important;
  opacity: 1 !important;
  visibility: visible !important;
}

body.theme-light #toast,
body.theme-light .toast {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1.5px solid rgba(14, 165, 233, 0.5) !important;
  box-shadow: 0 12px 30px -4px rgba(15, 23, 42, 0.18), 0 0 16px rgba(14, 165, 233, 0.2) !important;
}

@keyframes slideInToast {
  from {
    transform: translateY(20px) scale(0.95);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  inset: 0;
  background: rgba(4, 7, 15, 0.88);
  backdrop-filter: blur(14px);
  z-index: 99999999 !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.open,
.modal-overlay.active,
#auth-modal.open,
#auth-modal.active {
  display: flex !important;
}

.modal-dialog {
  background: #0f1523;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalZoomIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalZoomIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-header {
  padding: 1.25rem 1.6rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.settings-nav {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
  padding: 0.4rem 1rem 0;
  gap: 0.35rem;
}

.settings-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1rem;
  border-radius: 8px 8px 0 0;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.settings-nav-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.settings-nav-tab.active {
  color: #fff;
  background: #151d30;
  border-top: 2px solid var(--accent-primary);
}

.settings-body {
  padding: 1.6rem;
  overflow-y: auto;
  flex: 1;
}

.settings-tab-panel {
  display: none;
}

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

.settings-help-box {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.84rem;
  line-height: 1.6;
  color: #cbd5e1;
  margin-bottom: 1.2rem;
}

.input-password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-password-wrapper input {
  padding-right: 2.8rem;
}

.toggle-visibility-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.05rem;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.toggle-visibility-btn:hover {
  opacity: 1;
}

.connection-test-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.test-result-box {
  margin-top: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  display: none;
}

.test-result-box.success {
  display: block;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.test-result-box.error {
  display: block;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.test-result-box.loading {
  display: block;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #818cf8;
}

.modal-footer {
  padding: 1.2rem 1.6rem;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* =========================================================================
       FOOTER (SaaS ENTERPRISE GRADE)
       ========================================================================= */
footer.app-footer {
  background: linear-gradient(180deg, rgba(10, 16, 32, 0.98) 0%, rgba(4, 7, 16, 1) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1.5px solid rgba(56, 189, 248, 0.25);
  margin-top: 5rem;
  padding: 4rem 2.5rem 2.5rem;
  position: relative;
  z-index: 20;
  box-shadow: 0 -12px 45px rgba(0, 0, 0, 0.6);
}

footer.app-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #06b6d4 0%, #6366f1 25%, #a855f7 50%, #ec4899 75%, #10b981 100%);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.6);
}

.footer-container {
  max-width: 1540px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1.3fr 1fr;
  gap: 2.8rem;
  padding-bottom: 2.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-col-brand .footer-brand-title {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  margin-bottom: 1.25rem;
}

.footer-brand-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0284c7 0%, #6366f1 50%, #a855f7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.45);
  flex-shrink: 0;
}

.footer-brand-icon svg {
  width: 24px;
  height: 24px;
  fill: #fff;
}

.footer-brand-title h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
  line-height: 1.25;
}

.footer-brand-title h3 span {
  background: linear-gradient(135deg, #38bdf8 0%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.footer-sub {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-top: 4px;
  font-weight: 500;
}

.footer-desc {
  font-size: 1.02rem;
  color: #cbd5e1;
  line-height: 1.82;
  margin-bottom: 1.5rem;
}

.footer-system-status {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 1.15rem;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-size: 0.92rem;
  color: #34d399;
  font-weight: 600;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.2);
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulseAnimation 2s infinite ease-in-out;
}

.footer-heading {
  font-size: 1.12rem;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tech-badge-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.tech-badge-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.7rem 0.95rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.tech-badge-item:hover {
  background: rgba(26, 38, 70, 0.85);
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.tech-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}

.tech-badge-item strong {
  display: block;
  font-size: 0.94rem;
  color: #f8fafc;
  line-height: 1.35;
  font-weight: 600;
}

.tech-badge-item small {
  display: block;
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.3;
  margin-top: 2px;
}

.footer-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.footer-nav-list a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.98rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0;
  transition: all 0.2s ease;
  cursor: pointer;
}

.footer-nav-list a:hover {
  color: #38bdf8;
  transform: translateX(5px);
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.45);
}

.footer-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.footer-copyright {
  font-size: 0.94rem;
  color: #94a3b8;
}

.footer-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pill-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.22rem 0.65rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
}

@media (max-width: 960px) {
  header.app-header {
    height: auto;
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .app-navbar {
    top: auto;
  }

  .header-controls {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .tech-badge-list {
    grid-template-columns: 1fr;
  }

  .footer-bottom-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* =========================================================================
       THEME SYSTEM (LIGHT & DARK MODE)
       ========================================================================= */
body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

header.app-header,
.app-navbar,
footer.app-footer,
.panel-card,
.metric-card,
.platform-card,
.btn,
.modal-dialog,
.target-label {
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}

.theme-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.42rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.theme-switch-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.telegram-panel {
  border: 1px solid rgba(34, 158, 217, 0.35);
  background: radial-gradient(circle at 10% 10%, rgba(34, 158, 217, 0.12) 0%, rgba(14, 20, 34, 0.85) 100%);
}

/* -------------------------------------------------------------------------
       LIGHT MODE OVERRIDES
       ------------------------------------------------------------------------- */
/* =========================================================================
       COMPLETE CONSISTENT THEME CONTRAST ENGINE (DARK & LIGHT MODE)
       ========================================================================= */

/* -------------------------------------------------------------------------
       1. DARK MODE (DEFAULT HIGH-CONTRAST DARK THEME)
       ------------------------------------------------------------------------- */
body:not(.theme-light) {
  --bg-base: #06080e;
  --bg-card: #070e1c;
  --bg-card-hover: #0c162b;
  --bg-elevated: #0f1c36;
  --bg-input: #0c1527;
  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-hover: rgba(6, 182, 212, 0.5);
  --border-focus: #06b6d4;
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;
  --text-faint: #64748b;
  color: #f8fafc;
}

body:not(.theme-light) .form-input,
body:not(.theme-light) .form-textarea,
body:not(.theme-light) .form-select {
  background: #0c1527 !important;
  color: #f8fafc !important;
  border: 1.5px solid rgba(6, 182, 212, 0.28) !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4) !important;
}

body:not(.theme-light) .form-input:focus,
body:not(.theme-light) .form-textarea:focus,
body:not(.theme-light) .form-select:focus {
  background: #101c33 !important;
  border-color: #06b6d4 !important;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.28) !important;
}

body:not(.theme-light) .form-input::placeholder,
body:not(.theme-light) .form-textarea::placeholder {
  color: #64748b !important;
}

body:not(.theme-light) .form-label {
  color: #cbd5e1 !important;
  font-weight: 600 !important;
}

body:not(.theme-light) .panel-card-title {
  color: #ffffff !important;
  font-weight: 700 !important;
}

body:not(.theme-light) .portal-action-bar {
  background: rgba(7, 14, 28, 0.85) !important;
  border: 1px solid rgba(6, 182, 212, 0.25) !important;
}

body:not(.theme-light) .portal-action-bar .btn-secondary {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #e2e8f0 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
}

body:not(.theme-light) .portal-action-bar .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}

body:not(.theme-light) .dropzone {
  background: rgba(255, 255, 255, 0.02) !important;
  border: 2px dashed rgba(6, 182, 212, 0.35) !important;
}

body:not(.theme-light) .dropzone:hover {
  background: rgba(6, 182, 212, 0.06) !important;
  border-color: #22d3ee !important;
}

body:not(.theme-light) .dropzone strong {
  color: #ffffff !important;
}

body:not(.theme-light) .dropzone p {
  color: #94a3b8 !important;
}

body:not(.theme-light) .target-label {
  background: rgba(15, 23, 42, 0.75) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.1) !important;
  color: #cbd5e1 !important;
  justify-content: center !important;
  text-align: center !important;
}

body:not(.theme-light) .target-label:hover {
  background: rgba(30, 41, 59, 0.85) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

/* Platform Brand Glows & Active Highlights in Dark Mode (Single Logo Symbol) */
body:not(.theme-light) #target-yt:checked+label {
  border: 2px solid #ef4444 !important;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.24), rgba(15, 23, 42, 0.9)) !important;
  color: #ffffff !important;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.4), inset 0 0 12px rgba(239, 68, 68, 0.1) !important;
}

body:not(.theme-light) #target-tt:checked+label {
  border: 2px solid #25f4ee !important;
  background: linear-gradient(135deg, rgba(37, 244, 238, 0.2), rgba(254, 9, 121, 0.18)) !important;
  color: #ffffff !important;
  box-shadow: 0 0 18px rgba(37, 244, 238, 0.4), 0 0 10px rgba(254, 9, 121, 0.3) !important;
}

body:not(.theme-light) #target-ig:checked+label {
  border: 2px solid #e1306c !important;
  background: linear-gradient(135deg, rgba(225, 48, 108, 0.24), rgba(245, 133, 41, 0.18)) !important;
  color: #ffffff !important;
  box-shadow: 0 0 18px rgba(225, 48, 108, 0.4) !important;
}

body:not(.theme-light) #target-fb:checked+label {
  border: 2px solid #1877f2 !important;
  background: linear-gradient(135deg, rgba(24, 119, 242, 0.24), rgba(15, 23, 42, 0.9)) !important;
  color: #ffffff !important;
  box-shadow: 0 0 18px rgba(24, 119, 242, 0.4) !important;
}

body:not(.theme-light) #target-fbp:checked+label {
  border: 2px solid #0866ff !important;
  background: linear-gradient(135deg, rgba(8, 102, 255, 0.24), rgba(15, 23, 42, 0.9)) !important;
  color: #ffffff !important;
  box-shadow: 0 0 18px rgba(8, 102, 255, 0.4) !important;
}

body:not(.theme-light) #target-tw:checked+label {
  border: 2px solid #e2e8f0 !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(15, 23, 42, 0.9)) !important;
  color: #ffffff !important;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.3) !important;
}

body:not(.theme-light) #target-li:checked+label {
  border: 2px solid #0a66c2 !important;
  background: linear-gradient(135deg, rgba(10, 102, 194, 0.26), rgba(15, 23, 42, 0.9)) !important;
  color: #ffffff !important;
  box-shadow: 0 0 18px rgba(10, 102, 194, 0.4) !important;
}

body:not(.theme-light) #target-tg:checked+label {
  border: 2px solid #229ed9 !important;
  background: linear-gradient(135deg, rgba(34, 158, 217, 0.26), rgba(15, 23, 42, 0.9)) !important;
  color: #ffffff !important;
  box-shadow: 0 0 18px rgba(34, 158, 217, 0.4) !important;
}

body:not(.theme-light) .link-config-card {
  background: rgba(8, 15, 30, 0.8) !important;
  border: 1px solid rgba(6, 182, 212, 0.25) !important;
}

body:not(.theme-light) .link-config-card strong {
  color: #ffffff !important;
}

body:not(.theme-light) .link-config-card p {
  color: #94a3b8 !important;
}

body:not(.theme-light) .placement-card {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body:not(.theme-light) .placement-title {
  color: #ffffff !important;
}

body:not(.theme-light) .placement-desc {
  color: #94a3b8 !important;
}

body:not(.theme-light) .cta-chip {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
}

body:not(.theme-light) .cta-chip:hover {
  background: rgba(6, 182, 212, 0.22) !important;
  border-color: #06b6d4 !important;
  color: #ffffff !important;
}

/* -------------------------------------------------------------------------
       2. LIGHT MODE (PREMIUM, CRISP HIGH-CONTRAST LIGHT THEME)
       ------------------------------------------------------------------------- */
body.theme-light {
  --bg-base: #ebf1f7;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-elevated: #ffffff;
  --bg-input: #ffffff;
  --border-subtle: #dbe4ee;
  --border-hover: #0284c7;
  --border-focus: #0284c7;
  --text-main: #0f172a;
  --text-muted: #1e293b;
  --text-dim: #475569;
  --text-faint: #64748b;
  background-color: #ebf1f7 !important;
  background-image:
    radial-gradient(circle at 12% 10%, rgba(14, 165, 233, 0.10) 0%, transparent 45%),
    radial-gradient(circle at 88% 15%, rgba(99, 102, 241, 0.07) 0%, transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(14, 165, 233, 0.05) 0%, transparent 55%) !important;
  color: #0f172a !important;
}

/* Header in Light Mode - Floating Island Frame with Crisp Cyan Accent */
body.theme-light .portal-header-bar {
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfe 100%) !important;
  border: 1.5px solid rgba(14, 165, 233, 0.42) !important;
  border-radius: 20px !important;
  box-shadow: 0 10px 28px -6px rgba(15, 23, 42, 0.10), 0 4px 16px rgba(14, 165, 233, 0.15), inset 0 1px 0 #ffffff !important;
}

body.theme-light .portal-header-bar::before {
  opacity: 0.95;
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.45) !important;
}

/* Brand Logo, Title & Subtitle in Light Mode (High Contrast & Luxury Aesthetic) */
body.theme-light .portal-brand-title,
[data-theme="light"] .portal-brand-title {
  background: linear-gradient(135deg, #091e42 0%, #0369a1 55%, #4f46e5 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: #091e42 !important;
  letter-spacing: -0.015em !important;
  text-shadow: none !important;
  filter: drop-shadow(0 1px 1.5px rgba(9, 30, 66, 0.12)) !important;
}

body.theme-light .portal-brand-badge,
[data-theme="light"] .portal-brand-badge {
  background: linear-gradient(135deg, #0284c7 0%, #4f46e5 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35), 0 1px 2px rgba(15, 23, 42, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.6) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25) !important;
}

body.theme-light .portal-brand-sub,
[data-theme="light"] .portal-brand-sub {
  color: #334155 !important;
  font-weight: 600 !important;
  opacity: 0.95 !important;
  letter-spacing: 0.01em !important;
  text-shadow: none !important;
}

body.theme-light .portal-logo-img,
[data-theme="light"] .portal-logo-img {
  border: 2px solid rgba(2, 132, 199, 0.45) !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.2), 0 1px 3px rgba(15, 23, 42, 0.08) !important;
  filter: drop-shadow(0 2px 6px rgba(2, 132, 199, 0.2)) !important;
}

body.theme-light .portal-brand:hover .portal-logo-img,
[data-theme="light"] .portal-brand:hover .portal-logo-img {
  border-color: #0284c7 !important;
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.35) !important;
  filter: drop-shadow(0 4px 12px rgba(2, 132, 199, 0.35)) !important;
}

body.theme-light .burger-menu-trigger-btn,
[data-theme="light"] .burger-menu-trigger-btn {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06) !important;
}

body.theme-light .burger-icon-bar,
[data-theme="light"] .burger-icon-bar {
  background: #0284c7 !important;
  box-shadow: none !important;
}

body.theme-light .burger-menu-trigger-btn:hover,
[data-theme="light"] .burger-menu-trigger-btn:hover {
  background: #f0f9ff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.22) !important;
}

body.theme-light .burger-menu-trigger-btn:hover .burger-icon-bar,
[data-theme="light"] .burger-menu-trigger-btn:hover .burger-icon-bar {
  background: #0369a1 !important;
}

body.theme-light .portal-nav-pill {
  color: #475569 !important;
  border: 1px solid transparent !important;
}

body.theme-light .portal-nav-pill:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

body.theme-light .portal-nav-pill.active {
  background: linear-gradient(135deg, #0284c7, #06b6d4) !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3) !important;
}

body.theme-light .portal-nav-icon-btn {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

body.theme-light .portal-nav-icon-btn:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

body.theme-light .portal-greeting-bar {
  color: #475569 !important;
}

body.theme-light .portal-greeting-name {
  color: #0284c7 !important;
}

/* Action Controller Bar in Light Mode */
body.theme-light .portal-action-bar {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05) !important;
}

body.theme-light .portal-action-bar .btn-secondary {
  background: #f8fafc !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
}

body.theme-light .portal-action-bar .btn-secondary:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

body.theme-light .portal-action-bar .status-pill {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

/* Cards & Panels in Light Mode */
body.theme-light .panel-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 20px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
}

body.theme-light .panel-card:hover {
  border-color: #cbd5e1 !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08) !important;
}

body.theme-light .panel-card-header {
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

body.theme-light .panel-card-title {
  color: #0f172a !important;
  font-weight: 700 !important;
}

/* High Contrast Badges in Light Mode */
body.theme-light .card-pill-cyan {
  background: rgba(2, 132, 199, 0.12) !important;
  border: 1px solid rgba(2, 132, 199, 0.45) !important;
  color: #0369a1 !important;
  box-shadow: 0 1px 4px rgba(2, 132, 199, 0.12) !important;
}

body.theme-light .card-pill-purple {
  background: rgba(147, 51, 234, 0.12) !important;
  border: 1px solid rgba(147, 51, 234, 0.45) !important;
  color: #7e22ce !important;
  box-shadow: 0 1px 4px rgba(147, 51, 234, 0.12) !important;
}

body.theme-light .hero-pill-badge {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(16, 185, 129, 0.5) !important;
  color: #047857 !important;
  box-shadow: 0 1px 4px rgba(16, 185, 129, 0.12) !important;
}

/* Form Fields & Labels in Light Mode */
body.theme-light .form-label {
  color: #1e293b !important;
  font-weight: 600 !important;
}

body.theme-light .form-label span.required {
  color: #e11d48 !important;
}

body.theme-light .form-input,
body.theme-light .form-textarea,
body.theme-light .form-select {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

body.theme-light .form-input:focus,
body.theme-light .form-textarea:focus,
body.theme-light .form-select:focus {
  background: #ffffff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2) !important;
}

body.theme-light .form-input::placeholder,
body.theme-light .form-textarea::placeholder {
  color: #94a3b8 !important;
}

/* Buttons in Light Mode */
body.theme-light .btn-secondary {
  background: #f8fafc !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
}

body.theme-light .btn-secondary:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

/* Video Source Tabs in Light Mode */
body.theme-light .source-tabs {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
}

body.theme-light .source-tab-btn {
  color: #475569 !important;
}

body.theme-light .source-tab-btn.active {
  background: #ffffff !important;
  color: #0284c7 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
}

/* Dropzone in Light Mode */
body.theme-light .dropzone {
  background: #f8fafc !important;
  border: 2px dashed #cbd5e1 !important;
}

body.theme-light .dropzone:hover {
  background: #f0fdfa !important;
  border-color: #06b6d4 !important;
}

body.theme-light .dropzone strong {
  color: #0f172a !important;
}

body.theme-light .dropzone p {
  color: #64748b !important;
}

body.theme-light .dropzone-icon {
  color: #0284c7 !important;
}

/* Target Selector in Light Mode (Authentic Platform Brand Identities) */
body.theme-light .target-label {
  background: #ffffff !important;
  color: #334155 !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04) !important;
  justify-content: center !important;
  text-align: center !important;
}

body.theme-light .target-label:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08) !important;
}

body.theme-light label[for="target-tw"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230f172a'%3E%3Cpath d='M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z'/%3E%3C/svg%3E") !important;
}

body.theme-light #target-yt:checked+label {
  background: #fff1f2 !important;
  border: 2px solid #dc2626 !important;
  color: #991b1b !important;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.22) !important;
}

body.theme-light #target-tt:checked+label {
  background: #f0fdfa !important;
  border: 2px solid #0891b2 !important;
  color: #0f172a !important;
  box-shadow: 0 4px 14px rgba(8, 145, 178, 0.22) !important;
}

body.theme-light #target-ig:checked+label {
  background: #fdf2f8 !important;
  border: 2px solid #db2777 !important;
  color: #831843 !important;
  box-shadow: 0 4px 14px rgba(219, 39, 119, 0.22) !important;
}

body.theme-light #target-fb:checked+label {
  background: #eff6ff !important;
  border: 2px solid #1877f2 !important;
  color: #1e40af !important;
  box-shadow: 0 4px 14px rgba(24, 119, 242, 0.22) !important;
}

body.theme-light #target-fbp:checked+label {
  background: #eff6ff !important;
  border: 2px solid #0866ff !important;
  color: #1e40af !important;
  box-shadow: 0 4px 14px rgba(8, 102, 255, 0.22) !important;
}

body.theme-light #target-tw:checked+label {
  background: #f8fafc !important;
  border: 2px solid #0f172a !important;
  color: #0f172a !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18) !important;
}

body.theme-light #target-li:checked+label {
  background: #f0f9ff !important;
  border: 2px solid #0a66c2 !important;
  color: #075985 !important;
  box-shadow: 0 4px 14px rgba(10, 102, 194, 0.22) !important;
}

body.theme-light #target-tg:checked+label {
  background: #f0f9ff !important;
  border: 2px solid #229ed9 !important;
  color: #0369a1 !important;
  box-shadow: 0 4px 14px rgba(34, 158, 217, 0.22) !important;
}

body.theme-light button[data-i18n="btnSelectAll"] {
  background: #f0fdf4 !important;
  border: 1px solid #bbf7d0 !important;
  color: #15803d !important;
}

body.theme-light button[data-i18n="btnDeselectAll"] {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
}

/* Call to Action & Link Settings in Light Mode */
body.theme-light .link-config-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
}

body.theme-light .link-config-card strong {
  color: #0f172a !important;
}

body.theme-light .link-config-card p {
  color: #64748b !important;
}

body.theme-light .link-badge-icon {
  background: #e0f2fe !important;
  color: #0284c7 !important;
}

body.theme-light .cta-hint-label {
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  color: #475569 !important;
}

body.theme-light .cta-chip {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

body.theme-light .cta-chip:hover {
  background: #e0f2fe !important;
  border-color: #38bdf8 !important;
  color: #0369a1 !important;
}

body.theme-light .placement-card {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
}

body.theme-light .placement-title {
  color: #0f172a !important;
}

body.theme-light .placement-desc {
  color: #64748b !important;
}

body.theme-light .placement-option input:checked+.placement-card {
  background: #f0fdfa !important;
  border-color: #0d9488 !important;
}

/* Platform Grid Cards in Light Mode */
body.theme-light .platform-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
}

body.theme-light .platform-name {
  color: #0f172a !important;
}

body.theme-light .platform-user {
  color: #64748b !important;
}

body.theme-light .metric-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
}

body.theme-light .metric-value {
  color: #0f172a !important;
}

body.theme-light .metric-label {
  color: #64748b !important;
}

body.theme-light .post-item {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
}

body.theme-light .post-title {
  color: #0f172a !important;
}

/* Modal & Toast in Light Mode */
body.theme-light .modal-dialog {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.15) !important;
  color: #0f172a !important;
}

body.theme-light .modal-header,
body.theme-light .modal-footer {
  border-color: #e2e8f0 !important;
  background: #f8fafc !important;
}

body.theme-light .modal-header .modal-title>div>div:first-child {
  color: #0f172a !important;
}

body.theme-light .modal-header .modal-title>div>div:last-child {
  color: #64748b !important;
}

body.theme-light .modal-close-btn {
  color: #64748b !important;
}

body.theme-light .modal-close-btn:hover {
  color: #0f172a !important;
  background: #f1f5f9 !important;
}

body.theme-light #toast {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15) !important;
}

/* =========================================================================
       BASE COMPONENT ADDITIONS (MODAL GRIDS & QUICK ACTION BAR)
       ========================================================================= */
.quick-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.85rem;
  background: rgba(99, 102, 241, 0.08);
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(99, 102, 241, 0.35);
}

.form-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-grid-2col.s3-col {
  grid-template-columns: 2fr 1fr;
}

body.theme-light .quick-action-bar {
  background: rgba(99, 102, 241, 0.05);
  border-color: rgba(99, 102, 241, 0.25);
}

body.theme-light .quick-action-bar div {
  color: #334155 !important;
}

/* =========================================================================
       COMPREHENSIVE MOBILE RESPONSIVE ENGINE (360px - 768px+)
       ========================================================================= */
@media (max-width: 960px) {
  header.app-header {
    height: auto;
    padding: 0.75rem 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .app-navbar {
    top: auto;
  }

  .header-controls {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .tech-badge-list {
    grid-template-columns: 1fr;
  }

  .footer-bottom-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  main.app-viewport {
    padding: 1.2rem 1rem 3.5rem;
  }

  .studio-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

@media (max-width: 640px) {

  /* Base Mobile Viewport */
  body {
    font-size: 14px;
  }

  main.app-viewport {
    padding: 0.85rem 0.65rem 3rem;
  }

  /* Compact Mobile Header */
  header.app-header {
    position: relative;
    top: auto;
    padding: 0.65rem 0.75rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }

  .brand-section {
    width: 100%;
    justify-content: flex-start;
    gap: 0.65rem;
  }

  .brand-badge-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
  }

  .brand-badge-icon svg {
    width: 19px;
    height: 19px;
  }

  .brand-info h1 {
    font-size: 0.98rem;
    line-height: 1.2;
  }

  .brand-publisher-tag {
    font-size: 0.58rem;
    padding: 0.1rem 0.4rem;
  }

  .brand-info p {
    font-size: 0.68rem;
    margin-top: 1px;
  }

  .header-controls {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
  }

  .header-status-group {
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0.2rem 0.4rem;
  }

  .status-pill {
    font-size: 0.7rem;
    padding: 0.22rem 0.5rem;
    gap: 0.35rem;
  }

  .header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr) 52px 52px;
    gap: 0.35rem;
  }

  .header-actions .btn-sm {
    padding: 0.42rem 0.25rem !important;
    font-size: 0.74rem !important;
    justify-content: center;
    min-height: 38px;
    gap: 0.25rem !important;
  }

  .header-actions .btn-sm svg {
    width: 13px;
    height: 13px;
  }

  .lang-switch-btn,
  .theme-switch-btn {
    padding: 0.42rem 0.2rem !important;
    font-size: 0.72rem !important;
    justify-content: center;
    min-height: 38px;
  }

  /* Native Touch Mobile Navbar (Sticky Top 0 for Easy Tab Swapping) */
  .app-navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 0.35rem 0.55rem;
    gap: 0.35rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: rgba(7, 10, 18, 0.96);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  }

  body.theme-light .app-navbar {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  }

  .app-navbar::-webkit-scrollbar {
    display: none;
  }

  .main-nav-tab {
    padding: 0.48rem 0.8rem;
    font-size: 0.8rem;
    gap: 0.4rem;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
  }

  .main-nav-tab .tab-icon {
    font-size: 1rem;
  }

  /* Quick Action Bar */
  .quick-action-bar {
    padding: 0.75rem 0.85rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .quick-action-bar>div {
    width: 100%;
    justify-content: center;
  }

  .quick-action-bar button {
    width: 100%;
    justify-content: center;
    font-size: 0.82rem;
    padding: 0.55rem 0.85rem;
  }

  /* Form & Studio Panels */
  .panel-card {
    padding: 1rem 0.85rem;
  }

  .panel-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .panel-card-title {
    font-size: 1rem;
  }

  /* 2-Column Symmetrical Target Grid (Ergonomic Touch Targets) */
  .target-selector {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.45rem !important;
  }

  .target-label {
    padding: 0.55rem 0.35rem;
    font-size: 0.78rem;
    min-height: 42px;
    letter-spacing: -0.01em;
  }

  /* Avoid iOS Auto-Zoom by enforcing 16px font-size */
  .form-input,
  .form-textarea,
  select.form-input {
    font-size: 16px !important;
    padding: 0.7rem 0.85rem;
  }

  .source-tabs {
    width: 100%;
    display: flex;
  }

  .source-tab-btn {
    flex: 1;
    justify-content: center;
    font-size: 0.78rem;
    padding: 0.48rem 0.5rem;
  }

  .dropzone {
    padding: 1.5rem 0.85rem;
  }

  #btn-dispatch-submit {
    font-size: 0.92rem !important;
    padding: 0.85rem 0.75rem !important;
    white-space: normal !important;
    line-height: 1.4;
    text-align: center;
  }

  /* Video Player & Inspection Card */
  .inspect-body {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .video-player-phone {
    max-width: 250px;
    margin: 0 auto;
  }

  .specs-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
  }

  .platform-readiness-box {
    padding: 0.75rem;
  }

  .readiness-badges {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Social Accounts Tab */
  .platforms-grid {
    grid-template-columns: 1fr !important;
    gap: 0.9rem !important;
  }

  .platform-card {
    padding: 1.1rem 1rem;
  }

  /* Dashboard Metrics & KPIs */
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.65rem !important;
    margin-bottom: 1.5rem !important;
  }

  .metric-card {
    padding: 0.85rem 0.8rem;
  }

  .metric-title {
    font-size: 0.74rem;
  }

  .metric-value {
    font-size: 1.42rem !important;
  }

  .metric-sub {
    font-size: 0.68rem;
    line-height: 1.3;
  }

  .terminal-box {
    padding: 0.75rem;
    font-size: 0.74rem;
    max-height: 220px;
  }

  .log-line {
    flex-wrap: wrap;
    word-break: break-all;
  }

  /* Queue & History Items */
  .post-item {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.85rem !important;
    padding: 0.9rem 1rem !important;
  }

  .post-item>div:last-child {
    display: flex;
    justify-content: flex-end;
    width: 100%;
  }

  .post-item>div:last-child button {
    width: 100%;
    justify-content: center;
    padding: 0.5rem !important;
    font-size: 0.82rem !important;
  }

  .post-title {
    font-size: 0.94rem;
    word-break: break-word;
  }

  .post-meta {
    font-size: 0.75rem;
    gap: 0.45rem;
  }

  /* Telegram Alert Hub */
  .telegram-panel .panel-card-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.9rem !important;
  }

  .telegram-panel .panel-card-header>div:last-child {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .telegram-panel .panel-card-header>div:last-child button {
    width: 100%;
    justify-content: center;
  }

  #tg-config-details {
    flex-direction: column !important;
    gap: 0.65rem !important;
    font-size: 0.85rem !important;
  }

  #tg-config-details code {
    word-break: break-all;
  }

  /* Settings Modal */
  .modal-overlay {
    padding: 0.5rem !important;
    align-items: flex-end !important;
  }

  .modal-dialog {
    max-height: 94vh !important;
    border-radius: 18px 18px 10px 10px !important;
    width: 100% !important;
  }

  .modal-header {
    padding: 0.85rem 1rem !important;
  }

  .modal-title h2 {
    font-size: 1rem !important;
  }

  .settings-nav {
    padding: 0.35rem 0.5rem 0 !important;
    gap: 0.25rem !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .settings-nav::-webkit-scrollbar {
    display: none;
  }

  .settings-nav-tab {
    padding: 0.45rem 0.7rem !important;
    font-size: 0.76rem !important;
    flex-shrink: 0;
  }

  .settings-body {
    padding: 1rem 0.85rem !important;
  }

  .form-grid-2col,
  .form-grid-2col.s3-col {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  .connection-test-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.65rem !important;
  }

  .connection-test-bar>div {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
  }

  .connection-test-bar button {
    width: 100% !important;
    justify-content: center !important;
  }

  .modal-footer {
    padding: 0.85rem 1rem !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.6rem !important;
  }

  .modal-footer button {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Footer */
  footer.app-footer {
    margin-top: 2.5rem;
    padding: 2.2rem 1rem 1.8rem;
  }

  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 1.8rem !important;
    padding-bottom: 1.8rem !important;
  }

  .tech-badge-list {
    grid-template-columns: 1fr !important;
  }

  .footer-bottom-bar {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 0.85rem !important;
  }

  .footer-bottom-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  /* Toast Notification */
  #toast {
    left: 14px;
    right: 14px;
    bottom: 16px;
    font-size: 0.84rem;
    padding: 0.75rem 1rem;
    text-align: center;
    justify-content: center;
  }
}

@media (max-width: 420px) {
  .brand-info p {
    display: none;
  }

  .header-actions {
    grid-template-columns: repeat(3, 1fr) 1fr 1fr;
  }

  .metrics-grid {
    grid-template-columns: 1fr !important;
  }

  .target-label {
    font-size: 0.74rem;
    padding: 0.45rem 0.25rem;
  }

  .specs-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================================
       FUTURISTIC AI PORTAL STYLES (MATCHING USER REFERENCE DESIGN)
       ========================================================================= */

/* Top Portal Header Navigation - Floating Island Frame Design */
.portal-header-bar {
  width: calc(100% - 2rem);
  max-width: 1720px;
  margin: 0 auto 1rem auto;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(13, 22, 42, 0.96) 0%, rgba(8, 14, 28, 0.98) 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  padding: 0.85rem 1.85rem;
  position: sticky;
  top: 0;
  z-index: 999;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65), 0 0 20px rgba(56, 189, 248, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: visible !important;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

.portal-header-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #06b6d4 0%, #3b82f6 25%, #8b5cf6 50%, #ec4899 75%, #10b981 100%);
  background-size: 200% auto;
  animation: headerGradientShift 8s ease infinite;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.65);
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  pointer-events: none !important;
}

@keyframes headerGradientShift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.portal-header-content {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

/* Spacious Brand & Burger Navigation Wrapper */
.portal-brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  min-width: 0;
  flex-shrink: 0;
}

@media (max-width: 1450px) {
  .portal-brand-sub {
    display: none !important;
  }
}

/* Burger Menu Trigger Button (=) */
.burger-menu-trigger-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(14, 20, 36, 0.95), rgba(20, 30, 55, 0.9));
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 12px rgba(6, 182, 212, 0.2);
  flex-shrink: 0;
}

.burger-menu-trigger-btn:hover {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.35), rgba(99, 102, 241, 0.35));
  border-color: #38bdf8;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.45);
}

.burger-menu-trigger-btn.active {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border-color: #38bdf8;
}

.burger-icon-bar {
  display: block;
  width: 22px;
  height: 2.5px;
  border-radius: 4px;
  background: #38bdf8;
  transition: all 0.25s ease;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.6);
}

.burger-menu-trigger-btn:hover .burger-icon-bar {
  background: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

/* Brand Logo & Name */
.portal-brand {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
}

.portal-logo-svg,
.portal-logo-img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  filter: drop-shadow(0 0 16px rgba(6, 182, 212, 0.65));
  border: 1.5px solid rgba(56, 189, 248, 0.5);
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.portal-brand:hover .portal-logo-img,
.portal-brand:hover .portal-logo-svg {
  transform: scale(1.08) rotate(-2deg);
  filter: drop-shadow(0 0 22px rgba(56, 189, 248, 0.95));
  border-color: #38bdf8;
}

.portal-brand-text-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.portal-brand-title-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.portal-brand-title {
  font-size: 1.68rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 20%, #38bdf8 65%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.15;
  font-family: var(--font-khmer), var(--font-primary);
  text-shadow: 0 0 24px rgba(56, 189, 248, 0.35);
}

.portal-brand-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: linear-gradient(135deg, #0284c7 0%, #6366f1 100%);
  color: #ffffff;
  text-transform: uppercase;
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.4);
  line-height: 1;
  display: inline-block;
}

.portal-brand-sub {
  font-size: 0.82rem;
  color: #cbd5e1;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.2;
}

/* Direct Header Tool Action Buttons */
/* Direct Header Tool Action Buttons (Circular Icons) */
.btn-header-api,
.btn-header-api-icon {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  padding: 0 !important;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(168, 85, 247, 0.3));
  border: 1.5px solid rgba(168, 85, 247, 0.55);
  color: #ffffff;
  font-size: 1.12rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
  flex-shrink: 0;
}

.btn-header-api:hover,
.btn-header-api-icon:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.45), rgba(168, 85, 247, 0.55));
  border-color: #c084fc;
  transform: translateY(-2px) scale(1.08);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.6);
}

.btn-header-test,
.btn-header-test-icon {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  padding: 0 !important;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.22), rgba(244, 63, 94, 0.28));
  border: 1.5px solid rgba(244, 63, 94, 0.55);
  color: #fecdd3;
  font-size: 1.12rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 10px rgba(244, 63, 94, 0.3);
  flex-shrink: 0;
}

.btn-header-test:hover,
.btn-header-test-icon:hover {
  background: linear-gradient(135deg, #f43f5e 0%, #ec4899 100%);
  color: #ffffff;
  border-color: #f43f5e;
  transform: translateY(-2px) scale(1.08);
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.6);
}

.header-status-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.45rem !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  padding: 0 0.85rem !important;
  border-radius: 9999px !important;
  background: rgba(16, 185, 129, 0.12) !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
  color: #34d399 !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

/* Off-Canvas Burger Menu Drawer */
.burger-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 7, 16, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}

.burger-drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

.burger-menu-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 420px;
  max-width: 90vw;
  height: 100vh;
  background: linear-gradient(180deg, #090e1c 0%, #050813 100%);
  border-right: 1.5px solid rgba(56, 189, 248, 0.3);
  z-index: 999999;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 12px 0 45px rgba(0, 0, 0, 0.8), 0 0 35px rgba(6, 182, 212, 0.2);
  overflow: hidden;
}

.burger-menu-drawer.open {
  transform: translateX(0);
}

.burger-drawer-header {
  padding: 1.3rem 1.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(14, 20, 36, 0.85);
}

/* Live Cluster / Redis Status Card inside Burger Menu Drawer */
.burger-drawer-status-card {
  margin: 0.85rem 1.4rem 0.25rem 1.4rem;
  padding: 0.7rem 1rem;
  border-radius: 14px;
  background: rgba(16, 185, 129, 0.08);
  border: 1.5px solid rgba(16, 185, 129, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  transition: all 0.25s ease;
  box-sizing: border-box;
}

.burger-drawer-status-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.3;
}

.burger-drawer-status-sub {
  font-size: 0.68rem;
  color: #94a3b8;
  line-height: 1.25;
}

#redis-drawer-badge {
  padding: 0.25rem 0.65rem;
  font-size: 0.74rem;
  font-weight: 700;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.45);
  white-space: nowrap;
  flex-shrink: 0;
}

body.theme-light .burger-drawer-status-card,
[data-theme="light"] .burger-drawer-status-card {
  background: #ecfdf5 !important;
  border-color: #6ee7b7 !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1) !important;
}

body.theme-light .burger-drawer-status-title,
[data-theme="light"] .burger-drawer-status-title {
  color: #065f46 !important;
}

body.theme-light .burger-drawer-status-sub,
[data-theme="light"] .burger-drawer-status-sub {
  color: #047857 !important;
}

body.theme-light #redis-drawer-badge,
[data-theme="light"] #redis-drawer-badge {
  background: #d1fae5 !important;
  border-color: #10b981 !important;
  color: #047857 !important;
}

.burger-drawer-body {
  padding: 1.25rem 1.4rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.burger-drawer-section-title {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #38bdf8;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.burger-drawer-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
  font-family: inherit;
  margin-bottom: 0.4rem;
}

.burger-drawer-item:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateX(4px);
  color: #ffffff;
}

.burger-drawer-item.active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.35), rgba(99, 102, 241, 0.35));
  border-color: #38bdf8;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.35);
}

.burger-drawer-item-icon {
  font-size: 1.35rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.burger-drawer-item-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
}

.burger-drawer-item-sub {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 2px;
  line-height: 1.2;
}

.burger-drawer-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.1rem;
}

.burger-drawer-close-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ffffff;
  transform: rotate(90deg);
}

/* Center Pill Navigation */
.portal-nav-center {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: nowrap;
  justify-content: center;
  overflow: visible;
}

.portal-nav-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #cbd5e1;
  font-size: 1.02rem;
  font-weight: 600;
  padding: 0.52rem 1.15rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-khmer), var(--font-primary);
  text-decoration: none;
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.portal-nav-pill:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.22);
}

.portal-nav-pill.active {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 50%, #7c3aed 100%);
  border-color: rgba(56, 189, 248, 0.65);
  color: #ffffff;
  box-shadow: 0 0 22px rgba(37, 99, 235, 0.55), 0 2px 10px rgba(0, 0, 0, 0.35);
  font-weight: 700;
}

.portal-nav-pill .pill-caret {
  font-size: 0.75rem;
  margin-left: 0.25rem;
  transition: transform 0.25s ease;
}

/* Portal Dropdown Navigation Menu */
.portal-dropdown-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.portal-dropdown-wrapper.open .pill-caret,
.portal-dropdown-wrapper:hover .pill-caret {
  transform: rotate(180deg);
}

.portal-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 275px;
  background: #080f1e;
  background: rgba(8, 15, 30, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 14px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.85), 0 0 25px rgba(6, 182, 212, 0.25);
  padding: 0.6rem;
  display: none;
  flex-direction: column;
  gap: 0.35rem;
  z-index: 999999;
  animation: dropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.portal-dropdown-wrapper.open .portal-dropdown-menu,
.portal-dropdown-wrapper:hover .portal-dropdown-menu,
.portal-dropdown-menu.show {
  display: flex !important;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.portal-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.9rem;
  border-radius: 9px;
  color: #cbd5e1;
  font-size: 0.88rem;
  font-weight: 500;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
  width: 100%;
  font-family: inherit;
  white-space: nowrap;
}

.portal-dropdown-item * {
  pointer-events: none;
}

.portal-dropdown-item .dropdown-item-icon {
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
}

.portal-dropdown-item:hover,
.portal-dropdown-item.active {
  background: rgba(6, 182, 212, 0.18);
  color: #22d3ee;
  transform: translateX(3px);
}

.portal-dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0.35rem 0.4rem;
}

body.theme-light .portal-dropdown-menu {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.15);
}

body.theme-light .portal-dropdown-item {
  color: #334155;
}

body.theme-light .portal-dropdown-item:hover {
  background: rgba(6, 182, 212, 0.12);
  color: #0891b2;
}

body.theme-light .portal-dropdown-divider {
  background: rgba(0, 0, 0, 0.08);
}

/* Right Action Toolbar */
.portal-header-right {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.portal-circle-btn {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  max-width: 38px !important;
  max-height: 38px !important;
  border-radius: 50% !important;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 1.05rem;
  line-height: 1;
  padding: 0 !important;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

.portal-circle-btn svg {
  width: 17px !important;
  height: 17px !important;
  flex-shrink: 0 !important;
}

.portal-circle-btn:hover {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(99, 102, 241, 0.3));
  border-color: #38bdf8;
  color: #38bdf8;
  transform: translateY(-2px);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.5);
}

.portal-lang-btn {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  max-width: 38px !important;
  max-height: 38px !important;
  border-radius: 50% !important;
  font-size: 0.82rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.02em;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #34d399;
  border: 1.5px solid rgba(16, 185, 129, 0.45);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.15));
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  transition: all 0.22s ease;
  user-select: none;
  padding: 0 !important;
  box-sizing: border-box !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
  flex-shrink: 0 !important;
}

.portal-lang-btn:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(6, 182, 212, 0.3));
  border-color: #10b981;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.55);
}

.portal-exit-btn {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  max-width: 38px !important;
  max-height: 38px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%) !important;
  border: 1.5px solid rgba(56, 189, 248, 0.6) !important;
  color: #ffffff !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  transition: all 0.22s ease;
  font-size: 1.05rem;
  line-height: 1;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.45) !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

.portal-exit-btn svg {
  width: 17px !important;
  height: 17px !important;
  flex-shrink: 0 !important;
}

.portal-exit-btn:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 0 24px rgba(6, 182, 212, 0.75);
}

.portal-circle-btn.active {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 18px rgba(2, 132, 199, 0.55);
}

.input-pulse {
  animation: cyanPulseRing 1.2s infinite alternate ease-in-out;
  border-color: #22d3ee !important;
}

@keyframes cyanPulseRing {
  0% {
    box-shadow: 0 0 0 rgba(34, 211, 238, 0.2);
  }

  100% {
    box-shadow: 0 0 16px rgba(34, 211, 238, 0.7);
  }
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 9px;
  color: #cbd5e1;
  font-size: 0.86rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.16s ease;
  text-decoration: none;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
}

.search-result-item:hover,
.search-result-item:focus {
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  transform: translateX(3px);
  outline: none;
}

.search-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin: 0.5rem 0 0.25rem 0.35rem;
}



/* Hero Feature Banner */
.hero-feature-card {
  position: relative;
  width: 100%;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(6, 182, 212, 0.35);
  box-shadow: 0 12px 40px -10px rgba(4, 9, 20, 0.8), 0 0 24px rgba(6, 182, 212, 0.15);
  background: #060b17;
  margin-bottom: 1.6rem;
  min-height: 380px;
}

.hero-banner-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
  transition: transform 0.8s ease;
}

.hero-feature-card:hover .hero-banner-img {
  transform: scale(1.02);
}

.hero-banner-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 380px;
  background: linear-gradient(180deg,
      rgba(5, 11, 23, 0.2) 0%,
      rgba(5, 11, 23, 0.55) 40%,
      rgba(5, 11, 23, 0.95) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2.2rem 2.4rem;
  pointer-events: none;
  box-sizing: border-box;
}

.hero-overlay-interactive {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

/* Top Right Equalizer Badge */
.hero-equalizer-badge {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(8, 15, 30, 0.88);
  border: 1px solid rgba(6, 182, 212, 0.45);
  box-shadow: 0 0 18px rgba(6, 182, 212, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  backdrop-filter: blur(8px);
  z-index: 10;
  pointer-events: auto;
}

.hero-eq-bar {
  width: 3px;
  border-radius: 2px;
  background: #22d3ee;
  box-shadow: 0 0 6px #22d3ee;
  animation: eqBounce 1.2s ease-in-out infinite alternate;
}

.hero-eq-bar:nth-child(1) {
  height: 10px;
  animation-delay: 0s;
}

.hero-eq-bar:nth-child(2) {
  height: 20px;
  animation-delay: 0.2s;
}

.hero-eq-bar:nth-child(3) {
  height: 14px;
  animation-delay: 0.4s;
}

.hero-eq-bar:nth-child(4) {
  height: 18px;
  animation-delay: 0.1s;
}

@keyframes eqBounce {
  0% {
    height: 6px;
  }

  50% {
    height: 22px;
  }

  100% {
    height: 10px;
  }
}

/* Hero Pill & Title */
.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(6, 78, 59, 0.7);
  border: 1px solid #10b981;
  color: #6ee7b7;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.35rem 0.95rem;
  border-radius: 9999px;
  width: fit-content;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.hero-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.hero-title-text {
  font-size: 1.85rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  line-height: 1.25;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.8);
  font-family: var(--font-khmer), var(--font-primary);
}

/* =========================================================================
       GLASSMORPHIC LIVE METRIC COUNTERS STRIP (HERO BANNER OPTION 3)
       ========================================================================= */
.hero-metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
  width: 100%;
  position: relative;
  z-index: 10;
}

.hero-metric-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.1rem;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-metric-item:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(15, 23, 42, 0.88);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), 0 0 20px rgba(56, 189, 248, 0.15);
}

.metric-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-icon-wrap.icon-emerald {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.metric-icon-wrap.icon-cyan {
  background: rgba(6, 182, 212, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.35);
}

.metric-icon-wrap.icon-green {
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.metric-icon-wrap.icon-purple {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.metric-live-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: pulseLiveDot 1.6s infinite alternate;
}

@keyframes pulseLiveDot {
  0% {
    transform: scale(0.85);
    box-shadow: 0 0 4px #22c55e;
  }

  100% {
    transform: scale(1.15);
    box-shadow: 0 0 12px #22c55e, 0 0 20px rgba(34, 197, 94, 0.6);
  }
}

.metric-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.metric-value-row {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.metric-num {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  font-family: var(--font-mono, monospace), 'Kantumruy Pro', sans-serif;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.metric-unit {
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
}

.metric-trend {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
}

.metric-trend.trend-up {
  background: rgba(16, 185, 129, 0.22);
  color: #34d399;
}

.metric-badge-turbo {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(59, 130, 246, 0.25));
  color: #38bdf8;
  border: 0.5px solid rgba(56, 189, 248, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-status-live {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(34, 197, 94, 0.22);
  color: #4ade80;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.metric-trend.trend-perfect {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(168, 85, 247, 0.22);
  color: #d8b4fe;
}

.metric-label {
  font-size: 0.74rem;
  color: #cbd5e1;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Light Theme Adaptation for Metric Strip */
body.theme-light .hero-metric-item {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(226, 232, 240, 0.95);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

body.theme-light .hero-metric-item:hover {
  background: #ffffff;
  border-color: #38bdf8;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.15);
}

body.theme-light .hero-metric-item .metric-num {
  color: #0f172a;
}

body.theme-light .hero-metric-item .metric-label {
  color: #475569;
}

body.theme-light .hero-metric-item .metric-unit {
  color: #64748b;
}

@media (max-width: 992px) {
  .hero-metrics-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .hero-metrics-strip {
    grid-template-columns: 1fr;
  }
}

.portal-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1.25rem;
  background: rgba(7, 14, 28, 0.65);
  border: 1px solid rgba(6, 182, 212, 0.22);
  border-radius: 16px;
  backdrop-filter: blur(10px);
}

.hero-action-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

/* Dual Cards with Cyan Glowing Borders */
.studio-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.6rem;
  align-items: start;
}

body:not(.theme-light) .panel-card {
  background: #070e1c !important;
  border: 1px solid rgba(6, 182, 212, 0.4) !important;
  border-radius: 20px !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(6, 182, 212, 0.1) !important;
  overflow: hidden;
  transition: all 0.25s ease;
}

body:not(.theme-light) .panel-card:hover {
  border-color: rgba(6, 182, 212, 0.6) !important;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.5), 0 0 25px rgba(6, 182, 212, 0.18) !important;
}

body:not(.theme-light) .panel-card-header {
  background: rgba(6, 13, 26, 0.8) !important;
  border-bottom: 1px solid rgba(6, 182, 212, 0.25) !important;
  padding: 1.05rem 1.4rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.card-pill-cyan {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid #06b6d4;
  color: #22d3ee;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.22rem 0.75rem;
  border-radius: 9999px;
  letter-spacing: 0.04em;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
}

.card-pill-purple {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid #a855f7;
  color: #d8b4fe;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.22rem 0.75rem;
  border-radius: 9999px;
  letter-spacing: 0.04em;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.25);
}

/* Floating Robot Assistant Widget */
.floating-ai-widget {
  position: fixed;
  right: 14px;
  top: 56%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #071526, #032136);
  border: 2px solid #06b6d4;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.55), inset 0 0 8px rgba(6, 182, 212, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.floating-ai-widget:hover {
  transform: translateY(-50%) scale(1.12);
  border-color: #22d3ee;
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.8), inset 0 0 12px rgba(34, 211, 238, 0.5);
}

.floating-ai-icon {
  font-size: 1.5rem;
  display: inline-block;
  animation: floatRobot 2.5s ease-in-out infinite;
}

@keyframes floatRobot {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-3px);
  }
}

@media (max-width: 1080px) {
  .portal-header-bar {
    width: calc(100% - 1.5rem);
    margin: 0.65rem auto 0.85rem auto;
    border-radius: 18px;
    padding: 0.65rem 1.25rem;
  }

  .portal-header-content {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .portal-nav-center {
    order: 3;
    width: 100%;
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.35rem 0.2rem;
    gap: 0.4rem;
  }

  .portal-nav-center::-webkit-scrollbar {
    display: none;
  }

  .portal-nav-pill {
    flex-shrink: 0;
    font-size: 0.84rem;
    padding: 0.4rem 0.95rem;
  }

  .studio-grid {
    grid-template-columns: 1fr;
  }

  .hero-title-text {
    font-size: 1.4rem;
  }

  .hero-banner-img {
    height: 260px;
  }
}

@media (max-width: 640px) {
  .portal-header-bar {
    width: calc(100% - 1rem);
    margin: 0 auto 0.75rem auto;
    border-radius: 16px;
    padding: 0.55rem 0.85rem;
    top: 0;
  }

  .hero-banner-img {
    height: 220px;
  }

  .hero-title-text {
    font-size: 1.15rem;
  }

  .hero-equalizer-badge {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
  }

  .floating-ai-widget {
    right: 8px;
    width: 40px;
    height: 40px;
  }
}

/* =========================================================================
       AI VIDEO STUDIO & SMART VIDEO EDITOR STYLES
       ========================================================================= */
.ai-mode-toggle-group {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}

body.theme-light .ai-mode-toggle-group {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.ai-mode-pill-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: 'Kantumruy Pro', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ai-mode-pill-btn:hover {
  color: var(--text-main);
}

.ai-mode-pill-btn.active {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.4);
}

.ai-studio-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.75rem;
  margin-top: 1.25rem;
}

@media (max-width: 992px) {
  .ai-studio-grid {
    grid-template-columns: 1fr;
  }
}

.prompt-chips-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.prompt-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  font-family: 'Kantumruy Pro', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.prompt-chip:hover {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

.prompt-chip.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(59, 130, 246, 0.25));
  border-color: #38bdf8;
  color: #38bdf8;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.35);
}

.chip-delete-btn:hover {
  color: #ef4444 !important;
  opacity: 1 !important;
  transform: scale(1.2);
}

body.theme-light .prompt-chip {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #475569;
}

body.theme-light .prompt-chip:hover {
  background: #e0f2fe;
  color: #0284c7;
  border-color: #38bdf8;
}

/* =========================================================================
       AI STUDIO 4-COLUMN ROW ALIGNMENT (GENRE, TEMPLATE, VOICE, SPEED)
       ========================================================================= */
.ai-controls-row-4 {
  display: grid;
  grid-template-columns: 1.35fr 1.08fr 1.15fr 0.85fr;
  gap: 0.85rem;
  margin-top: 1.15rem;
  align-items: end;
}

@media (max-width: 960px) {
  .ai-controls-row-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .ai-controls-row-4 {
    grid-template-columns: 1fr;
  }
}

.ai-ctrl-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ai-ctrl-label-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  height: 26px;
  margin-bottom: 6px;
}

.ai-ctrl-label-wrap .form-label {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.btn-mini-add {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
  line-height: 1.2;
}

.btn-mini-add:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  transform: translateY(-1px);
}

.ai-styled-select {
  width: 100%;
  height: 38px;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: 'Kantumruy Pro', sans-serif;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background-color: rgba(15, 23, 42, 0.85);
  color: #f8fafc;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
  line-height: 1.4;
}

.ai-styled-select:hover {
  border-color: rgba(56, 189, 248, 0.6);
  background-color: rgba(22, 33, 58, 0.95);
}

.ai-styled-select:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2.5px rgba(56, 189, 248, 0.25);
}

.ai-styled-select option {
  background: #0f172a;
  color: #f8fafc;
  padding: 8px 12px;
}

/* Light Theme Styles for 4-Col Row Controls */
body.theme-light .ai-ctrl-label-wrap .form-label {
  color: #1e293b !important;
}

body.theme-light .btn-mini-add {
  color: #0284c7 !important;
  background: #e0f2fe !important;
  border-color: #bae6fd !important;
}

body.theme-light .btn-mini-add:hover {
  background: #bae6fd !important;
  border-color: #0284c7 !important;
}

body.theme-light .ai-styled-select {
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;
}

body.theme-light .ai-styled-select:hover {
  border-color: #94a3b8 !important;
}

body.theme-light .ai-styled-select:focus {
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 2.5px rgba(2, 132, 199, 0.2) !important;
}

body.theme-light .ai-styled-select option {
  background: #ffffff !important;
  color: #0f172a !important;
}

.ai-storyboard-wrapper {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

body.theme-light .ai-storyboard-wrapper {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.ai-storyboard-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.ai-scenes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
}

.ai-scene-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.ai-scene-card:hover {
  border-color: rgba(6, 182, 212, 0.5);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

body.theme-light .ai-scene-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

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

.ai-scene-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ai-scene-num {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(6, 182, 212, 0.2);
  color: var(--accent-cyan);
  padding: 2px 6px;
  border-radius: 4px;
}

.ai-scene-type {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-dim);
}

.ai-scene-duration {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 600;
}

.ai-scene-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 2px;
  display: block;
}

.ai-scene-textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-main);
  font-family: 'Kantumruy Pro', sans-serif;
  font-size: 0.78rem;
  line-height: 1.45;
  padding: 6px 8px;
  resize: vertical;
}

body.theme-light .ai-scene-textarea {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1e293b;
}

.ai-scene-prompt-tag {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 4px;
  line-height: 1.35;
  font-style: italic;
}

/* =========================================================================
       ULTRA-REALISTIC SMARTPHONE HARDWARE STUDIO MOCKUP (PRO MAX CHASSIS)
       ========================================================================= */
.smartphone-preview-wrapper {
  max-width: 326px;
  width: 100%;
  margin: 0 auto;
  padding: 10px;
  background: linear-gradient(145deg, #27272a 0%, #18181b 50%, #202024 100%);
  border-radius: 46px;
  position: relative;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 0 0 2.5px #3f3f46,
    0 0 0 4px #18181b,
    0 24px 60px -12px rgba(0, 0, 0, 0.75),
    0 0 30px rgba(56, 189, 248, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Left Hardware Buttons (Action Button + Volume Rockers) */
.smartphone-preview-wrapper::before {
  content: '';
  position: absolute;
  left: -4.5px;
  top: 85px;
  width: 3.5px;
  height: 24px;
  background: #52525b;
  border-radius: 3px 0 0 3px;
  box-shadow:
    0 38px 0 #52525b,
    0 82px 0 #52525b;
}

/* Right Hardware Button (Power / Siri Key) */
.smartphone-preview-wrapper::after {
  content: '';
  position: absolute;
  right: -4.5px;
  top: 105px;
  width: 3.5px;
  height: 52px;
  background: #52525b;
  border-radius: 0 3px 3px 0;
}

/* Top Hardware Ear Speaker Grill */
.smartphone-speaker-grill {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 3.5px;
  background: #09090b;
  border-radius: 999px;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  z-index: 25;
}

/* Inner Screen Display (Edge-to-Edge Bezel) */
.smartphone-screen {
  width: 100%;
  height: 520px;
  position: relative;
  background: #000000;
  border-radius: 38px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Glass Glare & Specular Reflection Across Screen */
.smartphone-glass-glare {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.02) 28%, transparent 45%);
  pointer-events: none;
  z-index: 12;
  border-radius: 38px;
}

/* Realistic Status Bar */
.smartphone-status-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 7px 18px 4px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 15;
  pointer-events: none;
  color: #ffffff;
}

.phone-status-time {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: #ffffff;
}

/* Dynamic Island Pill with Lens & Mic Reflection */
.phone-dynamic-island {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 7px;
  gap: 5px;
  width: 78px;
  height: 20px;
  background: #000000;
  border-radius: 20px;
  border: 0.5px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.island-camera-lens {
  width: 8px;
  height: 8px;
  background: radial-gradient(circle at 35% 35%, #1e3a5f 0%, #080f1d 70%, #000 100%);
  border-radius: 50%;
  border: 0.5px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 2px rgba(56, 189, 248, 0.6);
}

.island-mic-dot {
  width: 3.5px;
  height: 3.5px;
  background: #0f172a;
  border-radius: 50%;
}

.phone-status-icons {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #ffffff;
}

.phone-net-badge {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.phone-icon-svg {
  color: #ffffff;
  opacity: 0.95;
}

.phone-battery-icon {
  width: 17px;
  height: 9px;
  border: 1.2px solid rgba(255, 255, 255, 0.85);
  border-radius: 2.5px;
  padding: 1px;
  display: flex;
  align-items: center;
  position: relative;
}

.phone-battery-icon::after {
  content: '';
  position: absolute;
  right: -2.5px;
  top: 1.5px;
  width: 1.5px;
  height: 3.5px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 0 1px 1px 0;
}

.phone-battery-level {
  width: 78%;
  height: 100%;
  background: #10b981;
  border-radius: 1px;
}

.smartphone-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ai-screen-badges {
  position: absolute;
  top: 36px;
  left: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 8;
}

.ai-badge-pill {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  letter-spacing: 0.5px;
}

.ai-subtitles-container {
  position: absolute;
  bottom: 60px;
  left: 12px;
  right: 12px;
  z-index: 6;
  display: flex;
  justify-content: center;
  transition: all 0.3s ease;
}

.ai-subtitles-container.pos-safe_bottom {
  bottom: 65px;
  top: auto;
  transform: none;
}

.ai-subtitles-container.pos-center {
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
}

.ai-subtitles-container.pos-lower_third {
  bottom: 24px;
  top: auto;
  transform: none;
}

.ai-subtitle-box {
  font-family: 'Kantumruy Pro', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.45;
  padding: 6px 14px;
  border-radius: 8px;
  text-align: center;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
}

/* Subtitle Style 1: Yellow Glow Karaoke */
.ai-subtitle-box.subtitle-style-yellow {
  background: rgba(0, 0, 0, 0.85);
  color: #ffde00;
  border: 1.5px solid rgba(255, 222, 0, 0.6);
  text-shadow: 0 0 10px rgba(255, 222, 0, 0.6), 2px 2px 0 #000;
  animation: subtitleYellowGlow 1.8s infinite alternate;
}

@keyframes subtitleYellowGlow {
  from {
    transform: scale(1);
    box-shadow: 0 0 8px rgba(255, 222, 0, 0.2);
  }

  to {
    transform: scale(1.02);
    box-shadow: 0 0 18px rgba(255, 222, 0, 0.6);
  }
}

/* Subtitle Style 2: Neon Cyan */
.ai-subtitle-box.subtitle-style-green,
.ai-subtitle-box.subtitle-style-cyan {
  background: rgba(5, 15, 25, 0.85);
  color: #00f2fe;
  border: 1.5px solid rgba(0, 242, 254, 0.6);
  text-shadow: 0 0 10px rgba(0, 242, 254, 0.7), 2px 2px 0 #000;
  animation: subtitleCyanGlow 1.8s infinite alternate;
}

@keyframes subtitleCyanGlow {
  from {
    transform: scale(1);
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.3);
  }

  to {
    transform: scale(1.02);
    box-shadow: 0 0 18px rgba(0, 242, 254, 0.7);
  }
}

/* Subtitle Style 3: TikTok Flame Red Alert */
.ai-subtitle-box.subtitle-style-red {
  background: rgba(20, 5, 10, 0.85);
  color: #ff2a6d;
  border: 1.5px solid rgba(255, 42, 109, 0.6);
  text-shadow: 0 0 10px rgba(255, 42, 109, 0.7), 2px 2px 0 #000;
  animation: subtitleRedGlow 1.8s infinite alternate;
}

@keyframes subtitleRedGlow {
  from {
    transform: scale(1);
    box-shadow: 0 0 8px rgba(255, 42, 109, 0.25);
  }

  to {
    transform: scale(1.02);
    box-shadow: 0 0 18px rgba(255, 42, 109, 0.65);
  }
}

/* Subtitle Style 4: Smart Money Emerald */
.ai-subtitle-box.subtitle-style-emerald {
  background: rgba(2, 25, 15, 0.85);
  color: #00ff88;
  border: 1.5px solid rgba(0, 255, 136, 0.6);
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.7), 2px 2px 0 #000;
  animation: subtitleEmeraldGlow 1.8s infinite alternate;
}

@keyframes subtitleEmeraldGlow {
  from {
    transform: scale(1);
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.25);
  }

  to {
    transform: scale(1.02);
    box-shadow: 0 0 18px rgba(0, 255, 136, 0.65);
  }
}

/* Subtitle Style 5: Classic White */
.ai-subtitle-box.subtitle-style-white {
  background: transparent;
  color: #ffffff;
  border: none;
  font-size: 0.82rem;
  font-weight: 800;
  text-shadow: 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 0 4px 10px rgba(0, 0, 0, 0.9);
  box-shadow: none;
}

/* Subtitle Style 6: Minimal Box */
.ai-subtitle-box.subtitle-style-box {
  background: rgba(0, 0, 0, 0.85);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 5px 16px;
}

/* Kinetic Bounce animation on text change */
.ai-subtitle-box.kinetic-pop {
  animation: kineticBounce 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes kineticBounce {
  0% {
    transform: scale(0.9) translateY(6px);
    opacity: 0.7;
  }

  60% {
    transform: scale(1.06) translateY(-2px);
    opacity: 1;
  }

  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* Brand Watermark Overlay on Smartphone */
.ai-brand-watermark-overlay {
  position: absolute;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  backdrop-filter: blur(6px);
  transition: all 0.25s ease;
}

.ai-brand-watermark-overlay.pos-top-right {
  top: 36px;
  right: 14px;
}

.ai-brand-watermark-overlay.pos-top-left {
  top: 36px;
  left: 14px;
}

.ai-brand-watermark-overlay.pos-bottom-right {
  bottom: 60px;
  right: 12px;
}

.ai-brand-watermark-overlay.pos-none {
  display: none !important;
}

.watermark-logo-mini {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.watermark-text-mini {
  font-size: 0.65rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.4px;
}

.broll-indicator {
  color: var(--accent-cyan);
  font-weight: 600;
}

.sound-wave-bars {
  position: absolute;
  bottom: 6px;
  right: 12px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  z-index: 5;
}

.wave-bar {
  width: 3px;
  height: 100%;
  background: var(--accent-cyan);
  border-radius: 1px;
  animation: wavePulse 1.2s infinite ease-in-out alternate;
}

.wave-bar:nth-child(2) {
  animation-delay: 0.2s;
  height: 60%;
}

.wave-bar:nth-child(3) {
  animation-delay: 0.4s;
  height: 80%;
}

.wave-bar:nth-child(4) {
  animation-delay: 0.1s;
  height: 40%;
}

.wave-bar:nth-child(5) {
  animation-delay: 0.5s;
  height: 90%;
}

.wave-bar:nth-child(6) {
  animation-delay: 0.3s;
  height: 50%;
}

@keyframes wavePulse {
  0% {
    transform: scaleY(0.3);
  }

  100% {
    transform: scaleY(1);
  }
}

/* Floating Home Bar Indicator inside Screen Glass */
.smartphone-home-bar-wrap {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 15;
  pointer-events: none;
}

.smartphone-home-indicator {
  width: 110px;
  height: 4px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Light Theme Adaptation for Ultra-Realistic Smartphone Mockup */
body.theme-light .smartphone-preview-wrapper {
  background: linear-gradient(145deg, #e2e8f0 0%, #cbd5e1 50%, #f1f5f9 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.08),
    0 0 0 2.5px #64748b,
    0 0 0 4px #94a3b8,
    0 24px 50px -10px rgba(15, 23, 42, 0.25),
    0 0 25px rgba(2, 132, 199, 0.1);
}

body.theme-light .smartphone-preview-wrapper::before,
body.theme-light .smartphone-preview-wrapper::after {
  background: #64748b;
  box-shadow: 0 38px 0 #64748b, 0 82px 0 #64748b;
}

body.theme-light .smartphone-speaker-grill {
  background: #334155;
  border-color: rgba(0, 0, 0, 0.2);
}

.ai-preview-meta-card {
  max-width: 320px;
  margin: 1rem auto 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}

body.theme-light .ai-preview-meta-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ai-preview-meta-card .meta-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
}

.ai-preview-meta-card .meta-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Video Editor Canvas Monitor */
.editor-file-dropzone {
  border: 2px dashed rgba(6, 182, 212, 0.4);
  background: rgba(6, 182, 212, 0.03);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
}

.editor-file-dropzone:hover {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.08);
  transform: translateY(-1px);
}

body.theme-light .editor-file-dropzone {
  background: #f0fdf4;
  border-color: #38bdf8;
}

.aspect-ratio-selector-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.aspect-ratio-btn {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text-dim);
  font-family: 'Kantumruy Pro', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.aspect-ratio-btn.active,
.aspect-ratio-btn:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

body.theme-light .aspect-ratio-btn {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}

.ratio-box {
  border: 1.5px solid currentColor;
  border-radius: 2px;
  display: inline-block;
}

.ratio-box-vertical {
  width: 10px;
  height: 16px;
}

.ratio-box-horizontal {
  width: 16px;
  height: 10px;
}

.ratio-box-square {
  width: 12px;
  height: 12px;
}

.trimmer-sliders-wrapper {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 14px;
}

body.theme-light .trimmer-sliders-wrapper {
  background: #f8fafc;
  border-color: #e2e8f0;
}

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

.trimmer-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  min-width: 65px;
}

.trim-slider {
  flex: 1;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

.trimmer-val {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-cyan);
  min-width: 35px;
  text-align: right;
}

.filters-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-pill-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  font-family: 'Kantumruy Pro', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-pill-btn.active,
.filter-pill-btn:hover {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  color: #ffffff;
  border-color: transparent;
}

body.theme-light .filter-pill-btn {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
}

.editor-monitor-wrapper {
  background: #09090b;
  border: 2px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.editor-monitor-screen {
  position: relative;
  height: 440px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.editor-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.editor-screen-overlay-badge {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: #38bdf8;
  border: 1.5px solid #0284c7;
  padding: 6px 16px;
  border-radius: 999px;
  font-family: 'Kantumruy Pro', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.editor-monitor-footer {
  padding: 8px 12px;
  background: #18181b;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

/* Video Format & Orientation Router Styles (Responsive Light & Dark Mode) */
.video-format-router-card {
  border: 1.5px solid rgba(56, 189, 248, 0.18);
  background: rgba(15, 23, 42, 0.75);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: all 0.25s ease;
}

.router-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.router-badge-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.router-card-title {
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  display: block;
}

.router-card-sub {
  font-size: 0.76rem;
  color: #94a3b8;
  margin-top: 2px;
  line-height: 1.35;
}

.format-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-top: 0.95rem;
}

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

.format-mode-option {
  cursor: pointer;
  display: block;
  position: relative;
}

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

.format-mode-card {
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.6);
  border-radius: 11px;
  padding: 0.85rem 0.65rem;
  text-align: center;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  box-sizing: border-box;
}

.format-mode-card:hover {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(30, 41, 59, 0.85);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.format-mode-option input:checked+.format-mode-card {
  border-color: #38bdf8 !important;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.22), rgba(99, 102, 241, 0.18)) !important;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.35), inset 0 0 10px rgba(56, 189, 248, 0.1) !important;
  transform: translateY(-1px);
}

.format-icon-pill {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.2s ease;
}

.format-mode-option input:checked+.format-mode-card .format-icon-pill {
  background: #0284c7;
  color: #ffffff;
  border-color: #38bdf8;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

.format-mode-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f1f5f9;
  font-family: 'Kantumruy Pro', sans-serif !important;
  transition: color 0.2s ease;
}

.format-mode-option input:checked+.format-mode-card .format-mode-title {
  color: #38bdf8;
}

.format-mode-desc {
  font-size: 0.7rem;
  color: #94a3b8;
  line-height: 1.3;
}

/* Smart Routing Banner Alert */
.smart-routing-banner {
  margin-top: 0.95rem;
  padding: 0.85rem 1.05rem;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.25);
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: all 0.25s ease;
}

.smart-routing-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

#smart-routing-summary {
  color: #38bdf8;
  font-weight: 700;
  font-size: 0.82rem;
}

.smart-action-btns {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.btn-transcode-action {
  padding: 0.28rem 0.65rem !important;
  font-size: 0.74rem !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

#btn-quick-to-vertical {
  color: #38bdf8 !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
  background: rgba(56, 189, 248, 0.1) !important;
}

#btn-quick-to-horizontal {
  color: #a78bfa !important;
  border-color: rgba(167, 139, 250, 0.35) !important;
  background: rgba(167, 139, 250, 0.1) !important;
}

#btn-quick-trim {
  color: #f472b6 !important;
  border-color: rgba(244, 114, 182, 0.35) !important;
  background: rgba(244, 114, 182, 0.1) !important;
}

.smart-routing-details {
  font-size: 0.75rem;
  color: #cbd5e1;
  line-height: 1.5;
}

/* =========================================================================
       LIGHT MODE STYLES FOR VIDEO FORMAT ROUTER CARD
       ========================================================================= */
body.theme-light .video-format-router-card,
[data-theme="light"] .video-format-router-card {
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05) !important;
}

body.theme-light .router-card-title,
[data-theme="light"] .router-card-title {
  color: #0f172a !important;
}

body.theme-light .router-card-sub,
[data-theme="light"] .router-card-sub {
  color: #475569 !important;
}

body.theme-light .router-badge-icon,
[data-theme="light"] .router-badge-icon {
  background: #f5f3ff !important;
  color: #7c3aed !important;
  border-color: #ddd6fe !important;
}

body.theme-light .format-mode-card,
[data-theme="light"] .format-mode-card {
  background: #f8fafc !important;
  border: 1.5px solid #cbd5e1 !important;
  color: #334155 !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}

body.theme-light .format-mode-card:hover,
[data-theme="light"] .format-mode-card:hover {
  background: #f1f5f9 !important;
  border-color: #0284c7 !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.15) !important;
}

body.theme-light .format-mode-option input:checked+.format-mode-card,
[data-theme="light"] .format-mode-option input:checked+.format-mode-card {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%) !important;
  border-color: #0284c7 !important;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.22), 0 0 0 1px #0284c7 !important;
}

body.theme-light .format-icon-pill,
[data-theme="light"] .format-icon-pill {
  background: #ffffff !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
}

body.theme-light .format-mode-option input:checked+.format-mode-card .format-icon-pill,
[data-theme="light"] .format-mode-option input:checked+.format-mode-card .format-icon-pill {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
}

body.theme-light .format-mode-title,
[data-theme="light"] .format-mode-title {
  color: #1e293b !important;
}

body.theme-light .format-mode-option input:checked+.format-mode-card .format-mode-title,
[data-theme="light"] .format-mode-option input:checked+.format-mode-card .format-mode-title {
  color: #0369a1 !important;
}

body.theme-light .format-mode-desc,
[data-theme="light"] .format-mode-desc {
  color: #64748b !important;
}

body.theme-light .smart-routing-banner,
[data-theme="light"] .smart-routing-banner {
  background: #f0f9ff !important;
  border: 1px solid #bae6fd !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.08) !important;
}

body.theme-light #smart-routing-summary,
[data-theme="light"] #smart-routing-summary {
  color: #0369a1 !important;
}

body.theme-light .smart-routing-details,
[data-theme="light"] .smart-routing-details {
  color: #334155 !important;
}

body.theme-light .smart-routing-details strong,
[data-theme="light"] .smart-routing-details strong {
  color: #0f172a !important;
}

body.theme-light #btn-quick-to-vertical,
[data-theme="light"] #btn-quick-to-vertical {
  background: #ffffff !important;
  border: 1px solid #7dd3fc !important;
  color: #0284c7 !important;
}

body.theme-light #btn-quick-to-horizontal,
[data-theme="light"] #btn-quick-to-horizontal {
  background: #ffffff !important;
  border: 1px solid #c4b5fd !important;
  color: #7c3aed !important;
}

body.theme-light #btn-quick-trim,
[data-theme="light"] #btn-quick-trim {
  background: #ffffff !important;
  border: 1px solid #f9a8d4 !important;
  color: #db2777 !important;
}

.video-screen.horizontal-mode {
  aspect-ratio: 16 / 9 !important;
  max-width: 100% !important;
  border-radius: 12px !important;
  min-height: 220px !important;
}

.video-player-phone.horizontal-mode {
  width: 100% !important;
  max-width: 480px !important;
  border-radius: 16px !important;
}

/* =========================================================================
       AI AUTO-WRITE WITH AURORA SHIMMER BORDER & GLOW (OPTION 3)
       ========================================================================= */
.btn-ai-auto-write {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.85rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: #ffffff !important;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  border: 1px solid rgba(192, 132, 252, 0.65);
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.35);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  z-index: 1;
}

.btn-ai-auto-write::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg,
      transparent 0deg 280deg,
      rgba(56, 189, 248, 0.7) 310deg,
      rgba(236, 72, 153, 0.7) 335deg,
      rgba(168, 85, 247, 0.85) 360deg);
  animation: auroraRotate 3.5s linear infinite;
  z-index: -1;
  opacity: 0.85;
}

@keyframes auroraRotate {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.btn-ai-auto-write::after {
  content: '';
  position: absolute;
  inset: 1px;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  border-radius: 7px;
  z-index: -1;
  transition: all 0.25s ease;
}

.btn-ai-auto-write:hover {
  transform: translateY(-1.5px) scale(1.02);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.55), 0 0 16px rgba(56, 189, 248, 0.4);
  border-color: #d8b4fe;
}

.btn-ai-auto-write:hover::after {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
}

.btn-ai-auto-write:active {
  transform: translateY(0) scale(0.99);
}

.ai-loading-glow {
  border-color: #a855f7 !important;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.45) !important;
  animation: aiPulseBorder 1.5s infinite ease-in-out;
}

.ai-updated-glow {
  border-color: #10b981 !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.5) !important;
  transition: all 0.5s ease;
}

@keyframes aiPulseBorder {

  0%,
  100% {
    box-shadow: 0 0 6px rgba(168, 85, 247, 0.3);
    border-color: #a855f7;
  }

  50% {
    box-shadow: 0 0 18px rgba(168, 85, 247, 0.7);
    border-color: #c084fc;
  }
}

.pulse-text {
  animation: pulseTextAnim 1.4s infinite ease-in-out;
}

@keyframes pulseTextAnim {

  0%,
  100% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }
}

/* =========================================================================
       CONTENT CALENDAR & VISUAL SCHEDULER STYLES
       ========================================================================= */
.calendar-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

/* Top Stats Row */
.calendar-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}

.cal-stat-card {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s ease;
}

.cal-stat-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.cal-stat-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.cal-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  font-family: "JetBrains Mono", monospace;
}

.cal-stat-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 500;
}

/* Golden Time Slots Banner */
.golden-slots-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(217, 119, 6, 0.04));
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 16px;
  padding: 1rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.08);
}

.golden-slots-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.golden-slots-chips {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.golden-slot-chip {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.golden-slot-chip:hover {
  background: #f59e0b;
  color: #0f172a;
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.5);
}

/* Calendar Toolbar */
.calendar-toolbar {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 1rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.cal-month-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cal-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.cal-nav-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
}

.cal-month-label {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  min-width: 170px;
  text-align: center;
  letter-spacing: 0.01em;
}

.calendar-view-toggles {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.3);
  padding: 3px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.calendar-view-btn {
  padding: 0.4rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  background: transparent;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-view-btn:hover {
  color: var(--text-main);
}

.calendar-view-btn.active {
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

/* Platform Filters Row */
.cal-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 4px;
}

.cal-platform-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.cal-platform-chip:hover {
  border-color: var(--border-hover);
  color: var(--text-main);
}

.cal-platform-chip.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

/* Month Grid Table */
.calendar-grid-card {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}

.calendar-weekdays-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--border-subtle);
}

.calendar-weekday-col {
  padding: 0.75rem 0.5rem;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: rgba(255, 255, 255, 0.02);
}

.calendar-day-cell {
  min-height: 120px;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.6rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: background 0.15s ease;
  cursor: pointer;
  position: relative;
}

.calendar-day-cell:nth-child(7n) {
  border-right: none;
}

.calendar-day-cell.empty {
  background: rgba(0, 0, 0, 0.2);
  cursor: default;
}

.calendar-day-cell:not(.empty):hover {
  background: rgba(56, 189, 248, 0.05);
}

.calendar-day-cell.today {
  background: rgba(6, 182, 212, 0.07);
}

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

.day-number {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-dim);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.day-number.today-badge {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.6);
}

.day-post-count {
  font-size: 0.68rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 1px 6px;
  border-radius: 10px;
}

.day-posts-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

/* Mini Post Card inside day cell */
.mini-post-card {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 3px solid #38bdf8;
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 0.72rem;
  transition: all 0.15s ease;
  cursor: pointer;
}

.mini-post-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  border-color: #38bdf8;
}

.mini-post-card.status-published {
  border-left-color: #10b981;
}

.mini-post-card.status-scheduled {
  border-left-color: #f59e0b;
}

.mini-post-card.status-processing,
.mini-post-card.status-uploading {
  border-left-color: #06b6d4;
}

.mini-post-card.status-failed {
  border-left-color: #f43f5e;
}

.mini-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 2px;
}

.mini-card-time {
  font-weight: 700;
  color: var(--text-dim);
  font-size: 0.65rem;
}

.mini-card-title {
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.more-posts-indicator {
  font-size: 0.68rem;
  font-weight: 700;
  color: #94a3b8;
  text-align: center;
  padding: 2px;
}

/* Week View */
.calendar-week-container {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 1rem;
  overflow-x: auto;
}

.week-columns-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(140px, 1fr));
  gap: 10px;
}

.week-day-column {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.week-day-column.today {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.03);
}

.week-column-header {
  padding: 0.75rem 0.5rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--border-subtle);
}

.week-day-name {
  font-size: 0.76rem;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
}

.week-day-num {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 2px;
}

.week-column-body {
  padding: 0.65rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 380px;
}

.week-empty-slot {
  padding: 1.5rem 0.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-faint);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.week-empty-slot:hover {
  border-color: #38bdf8;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.05);
}

.week-detailed-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.week-detailed-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  border-color: #38bdf8;
}

.detailed-card-time {
  font-size: 0.7rem;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 4px;
}

.detailed-card-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  line-height: 1.3;
}

.detailed-card-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.target-chip {
  font-size: 0.65rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 6px;
  color: var(--text-dim);
}

/* List View (Agenda) */
.calendar-list-view {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.agenda-item-card {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.agenda-item-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.agenda-date-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.5rem 0.6rem;
  text-align: center;
}

.agenda-month {
  font-size: 0.72rem;
  font-weight: 700;
  color: #38bdf8;
  text-transform: uppercase;
}

.agenda-day {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.agenda-time {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.agenda-content {
  flex: 1;
}

.agenda-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.agenda-desc {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.agenda-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.platform-badge-chip {
  font-size: 0.74rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 12px;
  color: var(--text-muted);
}

.platform-badge-chip.success {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

.agenda-status-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.btn-sm-action {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-sm-action:hover {
  background: #38bdf8;
  color: #0f172a;
}

.calendar-empty-state {
  padding: 4rem 2rem;
  text-align: center;
  background: rgba(15, 23, 42, 0.7);
  border: 1px dashed var(--border-subtle);
  border-radius: 20px;
}

/* LIGHT MODE STYLES FOR CALENDAR */
body.theme-light .cal-stat-card,
body.theme-light .calendar-toolbar,
body.theme-light .calendar-grid-card,
body.theme-light .calendar-week-container,
body.theme-light .agenda-item-card,
body.theme-light .calendar-empty-state {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
}

body.theme-light .calendar-weekdays-row {
  background: #f8fafc !important;
  border-bottom-color: #e2e8f0 !important;
}

body.theme-light .calendar-day-cell {
  border-color: #f1f5f9 !important;
}

body.theme-light .calendar-day-cell:not(.empty):hover {
  background: #f8fafc !important;
}

body.theme-light .calendar-day-cell.today {
  background: rgba(2, 132, 199, 0.06) !important;
}

body.theme-light .calendar-day-cell.empty {
  background: #f8fafc !important;
}

body.theme-light .mini-post-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}

body.theme-light .golden-slots-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(254, 243, 199, 0.6)) !important;
  border-color: rgba(245, 158, 11, 0.45) !important;
}

body.theme-light .golden-slot-chip {
  background: #ffffff !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

body.theme-light .agenda-date-badge {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

/* =========================================================================
       NATIVE MOBILE & TABLET RESPONSIVE SYSTEM (APP-GRADE UI/UX)
       ========================================================================= */

/* ── Touch Ergonomics & Safe Areas ── */
html {
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

/* ── Tablet Optimization (641px to 1080px) ── */
/* ── Tablet Optimization (641px to 1080px) ── */
@media (min-width: 641px) and (max-width: 1080px) {
  main.app-viewport {
    padding: 0.85rem 1.15rem 4rem !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .portal-header-bar {
    width: calc(100% - 1.5rem) !important;
    margin: 0 auto 0.85rem auto !important;
    border-radius: 18px !important;
    padding: 0.75rem 1.25rem !important;
    top: 0 !important;
  }

  .portal-brand-sub {
    display: none !important;
  }

  .portal-header-content {
    gap: 0.75rem !important;
  }

  .studio-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr) !important;
    gap: 1.15rem !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .ai-studio-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr) !important;
    gap: 1.15rem !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .panel-card {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .format-mode-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0.65rem !important;
  }

  .ai-controls-row-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.75rem !important;
  }

  .quick-stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .target-selector {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

/* ── Mobile Phone Perfection (max-width: 768px) ── */
@media (max-width: 768px) {

  /* Mobile Viewport Spacing & Anti-Overflow */
  html,
  body {
    overflow-x: clip !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  main.app-viewport {
    padding: 0.5rem 0.5rem 5.5rem !important;
    max-width: 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow-x: clip !important;
    box-sizing: border-box !important;
  }

  .main-tab-content {
    max-width: 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  /* Panel Cards: Edge-to-Edge Native Feel & Safe Containment */
  .panel-card {
    padding: 0.95rem 0.85rem !important;
    border-radius: 16px !important;
    margin-bottom: 0.85rem !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  /* Header Bar: Mobile Layout - Flush to Top */
  .portal-header-bar {
    width: calc(100% - 1rem) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    border-radius: 16px !important;
    margin-top: 0 !important;
    padding: calc(0.45rem + env(safe-area-inset-top, 0px)) 0.75rem 0.6rem 0.75rem !important;
    top: 0 !important;
    position: sticky !important;
    z-index: 999 !important;
    box-sizing: border-box !important;
    margin-bottom: 0.85rem !important;
  }

  .portal-header-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.45rem !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* Top Row: Brand & Burger Menu */
  .portal-brand-wrapper {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  .portal-brand {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
  }

  .portal-logo-img {
    width: 34px !important;
    height: 34px !important;
    border-radius: 9px !important;
  }

  .portal-brand-title {
    font-size: 1.05rem !important;
    font-weight: 800 !important;
  }

  .portal-brand-badge {
    font-size: 0.6rem !important;
    padding: 2px 6px !important;
  }

  .portal-brand-sub {
    display: none !important;
  }

  .burger-menu-trigger-btn {
    width: 38px !important;
    height: 38px !important;
    border-radius: 10px !important;
  }

  /* Second Row: Smooth Swipeable Action Toolbar Capsule Strip */
  .portal-header-right {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 0.45rem !important;
    padding: 2px 1px 4px 1px !important;
    justify-content: flex-start !important;
    box-sizing: border-box !important;
  }

  .portal-header-right::-webkit-scrollbar {
    display: none !important;
  }

  .portal-circle-btn,
  .theme-toggle-circle-btn,
  .btn-header-api-icon,
  .btn-header-test-icon,
  .portal-lang-btn,
  .portal-setting-btn,
  .portal-exit-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    font-size: 0.95rem !important;
    flex-shrink: 0 !important;
  }

  .portal-auth-container {
    flex-shrink: 0 !important;
  }

  .user-profile-dropdown {
    position: fixed !important;
    top: calc(0.5rem + 54px + env(safe-area-inset-top, 0px)) !important;
    right: 12px !important;
    left: auto !important;
    width: 280px !important;
    max-width: calc(100vw - 24px) !important;
    z-index: 99999999 !important;
  }

  /* Redis Status Pill is moved inside Burger Menu Drawer on mobile */
  .header-status-pill {
    display: none !important;
  }

  /* Third Row: Full-Width Studio Segmented Tab Control */
  .portal-nav-center {
    width: 100% !important;
    max-width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 4px !important;
    background: rgba(14, 20, 36, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 12px !important;
    padding: 4px !important;
    box-sizing: border-box !important;
  }

  .portal-nav-pill {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
    padding: 0.5rem 0.4rem !important;
    font-size: 0.8rem !important;
    border-radius: 9px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }

  /* Hero Feature Banner on Mobile */
  .hero-feature-card {
    padding: 1.15rem 0.95rem !important;
    min-height: auto !important;
    border-radius: 18px !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin-bottom: 1rem !important;
  }

  .hero-banner-img {
    display: none !important;
  }

  .hero-banner-overlay {
    position: relative !important;
    inset: auto !important;
    padding: 0 !important;
    background: transparent !important;
  }

  .hero-title-text {
    font-size: 1.08rem !important;
    line-height: 1.4 !important;
    word-break: break-word !important;
    margin-bottom: 0.75rem !important;
  }

  .hero-metrics-strip {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0.45rem !important;
    width: 100% !important;
  }

  .hero-metric-item {
    padding: 0.55rem 0.75rem !important;
  }

  /* Quick Action & Status Controller Bar on Mobile */
  .portal-action-bar {
    padding: 0.65rem 0.75rem !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.6rem !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    margin-bottom: 1rem !important;
  }

  .portal-action-bar>div {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.45rem !important;
    margin-left: 0 !important;
  }

  .portal-action-bar .btn {
    flex: 1 1 100% !important;
    justify-content: center !important;
    text-align: center !important;
  }

  .portal-action-bar .status-pill {
    flex: 1 1 auto !important;
    justify-content: center !important;
    text-align: center !important;
  }

  /* Studio Grid: 1-Column Stacking on Mobile with Strict Width Bounds */
  .studio-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 1rem !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .ai-studio-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 1rem !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .ai-controls-col,
  .ai-preview-col {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* Panel Card Header */
  .panel-card-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.55rem !important;
    padding-bottom: 0.75rem !important;
    margin-bottom: 0.85rem !important;
  }

  .panel-card-title {
    font-size: 0.98rem !important;
    line-height: 1.35 !important;
  }

  /* Form Elements Inside Panel Card */
  .panel-card form,
  .panel-card .form-group {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .panel-card .form-input,
  .panel-card .form-textarea {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* Dropzone: Responsive Touch Box with Zero Horizontal Clipping */
  .dropzone {
    padding: 1.4rem 0.85rem !important;
    text-align: center !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .dropzone strong {
    font-size: 0.9rem !important;
    display: block !important;
    word-break: break-word !important;
  }

  .dropzone p {
    font-size: 0.74rem !important;
    word-break: break-word !important;
    line-height: 1.4 !important;
  }

  /* Video Format Router Card & Format Modes */
  .video-format-router-card {
    padding: 0.95rem 0.85rem !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    margin-bottom: 1rem !important;
  }

  .router-card-title {
    font-size: 0.88rem !important;
    line-height: 1.35 !important;
    word-break: break-word !important;
  }

  .router-card-sub {
    font-size: 0.72rem !important;
    line-height: 1.35 !important;
    word-break: break-word !important;
  }

  .format-mode-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0.65rem !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .format-mode-option {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .format-mode-card {
    padding: 0.85rem 0.75rem !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    text-align: center !important;
  }

  .format-mode-title {
    font-size: 0.86rem !important;
  }

  .format-mode-desc {
    font-size: 0.7rem !important;
    line-height: 1.3 !important;
    word-break: break-word !important;
  }

  /* Smart Routing Banner Alert */
  .smart-routing-banner {
    padding: 0.75rem 0.75rem !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .smart-action-btns {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.35rem !important;
  }

  .btn-transcode-action {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }

  /* Social Media Target Selector Grid: 2-Column Touch Grid */
  .target-selector {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.45rem !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .target-label {
    font-size: 0.76rem !important;
    padding: 0.5rem 0.55rem !important;
    min-height: 42px !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    line-height: 1.25 !important;
  }

  /* YouTube Multi-Channel Funnel Box */
  #youtube-channel-subselector {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding: 0.75rem 0.8rem !important;
  }

  #youtube-channel-subselector>div:last-child {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .yt-ch-pill {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* Link Config Card & Call to Action Box */
  .link-config-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding: 0.95rem 0.85rem !important;
  }

  #link-fields-body {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* Fast CTA Presets Swipeable Strip */
  .cta-presets {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 5px !important;
    padding: 3px 1px 6px 1px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .cta-presets::-webkit-scrollbar {
    display: none !important;
  }

  .cta-chip {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    font-size: 0.73rem !important;
    padding: 0.35rem 0.65rem !important;
  }

  /* Placement Options */
  .placement-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0.45rem !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .placement-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* Auto-Pinned Comment Container */
  #first-comment-container {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding: 0.75rem 0.8rem !important;
  }

  #post-first-comment {
    font-size: 0.78rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* AI Studio Input & Form Controls */
  .ai-mode-toggle-group {
    width: 100% !important;
    display: flex !important;
    background: rgba(0, 0, 0, 0.45) !important;
    border-radius: 12px !important;
    padding: 3px !important;
    gap: 3px !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    box-sizing: border-box !important;
  }

  .ai-mode-toggle-group::-webkit-scrollbar {
    display: none !important;
  }

  .ai-mode-pill-btn {
    flex: 1 1 0 !important;
    text-align: center !important;
    justify-content: center !important;
    padding: 0.5rem 0.35rem !important;
    font-size: 0.72rem !important;
    border-radius: 9px !important;
    line-height: 1.3 !important;
    white-space: normal !important;
  }

  /* Quick Prompt Preset Chips: Native Horizontal Swipeable Carousel */
  .prompt-chips-container {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 4px 2px 8px 2px !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .prompt-chips-container::-webkit-scrollbar {
    display: none !important;
  }

  .prompt-chip {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    font-size: 0.76rem !important;
    padding: 0.45rem 0.85rem !important;
    border-radius: 9999px !important;
  }

  #ai-prompt-input {
    font-size: 15px !important;
    padding: 0.75rem 0.85rem !important;
    border-radius: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .ai-controls-row-4 {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0.65rem !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .ai-ctrl-col {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* Inspection & Preview Video Card on Mobile */
  .video-inspect-wrapper,
  .inspect-body {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 1rem !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .video-specs-panel,
  .specs-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .social-phone-frame {
    max-width: 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    border-radius: 22px !important;
  }
}

/* ── Native Mobile Bottom App Navigation Bar ── */
.mobile-app-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .mobile-app-bottom-nav {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 998 !important;
    height: 60px !important;
    background: rgba(8, 14, 28, 0.94) !important;
    border-top: 1.5px solid rgba(56, 189, 248, 0.28) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    box-shadow: 0 -6px 25px rgba(0, 0, 0, 0.55) !important;
    align-items: center !important;
    justify-content: space-around !important;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .mobile-nav-item {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    color: #94a3b8 !important;
    padding: 4px 0 !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border-radius: 12px !important;
    font-family: inherit !important;
  }

  .mobile-nav-item:active {
    transform: scale(0.92) !important;
  }

  .mobile-nav-item.active {
    color: #38bdf8 !important;
  }

  .mobile-nav-item.active .mob-nav-icon {
    transform: scale(1.15) !important;
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.65)) !important;
  }

  .mob-nav-icon {
    font-size: 1.2rem !important;
    transition: transform 0.2s ease !important;
    line-height: 1 !important;
  }

  .mob-nav-label {
    font-size: 0.66rem !important;
    font-weight: 600 !important;
    margin-top: 3px !important;
    line-height: 1 !important;
    letter-spacing: -0.01em !important;
  }

  /* Light Mode Bottom Navigation */
  body.theme-light .mobile-app-bottom-nav {
    background: rgba(255, 255, 255, 0.95) !important;
    border-top-color: rgba(2, 132, 199, 0.25) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08) !important;
  }

  body.theme-light .mobile-nav-item {
    color: #64748b !important;
  }

  body.theme-light .mobile-nav-item.active {
    color: #0284c7 !important;
  }

  body.theme-light .mobile-nav-item.active .mob-nav-icon {
    filter: drop-shadow(0 0 8px rgba(2, 132, 199, 0.4)) !important;
  }

  body.theme-light .portal-nav-center {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
  }
}

/* =========================================================================
   PERFORMANCE REPORTS & PERIOD SELECTOR - HIGH-CONTRAST LIGHT & DARK MODES
   ========================================================================= */

/* Top Toolbar */
.reports-top-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 1.25rem;
}

body.theme-light .reports-top-toolbar {
  border-bottom: 1px solid #e2e8f0;
}

.reports-top-title-group {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.reports-title-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  font-size: 1.4rem;
  flex-shrink: 0;
}

.reports-main-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.3;
}

body.theme-light .reports-main-title {
  color: #0f172a !important;
}

.reports-main-subtitle {
  font-size: 0.84rem;
  color: #94a3b8;
  display: block;
  margin-top: 2px;
}

body.theme-light .reports-main-subtitle {
  color: #475569 !important;
}

/* Period Selector Pills Bar */
.report-period-pills-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  background: rgba(15, 23, 42, 0.85);
  padding: 0.35rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.theme-light .report-period-pills-bar {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
}

.report-period-btn {
  background: transparent;
  color: #94a3b8;
  border: 1px solid transparent;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.report-period-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
}

.report-period-btn.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
  color: #ffffff !important;
  border-color: #a5b4fc !important;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4) !important;
  transform: translateY(-1px);
}

body.theme-light .report-period-btn {
  color: #334155 !important;
  font-weight: 600 !important;
}

body.theme-light .report-period-btn:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

body.theme-light .report-period-btn.active {
  background: linear-gradient(135deg, #4f46e5, #6366f1) !important;
  color: #ffffff !important;
  border-color: #4f46e5 !important;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35) !important;
}

/* Timeframe Card */
.report-timeframe-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.25rem 1.4rem;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  margin-bottom: 1.5rem;
  transition: all 0.2s ease;
}

body.theme-light .report-timeframe-card {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
}

.report-timeframe-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

body.theme-light .report-timeframe-title {
  color: #0f172a !important;
}

.report-timeframe-sub {
  font-size: 0.84rem;
  color: #94a3b8;
  margin-top: 0.35rem;
}

body.theme-light .report-timeframe-sub {
  color: #475569 !important;
}

/* KPI Summary Cards Grid */
.report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.report-kpi-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.report-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.4);
}

body.theme-light .report-kpi-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04) !important;
}

body.theme-light .report-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08) !important;
  border-color: #cbd5e1 !important;
}

.report-kpi-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #94a3b8;
  font-size: 0.83rem;
  font-weight: 600;
}

body.theme-light .report-kpi-label {
  color: #475569 !important;
  font-weight: 700 !important;
}

.report-kpi-num {
  font-size: 1.95rem;
  font-weight: 800;
  margin: 0.6rem 0;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.report-kpi-num-tasks {
  color: #f8fafc;
}
body.theme-light .report-kpi-num-tasks {
  color: #0f172a !important;
}

.report-kpi-num-published {
  color: #34d399;
}
body.theme-light .report-kpi-num-published {
  color: #059669 !important;
}

.report-kpi-num-dispatches {
  color: #818cf8;
}
body.theme-light .report-kpi-num-dispatches {
  color: #4f46e5 !important;
}

.report-kpi-num-live {
  color: #38bdf8;
}
body.theme-light .report-kpi-num-live {
  color: #0284c7 !important;
}

.report-kpi-num-rate {
  color: #fbbf24;
}
body.theme-light .report-kpi-num-rate {
  color: #d97706 !important;
}

.report-kpi-footnote {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
}

body.theme-light .report-kpi-footnote {
  color: #64748b !important;
}

/* Report Table Cards */
.report-table-card {
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 2rem;
  transition: all 0.2s ease;
}

body.theme-light .report-table-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.04) !important;
}

.report-table-header {
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

body.theme-light .report-table-header {
  border-bottom: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
}

.report-table-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

body.theme-light .report-table-title {
  color: #0f172a !important;
}

.report-table-sub {
  font-size: 0.78rem;
  color: #94a3b8;
  margin: 0.25rem 0 0 0;
}

body.theme-light .report-table-sub {
  color: #475569 !important;
}

/* Tables */
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.report-table thead tr {
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
}

body.theme-light .report-table thead tr {
  background: #f1f5f9 !important;
  border-bottom: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

.report-table th {
  padding: 0.85rem 1rem;
  font-weight: 700;
}

.report-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.15s ease;
  color: #cbd5e1;
}

.report-table tbody tr:hover {
  background: rgba(51, 65, 85, 0.35);
}

body.theme-light .report-table tbody tr {
  border-bottom: 1px solid #f1f5f9 !important;
  color: #1e293b !important;
}

body.theme-light .report-table tbody tr:hover {
  background: #f8fafc !important;
}

.report-table td {
  padding: 0.85rem 1rem;
}

/* Post Title in Table */
.report-post-title-text {
  font-weight: 600;
  color: #f8fafc;
  font-size: 0.86rem;
  line-height: 1.35;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.theme-light .report-post-title-text {
  color: #0f172a !important;
  font-weight: 700 !important;
}

/* Platform Tag Chip */
.report-platform-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  font-size: 0.75rem;
  font-weight: 600;
}

body.theme-light .report-platform-chip {
  background: #eef2ff !important;
  color: #4338ca !important;
  border: 1px solid #c7d2fe !important;
}

/* Live Link Button */
.report-live-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #38bdf8;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.report-live-link-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #ffffff;
  transform: translateY(-1px);
}

body.theme-light .report-live-link-btn {
  background: #e0f2fe !important;
  color: #0284c7 !important;
  border: 1px solid #7dd3fc !important;
}

body.theme-light .report-live-link-btn:hover {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
}

/* Status Badges */
.report-verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
  font-size: 0.75rem;
  font-weight: 700;
}

body.theme-light .report-verified-badge {
  background: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #86efac !important;
}

.report-status-active {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-block;
}

body.theme-light .report-status-active {
  background: #dcfce7 !important;
  color: #166534 !important;
  border: 1px solid #86efac !important;
}

.report-status-needs-review {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-block;
}

body.theme-light .report-status-needs-review {
  background: #fee2e2 !important;
  color: #991b1b !important;
  border: 1px solid #fca5a5 !important;
}

/* Error callout in failed posts */
.report-error-text {
  color: #f87171;
  font-size: 0.78rem;
  font-family: monospace;
  line-height: 1.35;
  max-width: 420px;
  word-break: break-word;
  background: rgba(239, 68, 68, 0.08);
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

body.theme-light .report-error-text {
  color: #991b1b !important;
  background: #fef2f2 !important;
  border: 1px solid #fecaca !important;
}

/* =========================================================================
   REGISTRATION ROLE SELECTOR CARDS (Admin, Creator, Viewer)
   ========================================================================= */
.reg-role-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.reg-role-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 6px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.65);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  user-select: none;
}

.reg-role-card input[type="radio"] {
  position: absolute;
  top: 8px;
  right: 8px;
  margin: 0;
  cursor: pointer;
}

.reg-role-card .reg-role-icon {
  font-size: 1.35rem;
  margin-bottom: 3px;
}

.reg-role-card .reg-role-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f8fafc;
}

.reg-role-card .reg-role-sub {
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 1px;
}

.reg-role-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.4);
}

.reg-role-card.role-admin-card.active,
.reg-role-card.role-admin-card:has(input:checked) {
  border-color: #f59e0b !important;
  background: rgba(245, 158, 11, 0.16) !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.3) !important;
}

.reg-role-card.role-admin-card.active .reg-role-name,
.reg-role-card.role-admin-card:has(input:checked) .reg-role-name {
  color: #fbbf24 !important;
}

.reg-role-card.role-creator-card.active,
.reg-role-card.role-creator-card:has(input:checked) {
  border-color: #0284c7 !important;
  background: rgba(2, 132, 199, 0.16) !important;
  box-shadow: 0 0 16px rgba(2, 132, 199, 0.3) !important;
}

.reg-role-card.role-creator-card.active .reg-role-name,
.reg-role-card.role-creator-card:has(input:checked) .reg-role-name {
  color: #38bdf8 !important;
}

.reg-role-card.role-viewer-card.active,
.reg-role-card.role-viewer-card:has(input:checked) {
  border-color: #64748b !important;
  background: rgba(100, 116, 139, 0.18) !important;
  box-shadow: 0 0 16px rgba(100, 116, 139, 0.3) !important;
}

.reg-role-card.role-viewer-card.active .reg-role-name,
.reg-role-card.role-viewer-card:has(input:checked) .reg-role-name {
  color: #e2e8f0 !important;
}

/* Light Mode Overrides */
body.theme-light .reg-role-card {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

body.theme-light .reg-role-card .reg-role-name {
  color: #0f172a !important;
}

body.theme-light .reg-role-card .reg-role-sub {
  color: #64748b !important;
}

body.theme-light .reg-role-card.role-admin-card.active,
body.theme-light .reg-role-card.role-admin-card:has(input:checked) {
  background: #fef3c7 !important;
  border-color: #d97706 !important;
}
body.theme-light .reg-role-card.role-admin-card.active .reg-role-name,
body.theme-light .reg-role-card.role-admin-card:has(input:checked) .reg-role-name {
  color: #b45309 !important;
}

body.theme-light .reg-role-card.role-creator-card.active,
body.theme-light .reg-role-card.role-creator-card:has(input:checked) {
  background: #e0f2fe !important;
  border-color: #0284c7 !important;
}
body.theme-light .reg-role-card.role-creator-card.active .reg-role-name,
body.theme-light .reg-role-card.role-creator-card:has(input:checked) .reg-role-name {
  color: #0369a1 !important;
}

body.theme-light .reg-role-card.role-viewer-card.active,
body.theme-light .reg-role-card.role-viewer-card:has(input:checked) {
  background: #f1f5f9 !important;
  border-color: #64748b !important;
}

/* Print View Formatting for Reports */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .portal-header-bar,
  .mobile-app-bottom-nav,
  .burger-drawer-overlay,
  .burger-drawer,
  .report-period-pills-bar,
  .app-footer {
    display: none !important;
  }
  .main-tab-content {
    display: none !important;
  }
  #tab-content-reports {
    display: block !important;
  }
  .panel-card {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
  }
  table th, table td {
    border: 1px solid #ddd !important;
    color: #000 !important;
  }
}