/* =============================================================================
   VOXCLIENT APPLICATION DESIGN SYSTEM — app.css
   Next-Generation Creative Studio & Operating System for Modern Agencies
   Theme: Titanium Carbon & Electric Cobalt (No Purple Void)
   ============================================================================= */

/* ── App Shell & Base Layout ────────────────────────────────────────────────── */
.app-body {
  background: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

/* ── App Top Navigation (Floating Glass Studio Header) ───────────────────────── */
.app-topnav {
  position: sticky;
  top: 10px;
  z-index: 900;
  width: 100%;
  padding: 0 16px;
  margin-bottom: 20px;
}

.app-topnav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 10px 20px;
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: 0 14px 40px -10px rgba(0, 0, 0, 0.45);
}

.app-topnav-brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.workspace-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--surface-glass);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.workspace-sidebar-toggle:hover {
  background: rgba(37, 99, 235, 0.15);
  color: var(--accent-bright);
  border-color: rgba(59, 130, 246, 0.3);
}

.app-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

/* ── Workspace Switcher Pill Dropdown ───────────────────────────────────────── */
.workspace-switcher-wrap {
  position: relative;
}

.workspace-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.workspace-switcher-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(59, 130, 246, 0.35);
}

.workspace-switcher-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald-bright);
  box-shadow: 0 0 8px var(--emerald-bright);
}

.workspace-switcher-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(37, 99, 235, 0.2);
  color: var(--accent-bright);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.workspace-switcher-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: min(350px, calc(100vw - 28px));
  background: var(--surface-solid);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65), 0 0 30px rgba(37, 99, 235, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  overflow: hidden;
  flex-direction: column;
  max-height: min(72vh, 520px);
  animation: slideDownFade 0.2s var(--ease-spring);
}

.workspace-switcher-header {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.workspace-switcher-list {
  max-height: min(55vh, 420px);
  min-height: 40px;
  overflow-y: auto;
  padding: 6px;
}

.workspace-switcher-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 13.5px;
  cursor: pointer;
  text-align: left;
  transition: background-color var(--duration-fast);
}

.workspace-switcher-item:hover {
  background: rgba(37, 99, 235, 0.12);
  color: var(--accent-bright);
}

.workspace-switcher-item.is-active {
  background: rgba(37, 99, 235, 0.2);
  font-weight: 600;
}

.workspace-switcher-item > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.workspace-switcher-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 3px; }
.workspace-switcher-item-heading { display: flex; min-width: 0; align-items: center; flex-wrap: wrap; gap: 5px 9px; }
.workspace-switcher-item-name { min-width: 0; color: var(--text-primary); font-weight: 700; overflow-wrap: anywhere; }
.workspace-switcher-item-role { color: var(--text-muted); font-size: 11px; font-weight: 600; }
.workspace-switcher-item-plan { color: var(--text-muted); font-size: 11px; text-transform: capitalize; }
.workspace-switcher-selected { flex: 0 0 auto; color: var(--emerald-bright); font-size: 16px; font-weight: 800; }
.workspace-switcher-state { padding: 14px 12px; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.workspace-switcher-retry { margin: 0 12px 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-glass); color: var(--text-primary); cursor: pointer; }

.workspace-switcher-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.workspace-switcher-invites-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  background: var(--surface-glass);
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--duration-fast), color var(--duration-fast);
}

.workspace-switcher-invites-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

/* ── App Navigation Links (Studio Tabs) ─────────────────────────────────────── */
.app-main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  padding: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  flex-shrink: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.app-main-nav::-webkit-scrollbar {
  display: none;
}

.app-main-nav a {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: all var(--duration-fast);
  white-space: nowrap;
}

.app-main-nav a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.app-main-nav a.active {
  color: #FFFFFF;
  background: rgba(37, 99, 235, 0.20);
  font-weight: 600;
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 12px;
}

/* ── User Avatar & Profile Dropdown ─────────────────────────────────────────── */
.app-topnav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #1D4ED8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  border: 2px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: transform var(--duration-fast);
}

.app-user-avatar:hover {
  transform: scale(1.05);
}

.profile-dropdown-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 280px;
  max-width: min(320px, calc(100vw - 24px));
  max-height: min(78vh, 560px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface-solid);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  overflow: hidden;
  animation: slideDownFade 0.2s var(--ease-spring);
}

.profile-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-glass);
}

.profile-dropdown-eyebrow {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.profile-dropdown-email {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.profile-dropdown-stats {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12.5px;
}

.profile-dropdown-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-dropdown-stat-label {
  color: var(--text-secondary);
}

.profile-dropdown-stat-val {
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.profile-dropdown-stat-val.credit-val {
  color: var(--emerald-bright);
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-family: var(--font-sans);
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  text-align: left;
  transition: all var(--duration-fast);
}

.profile-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.profile-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

/* ── App Main Layout Area ───────────────────────────────────────────────────── */
.app-main {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px 60px;
  box-sizing: border-box;
}

/* ── Dashboard KPI Cards ────────────────────────────────────────────────────── */
.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
  margin-bottom: 30px;
}

.kpi-card {
  padding: 20px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all var(--duration-normal) var(--ease-spring);
}

.kpi-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.kpi-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.kpi-sub {
  font-size: 12px;
  color: var(--emerald-bright);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Client Cards Grid ──────────────────────────────────────────────────────── */
.client-launcher-card {
  background: var(--surface-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: all var(--duration-normal) var(--ease-spring);
}

.client-launcher-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-light);
  box-shadow: var(--shadow-md), 0 0 25px rgba(37, 99, 235, 0.2);
}

/* ── General Modals & Overlays ──────────────────────────────────────────────── */
.ab-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 12, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.ab-modal-backdrop.is-active,
.ab-modal-backdrop[aria-hidden="false"] {
  display: flex;
}

.ab-modal {
  background: var(--surface-solid);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), 0 0 50px rgba(37, 99, 235, 0.25);
  max-width: 520px;
  width: 100%;
  overflow: hidden;
  animation: slideUpModal 0.22s var(--ease-spring);
}

/* Session dialogs are injected by public-auth.js on every authenticated page. */
.session-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 6, 12, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.session-modal-backdrop.is-open,
.session-modal-backdrop[aria-hidden="false"] {
  display: flex;
}

.session-modal-card {
  width: min(100%, 440px);
  padding: 28px;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-xl);
  background: var(--surface-solid);
  box-shadow: var(--shadow-lg), 0 0 50px rgba(37, 99, 235, 0.2);
  color: var(--text-primary);
  text-align: center;
}

.session-icon-wrap {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  place-items: center;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 18px;
  background: rgba(37, 99, 235, 0.14);
  color: var(--accent-bright);
}

.session-eyebrow {
  margin: 0 0 8px;
  color: var(--accent-bright);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.session-title {
  margin: 0 0 10px;
  color: var(--text-primary);
  font-size: 22px;
  line-height: 1.25;
}

.session-desc {
  margin: 0 0 20px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
}

.session-device-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-glass);
  text-align: left;
}

.session-device-badge {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background: var(--surface-3);
  color: var(--accent-bright);
}

.session-warning-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  padding: 12px 14px;
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.07);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.55;
  text-align: left;
}

@media (max-width: 480px) {
  .session-modal-card {
    padding: 22px 18px;
  }
}

.ab-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.ab-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-display);
}

.ab-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.ab-modal-close:hover {
  color: var(--text-primary);
}

.ab-modal-body {
  padding: 24px;
}

.ab-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface-glass);
}

/* ── Form Inputs ────────────────────────────────────────────────────────────── */
.ab-form-group {
  margin-bottom: 16px;
}

.ab-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.ab-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: all var(--duration-fast);
}

.ab-input:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.ab-textarea {
  resize: vertical;
  min-height: 80px;
}

/* ── Animations ─────────────────────────────────────────────────────────────── */
@keyframes slideDownFade {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUpModal {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

/* ── Mobile App Navigation Drawer ───────────────────────────────────────────── */
.app-mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface-solid);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin: 10px 16px 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  animation: slideDownFade 0.2s var(--ease-spring);
}

.app-mobile-nav a {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast);
}

.app-mobile-nav a:hover,
.app-mobile-nav a.active {
  color: #FFFFFF;
  background: rgba(37, 99, 235, 0.2);
}

/* Responsive */
@media (max-width: 1280px) {
  .app-logo-workspace {
    display: none;
  }
  .app-main-nav a {
    padding: 6px 10px;
    font-size: 13px;
  }
}

@media (max-width: 1024px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .app-main-nav {
    display: none;
  }
}

@media (min-width: 901px) {
  .app-mobile-nav {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .dashboard-kpi-grid {
    grid-template-columns: 1fr;
  }
  .app-topnav {
    padding: 8px 12px;
  }
  .app-topnav-inner {
    padding: 6px 12px;
  }
  .workspace-switcher-btn {
    padding: 5px 8px;
    font-size: 12px;
  }
  .workspace-switcher-role-badge {
    display: none;
  }
}

/* ================================================================
   Campaign Cards & Workflow Operations
   ================================================================ */
.campaign-card {
  background: rgba(14, 10, 26, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.campaign-card:hover {
  transform: translateY(-3px);
  border-color: rgba(167, 139, 250, 0.4);
  box-shadow: 0 12px 32px rgba(124, 58, 237, 0.12);
}

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

.campaign-card-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px 0;
  cursor: pointer;
}

.campaign-card-dates {
  font-size: 12px;
  color: var(--text-muted);
}

.campaign-card-brief {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
}

.campaign-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.campaign-metrics-summary-card {
  background: rgba(14, 10, 26, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 24px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.campaign-metrics-summary-card:hover {
  border-color: rgba(124, 58, 237, 0.35);
}

.campaign-timeline-item {
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.campaign-timeline-item:hover {
  border-color: rgba(167, 139, 250, 0.3);
  transform: translateX(2px);
}

.campaign-conflict-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

/* ================================================================
   Workload Manager Styles
   ================================================================ */
.workload-manager-wrap {
  width: 100%;
  margin-bottom: 40px;
}

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

.workload-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.workload-card {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12) 0%, rgba(14, 10, 26, 0.85) 100%);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* ================================================================
   Brand Memory Badges & Controls
   ================================================================ */
.vc-memory-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.vc-memory-confirmed {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.28);
  color: #34d399;
}

.vc-memory-inferred {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.28);
  color: #fbbf24;
}

.vc-memory-scope-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 9px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.25);
  color: #c4b5fd;
  font-weight: 600;
}

.vc-memory-edit {
  padding: 7px 10px;
  border: 1px solid rgba(196, 181, 253, 0.2);
  border-radius: 8px;
  background: rgba(196, 181, 253, 0.08);
  color: #c4b5fd;
  font: inherit;
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
  transition: background 0.15s;
}

.vc-memory-edit:hover {
  background: rgba(196, 181, 253, 0.18);
  color: #fff;
}

/* ================================================================
   Light Mode & Table Dropdown / Sidebar Overrides
   ================================================================ */
[data-theme="light"] .workspace-switcher-btn {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}
[data-theme="light"] .workspace-switcher-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

button.client-activity-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  user-select: none;
}

button.client-activity-tag:hover {
  background: rgba(167, 139, 250, 0.18);
  border-color: rgba(167, 139, 250, 0.45);
  color: #ffffff;
  transform: translateY(-1px);
}

[data-theme="light"] button.client-activity-tag {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

[data-theme="light"] button.client-activity-tag:hover {
  background: #ede9fe;
  border-color: #a78bfa;
  color: #6d28d9;
}

/* Prevent layout flicker & ensure zero width when sidebar is collapsed */
.ai-layout.collapsed .ai-sidebar {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  opacity: 0 !important;
  border: none !important;
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/* Ensure table container does not clip 3-dot dropdown in List View */
.members-table-wrap {
  overflow: visible !important;
}

/* Clients, campaigns and approvals views are rendered dynamically by app.js. */
.ai-main:has(.clients-dir-container),
.ai-main:has(.members-container),
.ai-main:has(.campaigns-page-wrap) { padding: clamp(18px, 3vw, 36px) !important; }
.clients-dir-container, .members-container, .campaigns-page-wrap { width: min(100%, 1420px); min-width: 0; margin: 0 auto; }
.clients-dir-header, .members-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.clients-dir-title, .members-title { margin: 0 0 6px; color: var(--text-primary); font-size: clamp(24px, 3vw, 30px); line-height: 1.2; letter-spacing: -.025em; }
.clients-dir-subtitle, .members-subtitle { margin: 0; color: var(--text-secondary); font-size: 13px; line-height: 1.55; }
.clients-dir-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) auto; align-items: center; gap: 14px; margin: 0 0 12px; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-glass); }
.clients-dir-search-wrap, .campaign-search-box { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-solid); color: var(--text-muted); }
.clients-dir-search-input, .campaign-search-box input { width: 100%; min-width: 0; min-height: 40px; border: 0; outline: 0; background: transparent; color: var(--text-primary); font: inherit; font-size: 13px; }
.clients-dir-search-input::placeholder, .campaign-search-box input::placeholder { color: var(--text-muted); }
.clients-dir-controls, .campaign-filters-group { display: flex; min-width: 0; align-items: center; flex-wrap: wrap; gap: 8px; }
.clients-dir-filter-select, .campaign-select-filter { min-height: 40px; max-width: 100%; padding: 8px 30px 8px 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-solid); color: var(--text-primary); font: inherit; font-size: 12px; }
.clients-dir-filter-select option, .campaign-select-filter option { color: var(--text-primary); background: var(--surface-solid); }
.clients-dir-view-toggle { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-solid); }
.clients-dir-toggle-btn { display: inline-grid; width: 34px; height: 32px; place-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--text-muted); cursor: pointer; }
.clients-dir-toggle-btn.active { background: var(--accent-soft); color: var(--accent-bright); }
#clients-dir-count-indicator { color: var(--text-muted); font-size: 12px; }
.clients-dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); align-items: stretch; gap: 16px; }
.client-card { display: grid; min-width: 0; min-height: 0; aspect-ratio: auto; grid-template-rows: minmax(0, 1fr) auto; align-content: stretch; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: 0 10px 26px rgba(0,0,0,.12); }
.client-card > div:first-child { display: flex; min-height: 0; flex-direction: column; overflow: visible; }
.client-card-activity-row { margin-top: auto; padding-top: 12px; }
.client-card-footer { align-self: end; width: 100%; }
.client-card-desc { margin: 10px 0 12px; }
.client-card-activity-row { margin-top: 0; padding-top: 0; }
.client-card-footer { padding-top: 10px; }
.client-card > div:first-child { display: flex; min-height: 0; flex-direction: column; overflow: visible; }
.client-card-header, .client-card-identity { display: flex; min-width: 0; align-items: flex-start; gap: 12px; }
.client-card-header { justify-content: space-between; }
.client-card-identity { align-items: center; }
.client-card-avatar { display: grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; border-radius: 13px; color: #fff; font-weight: 750; }
.client-card-headings { min-width: 0; }
.client-card-name { color: var(--text-primary); font-size: 15px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.client-card-industry-wrap { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.client-card-industry, .client-pinned-pill { display: inline-flex; align-items: center; padding: 3px 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-glass); color: var(--text-secondary); font-size: 10px; line-height: 1.4; }
.client-card-menu-wrap { position: relative; flex: 0 0 auto; }
.client-card-menu-btn { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--text-muted); cursor: pointer; }
.client-card-menu-btn:hover, .client-card-menu-btn:focus-visible { border-color: var(--border); background: var(--surface-glass); color: var(--text-primary); }
.client-card-dropdown { position: absolute; top: calc(100% + 5px); right: 0; z-index: 30; min-width: 190px; padding: 5px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-solid); box-shadow: 0 16px 34px rgba(0,0,0,.32); }
.client-dropdown-item { display: flex; width: 100%; align-items: center; gap: 9px; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text-primary); text-align: left; font: inherit; font-size: 12px; cursor: pointer; }
.client-dropdown-item:hover { background: var(--surface-glass); }
.client-dropdown-item.danger { color: #f87171; }
.client-dropdown-divider { height: 1px; margin: 4px; background: var(--border); }
.client-card-desc { display: -webkit-box; margin: 10px 0 12px; overflow: hidden; color: var(--text-secondary); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 5; }
.client-card-activity-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: auto; padding-top: 12px; }
.client-card-footer { padding-top: 10px; border-top: 1px solid var(--border); }
.btn-enter-workspace { display: flex; width: 100%; min-height: 40px; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 10px; background: var(--accent-soft); color: var(--accent-bright); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.btn-enter-workspace:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }

/* Empty states were inheriting browser layout in campaigns and approvals. */
.ab-empty-state { display: flex; width: min(100%, 680px); min-height: 230px; flex-direction: column; align-items: center; justify-content: center; gap: 8px; margin: 18px auto; padding: clamp(24px, 4vw, 44px); border: 1px solid var(--border); border-radius: 18px; background: linear-gradient(145deg, var(--surface), var(--surface-glass)); text-align: center; }
.ab-empty-state-icon { display: grid; min-width: 48px; min-height: 48px; place-items: center; margin-bottom: 4px; border-radius: 15px; background: var(--accent-soft); color: var(--accent-bright); }
.ab-empty-state h3, .ab-empty-state h4 { margin: 0; color: var(--text-primary) !important; font-size: 16px; line-height: 1.4; }
.ab-empty-state p { max-width: 470px; margin: 0 0 8px; color: var(--text-secondary) !important; font-size: 13px; line-height: 1.6; }

/* Global page scrolling recovery: page-level content must never be clipped by a viewport lock. */
html,
body.app-body {
  height: auto !important;
  min-height: 100% !important;
  overflow-x: clip !important;
  overflow-y: auto !important;
}
body.app-body > .app-shell,
.app-shell {
  height: auto !important;
  min-height: 100vh !important;
  max-height: none !important;
  overflow: visible !important;
}
.app-shell > .app-main,
.app-main {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}
.app-main.app-main-fullwidth {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

/* Campaign and approval controls share readable responsive filter surfaces. */
.campaigns-page-wrap { padding-bottom: 36px; }
.campaign-breadcrumbs { display: flex; align-items: center; gap: 7px; margin-bottom: 14px; color: var(--text-muted); font-size: 11px; }
.campaign-breadcrumbs a { color: var(--accent-bright); text-decoration: none; }
.campaign-toolbar { margin-bottom: 16px; padding: 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-glass); }
.campaign-search-box { width: min(100%, 320px); }
.campaigns-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); align-items: stretch; gap: 16px; }
.campaign-card { display: flex; min-width: 0; flex-direction: column; gap: 12px; padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.campaign-card-header, .campaign-card-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 9px; }
.campaign-card-title { margin: 0; color: var(--text-primary); font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; cursor: pointer; }
.campaign-card-dates, .campaign-card-brief { color: var(--text-secondary); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.campaign-channels-row { display: flex; flex-wrap: wrap; gap: 6px; }
.campaign-client-tag, .approval-campaign-link, .channel-pill { display: inline-flex; align-items: center; max-width: 100%; padding: 4px 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-glass); color: var(--text-secondary); font-size: 10px; overflow-wrap: anywhere; }
.approval-meta-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }

/* Members page panels need a grid, not a vertical run of raw labels. */
.members-container { padding-bottom: 36px; }
.members-summary-card, .members-table-wrap { min-width: 0; margin: 16px 0; padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.members-stats-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.members-stat-box { min-width: 0; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-glass); }
.members-stat-lbl { margin-bottom: 6px; color: var(--text-muted); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.members-stat-val { color: var(--text-primary); font-size: 20px; font-weight: 750; line-height: 1.35; overflow-wrap: anywhere; }
.members-progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: var(--surface-solid); }
.members-progress-bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #38bdf8); transition: width .25s ease; }
.members-table { width: 100%; border-collapse: collapse; color: var(--text-primary); font-size: 12px; }
.members-table th { color: var(--text-muted); font-size: 10px; text-align: left; text-transform: uppercase; letter-spacing: .05em; }
.members-table th, .members-table td { border-bottom: 1px solid var(--border); }
.members-table tbody tr:last-child td { border-bottom: 0; }
.members-rules-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.members-rule-card { display: flex; min-width: 0; align-items: flex-start; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.members-rule-icon { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border-radius: 11px; background: var(--accent-soft); }
.members-rule-title { margin-bottom: 5px; color: var(--text-primary); font-size: 13px; font-weight: 700; }
.members-rule-desc { margin: 0; color: var(--text-secondary); font-size: 12px; line-height: 1.55; }
.seat-billing-error { color: #fca5a5; }

@media (max-width: 900px) {
  .clients-dir-toolbar { grid-template-columns: minmax(0, 1fr); }
  .members-stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .clients-dir-header, .members-header { flex-direction: column; }
  .clients-dir-header > div:last-child, .members-header > div:last-child { width: 100%; flex-wrap: wrap; }
  .clients-dir-header .btn, .members-header .btn { justify-content: center; }
  .clients-dir-controls, .campaign-filters-group { align-items: stretch; }
  .clients-dir-filter-select, .campaign-select-filter { flex: 1 1 140px; }
  .members-stats-row { grid-template-columns: minmax(0, 1fr); }
  .members-summary-card, .members-table-wrap { padding: 12px; }
  .members-table-wrap { overflow-x: auto !important; }
  .members-table { min-width: 620px; }
}

/* Publishing Notice Banner */
.publishing-notice-banner {
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

body.light-theme .publishing-notice-banner,
body.light-mode .publishing-notice-banner,
[data-theme="light"] .publishing-notice-banner {
  background: #f1f5f9;
  border-color: #cbd5e1;
  border-left-color: #7c3aed;
}

body.light-theme .publishing-notice-banner strong,
body.light-mode .publishing-notice-banner strong,
[data-theme="light"] .publishing-notice-banner strong {
  color: #0f172a;
}

/* Approval Card Styles */
.approval-card {
  background: rgba(14, 10, 26, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.approval-card:hover {
  border-color: rgba(167, 139, 250, 0.3);
}

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

/* Responsive workload manager refinement: compact hierarchy and touch-friendly actions. */
.workload-manager-wrap { min-width: 0; width: 100%; }
.workload-header { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:12px; }
.workload-title { font-size:clamp(15px,1.5vw,19px); line-height:1.35; margin:0; }
.workload-card { position:relative; min-width:0; overflow:hidden; padding:clamp(14px,2vw,22px); border-radius:16px; border:1px solid rgba(139,92,246,.24); border-left:3.5px solid #ef4444; background:linear-gradient(120deg,rgba(26,21,46,.76),rgba(14,11,28,.88)); box-shadow:0 8px 26px rgba(0,0,0,.12); }
.workload-card:hover { transform:translateY(-1px); border-color:rgba(139,92,246,.42); }
[data-theme="light"] .workload-card, body.light-mode .workload-card { color:#172033; background:#fff; border-color:#e2e8f0; border-left-color:#ef4444; box-shadow:0 6px 20px rgba(15,23,42,.06); }
.workload-meta-row { display:flex; flex-wrap:wrap; align-items:center; gap:7px 9px; min-width:0; margin-bottom:10px; }
.workload-tag, .workload-meta-row > span { max-width:100%; overflow-wrap:anywhere; }
.workload-dialogue-box { min-width:0; margin:8px 0 12px; padding:0; border:0; background:transparent; line-height:1.55; overflow-wrap:anywhere; }
.workload-dialogue-box > div:first-child { color:var(--text-primary,inherit); font-size:clamp(13px,1.2vw,15px); }
[data-theme="light"] .workload-dialogue-box > div:first-child, body.light-mode .workload-dialogue-box > div:first-child { color:#172033; }
.workload-context-subtext { display:flex; flex-wrap:wrap; gap:5px 8px; margin-top:9px; color:var(--text-muted,#aebbd0); font-size:12px; line-height:1.5; }
[data-theme="light"] .workload-context-subtext, body.light-mode .workload-context-subtext { color:#4b5870; }
.workload-actions-row { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-top:12px; }
.workload-actions-row .btn { min-height:36px; max-width:100%; white-space:normal; line-height:1.3; }
.workload-actions-row .btn-primary { background:#2448c7; color:#fff; border-color:#2448c7; }
.workload-actions-row .btn-primary:hover:not(:disabled) { background:#1c3ba8; border-color:#1c3ba8; }
.workload-actions-row .btn:focus-visible, .workload-header button:focus-visible { outline:3px solid #9bb4ff; outline-offset:3px; }
@media (max-width:640px) {
  .workload-header { align-items:flex-start; }
  .workload-title { font-size:16px; }
  .workload-card { padding:14px; border-radius:13px; }
  .workload-meta-row { gap:6px; }
  .workload-context-subtext { gap:5px 7px; }
  .workload-actions-row { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .workload-actions-row .btn { width:100%; min-width:0; min-height:40px; padding:8px 10px !important; font-size:12px !important; }
  .workload-actions-row #btn-workload-generate, .workload-actions-row #btn-workload-review { grid-column:span 2; }
}
@media (max-width:360px) {
  .workload-card { padding:11px; }
  .workload-actions-row { grid-template-columns:minmax(0,1fr); }
  .workload-actions-row .btn, .workload-actions-row #btn-workload-generate, .workload-actions-row #btn-workload-review { grid-column:1; }
}

/* Mobile AI Studio: keep conversation viewport fixed, tabs scrollable, and composer anchored at bottom. */
@media (max-width: 768px) {
  .ai-layout {
    height: auto !important;
    max-height: none !important;
    min-height: calc(100dvh - 56px) !important;
    overflow: visible !important;
  }
  .ai-layout .ai-main,
  .ai-studio-main {
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    overflow: hidden !important;
  }
  .ai-studio-main .client-workspace-header,
  .ai-main > div:first-child {
    flex: 0 0 auto !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    padding: 8px 12px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none !important;
  }
  .ai-studio-main .client-workspace-header::-webkit-scrollbar,
  .ai-main > div:first-child::-webkit-scrollbar { display: none; }
  .ai-studio-main .client-workspace-header > div:first-child,
  .ai-main > div:first-child > div:first-child {
    flex: 0 0 auto !important;
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
  }
  .ai-studio-main .client-workspace-header > div:last-child,
  .ai-main > div:first-child > div:last-child {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    white-space: nowrap !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }
  .ai-studio-main .client-workspace-header > div:last-child > *,
  .ai-main > div:first-child > div:last-child > * { flex: 0 0 auto !important; }
  .ai-main #chat-history-area {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overscroll-behavior-y: contain;
    padding: 12px 0 !important;
  }
  .ai-main #chat-history-inner {
    padding: 0 12px !important;
  }
  .ai-main #chat-empty-state {
    min-height: 0;
    height: auto !important;
    margin: auto 0;
    padding: 18px 0;
  }
  .ai-studio-main .chat-composer-outer,
  .ai-main > div:last-child {
    flex: 0 0 auto !important;
    padding: 0 12px calc(8px + env(safe-area-inset-bottom)) !important;
    width: 100% !important;
  }
  .ai-studio-main .chat-composer-outer > div:first-child,
  .ai-main > div:last-child > div:first-child {
    border-radius: 16px !important;
    padding: 7px 9px !important;
  }
  .ai-main #input-chat-composer {
    min-width: 0;
    font-size: 16px !important;
  }
}
@media (max-width: 380px) {
  .ai-main #chat-empty-state h2 {
    font-size: 20px !important;
    margin-bottom: 8px !important;
  }
  .ai-main #chat-empty-state p {
    font-size: 13px !important;
    padding: 0 8px;
  }
  .ai-main #chat-empty-state > div:first-child {
    width: 52px !important;
    height: 52px !important;
    margin-bottom: 14px !important;
  }
}

/* Campaign management modal layout — scoped to the redesigned v2 campaign forms. */
.ab-modal.vox-modal-fixed-layout {
  display: flex;
  flex-direction: column;
  max-height: min(88dvh, 900px);
  overflow: hidden;
}
.ab-modal.vox-modal-fixed-layout .vox-modal-form-wrap {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.ab-modal.vox-modal-fixed-layout .vox-modal-scroll-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.ab-modal.vox-modal-fixed-layout .vox-modal-sticky-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  flex: 0 0 auto;
  padding: 14px 20px;
  border-top: 1px solid var(--border, rgba(255,255,255,.12));
  background: var(--surface-solid, #131b2d);
}
/* Custom select and date-picker controls used by campaign forms. */
.vox-select-wrap, .vox-dp-wrap { position: relative; min-width: 0; }
.vox-select-trigger {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border, rgba(255,255,255,.16));
  border-radius: 10px;
  color: var(--text-primary, #f4f6fb);
  background: var(--surface-2-solid, #151c2c);
  text-align: left;
  cursor: pointer;
}
.vox-select-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vox-select-label.is-placeholder { opacity: .65; }
.vox-select-menu {
  position: absolute;
  inset: calc(100% + 5px) 0 auto;
  z-index: 10030;
  display: none;
  max-height: 240px;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid var(--border, rgba(255,255,255,.16));
  border-radius: 10px;
  background: var(--surface-solid, #131b2d);
  box-shadow: 0 12px 32px rgba(0,0,0,.28);
}
.vox-select-wrap.is-open .vox-select-menu { display: block; }
.vox-select-item { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; border-radius: 7px; color: var(--text-primary, #f4f6fb); cursor: pointer; }
.vox-select-item:hover, .vox-select-item:focus-visible { outline: none; background: var(--surface-hover, rgba(255,255,255,.08)); }
.vox-select-item.is-selected { background: var(--accent-dim, rgba(99,102,241,.16)); }
.vox-dp-input-box { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 10px; border: 1px solid var(--border, rgba(255,255,255,.16)); border-radius: 10px; background: var(--surface-2-solid, #151c2c); cursor: pointer; }
.vox-dp-display-input { flex: 1 1 auto; width: 100%; min-width: 0; border: 0; outline: 0; color: var(--text-primary, #f4f6fb); background: transparent; }
.vox-dp-popover { position: absolute; top: calc(100% + 6px); left: 0; z-index: 10030; width: min(320px, calc(100vw - 32px)); padding: 12px; border: 1px solid var(--border, rgba(255,255,255,.16)); border-radius: 12px; background: var(--surface-solid, #131b2d); box-shadow: 0 12px 32px rgba(0,0,0,.28); }
.vox-dp-header, .vox-dp-weekdays, .vox-dp-days-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.vox-dp-header { grid-template-columns: 36px 1fr 36px; align-items: center; margin-bottom: 10px; }
.vox-dp-month-title { text-align: center; }
.vox-dp-weekdays { margin-bottom: 5px; text-align: center; font-size: 11px; opacity: .7; }
.vox-dp-day { display: grid; min-height: 32px; place-items: center; border-radius: 7px; cursor: pointer; }
.vox-dp-day:hover, .vox-dp-day:focus-visible { outline: none; background: var(--surface-hover, rgba(255,255,255,.08)); }
.vox-dp-day.is-outside { opacity: .38; }
.vox-dp-day.is-selected { color: #fff; background: var(--accent, #6366f1); }
.vox-dp-footer { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border, rgba(255,255,255,.12)); }
.vox-confirm-icon-wrap { display: grid; width: 48px; height: 48px; place-items: center; margin: 0 auto 12px; border-radius: 50%; color: var(--text-primary, #f4f6fb); background: var(--surface-hover, rgba(255,255,255,.08)); }
.vox-confirm-icon-wrap.is-destructive { color: #f87171; background: rgba(248,113,113,.12); }
.vox-reject-meta-box { margin-top: 12px; padding: 12px; border: 1px solid var(--border, rgba(255,255,255,.14)); border-radius: 10px; background: var(--surface-hover, rgba(255,255,255,.04)); }
.btn-danger { color: #fff; border-color: #dc2626; background: #dc2626; }
.btn-danger:hover { border-color: #b91c1c; background: #b91c1c; }
@media (max-width: 650px) {
  .ab-modal.vox-modal-fixed-layout { width: 100% !important; max-height: 92dvh; }
  .ab-modal.vox-modal-fixed-layout .vox-modal-sticky-footer { padding: 12px 14px; }
  .vox-dp-popover { max-width: calc(100vw - 36px); }
}

/* =============================================================================
   VOXCLIENT CORE APPLICATION ENHANCEMENTS — REPAIRED DESIGN SYSTEM
   Full coverage for Client Creation, Brand Memory, Structured Chat & Light Theme
   ============================================================================= */

/* ── Workspace sidebar scroll recovery: keep the conversation list independently scrollable ── */
.ai-layout {
  min-height: 0 !important;
}
.ai-layout > .ai-sidebar {
  min-height: 0 !important;
  height: 100% !important;
}
.ai-layout > .ai-sidebar > .ai-sidebar-list {
  display: block !important;
  flex: 1 1 0% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  overflow-y: scroll !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
}

/* ── Global Shell & AI Studio Viewport Lock ─────────────────────────────────── */
.app-main.app-main-fullwidth {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 1 1 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.view-ai-studio .app-shell,
.app-shell:has(.ai-studio-main) {
  height: auto !important;
  min-height: 100vh !important;
  max-height: none !important;
  overflow: visible !important;
}

.view-ai-studio .app-topnav,
.app-shell:has(.ai-studio-main) .app-topnav {
  margin-bottom: 0 !important;
  padding-bottom: 4px !important;
}

.view-ai-studio .app-main,
.app-shell:has(.ai-studio-main) .app-main {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  display: flex !important;
  flex-direction: column !important;
}

.ai-studio-main {
  flex: 1 1 auto !important;
  min-height: 70vh !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  display: flex !important;
  flex-direction: column !important;
  position: relative !important;
}

/* Allow the complete client workspace to scroll when its content exceeds the viewport. */
.app-shell:has(.ai-layout) .app-main,
.app-shell:has(.ai-studio-main) .app-main {
  min-height: calc(100vh - 90px) !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}
.app-shell:has(.ai-layout) .ai-layout {
  height: auto !important;
  min-height: calc(100vh - 100px) !important;
  max-height: none !important;
  overflow: visible !important;
}

.ai-studio-main .client-workspace-header {
  flex: 0 0 auto !important;
  z-index: 20;
}

.ai-studio-main #chat-history-area {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  width: 100% !important;
  overflow-y: auto !important;
  overscroll-behavior-y: contain;
}

.ai-studio-main #chat-history-inner {
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  gap: 0 !important;
}

.ai-studio-main #chat-history-inner > [data-role="assistant"],
.ai-studio-main #chat-history-inner > div:has(.chat-markdown-body),
.ai-studio-main #chat-history-inner > [data-role="user"] {
  flex: 0 0 auto !important;
  min-height: 0 !important;
  height: auto !important;
}

.ai-studio-main .chat-composer-outer {
  flex: 0 0 auto !important;
  z-index: 20;
  width: 100% !important;
  max-width: 860px !important;
  margin: 0 auto !important;
  padding: 0 24px 8px 24px !important;
  box-sizing: border-box !important;
}

/* ── Back Button & Interactive Helpers ──────────────────────────────────────── */
.ab-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-bottom: 24px;
  transition: color 0.15s ease, transform 0.15s ease;
}

.ab-back-btn:hover {
  color: var(--text-primary);
  transform: translateX(-2px);
}

.client-subnav-pill {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  cursor: pointer !important;
  user-select: none !important;
}

.client-subnav-pill:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25) !important;
}

.client-subnav-pill.active {
  background: rgba(37, 99, 235, 0.25) !important;
  border-color: rgba(96, 165, 250, 0.5) !important;
  color: #FFFFFF !important;
}

/* ── Dedicated Client Creation Page ─────────────────────────────────────────── */
.dedicated-create-page {
  width: 100%;
  min-height: calc(100vh - 110px);
  padding: 12px 24px 64px;
  box-sizing: border-box;
  background: radial-gradient(ellipse at 50% 0%, rgba(37, 99, 235, 0.12), transparent 60%);
}

.dedicated-create-wrap {
  width: min(100%, 860px);
  margin: 0 auto;
}

.dedicated-create-page > .dedicated-create-wrap > .ab-back-btn {
  margin-top: 4px;
  margin-bottom: 20px;
}

.dedicated-create-heading {
  margin: 0 0 26px;
}

.dedicated-create-eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  font-weight: 800;
  color: var(--accent-light, #60a5fa);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.dedicated-create-heading h1 {
  font-size: clamp(28px, 3.8vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.035em;
  margin: 0 0 10px;
  color: var(--text-primary);
}

.dedicated-create-heading p {
  max-width: 620px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.6;
}

.dedicated-create-form {
  padding: clamp(20px, 3.2vw, 32px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl, 20px);
  background: var(--surface-card, rgba(14, 18, 30, 0.88));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.dedicated-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.dedicated-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.dedicated-field-label {
  display: block;
  line-height: 1.4;
}

.dedicated-required-star {
  display: inline !important;
  color: var(--accent-light, #60a5fa);
  margin-left: 3px;
  font-weight: 700;
}

.dedicated-form-full {
  grid-column: 1 / -1;
}

.dedicated-form-grid input,
.dedicated-form-grid textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--bg-subtle, rgba(255, 255, 255, 0.035));
  color: var(--text-primary);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.dedicated-form-grid textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.55;
}

.dedicated-form-grid input:focus,
.dedicated-form-grid textarea:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

.dedicated-form-grid input::placeholder,
.dedicated-form-grid textarea::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.dedicated-upload-section {
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.dedicated-upload-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.dedicated-upload-heading h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text-primary);
}

.dedicated-upload-heading p {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
  max-width: 580px;
}

.dedicated-optional-pill {
  font-size: 10px;
  letter-spacing: 0.08em;
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 4px 10px;
  color: var(--accent-light);
  background: rgba(37, 99, 235, 0.1);
  white-space: nowrap;
  font-weight: 700;
}

.dedicated-material-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 28px 16px;
  border: 1px dashed var(--border-glow, rgba(37, 99, 235, 0.45));
  border-radius: 14px;
  background: rgba(37, 99, 235, 0.04);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}

.dedicated-material-dropzone:hover,
.dedicated-material-dropzone.is-dragging {
  border-color: var(--accent-light);
  background: rgba(37, 99, 235, 0.1);
}

.dedicated-upload-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.15);
  color: var(--accent-light);
  font-size: 22px;
}

.dedicated-material-dropzone strong {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text-primary);
}

.dedicated-material-dropzone small {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-muted);
}

.dedicated-client-file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.dedicated-client-file-list:empty {
  display: none;
}

.dedicated-client-file-list > div {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-subtle, rgba(255, 255, 255, 0.025));
  font-size: 12.5px;
}

.dedicated-upload-note {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 12px 0 0;
}

.dedicated-create-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.dedicated-required-note {
  font-size: 12px;
  color: var(--text-muted);
}

.dedicated-required-note span {
  color: var(--accent-light);
}

.dedicated-create-footer > div {
  display: flex;
  gap: 12px;
  align-items: center;
}

#dedicated-create-client-error {
  padding: 12px 14px;
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .dedicated-create-page {
    padding: 16px 14px 44px;
  }
  .dedicated-form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .dedicated-form-full {
    grid-column: auto;
  }
  .dedicated-create-form {
    padding: 18px 16px;
    gap: 20px;
  }
  .dedicated-create-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }
  .dedicated-create-footer > div {
    justify-content: flex-end;
  }
  .dedicated-upload-heading {
    flex-direction: column;
    gap: 8px;
  }
}

/* ── Dedicated Brand Memory Page ────────────────────────────────────────────── */
.vc-memory-page {
  min-height: calc(100vh - 110px);
  padding: 24px 24px 64px;
  box-sizing: border-box;
  color: var(--text-primary);
  background: radial-gradient(ellipse at 65% 10%, rgba(37, 99, 235, 0.14), transparent 50%);
}

.vc-memory-page-wrap {
  width: min(1140px, 100%);
  margin: 0 auto;
}

.vc-memory-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s ease;
}

.vc-memory-back:hover {
  color: var(--text-primary);
  transform: translateX(-2px);
}

.vc-memory-page-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.vc-memory-page-mark {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-glow, rgba(37, 99, 235, 0.35));
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.2), rgba(37, 99, 235, 0.05));
  color: var(--accent-light);
}

.vc-memory-page-heading {
  flex: 1;
  min-width: 220px;
}

.vc-memory-page-heading h1 {
  margin: 0 0 6px;
  font-size: clamp(26px, 3.5vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.vc-memory-page-heading p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.6;
}

.vc-memory-page-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--accent);
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.25);
  transition: transform 0.15s ease, background 0.15s ease;
}

.vc-memory-page-add:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
}

.vc-memory-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.vc-memory-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-card, rgba(14, 18, 30, 0.7));
  backdrop-filter: blur(12px);
}

.vc-memory-stat-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.vc-memory-stat-label {
  font-size: 11.5px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.vc-memory-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-card, rgba(14, 18, 30, 0.7));
  backdrop-filter: blur(12px);
  flex-wrap: wrap;
}

.vc-memory-search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 220px;
  padding: 0 8px;
  color: var(--text-muted);
}

.vc-memory-search input {
  width: 100%;
  height: 38px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 13.5px;
}

.vc-memory-search input::placeholder {
  color: var(--text-muted);
}

.vc-memory-filter-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
}

.vc-memory-filter {
  min-width: 160px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-solid, #131b2d);
  color: var(--text-primary);
  font: inherit;
  font-size: 12.5px;
  outline: none;
  cursor: pointer;
}

.vc-memory-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.vc-memory-list-head h2 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.vc-memory-list-head p {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.vc-memory-live-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid rgba(52, 211, 153, 0.25);
  border-radius: 999px;
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.08);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.vc-memory-live-tag span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
}

.vc-memory-page-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.vc-memory-item {
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-card, rgba(14, 18, 30, 0.7));
  backdrop-filter: blur(12px);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.vc-memory-item:hover {
  border-color: var(--border-glow, rgba(37, 99, 235, 0.35));
  transform: translateY(-1px);
}

.vc-memory-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.vc-memory-category {
  color: var(--accent-light);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.vc-memory-item-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vc-memory-source {
  color: var(--text-muted);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.vc-memory-item > p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.vc-memory-delete {
  padding: 6px 10px;
  border: 1px solid rgba(248, 113, 113, 0.25);
  border-radius: 7px;
  background: rgba(248, 113, 113, 0.08);
  color: #fca5a5;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.vc-memory-delete:hover {
  background: rgba(248, 113, 113, 0.18);
  border-color: rgba(248, 113, 113, 0.4);
}

.vc-memory-delete:disabled {
  opacity: 0.5;
  cursor: wait;
}

.vc-memory-empty {
  padding: 56px 20px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 16px;
  background: var(--surface-card, rgba(14, 18, 30, 0.4));
}

.vc-memory-empty-icon {
  font-size: 36px;
  color: var(--accent-light);
}

.vc-memory-empty h3 {
  margin: 12px 0 6px;
  color: var(--text-primary);
  font-size: 18px;
}

.vc-memory-empty p,
.vc-memory-page-loading p {
  margin: 0 auto 18px;
  max-width: 440px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

.vc-memory-page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  padding: 48px;
}

.vc-memory-page-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(37, 99, 235, 0.2);
  border-top-color: var(--accent-light);
  border-radius: 50%;
  animation: vcMemorySpin 0.8s linear infinite;
}

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

@media (max-width: 700px) {
  .vc-memory-page { padding: 18px 14px 44px; }
  .vc-memory-stats { grid-template-columns: 1fr; gap: 10px; }
  .vc-memory-toolbar { flex-direction: column; align-items: stretch; }
  .vc-memory-filter-label { justify-content: space-between; }
  .vc-memory-filter { flex: 1; }
  .vc-memory-page-hero { flex-direction: column; align-items: flex-start; }
}

/* ── Add Brand Memory Dialog / Backdrop ─────────────────────────────────────── */
.vc-memory-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10020 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
  box-sizing: border-box;
  background: rgba(4, 6, 14, 0.78) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}

.vc-memory-dialog {
  width: min(580px, 100%);
  max-height: min(88vh, 740px);
  overflow: auto;
  box-sizing: border-box;
  border: 1px solid var(--border-glow, rgba(37, 99, 235, 0.35));
  border-radius: 20px;
  background: var(--surface-solid, #131b2d);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  color: var(--text-primary);
  animation: vcMemoryEnter 0.18s ease-out;
}

.vc-memory-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 24px 20px;
  border-bottom: 1px solid var(--border);
}

.vc-memory-title-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-glow, rgba(37, 99, 235, 0.35));
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.2), rgba(37, 99, 235, 0.05));
  color: var(--accent-light);
  font-size: 22px;
}

.vc-memory-title-copy {
  flex: 1;
  min-width: 0;
}

.vc-memory-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-light);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.vc-memory-title-copy h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.vc-memory-title-copy p {
  margin: 5px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.vc-memory-close {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.vc-memory-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.vc-memory-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px;
}

.vc-memory-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 650;
}

.vc-memory-hint {
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.5;
}

.vc-memory-required {
  color: var(--accent-light);
}

.vc-memory-select-wrap {
  position: relative;
  display: block;
}

.vc-memory-select {
  display: block;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 46px;
  box-sizing: border-box;
  padding: 0 44px 0 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
  background: var(--surface-solid, #131b2d);
  color: var(--text-primary);
  font: inherit;
  font-size: 13.5px;
  font-weight: 550;
  cursor: pointer;
  transition: border-color 0.16s, box-shadow 0.16s;
}

.vc-memory-select:focus,
.vc-memory-textarea:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.vc-memory-select option {
  background: var(--surface-solid, #131b2d);
  color: var(--text-primary);
  padding: 10px;
}

.vc-memory-chevron {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 18px;
  line-height: 1;
}

.vc-memory-textarea {
  width: 100%;
  min-height: 140px;
  box-sizing: border-box;
  resize: vertical;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
  background: var(--bg-subtle, rgba(255, 255, 255, 0.035));
  color: var(--text-primary);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.65;
  transition: border-color 0.16s, box-shadow 0.16s;
}

.vc-memory-textarea::placeholder {
  color: var(--text-muted);
}

.vc-memory-char-count {
  align-self: flex-end;
  margin-top: -2px;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 500;
}

.vc-memory-footer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.vc-memory-persistence {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-secondary);
  font-size: 11.5px;
  line-height: 1.5;
}

.vc-memory-check {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  font-size: 11px;
  font-weight: 800;
}

.vc-memory-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.vc-memory-cancel,
.vc-memory-save {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 10px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, border-color 0.15s, opacity 0.15s;
}

.vc-memory-cancel {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

.vc-memory-cancel:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.vc-memory-save {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.25);
}

.vc-memory-save:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
}

.vc-memory-save:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.vc-memory-error {
  margin: 0;
  padding: 10px 14px;
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 9px;
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  font-size: 12.5px;
}

@media (max-width: 520px) {
  .vc-memory-dialog { border-radius: 16px; }
  .vc-memory-header { padding: 18px; }
  .vc-memory-form { padding: 18px; gap: 18px; }
  .vc-memory-actions { width: 100%; }
  .vc-memory-cancel, .vc-memory-save { flex: 1; }
}

/* ── Chat Markdown Formatting, Tables, Workflows, Attachments & Overlays ───── */
.chat-markdown-body {
  min-width: 0;
  max-width: 100%;
  color: var(--text-primary);
  font-size: 14.5px;
  line-height: 1.65;
}

.chat-markdown-body > * {
  max-width: 100%;
  box-sizing: border-box;
}

.chat-markdown-body p {
  margin: 0 0 12px;
}

.chat-markdown-body p:last-child {
  margin-bottom: 0;
}

.chat-markdown-body code {
  font-family: var(--font-mono, monospace);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.9em;
  color: var(--accent-light, #93c5fd);
}

.chat-markdown-body pre {
  margin: 14px 0;
  padding: 14px 16px;
  background: rgba(5, 8, 16, 0.85);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-x: auto;
  max-width: 100%;
}

.chat-markdown-body pre code {
  background: transparent;
  padding: 0;
  border: none;
  color: #e2e8f0;
  white-space: pre;
  font-size: 13px;
}

.chat-markdown-body .chat-table-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 16px 0 20px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-card, rgba(14, 18, 30, 0.7));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.chat-markdown-body table {
  width: 100%;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  line-height: 1.55;
  text-align: left;
}

.chat-markdown-body thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 14px;
  color: var(--text-primary);
  background: var(--surface-solid, #131b2d);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.025em;
  white-space: normal;
  overflow-wrap: anywhere;
}

.chat-markdown-body tbody td {
  padding: 12px 14px;
  vertical-align: top;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  overflow-wrap: anywhere;
}

.chat-markdown-body tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.018);
}

.chat-markdown-body tbody tr:hover td {
  background: rgba(37, 99, 235, 0.06);
}

.chat-markdown-body tbody tr:last-child td {
  border-bottom: 0;
}

.chat-markdown-body blockquote {
  margin: 14px 0;
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: rgba(37, 99, 235, 0.08);
  color: var(--text-secondary);
}

.chat-markdown-body hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

.chat-markdown-body img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

.chat-markdown-body ul,
.chat-markdown-body ol {
  padding-left: 24px;
  margin: 8px 0 12px;
}

.chat-markdown-body li {
  margin: 5px 0;
  padding-left: 2px;
}

.chat-markdown-body .chat-workflow-step {
  position: relative;
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 16px 0;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-card, rgba(14, 18, 30, 0.7));
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.chat-markdown-body .chat-workflow-step-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.chat-markdown-body .chat-workflow-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  min-height: 38px;
  border: 1px solid var(--border-glow, rgba(37, 99, 235, 0.35));
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.15);
  color: var(--accent-light);
  font-size: 13.5px;
  font-weight: 800;
}

.chat-markdown-body .chat-workflow-step-title {
  min-width: 0;
  padding-top: 6px;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 750;
  line-height: 1.4;
}

.chat-markdown-body .chat-field-row {
  display: block;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
  line-height: 1.6;
}

.chat-markdown-body .chat-field-label {
  display: inline-block;
  margin: 0 8px 3px 0;
  color: var(--accent-light);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Floating jump-to-latest button */
.chat-jump-latest {
  position: fixed;
  left: 50%;
  bottom: 95px;
  z-index: 900;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-solid, rgba(17, 24, 39, 0.95));
  color: var(--text-primary);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.chat-jump-latest.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.chat-jump-latest:hover {
  background: var(--surface-hover, rgba(37, 99, 235, 0.2));
  border-color: var(--accent);
}

@media (max-width: 640px) {
  .chat-jump-latest {
    bottom: 85px;
    width: 36px;
    height: 36px;
  }
}

/* Full-screen file drag-drop overlay */
#vox-chat-drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: rgba(4, 6, 14, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 0.16s ease, transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}

#vox-chat-drop-overlay.is-visible {
  opacity: 1;
  transform: scale(1);
}

.vox-chat-drop-art {
  position: relative;
  width: 136px;
  height: 112px;
  margin-bottom: 22px;
}

.vox-drop-file {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.vox-drop-file-code {
  left: 5px;
  top: 19px;
  width: 56px;
  height: 50px;
  border-radius: 14px;
  background: #93c5fd;
  color: #0f172a;
  font-size: 20px;
  font-weight: 900;
  transform: rotate(-13deg);
}

.vox-drop-file-doc {
  right: 9px;
  top: 4px;
  width: 47px;
  height: 64px;
  gap: 6px;
  align-items: flex-start;
  flex-direction: column;
  padding-left: 10px;
  border-radius: 7px;
  background: #60a5fa;
  transform: rotate(15deg);
}

.vox-drop-file-doc i {
  display: block;
  width: 24px;
  height: 4px;
  border-radius: 3px;
  background: #0f172a;
}

.vox-drop-file-doc i:nth-child(2) { width: 18px; }
.vox-drop-file-doc i:nth-child(3) { width: 14px; }

.vox-drop-file-image {
  left: 43px;
  bottom: 0;
  width: 63px;
  height: 53px;
  border-radius: 14px;
  background: #2563eb;
}

.vox-chat-drop-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  color: #fff;
}

.vox-chat-drop-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
}

/* Chat Attachments Row & Cards */
.chat-attachments-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  width: 100%;
}

.chat-attachment-img-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.3);
  cursor: pointer;
  max-width: 180px;
  max-height: 140px;
  transition: transform 0.15s ease, border-color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-attachment-img-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-light);
}

.chat-attachment-thumb {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 140px;
  object-fit: cover;
  border-radius: 9px;
}

.chat-attachment-name-pill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 3px 6px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
  color: #fff;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-attachment-doc-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface-card, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 13px;
  max-width: 260px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.chat-attachment-doc-card:hover {
  background: var(--surface-hover, rgba(255, 255, 255, 0.1));
  border-color: var(--accent-light);
}

.chat-attachment-doc-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.chat-attachment-doc-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* Lightbox Modal */
#chat-lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 10040;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.chat-lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  object-fit: contain;
}

.chat-lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s;
}

.chat-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ── Toast Notifications ────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  z-index: 10050;
  pointer-events: none;
}

.ab-toast {
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
  max-width: 380px;
  word-break: break-word;
}

.ab-toast.show {
  opacity: 1;
  transform: translateX(0);
}

.ab-toast-success {
  background: linear-gradient(135deg, #10b981, #059669);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.ab-toast-error {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.ab-toast-info {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border: 1px solid rgba(37, 99, 235, 0.4);
}

/* ── Comprehensive Light Theme Overrides ([data-theme=light]) ─────────────── */
[data-theme=light] .dedicated-create-page {
  background: radial-gradient(ellipse at 50% 0%, rgba(37, 99, 235, 0.08), transparent 60%);
}

[data-theme=light] .dedicated-create-heading h1 {
  color: #0F172A !important;
}

[data-theme=light] .dedicated-create-heading p {
  color: #475569 !important;
}

[data-theme=light] .dedicated-create-form {
  background: #FFFFFF !important;
  border-color: #E2E8F0 !important;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.08) !important;
}

[data-theme=light] .dedicated-form-grid label {
  color: #334155 !important;
}

[data-theme=light] .dedicated-form-grid input,
[data-theme=light] .dedicated-form-grid textarea {
  background: #F8FAFC !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
}

[data-theme=light] .dedicated-form-grid input:focus,
[data-theme=light] .dedicated-form-grid textarea:focus {
  border-color: #2563EB !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

[data-theme=light] .dedicated-upload-heading h2 {
  color: #0F172A !important;
}

[data-theme=light] .dedicated-upload-heading p {
  color: #475569 !important;
}

[data-theme=light] .dedicated-material-dropzone {
  background: #F8FAFC !important;
  border-color: #CBD5E1 !important;
}

[data-theme=light] .dedicated-material-dropzone:hover {
  background: #F1F5F9 !important;
  border-color: #2563EB !important;
}

[data-theme=light] .dedicated-material-dropzone strong {
  color: #0F172A !important;
}

[data-theme=light] .dedicated-material-dropzone small {
  color: #64748B !important;
}

[data-theme=light] .dedicated-client-file-list > div {
  background: #F8FAFC !important;
  border-color: #E2E8F0 !important;
  color: #0F172A !important;
}

[data-theme=light] .dedicated-upload-section,
[data-theme=light] .dedicated-create-footer {
  border-top-color: #E2E8F0 !important;
}

/* Light Theme - Brand Memory */
[data-theme=light] .vc-memory-page {
  background: radial-gradient(ellipse at 65% 10%, rgba(37, 99, 235, 0.08), transparent 50%);
  color: #0F172A;
}

[data-theme=light] .vc-memory-page-heading h1 {
  color: #0F172A !important;
}

[data-theme=light] .vc-memory-page-heading p {
  color: #475569 !important;
}

[data-theme=light] .vc-memory-stat,
[data-theme=light] .vc-memory-toolbar,
[data-theme=light] .vc-memory-item {
  background: #FFFFFF !important;
  border-color: #E2E8F0 !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04) !important;
}

[data-theme=light] .vc-memory-stat-value {
  color: #0F172A !important;
}

[data-theme=light] .vc-memory-stat-label {
  color: #64748B !important;
}

[data-theme=light] .vc-memory-search input {
  color: #0F172A !important;
}

[data-theme=light] .vc-memory-filter {
  background: #FFFFFF !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
}

[data-theme=light] .vc-memory-filter option {
  background: #FFFFFF !important;
  color: #0F172A !important;
}

[data-theme=light] .vc-memory-list-head h2 {
  color: #0F172A !important;
}

[data-theme=light] .vc-memory-item > p {
  color: #334155 !important;
}

[data-theme=light] .vc-memory-dialog {
  background: #FFFFFF !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.15) !important;
}

[data-theme=light] .vc-memory-header {
  border-bottom-color: #E2E8F0 !important;
}

[data-theme=light] .vc-memory-title-copy h2 {
  color: #0F172A !important;
}

[data-theme=light] .vc-memory-title-copy p {
  color: #475569 !important;
}

[data-theme=light] .vc-memory-select,
[data-theme=light] .vc-memory-textarea {
  background: #F8FAFC !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
}

[data-theme=light] .vc-memory-footer {
  border-top-color: #E2E8F0 !important;
}

[data-theme=light] .vc-memory-cancel {
  border-color: #CBD5E1 !important;
  color: #334155 !important;
}

[data-theme=light] .vc-memory-cancel:hover {
  background: #F1F5F9 !important;
  color: #0F172A !important;
}

/* Light Theme - Chat Messages & Markdown */
[data-theme=light] .chat-markdown-body {
  color: #1E293B !important;
}

[data-theme=light] .chat-markdown-body h1,
[data-theme=light] .chat-markdown-body h2,
[data-theme=light] .chat-markdown-body h3,
[data-theme=light] .chat-markdown-body h4 {
  color: #0F172A !important;
}

[data-theme=light] .chat-markdown-body strong {
  color: #0F172A !important;
}

[data-theme=light] .chat-markdown-body .chat-table-wrap {
  background: #FFFFFF !important;
  border-color: #E2E8F0 !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05) !important;
}

[data-theme=light] .chat-markdown-body table thead th {
  background: #F8FAFC !important;
  color: #334155 !important;
  border-bottom-color: #CBD5E1 !important;
}

[data-theme=light] .chat-markdown-body table tbody td {
  color: #1E293B !important;
  border-bottom-color: #F1F5F9 !important;
}

[data-theme=light] .chat-markdown-body table tbody tr:nth-child(even) td {
  background: #FAFAFC !important;
}

[data-theme=light] .chat-markdown-body table tbody tr:hover td {
  background: #EFF6FF !important;
}

[data-theme=light] .chat-markdown-body code {
  background: #F1F5F9 !important;
  color: #2563EB !important;
  border-color: #E2E8F0 !important;
}

[data-theme=light] .chat-markdown-body pre {
  background: #0F172A !important;
  border-color: #1E293B !important;
}

[data-theme=light] .chat-markdown-body pre code {
  color: #F8FAFC !important;
}

[data-theme=light] .chat-markdown-body .chat-workflow-step {
  background: #FFFFFF !important;
  border-color: #E2E8F0 !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04) !important;
}

[data-theme=light] .chat-markdown-body .chat-workflow-step-header {
  border-bottom-color: #E2E8F0 !important;
}

[data-theme=light] .chat-markdown-body .chat-workflow-step-title {
  color: #0F172A !important;
}

[data-theme=light] .chat-markdown-body .chat-field-row {
  background: #F8FAFC !important;
  border-color: #E2E8F0 !important;
}

[data-theme=light] .chat-jump-latest {
  background: #FFFFFF !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.15) !important;
}

[data-theme=light] .chat-attachment-doc-card {
  background: #FFFFFF !important;
  border-color: #E2E8F0 !important;
  color: #0F172A !important;
}

[data-theme=light] .chat-attachment-doc-card:hover {
  background: #F8FAFC !important;
  border-color: #2563EB !important;
}

/* Light Theme - Client Cards & Directory */
[data-theme=light] .clients-dir-container {
  color: #0F172A;
}

[data-theme=light] .clients-dir-title {
  color: #0F172A !important;
}

[data-theme=light] .clients-dir-subtitle {
  color: #475569 !important;
}

[data-theme=light] .clients-dir-toolbar {
  background: #FFFFFF !important;
  border-color: #E2E8F0 !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04) !important;
}

[data-theme=light] .clients-dir-search-input {
  background: #F8FAFC !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
}

[data-theme=light] .clients-dir-filter-select {
  background: #F8FAFC !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
}

[data-theme=light] .client-card {
  background: #FFFFFF !important;
  border-color: #E2E8F0 !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05) !important;
}

[data-theme=light] .client-card:hover {
  border-color: #2563EB !important;
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.12) !important;
}

[data-theme=light] .client-card-name {
  color: #0F172A !important;
}

[data-theme=light] .client-card-desc {
  color: #475569 !important;
}

[data-theme=light] .client-card-dropdown {
  background: #FFFFFF !important;
  border-color: #E2E8F0 !important;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.12) !important;
}

[data-theme=light] .client-dropdown-item {
  color: #334155 !important;
}

[data-theme=light] .client-dropdown-item:hover {
  background: #F1F5F9 !important;
  color: #0F172A !important;
}

[data-theme=light] .client-subnav-pill {
  background: #FFFFFF !important;
  border-color: #CBD5E1 !important;
  color: #334155 !important;
}

[data-theme=light] .client-subnav-pill:hover {
  background: #F1F5F9 !important;
  color: #0F172A !important;
}

/* Light Theme - Campaigns & Approvals */
[data-theme=light] .campaigns-page-wrap,
[data-theme=light] .approvals-page-wrap {
  color: #0F172A;
}

[data-theme=light] .campaign-card,
[data-theme=light] .approval-card,
[data-theme=light] .campaign-hero-card {
  background: #FFFFFF !important;
  border-color: #E2E8F0 !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05) !important;
}

[data-theme=light] .campaign-card-title,
[data-theme=light] .campaign-hero-title {
  color: #0F172A !important;
}

[data-theme=light] .campaign-card-brief {
  color: #475569 !important;
}

[data-theme=light] .approval-body-preview {
  background: #F8FAFC !important;
  border-color: #E2E8F0 !important;
  color: #334155 !important;
}

[data-theme=light] .campaign-toolbar {
  background: #FFFFFF !important;
  border-color: #E2E8F0 !important;
}

[data-theme=light] .campaign-search-box input,
[data-theme=light] .campaign-select-filter {
  background: #F8FAFC !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
}

/* Light Theme - Members & Seats */
[data-theme=light] .members-title {
  color: #0F172A !important;
}

[data-theme=light] .members-subtitle {
  color: #475569 !important;
}

[data-theme=light] .members-summary-card,
[data-theme=light] .members-rule-card,
[data-theme=light] .members-table-wrap {
  background: #FFFFFF !important;
  border-color: #E2E8F0 !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05) !important;
}

[data-theme=light] .members-stat-box {
  background: #F8FAFC !important;
  border-color: #E2E8F0 !important;
}

[data-theme=light] .members-stat-val {
  color: #0F172A !important;
}

[data-theme=light] .members-rule-title {
  color: #0F172A !important;
}

[data-theme=light] .members-table th {
  background: #F1F5F9 !important;
  color: #475569 !important;
}

[data-theme=light] .members-table td {
  border-bottom-color: #E2E8F0 !important;
  color: #1E293B !important;
}

/* Premium custom-menu presentation for native selects: visual treatment only. */
select,
select.input,
.clients-dir-filter-select,
.campaign-select-filter,
.admin-dialog-field-wrap select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 42px;
  padding: 10px 42px 10px 14px !important;
  border: 1px solid rgba(148,163,184,.22) !important;
  border-radius: 12px !important;
  background-color: rgba(23,30,45,.96) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a8b5cc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  color: #edf2ff !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 3px 10px rgba(0,0,0,.08);
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
select:hover,
select.input:hover,
.clients-dir-filter-select:hover,
.campaign-select-filter:hover,
.admin-dialog-field-wrap select:hover {
  border-color: rgba(124,156,255,.65) !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.14), inset 0 1px 0 rgba(255,255,255,.04);
}
select:focus-visible,
select.input:focus-visible,
.clients-dir-filter-select:focus-visible,
.campaign-select-filter:focus-visible,
.admin-dialog-field-wrap select:focus-visible {
  outline: none !important;
  border-color: #819bff !important;
  box-shadow: 0 0 0 3px rgba(100,130,255,.2), 0 5px 16px rgba(0,0,0,.12);
}
select option,
select optgroup {
  background: #171e2d;
  color: #edf2ff;
}
[data-theme="light"] select,
[data-theme="light"] select.input,
[data-theme="light"] .clients-dir-filter-select,
[data-theme="light"] .campaign-select-filter,
[data-theme="light"] .admin-dialog-field-wrap select {
  background-color: #fff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  color: #172033 !important;
  border-color: #d4dce8 !important;
  box-shadow: 0 2px 7px rgba(15,23,42,.04);
}
[data-theme="light"] select option,
[data-theme="light"] select optgroup {
  background: #fff;
  color: #172033;
}

/* Consistent native select menus across the app: filters, forms, and dialogs. */
select,
select.input,
.clients-dir-filter-select,
.campaign-select-filter,
.admin-dialog-field-wrap select {
  color-scheme: dark;
  accent-color: var(--accent, #527cff);
  border: 1px solid var(--border, #343b4b);
  border-radius: 10px;
  background-color: var(--surface-solid, #191e29);
  color: var(--text-primary, #f4f6fb);
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
select:hover,
select.input:hover,
.clients-dir-filter-select:hover,
.campaign-select-filter:hover,
.admin-dialog-field-wrap select:hover {
  border-color: color-mix(in srgb, var(--accent, #527cff) 55%, var(--border, #343b4b));
}
select:focus-visible,
select.input:focus-visible,
.clients-dir-filter-select:focus-visible,
.campaign-select-filter:focus-visible,
.admin-dialog-field-wrap select:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent, #527cff) 65%, transparent);
  outline-offset: 2px;
  border-color: var(--accent, #527cff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #527cff) 14%, transparent);
}
select option,
select optgroup {
  background-color: #191e29;
  color: #edf1fa;
}
[data-theme="light"] select,
[data-theme="light"] select.input,
[data-theme="light"] .clients-dir-filter-select,
[data-theme="light"] .campaign-select-filter,
[data-theme="light"] .admin-dialog-field-wrap select {
  color-scheme: light;
  background-color: #fff;
  color: #172033;
  border-color: #cbd5e1;
}
[data-theme="light"] select option,
[data-theme="light"] select optgroup {
  background-color: #fff;
  color: #172033;
}

/* Approvals page alignment: match the content inset used by other workspace views. */
.approvals-page-wrap {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 22px clamp(18px, 2.2vw, 32px) 36px;
  margin: 0 auto;
}
.approvals-page-wrap > .campaign-breadcrumbs {
  margin: 0 0 22px;
  padding: 0;
  line-height: 1.5;
}
.approvals-page-wrap > .campaign-toolbar {
  width: 100%;
  box-sizing: border-box;
}
.approvals-page-wrap #approvals-list-container {
  min-width: 0;
  width: 100%;
}
@media (max-width: 640px) {
  .approvals-page-wrap { padding: 16px 14px 28px; }
  .approvals-page-wrap > .campaign-breadcrumbs { margin-bottom: 16px; }
}

/* Final select-control polish: refined pill-like fields across filters, forms and dialogs. */
select,
select.input,
.clients-dir-filter-select,
.campaign-select-filter,
.admin-dialog-field-wrap select {
  appearance: none !important;
  -webkit-appearance: none !important;
  min-height: 42px !important;
  padding: 10px 42px 10px 14px !important;
  border: 1px solid rgba(148,163,184,.24) !important;
  border-radius: 12px !important;
  background-color: #171e2d !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a8b5cc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  color: #edf2ff !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 3px 10px rgba(0,0,0,.08) !important;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease;
}
select:hover,
select.input:hover,
.clients-dir-filter-select:hover,
.campaign-select-filter:hover,
.admin-dialog-field-wrap select:hover {
  border-color: rgba(124,156,255,.7) !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.14) !important;
}
select:focus-visible,
select.input:focus-visible,
.clients-dir-filter-select:focus-visible,
.campaign-select-filter:focus-visible,
.admin-dialog-field-wrap select:focus-visible {
  outline: none !important;
  border-color: #819bff !important;
  box-shadow: 0 0 0 3px rgba(100,130,255,.2) !important;
}
select option,
select optgroup { background: #171e2d; color: #edf2ff; }
[data-theme="light"] select,
[data-theme="light"] select.input,
[data-theme="light"] .clients-dir-filter-select,
[data-theme="light"] .campaign-select-filter,
[data-theme="light"] .admin-dialog-field-wrap select {
  background-color: #fff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  color: #172033 !important;
  border-color: #d4dce8 !important;
}
[data-theme="light"] select option,
[data-theme="light"] select optgroup { background: #fff; color: #172033; }

/* Workspace side-page layout: prevent nested max-widths and parent padding from creating oversized margins. */
#app-main:not(.app-main-fullwidth) > .ai-main {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 24px clamp(20px, 2.2vw, 32px) !important;
  box-sizing: border-box !important;
}
#app-main > .ai-main:has(.clients-dir-container),
#app-main > .ai-main:has(.members-container),
#app-main > .ai-main:has(.campaigns-page-wrap),
#app-main > .ai-main:has(.approvals-page-wrap) {
  max-width: none !important;
  padding: 24px clamp(20px, 2.2vw, 32px) !important;
}
#app-main .clients-dir-container,
#app-main .members-container,
#app-main .campaigns-page-wrap,
#app-main .approvals-page-wrap {
  width: 100% !important;
  max-width: 1500px !important;
  margin-inline: auto !important;
  box-sizing: border-box !important;
}
@media (max-width: 640px) {
  #app-main:not(.app-main-fullwidth) > .ai-main,
  #app-main > .ai-main:has(.clients-dir-container),
  #app-main > .ai-main:has(.members-container),
  #app-main > .ai-main:has(.campaigns-page-wrap),
  #app-main > .ai-main:has(.approvals-page-wrap) {
    padding: 16px !important;
  }
}

/* Legacy shell gutter fallback for content outside the dynamic page root. */
.app-main {
  padding-inline: clamp(24px, 3vw, 44px) !important;
  box-sizing: border-box !important;
}
.app-main.app-main-fullwidth {
  padding-inline: clamp(24px, 3vw, 44px) !important;
  box-sizing: border-box !important;
}
.app-main > .ai-main,
.app-main > main,
.app-main > section {
  min-width: 0;
  max-width: 1600px;
  margin-inline: auto;
}
@media (max-width: 640px) {
  .app-main,
  .app-main.app-main-fullwidth {
    padding-inline: 16px !important;
  }
}

/* Final global scroll guard: page-level content remains reachable on every route. */
html,
body.app-body {
  height: auto !important;
  min-height: 100% !important;
  overflow-x: clip !important;
  overflow-y: auto !important;
}
.app-shell,
body.app-body > .app-shell {
  height: auto !important;
  min-height: 100vh !important;
  max-height: none !important;
  overflow: visible !important;
}
.app-shell > .app-main,
.app-main,
.app-main.app-main-fullwidth {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}
.app-main.app-main-fullwidth {
  flex: 1 1 auto !important;
  min-height: 0 !important;
}


/* Workspace dashboard usability refinement — shared visual tokens, scoped to Home. */
.workspace-dashboard {
  --dash-space-1: 4px; --dash-space-2: 8px; --dash-space-3: 12px;
  --dash-space-4: 16px; --dash-space-5: 24px;
  --dash-text-xs: 12px; --dash-text-sm: 13px; --dash-text-md: 14px;
  --dash-text-lg: 16px; --dash-text-xl: 20px;
  --dash-radius-sm: 8px; --dash-radius-md: 12px; --dash-radius-lg: 16px;
  --dash-muted: var(--text-secondary); --dash-subtle: var(--text-muted);
}
.workspace-dashboard .workspace-dashboard-title {
  margin: 0 0 6px; color: var(--text-primary); font-size: clamp(24px, 2.4vw, 30px);
  font-weight: 750; line-height: 1.2; letter-spacing: -.025em;
}
.workspace-dashboard .btn {
  min-height: 36px !important; padding: 8px 12px !important; border-radius: var(--dash-radius-sm) !important;
  font-size: var(--dash-text-sm) !important; font-weight: 600; line-height: 1.25;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.workspace-dashboard .btn-primary { background: #2457d6; border-color: #2457d6; color: #fff; }
.workspace-dashboard .btn-primary:hover:not(:disabled) { background: #1e49b5; border-color: #1e49b5; }
.workspace-dashboard .btn-secondary,
.workspace-dashboard .btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.workspace-dashboard .btn-secondary:hover:not(:disabled),
.workspace-dashboard .btn-ghost:hover:not(:disabled) { background: var(--surface-glass); border-color: var(--border); color: var(--text-primary) !important; }
.workspace-dashboard .btn-ghost { color: var(--text-secondary) !important; }
.workspace-dashboard .btn:focus-visible { outline: 3px solid #93b4ff; outline-offset: 3px; }
.workspace-dashboard .activity-feed-list { display:flex; flex-direction:column; gap:10px; }
.workspace-dashboard .activity-timeline-item { border-radius: var(--dash-radius-md) !important; padding: 12px 14px !important; }
.workspace-dashboard .activity-item-title { font-weight:650; color:var(--text-primary); font-size:var(--dash-text-md); line-height:1.4; }
.workspace-dashboard .activity-item-description { color:var(--dash-muted); font-size:var(--dash-text-sm); line-height:1.45; overflow-wrap:anywhere; }
.workspace-dashboard .workload-header-with-controls { justify-content:flex-start; }
.workspace-dashboard .workload-header-with-controls .workload-title { flex:1 1 auto; }
.workspace-dashboard .workload-header-with-controls .workload-carousel-controls { flex:0 0 auto; margin-left:0; }

/* Workspace header: separate the brand, workspace selector, navigation and
   account actions into deliberate visual groups. */
/* Workspace header layout: three explicit columns prevent the switcher from
   painting into the navigation. The center column may shrink/scroll; side
   columns remain sized to their own controls. */
.app-topnav-inner {
  display:grid !important;
  grid-template-columns:max-content minmax(0, 1fr) max-content;
  align-items:center;
  column-gap:18px;
  flex-wrap:nowrap;
  justify-content:initial;
  padding-left:26px;
  padding-right:26px;
}
.app-topnav-brand-group {
  grid-column:1;
  display:flex;
  align-items:center;
  flex:initial;
  flex-shrink:0;
  min-width:0;
  gap:14px;
  overflow:visible;
  padding-right:8px;
}
.app-topnav-brand-group .app-logo {
  display:inline-flex;
  flex:0 0 auto;
  min-width:max-content;
}
.app-topnav-brand-group .workspace-switcher-wrap {
  position:relative;
  flex:0 0 176px !important;
  width:176px;
  min-width:176px;
  max-width:176px;
  margin:0 0 0 10px !important;
}
.app-topnav-brand-group .workspace-switcher-btn {
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:9px;
  width:100% !important;
  min-width:0;
  max-width:100%;
  min-height:40px;
  padding:7px 11px;
  font-size:13px !important;
  line-height:1.3;
  box-sizing:border-box;
  overflow:hidden;
  border-radius:14px;
  background:var(--surface-glass);
  border:1px solid var(--border);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035);
}
.app-topnav-brand-group .workspace-switcher-btn::after { content:none !important; }
.app-topnav-brand-group .workspace-switcher-btn > svg {
  display:block;
  flex:0 0 12px;
  width:12px;
  height:12px;
  margin-left:4px;
}
.app-topnav-brand-group .workspace-switcher-indicator {
  display:block;
  flex:0 0 7px;
  width:7px;
  height:7px;
}
.app-topnav-brand-group .workspace-switcher-name {
  display:none !important;
}
.app-topnav-brand-group .workspace-switcher-role-badge {
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  flex:1 1 auto;
  min-width:0;
  min-height:30px;
  padding:5px 14px;
  font-size:12px !important;
  line-height:1.2;
  letter-spacing:.055em;
  text-align:center;
}
.app-topnav-brand-group .workspace-switcher-btn:hover {
  background:var(--surface-glass);
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(59,130,246,.08);
}
.workspace-switcher-name {
  display:block;
  flex:1 1 0;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
@media (max-width:1400px) {
  .workspace-switcher-role-badge { display:none !important; }
}
.app-main-nav {
  grid-column:2;
  order:initial;
  display:flex;
  flex:initial;
  width:100%;
  min-width:0;
  max-width:100%;
  box-sizing:border-box;
  justify-content:flex-start;
  flex-wrap:nowrap;
  gap:clamp(7px, 0.55vw, 10px);
  overflow-x:auto;
  overflow-y:hidden;
  scrollbar-width:none;
  -webkit-overflow-scrolling:touch;
  padding:3px 6px 3px 12px;
  margin-left:0;
}
.app-main-nav::-webkit-scrollbar { display:none; }
.app-main-nav a,
.app-main-nav a.active {
  flex:0 0 auto !important;
  min-width:max-content;
  white-space:nowrap;
  padding-left:10px;
  padding-right:10px;
  border-radius:12px !important;
  align-self:center;
  margin-top:0;
  margin-bottom:0;
}
.app-topnav-right {
  grid-column:3;
  order:initial;
  display:flex;
  align-items:center;
  flex:initial;
  min-width:max-content;
  margin:0 !important;
  gap:10px;
  padding-right:2px;
}
.app-topnav-right .theme-toggle-btn {
  width:44px;
  min-width:44px;
  height:44px;
  min-height:44px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:13px;
  border:1px solid var(--border);
  background:var(--surface-glass);
}
.app-topnav-right .app-user-avatar {
  width:44px;
  height:44px;
  min-width:44px;
  flex:0 0 44px;
  border:1px solid var(--border);
  box-shadow:0 0 0 1px rgba(255,255,255,.035);
}
@media (max-width:1120px) {
  .app-topnav-inner { column-gap:10px; padding-left:16px; padding-right:16px; }
  .app-topnav-brand-group { gap:9px; padding-right:0; }
  .app-logo-workspace { display:none; }
  .app-main-nav { gap:2px; }
  .app-main-nav a,
  .app-main-nav a.active { padding-left:8px; padding-right:8px; font-size:12px; }
}
@media (max-width:900px) {
  .app-topnav-inner { grid-template-columns:minmax(0, 1fr) max-content; }
  .app-topnav-brand-group { grid-column:1; }
  .app-main-nav { grid-column:1 / -1; grid-row:2; width:100%; }
  .app-topnav-right { grid-column:2; grid-row:1; }
}
@media (max-width:760px) {
  .app-topnav { padding:0 8px; }
  .app-topnav-inner { padding:8px; column-gap:6px; }
  .app-topnav-brand-group { gap:6px; }
  .workspace-sidebar-toggle { width:32px; height:32px; flex:0 0 32px; }
  .app-logo .nav-logo-text { display:none; }
  .app-topnav-brand-group .workspace-switcher-wrap { flex-basis:132px !important; width:132px; min-width:132px; max-width:132px; margin-left:5px !important; }
  .workspace-switcher-btn { gap:5px; font-size:12px; }
  .app-main-nav { grid-column:1 / -1; grid-row:2; }
  .app-main-nav a,
  .app-main-nav a.active { padding:7px; font-size:11px; }
  .app-topnav-right { gap:5px; }
  .app-user-avatar { width:36px; height:36px; min-width:36px; flex:0 0 36px; }
  .app-topnav-right .theme-toggle-btn { width:38px; min-width:38px; height:38px; min-height:38px; }
}
@media (max-width:420px) {
  .app-topnav-brand-group .workspace-switcher-wrap { display:none; }
  .app-topnav-inner { grid-template-columns:minmax(0,1fr) max-content; gap:5px; }
}
