/* ==========================================================================
   Uniframe Studio - Design System Architecture
   Inspired by Kling AI & Higgsfield Cinematic Generative Studios
   Zero Emoji | 8 Interactive States | DTCG Intent Tokens | Mobile-First Base
   ========================================================================== */

:root {
  /* Typography Scale */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Obsidian / Cinematic Surface Tokens */
  --surface-canvas: #090a0d;
  --surface-rail: #0e1015;
  --surface-topbar: #101217;
  --surface-card: #13161c;
  --surface-card-hover: #181c24;
  --surface-dock: rgba(16, 18, 24, 0.92);
  --surface-popover: #161922;
  --surface-input: #0c0e12;

  /* Hairline Border Tokens */
  --border-subtle: #1c212b;
  --border-medium: #272f3d;
  --border-hover: #3b465a;
  --border-focus: #38bdf8;
  --border-glow: rgba(43, 248, 77, 0.35);

  /* Primary Accent: Electric Lime / Neon Kling Green */
  --accent-lime: #2bf84d;
  --accent-lime-hover: #38ff5a;
  --accent-lime-active: #22d640;
  --accent-lime-text: #050806;
  --accent-lime-glow: rgba(43, 248, 77, 0.28);

  /* Secondary Accents */
  --accent-cyan: #38bdf8;
  --accent-cyan-hover: #0284c7;
  --accent-cyan-subtle: rgba(56, 189, 248, 0.12);
  --accent-purple: #a855f7;

  /* Typography Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #7c8aa0; /* >= 4.5:1 on every dark surface (was #64748b, 3.6-4.2:1) */
  --text-disabled: #475569;

  /* Engine Health Status Colors */
  --status-online: #22c55e;
  --status-warning: #eab308;
  --status-offline: #64748b;
  --status-danger: #ef4444;

  /* Dimensions & Spacing */
  --rail-width: 68px;
  --topbar-height: 56px;
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-normal: 240ms;
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--surface-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

/* Native controls and scrollbars follow the dark theme (scrollbar-color is
   inherited, so every scroll container picks it up) */
html {
  color-scheme: dark;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hover) transparent;
}

/* App Master Layout */
.studio-app {
  display: flex;
  width: 100vw;
  height: 100vh;
  position: relative;
}

/* ==========================================================================
   1. Left Slim Navigation Rail (Kling Architecture)
   ========================================================================== */

.nav-rail {
  width: var(--rail-width);
  height: 100vh;
  background-color: var(--surface-rail);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0 16px;
  flex-shrink: 0;
  z-index: 95; /* above the floating dock (90) so rail popovers are not covered */
}

.rail-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.brand-monogram {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  position: relative;
  text-decoration: none;
  transition: background-color var(--duration-fast), border-color var(--duration-fast), transform var(--duration-fast) var(--ease-spring);
}

.brand-monogram-img {
  display: block;
  width: 30px;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.45));
}

.brand-monogram:hover {
  background-color: rgba(255, 255, 255, 0.04);
  border-color: var(--border-subtle);
  transform: translateY(-1px);
}

.brand-monogram:focus-visible {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

.brand-pulse-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-lime);
  border: 2px solid var(--surface-rail);
  box-shadow: 0 0 8px var(--accent-lime);
}

.rail-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  align-items: center;
}

.rail-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-spring);
}

.rail-btn:hover {
  background-color: var(--surface-card-hover);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.rail-btn:focus-visible {
  outline: 2px solid var(--border-focus);
}

.rail-btn.active {
  background-color: var(--surface-card);
  color: var(--accent-lime);
  border-color: var(--border-medium);
  box-shadow: inset 0 0 12px rgba(43, 248, 77, 0.08);
}

.rail-btn.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background-color: var(--accent-lime);
}

.rail-btn.is-filtering {
  color: var(--accent-lime);
  border-color: var(--accent-lime);
  background-color: var(--surface-card);
}

.rail-btn.is-filtering .rail-counter {
  color: var(--accent-lime);
  border-color: var(--accent-lime);
}

.rail-counter {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  background-color: var(--surface-card-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-muted);
}

.rail-log-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
}

.rail-tooltip {
  position: absolute;
  left: calc(100% + 12px);
  background-color: var(--surface-popover);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-4px);
  transition: all var(--duration-fast);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 100;
}

.rail-btn:hover .rail-tooltip {
  opacity: 1;
  transform: translateX(0);
}

.rail-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.rail-credits {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 52px;
  padding: 8px 2px 7px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: default;
}

.rail-credits-icon {
  color: var(--accent-lime);
  margin-bottom: 2px;
}

.rail-credits-value {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.rail-credits-label {
  font-size: 9px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.rail-avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(140deg, #38bdf8 0%, #6366f1 50%, #c056f5 100%);
  border: 0;
  box-shadow: 0 0 0 2px var(--surface-rail), 0 0 0 3px rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: box-shadow var(--duration-fast), transform var(--duration-fast) var(--ease-spring);
}

.rail-avatar-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px var(--surface-rail), 0 0 0 3px rgba(255, 255, 255, 0.35);
}

.rail-avatar-btn:active {
  transform: scale(0.96);
}

.avatar-glyph {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* ==========================================================================
   2. Main Shell & Top Bar
   ========================================================================== */

.studio-main-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

.app-topbar {
  height: var(--topbar-height);
  background-color: var(--surface-topbar);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.workspace-pill {
  display: flex;
  align-items: center;
  gap: 8px;
}

.workspace-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.workspace-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  color: var(--accent-cyan);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
}

/* Segmented Pill Selector (Higgsfield Style) */
.mode-segmented {
  display: flex;
  align-items: center;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}

.mode-pill {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.mode-pill:hover {
  color: var(--text-primary);
  background-color: var(--surface-card-hover);
}

.mode-pill.active {
  background-color: var(--surface-popover);
  color: var(--text-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.mode-pill.active svg {
  color: var(--accent-lime);
}

/* Topbar Right & Engine Health Hub */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Engine Hub Trigger & Popover */
.engine-hub-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.engine-hub-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-fast);
}

.engine-hub-btn:hover {
  background-color: var(--surface-card-hover);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.engine-hub-btn:focus-visible {
  outline: 2px solid var(--accent-lime);
  outline-offset: 2px;
}

.engine-hub-btn[aria-expanded="true"] {
  border-color: var(--accent-lime);
  background-color: var(--surface-card-hover);
  color: var(--text-primary);
}

.engine-hub-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--status-online);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
  flex-shrink: 0;
  transition: all var(--duration-normal);
}

.engine-hub-pulse-dot.warning {
  background-color: var(--status-warning);
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

.engine-hub-pulse-dot.busy {
  background-color: var(--accent-lime);
  box-shadow: 0 0 8px var(--accent-lime);
  animation: pulseDot 1s ease-in-out infinite;
}

.engine-hub-title {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

.engine-hub-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-weight: 500;
}

.engine-hub-chevron {
  color: var(--text-muted);
  transition: transform var(--duration-fast);
}

.engine-hub-btn[aria-expanded="true"] .engine-hub-chevron {
  transform: rotate(180deg);
}

.engine-hub-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background-color: var(--surface-popover);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
  z-index: 1000;
  overflow: hidden;
  animation: fadeIn 0.15s ease-out;
}

.engine-hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background-color: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-subtle);
}

.engine-hub-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.engine-hub-header-title svg {
  color: var(--accent-lime);
}

.engine-hub-online-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background-color: rgba(34, 197, 94, 0.12);
  color: var(--status-online);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.engine-hub-list {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 380px;
  overflow-y: auto;
}

.engine-hub-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  transition: all var(--duration-fast);
}

.engine-hub-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--border-medium);
}

.engine-hub-item.clickable {
  cursor: pointer;
}

.engine-hub-item.clickable:hover {
  border-color: rgba(43, 248, 77, 0.4);
}

.engine-hub-item.busy {
  border-color: rgba(43, 248, 77, 0.4);
  background-color: rgba(43, 248, 77, 0.06);
}

.engine-hub-item.busy .chip-dot {
  background-color: var(--accent-lime);
  box-shadow: 0 0 8px var(--accent-lime);
  animation: pulseDot 1s ease-in-out infinite;
}

.engine-hub-item-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.engine-hub-item-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.engine-hub-item-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.engine-hub-item-type {
  font-size: 9px;
  color: var(--text-muted);
  white-space: nowrap;
}

.engine-hub-item-badge {
  font-size: 10px;
  font-family: var(--font-mono, monospace);
  font-weight: 600;
  color: var(--text-secondary);
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.engine-hub-footer {
  padding: 8px;
  background-color: rgba(255, 255, 255, 0.01);
  border-top: 1px solid var(--border-subtle);
}

.engine-hub-action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.engine-hub-action-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: var(--border-medium);
  color: var(--accent-lime);
}

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--status-offline);
  transition: all var(--duration-normal);
  flex-shrink: 0;
}

.chip-dot.online {
  background-color: var(--status-online);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

.chip-dot.warning {
  background-color: var(--status-warning);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-toggle {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 5px 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.icon-toggle:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.icon-toggle.active {
  background-color: var(--surface-card-hover);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.topbar-btn {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.topbar-btn:hover {
  background-color: var(--surface-card-hover);
  color: var(--accent-cyan);
  border-color: var(--border-medium);
}

/* ==========================================================================
   3. Studio Viewport & Responsive Media Canvas
   ========================================================================== */

.studio-viewport {
  flex: 1;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 16px 24px 180px; /* bottom padding so floating dock never overlaps content */
}

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

.toolbar-section-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar-section-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar-sub-btn {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.toolbar-sub-btn:hover {
  background-color: var(--surface-card-hover);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

/* Density / Column Selector */
.density-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  padding: 3px 6px;
  border-radius: var(--radius-sm);
}

.density-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.density-pills {
  display: flex;
  align-items: center;
  gap: 2px;
}

.density-btn {
  width: 22px;
  height: 22px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast);
}

.density-btn:hover {
  color: var(--text-primary);
  background-color: var(--surface-card-hover);
}

.density-btn.active {
  background-color: var(--surface-popover);
  border-color: var(--border-medium);
  color: var(--accent-lime);
}

/* View Mode Switcher (Grid vs List) */
.view-switch-group {
  display: flex;
  align-items: center;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.view-switch-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.view-switch-btn:hover {
  color: var(--text-primary);
  background-color: var(--surface-card-hover);
}

.view-switch-btn.active {
  background-color: var(--surface-popover);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.filter-pills {
  display: flex;
  gap: 6px;
}

.filter-pill {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.filter-pill:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.filter-pill.active {
  background-color: var(--surface-card);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.gallery-metrics {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ==========================================================================
   Controlled Responsive Grid System with User-Selectable Density
   ========================================================================== */

.gallery-grid-canvas {
  --gallery-cols: 8;
  display: grid !important;
  grid-template-columns: repeat(var(--gallery-cols, 8), minmax(0, 1fr)) !important;
  gap: 10px;
  width: 100%;
}

.gallery-grid-canvas[style*="display: none"],
.gallery-grid-canvas.hidden {
  display: none !important;
}

/* Density Presets (2 to 8 columns) */
.gallery-grid-canvas.cols-2 { --gallery-cols: 2; }
.gallery-grid-canvas.cols-3 { --gallery-cols: 3; }
.gallery-grid-canvas.cols-4 { --gallery-cols: 4; }
.gallery-grid-canvas.cols-5 { --gallery-cols: 5; }
.gallery-grid-canvas.cols-6 { --gallery-cols: 6; }
.gallery-grid-canvas.cols-7 { --gallery-cols: 7; }
.gallery-grid-canvas.cols-8 { --gallery-cols: 8; }

/* Active Jobs Grid - Uses display: contents to sit seamlessly in the same grid! */
.active-jobs-grid {
  display: contents;
}

/* Media Card (Fluid Column Fill - Zero Dead Space) */
.media-card {
  position: relative;
  width: 100%;
  aspect-ratio: 9/16;
  margin: 0;
  background-color: #0c0e14;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-spring), border-color var(--duration-fast), box-shadow var(--duration-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-card:hover {
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
}

/* Active Generating Card in Grid */
.job-card-active {
  position: relative;
  width: 100%;
  aspect-ratio: 9/16;
  margin: 0;
  background-color: var(--surface-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
  transition: all var(--duration-fast);
}

.job-card-active.processing {
  border-color: var(--accent-lime);
  box-shadow: 0 0 20px rgba(43, 248, 77, 0.2);
}

.job-card-active.queued {
  border-color: rgba(168, 85, 247, 0.5);
  border-style: dashed;
  background-color: rgba(22, 18, 30, 0.6);
}

.job-card-active.completed {
  border-color: rgba(34, 197, 94, 0.6);
}

.job-card-active.failed {
  border-color: rgba(239, 68, 68, 0.6);
}

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

.job-card-engine {
  display: flex;
  align-items: center;
  gap: 6px;
}

.job-card-engine-name {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent-lime);
  text-transform: uppercase;
}

.job-card-active.queued .job-card-engine-name {
  color: var(--accent-purple);
}

.job-card-timer {
  font-family: var(--font-mono);
  font-size: 10px;
  background-color: var(--surface-input);
  border: 1px solid var(--border-subtle);
  padding: 2px 5px;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
}

.job-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  margin: auto 0;
  overflow: hidden;
}

.job-card-prompt {
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.job-status-line {
  font-size: 11px;
  color: var(--accent-lime);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-card-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}

.job-action-btn {
  background-color: var(--surface-popover);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.job-action-btn:hover {
  background-color: var(--surface-card-hover);
  border-color: var(--border-medium);
}

.job-action-btn.primary {
  background-color: var(--accent-lime);
  color: var(--accent-lime-text);
  border-color: transparent;
}

.job-action-btn.cancel {
  color: var(--text-muted);
}

.job-action-btn.cancel:hover {
  color: var(--status-danger);
  border-color: var(--status-danger);
}

/* ==========================================================================
   List View Architecture (Stream Table Layout)
   ========================================================================== */

.gallery-grid-canvas.list-view {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px;
}

.gallery-grid-canvas.list-view .active-jobs-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.gallery-grid-canvas.list-view .job-card-active {
  width: 100%;
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
  height: auto;
  min-height: 64px;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  gap: 16px;
}

.gallery-grid-canvas.list-view .job-card-active .job-card-body {
  flex-direction: row;
  margin: 0;
  gap: 12px;
  flex: 1;
  text-align: left;
}

.gallery-grid-canvas.list-view .job-card-active .job-card-prompt {
  -webkit-line-clamp: 1;
}

.gallery-grid-canvas.list-view .media-card {
  width: 100%;
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
  height: 88px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  gap: 16px;
  border-radius: var(--radius-md);
}

.gallery-grid-canvas.list-view .media-ambient-blur {
  display: none;
}

.gallery-grid-canvas.list-view .media-element {
  width: 48px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
}

.gallery-grid-canvas.list-view .play-indicator {
  display: none;
}

.gallery-grid-canvas.list-view .card-header-bar {
  display: none;
}

.gallery-grid-canvas.list-view .card-hover-overlay {
  display: none;
}

/* List Row Inner Components */
.list-row-media {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.list-row-thumb-wrap {
  width: 46px;
  height: 70px;
  border-radius: var(--radius-xs);
  overflow: hidden;
  background-color: var(--surface-input);
  flex-shrink: 0;
  position: relative;
}

.list-row-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-row-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.list-row-tags {
  display: flex;
  align-items: center;
  gap: 6px;
}

.list-tag-pill {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  background-color: var(--surface-popover);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  text-transform: uppercase;
}

.list-tag-pill.video {
  color: var(--accent-lime);
  border-color: rgba(43, 248, 77, 0.3);
}

.list-tag-pill.engine {
  color: var(--accent-cyan);
}

.list-row-prompt {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-row-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
}

.list-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.list-action-btn {
  background-color: var(--surface-popover);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.list-action-btn:hover {
  background-color: var(--surface-card-hover);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.list-action-btn.primary {
  background-color: var(--accent-lime);
  color: var(--accent-lime-text);
  border-color: transparent;
}

.list-action-btn.icon-only {
  padding: 5px;
}

/* Ambient Blur Backdrop behind vertical 9:16 content */
.media-ambient-blur {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(20px) brightness(0.3);
  transform: scale(1.1);
  pointer-events: none;
  opacity: 0.6;
}

.media-element {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  display: block;
  border-radius: inherit;
}

/* Reference Card Badges (Matching Image 3) */
.card-tag-pill {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 5;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #e2e8f0;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: none;
  text-transform: uppercase;
  line-height: 1.2;
}

.card-tag-pill.ai {
  color: var(--accent-lime);
  border-color: rgba(43, 248, 77, 0.3);
}

/* Card Pin / Favorite Button (Top Right Heart Outline) */
.card-pin-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--duration-fast), color var(--duration-fast), background var(--duration-fast);
}

.media-card:hover .card-pin-btn,
.card-pin-btn.pinned {
  opacity: 1;
}

.card-pin-btn:hover {
  background: rgba(0, 0, 0, 0.85);
  color: #ffffff;
}

.card-pin-btn.pinned {
  color: var(--accent-lime);
  border-color: rgba(43, 248, 77, 0.4);
}

/* Video Duration Pill (Bottom-Right, exactly like Image 3 reference) */
.video-duration-pill {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 5;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.video-duration-pill svg {
  width: 8px;
  height: 8px;
  fill: currentColor;
  flex-shrink: 0;
}

/* Bottom-Left Filename/Meta in Grid (Subtle) */
.card-meta-bottom-left {
  position: absolute;
  bottom: 8px;
  left: 8px;
  z-index: 5;
  max-width: calc(100% - 68px);
  font-size: 9px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
  pointer-events: none;
}

/* Hover Quick Actions Overlay */
.card-hover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 11, 15, 0.1) 0%, rgba(9, 11, 15, 0.9) 100%);
  opacity: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px;
  gap: 6px;
  z-index: 6;
  transition: opacity var(--duration-fast);
  pointer-events: none;
}

.media-card:hover .card-hover-overlay {
  opacity: 1;
  pointer-events: auto;
}

.card-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.card-action-btn {
  flex: 1 1 calc(50% - 4px);
  min-width: 0;
  background-color: rgba(20, 24, 32, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  font-size: 10px;
  font-weight: 600;
  padding: 5px 6px;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition: all var(--duration-fast);
  white-space: nowrap;
}

.card-action-btn:hover {
  background-color: var(--accent-lime);
  color: var(--accent-lime-text);
  border-color: var(--accent-lime);
}

.card-action-btn.icon-only {
  flex: 0 0 28px;
  height: 28px;
  padding: 0;
}

.card-action-btn.action-delete:hover {
  background-color: #ef4444 !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
}

/* Active Generation Live Shimmer Card */
.job-active-card {
  position: relative;
  aspect-ratio: 9/16;
  background-color: var(--surface-card);
  border: 1px solid var(--accent-lime);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px rgba(43, 248, 77, 0.2);
}

/* ==========================================================================
   Multi-Job Parallel Generation & Queue Dock Styles
   ========================================================================== */

.dock-queue-bar {
  position: fixed;
  bottom: 110px;
  left: calc(50% + 34px);
  transform: translateX(-50%);
  width: min(840px, calc(100vw - 110px));
  background-color: rgba(14, 18, 25, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 88;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
  transition: all var(--duration-fast);
}

.queue-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.queue-pulse-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-lime);
  box-shadow: 0 0 10px var(--accent-lime);
  animation: pulseDot 1.5s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

.queue-status-text {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.queue-bar-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.queue-bar-chips::-webkit-scrollbar {
  display: none;
}

.queue-chip-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.queue-chip-pill.processing {
  border-color: rgba(43, 248, 77, 0.4);
  color: var(--accent-lime);
}

.queue-chip-pill.queued {
  border-color: rgba(168, 85, 247, 0.4);
  color: var(--accent-purple);
}

.queue-bar-action-btn {
  background-color: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.queue-bar-action-btn:hover {
  background-color: var(--surface-card-hover);
  color: var(--text-primary);
  border-color: var(--border-medium);
}



/* Engine Chip Busy State */
.engine-chip.busy {
  border-color: rgba(43, 248, 77, 0.4);
  background-color: rgba(43, 248, 77, 0.08);
}

.engine-chip.busy .chip-dot {
  background-color: var(--accent-lime);
  box-shadow: 0 0 8px var(--accent-lime);
  animation: pulseDot 1s ease-in-out infinite;
}

.engine-chip.busy .chip-name {
  color: var(--text-primary);
}

/* Terminal Filters & Badges */
.terminal-filter-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.term-filter-chip {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.term-filter-chip:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.term-filter-chip.active {
  background-color: var(--surface-card);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.log-engine-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
  text-transform: uppercase;
}

.log-engine-badge.system {
  background-color: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.log-engine-badge.grok {
  background-color: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

.log-engine-badge.higgsfield {
  background-color: rgba(43, 248, 77, 0.15);
  color: var(--accent-lime);
}

.log-engine-badge.kling {
  background-color: rgba(251, 146, 60, 0.15);
  color: #fb923c;
}

.log-engine-badge.heygen {
  background-color: rgba(168, 85, 247, 0.15);
  color: var(--accent-purple);
}

.log-engine-badge.flow {
  background-color: rgba(250, 204, 21, 0.15);
  color: #facc15;
}

.dock-generate-btn.queue-mode {
  background-color: var(--surface-card);
  color: var(--text-primary);
  border: 1px solid var(--accent-lime);
  box-shadow: 0 4px 14px rgba(43, 248, 77, 0.2);
}

.dock-generate-btn.queue-mode:hover {
  background-color: var(--surface-card-hover);
  box-shadow: 0 6px 20px rgba(43, 248, 77, 0.35);
}

.job-ambient-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(43, 248, 77, 0.12) 0%, transparent 70%);
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.job-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px;
  gap: 16px;
}

.job-spinner-ring {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(43, 248, 77, 0.2);
  border-top-color: var(--accent-lime);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

.job-engine-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent-lime);
}

.job-status-msg {
  font-size: 12px;
  color: var(--text-secondary);
  max-width: 200px;
  line-height: 1.4;
}

.job-time-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  background-color: var(--surface-input);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

/* Empty Canvas Placeholder */
.canvas-empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
  max-width: 600px;
  margin: 0 auto;
}

.empty-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-lime);
  margin-bottom: 20px;
}

.empty-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

/* OpenHiggsfield Style Prompt Preview Cards */
.empty-prompt-chips {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.prompt-chip-card {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  transition: all var(--duration-fast);
}

.prompt-chip-card:hover {
  background-color: var(--surface-card-hover);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.prompt-thumb-grad {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.grad-studio {
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 50%, #f97316 100%);
}

.grad-lodge {
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 50%, #78350f 100%);
}

.grad-ponds {
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 50%, #3b82f6 100%);
}

.prompt-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.prompt-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.prompt-card-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.prompt-chip {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.prompt-chip:hover {
  background-color: var(--surface-card-hover);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

/* Keycap Shortcut Badge inside Generate Button (OpenHiggsfield Style) */
.btn-kbd {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  background-color: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-xs);
  padding: 2px 5px;
  color: var(--accent-lime-text);
  margin-left: 2px;
}

/* Real-Time Cost Badge inside Generate Button (OpenHiggsfield Style) */
.cta-cost-badge {
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background-color: rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(0, 0, 0, 0.22);
  border-radius: 999px;
  padding: 1px 7px;
  color: var(--accent-lime-text);
  margin-left: 2px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  letter-spacing: -0.01em;
}

.dock-generate-btn.queue-mode .cta-cost-badge {
  background-color: rgba(43, 248, 77, 0.12);
  border-color: rgba(43, 248, 77, 0.3);
  color: var(--accent-lime);
}

/* ==========================================================================
   4. Signature Floating Generation Command Dock (Kling / Higgsfield Core UI)
   ========================================================================== */

.floating-dock {
  position: fixed;
  bottom: 24px;
  left: calc(50% + 34px); /* centered accounting for left rail */
  transform: translateX(-50%);
  width: min(980px, calc(100vw - 120px));
  background-color: var(--surface-dock);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  box-shadow: 0 30px 70px -10px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  padding: 16px 20px 14px;
  gap: 12px;
  z-index: 90;
  transition: box-shadow var(--duration-fast), border-color var(--duration-fast);
}

.floating-dock:focus-within {
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 36px 80px -8px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(43, 248, 77, 0.25);
}

/* Top Input Row */
.dock-input-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  position: relative;
}

/* Reference Attachment Slot (Multi-reference support: up to 3) */
.reference-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  position: relative;
}

.ref-thumbnails-list {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ref-add-btn {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-fast);
  padding: 4px;
  flex-shrink: 0;
}

.ref-add-btn:hover {
  border-color: var(--accent-lime);
  color: var(--accent-lime);
  background-color: rgba(43, 248, 77, 0.06);
}

.ref-add-btn.has-refs {
  width: 44px;
  height: 52px;
  border-style: dashed;
  background-color: rgba(255, 255, 255, 0.02);
}

.ref-add-label {
  font-size: 10px;
  font-weight: 700;
  margin-top: 2px;
  letter-spacing: 0.02em;
}

.ref-thumbnail-wrap {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--accent-lime);
  background-color: rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: transform var(--duration-fast), border-color var(--duration-fast);
}

.ref-thumbnail-wrap:hover {
  transform: translateY(-1px);
  border-color: #55f87b;
}

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

.ref-thumb-badge {
  position: absolute;
  bottom: 2px;
  left: 3px;
  background: rgba(0, 0, 0, 0.8);
  color: var(--accent-lime);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
  line-height: 1;
  pointer-events: none;
  border: 1px solid rgba(43, 248, 77, 0.35);
}

.ref-remove-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-fast);
  z-index: 2;
}

.ref-remove-btn:hover {
  background-color: var(--status-danger);
  border-color: var(--status-danger);
}

/* Prompt Textarea */
.prompt-text-container {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.dock-textarea {
  width: 100%;
  min-height: 54px;
  max-height: 140px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  resize: none;
  padding: 4px 6px;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.dock-textarea::-webkit-scrollbar {
  width: 5px;
}

.dock-textarea::-webkit-scrollbar-track {
  background: transparent;
}

.dock-textarea::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 4px;
}

.dock-textarea::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

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

/* Enhance Button */
.dock-enhance-btn {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--duration-fast);
}

.dock-enhance-btn:hover {
  background-color: rgba(168, 85, 247, 0.12);
  border-color: var(--accent-purple);
  color: #c084fc;
}

.dock-enhance-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Bottom Controls Strip */
.dock-controls-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 10px;
  gap: 12px;
  position: relative;
}

.pill-group-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

/* Parameter Popover Anchor */
.param-popover-anchor {
  position: relative;
  flex-shrink: 0;
}

.dock-pill {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--duration-fast);
  white-space: nowrap;
}

.dock-pill:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text-primary);
}

.dock-pill:focus-visible {
  outline: 2px solid var(--border-focus);
}

.pill-icon-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-lime);
  flex-shrink: 0;
}

.pill-tag {
  color: var(--text-muted);
  font-weight: 500;
}

.pill-val {
  color: var(--text-primary);
}

/* Popover Menus */
.param-popover-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  min-width: 240px;
  max-height: 280px;
  overflow-y: auto;
  background-color: var(--surface-popover);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65);
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 120;
}

.param-popover-menu.open {
  display: flex;
}

.param-popover-menu.compact {
  min-width: 180px;
}

.gallery-toolbar .param-popover-menu {
  top: calc(100% + 6px);
  bottom: auto;
  right: 0;
  left: auto;
}

.menu-group-heading {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 8px 3px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background-color var(--duration-fast);
}

.menu-item:hover {
  background-color: var(--surface-card-hover);
}

.menu-item.selected {
  background-color: rgba(43, 248, 77, 0.12);
  color: var(--accent-lime);
}

.item-info {
  display: flex;
  flex-direction: column;
}

.item-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.menu-item.selected .item-name {
  color: var(--accent-lime);
}

.item-desc {
  font-size: 10px;
  color: var(--text-muted);
}

/* OpenHiggsfield-Style Rich Model Selector Popover */
#menuModel {
  min-width: 360px;
  max-width: 440px;
  max-height: 420px;
  padding: 8px;
  gap: 3px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.menu-model-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background-color: transparent;
  border: 1px solid transparent;
  transition: all var(--duration-fast) ease;
}

.menu-model-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.menu-model-item.selected {
  background-color: rgba(43, 248, 77, 0.08);
  border-color: rgba(43, 248, 77, 0.3);
}

.model-icon-box {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  transition: all var(--duration-fast);
}

.menu-model-item:hover .model-icon-box {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.menu-model-item.selected .model-icon-box {
  background: rgba(43, 248, 77, 0.15);
  border-color: rgba(43, 248, 77, 0.4);
  color: var(--accent-lime);
}

.model-info-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.model-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.model-title-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.menu-model-item.selected .model-title-text {
  color: #ffffff;
}

.model-sub-desc {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* Feature & Tier Badges */
.model-pill-badge {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.model-pill-badge.badge-new {
  background: #d4f82a;
  color: #000000;
  font-style: italic;
  font-weight: 900;
}

.model-pill-badge.badge-unlimited {
  background: linear-gradient(90deg, #38bdf8 0%, #818cf8 100%);
  color: #000000;
  font-style: italic;
  font-weight: 900;
}

.model-pill-badge.badge-pro {
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #d8b4fe;
}

.model-pill-badge.badge-o1 {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93c5fd;
}

.model-pill-badge.badge-cinema {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fcd34d;
}

.model-pill-badge.badge-flash,
.model-pill-badge.badge-turbo {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.model-pill-badge.badge-chrome {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
  font-size: 8px;
}

/* Right-aligned Cost Pill */
.model-cost-pill {
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.model-cost-pill.paid {
  background: rgba(43, 248, 77, 0.1);
  border: 1px solid rgba(43, 248, 77, 0.28);
  color: var(--accent-lime);
}

.model-cost-pill.free {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  font-size: 10px;
}

/* Aspect Ratio Mini Box Indicators */
.item-icon-box {
  border: 1px dashed var(--text-muted);
  border-radius: 2px;
}
.item-icon-box.r916 { width: 10px; height: 16px; }
.item-icon-box.r169 { width: 16px; height: 10px; }
.item-icon-box.r11 { width: 12px; height: 12px; }
.item-icon-box.r45 { width: 11px; height: 14px; }
.item-icon-box.r219 { width: 18px; height: 8px; }

/* Neon Lime Kling / Higgsfield Generate CTA */
.dock-generate-btn {
  background-color: var(--accent-lime);
  color: var(--accent-lime-text);
  border: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 8px 20px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--duration-fast) var(--ease-spring);
  box-shadow: 0 4px 14px var(--accent-lime-glow);
}

.dock-generate-btn:hover {
  background-color: var(--accent-lime-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(43, 248, 77, 0.45);
}

.dock-generate-btn:active {
  background-color: var(--accent-lime-active);
  transform: translateY(0);
}

.dock-generate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.spinner-dot {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(0, 0, 0, 0.3);
  border-top-color: #000000;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ==========================================================================
   5. Terminal Drawer (CLI Logs Stream - Side Drawer Architecture)
   ========================================================================== */

.terminal-slideup {
  position: fixed;
  top: var(--topbar-height);
  right: 0;
  bottom: 0;
  width: 440px;
  max-width: 90vw;
  background-color: #08090d;
  border-left: 1px solid var(--border-medium);
  z-index: 95;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--duration-normal) var(--ease-spring);
  box-shadow: -12px 0 36px rgba(0, 0, 0, 0.75);
}

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

.terminal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background-color: var(--surface-topbar);
  border-bottom: 1px solid var(--border-subtle);
}

.terminal-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
}

.terminal-live-tag {
  font-size: 9px;
  font-weight: 700;
  background-color: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: var(--status-online);
  padding: 1px 5px;
  border-radius: var(--radius-xs);
}

.terminal-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.term-btn {
  background-color: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.term-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.term-btn.close {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
}

.terminal-filter-strip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 16px;
  background-color: var(--surface-card);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
  scrollbar-width: none;
}

.terminal-filter-strip::-webkit-scrollbar {
  display: none;
}

.term-filter-chip {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-fast);
}

.term-filter-chip:hover {
  color: var(--text-primary);
  background-color: var(--surface-card-hover);
}

.term-filter-chip.active {
  background-color: var(--surface-popover);
  border-color: var(--border-subtle);
  color: var(--accent-cyan);
}

.terminal-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  color: #7dd3fc;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.log-row {
  display: flex;
  gap: 8px;
}

.log-ts {
  color: var(--text-muted);
  flex-shrink: 0;
}

.log-txt.info { color: #7dd3fc; }
.log-txt.success { color: var(--accent-lime); }
.log-txt.error { color: var(--status-danger); }

/* ==========================================================================
   6. Theater / Lightbox Modal (Focus Inspection)
   ========================================================================== */

.theater-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theater-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(6, 8, 11, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.theater-content {
  position: relative;
  z-index: 2;
  width: min(1380px, 96vw);
  height: min(880px, 92vh);
  background-color: var(--surface-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  box-shadow: 0 32px 72px rgba(0, 0, 0, 0.85);
}

.theater-media-stage {
  flex: 1;
  background-color: #040507;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 24px;
}

.theater-close-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: rgba(15, 18, 24, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all var(--duration-fast);
}

.theater-close-btn:hover {
  background-color: var(--surface-card-hover);
  border-color: var(--text-primary);
}

.theater-media {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.75);
}

.theater-inspector {
  width: 440px;
  min-width: 420px;
  background-color: var(--surface-popover);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 24px 28px;
  gap: 18px;
  overflow-y: auto;
  flex-shrink: 0;
}

.inspector-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inspector-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent-lime);
  text-transform: uppercase;
}

.inspector-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  word-break: break-all;
}

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

.inspector-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* Prompt Box Style (Fiel ao design da Imagem 1) */
.inspector-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-copy-prompt {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-medium);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.btn-copy-prompt:hover {
  background: var(--surface-card-hover);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.theater-prompt-box {
  background: #0f1013;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  max-height: 180px;
  overflow-y: auto;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35);
}

.theater-prompt-text {
  font-size: 12px;
  line-height: 1.6;
  color: #e4e4e7;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  font-family: inherit;
}

/* Metadata Grid Style (Fiel à Imagem 2 - Sem redundância) */
.theater-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  padding: 16px;
  background: #0f1013;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-md);
}

.meta-card-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-card-item.full-width {
  grid-column: 1 / -1;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.meta-card-label {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #71717a;
  white-space: nowrap;
}

.meta-card-val {
  font-size: 12px;
  font-weight: 600;
  color: #f4f4f5;
  word-break: break-word;
}

.meta-card-val.is-muted {
  color: #71717a;
  font-weight: 500;
}

.meta-project-val-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 65%;
  justify-content: flex-end;
}

.meta-project-val-group .meta-val-clickable {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  max-width: 220px;
}

.inspector-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-btn-pill {
  width: 100%;
  background-color: var(--surface-card);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.action-btn-pill:hover {
  background-color: var(--surface-card-hover);
  border-color: var(--text-primary);
}

.action-btn-pill.primary {
  background-color: var(--accent-lime);
  color: var(--accent-lime-text);
  border-color: transparent;
}

.action-btn-pill.primary:hover {
  background-color: var(--accent-lime-hover);
}

.action-btn-pill.danger {
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.action-btn-pill.danger:hover {
  background-color: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
}

.action-btn-pill.highlight-reuse {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(59, 130, 246, 0.12));
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #10b981;
  font-weight: 700;
}

.action-btn-pill.highlight-reuse:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.28), rgba(59, 130, 246, 0.22));
  border-color: #10b981;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

/* Seção de Referências e Frame Inicial no Theater Inspector */
.theater-refs-count-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-lime);
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.theater-refs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  background: #0f1013;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35);
}

.theater-ref-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #18191e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.theater-ref-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-lime);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
}

.theater-ref-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.theater-ref-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 16, 0.84);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.15s ease;
  padding: 6px;
}

.theater-ref-card:hover .theater-ref-card-overlay {
  opacity: 1;
}

.btn-ref-action {
  width: 100%;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transition: all 0.15s ease;
}

.btn-ref-action:hover {
  background: var(--accent-lime);
  color: #000;
  border-color: var(--accent-lime);
}

.btn-ref-action.btn-ref-use {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--accent-lime);
}

.btn-ref-action.btn-ref-use:hover {
  background: var(--accent-lime);
  color: #000;
}

.theater-ref-pill-num {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  pointer-events: none;
}

.theater-ref-type-tag {
  position: absolute;
  bottom: 4px;
  left: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(4px);
  color: var(--accent-lime);
  font-size: 8.5px;
  font-weight: 700;
  text-align: center;
  padding: 2px 4px;
  border-radius: 3px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

/* Badge de Referências no Card da Galeria */
.card-ref-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: rgba(16, 185, 129, 0.18);
  color: var(--accent-lime);
  border: 1px solid rgba(16, 185, 129, 0.35);
  backdrop-filter: blur(4px);
  position: absolute;
  top: 10px;
  right: 38px;
  z-index: 3;
}

.card-ref-badge.video-ref {
  background: rgba(59, 130, 246, 0.22);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.4);
}

.card-action-btn.action-reuse:hover {
  background-color: var(--accent-lime) !important;
  color: var(--accent-lime-text) !important;
  border-color: var(--accent-lime) !important;
}

/* Efeito de pulso no Dock ao reutilizar */
@keyframes dockPulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.dock-pulse-highlight {
  animation: dockPulse 1.2s ease-out;
  border-color: var(--accent-lime) !important;
}

.action-btn-pill.compact {
  width: auto;
  padding: 4px 10px;
  font-size: 11px;
  white-space: nowrap;
}

#menuProfile {
  min-width: 320px;
  max-height: 340px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.meta-key {
  color: var(--text-muted);
}

.meta-val {
  color: var(--text-primary);
  font-weight: 500;
}

/* Engine Distinction Badges & Meta Lines */
.engine-tag-inline {
  font-size: 11px;
  letter-spacing: 0.02em;
}

.engine-tag-pill {
  letter-spacing: 0.04em;
  padding: 1px 4px;
  border-radius: var(--radius-xs);
  background-color: rgba(255, 255, 255, 0.05);
}

.job-card-source-line {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* ==========================================================================
   Uniframe v3 - Multi-Project, Multilogin & Audio Extensions
   ========================================================================== */

/* Project Selector Dropdown in Topbar */
.project-selector-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.project-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--surface-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.project-pill-btn:hover {
  background-color: var(--surface-card-hover);
  border-color: var(--border-hover);
}

.project-pill-btn .project-name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 280px;
  background-color: var(--surface-popover);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  z-index: 1000;
  overflow: hidden;
}

.dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background-color: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.btn-new-proj {
  background-color: transparent;
  border: 1px solid var(--accent-lime);
  color: var(--accent-lime);
  border-radius: var(--radius-xs);
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-new-proj:hover {
  background-color: var(--accent-lime);
  color: var(--accent-lime-text);
}

.dropdown-project-list {
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
}

.dropdown-project-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.dropdown-project-item:hover {
  background-color: var(--surface-card-hover);
  color: var(--text-primary);
}

.dropdown-project-item.active {
  background-color: rgba(43, 248, 77, 0.08);
  color: var(--accent-lime);
  font-weight: 600;
}

.proj-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.proj-item-count {
  font-size: 10px;
  color: var(--text-muted);
  background-color: rgba(255, 255, 255, 0.05);
  padding: 1px 5px;
  border-radius: var(--radius-xs);
}

/* Gallery Toolbar Separators & Project Filters */
.toolbar-separator {
  width: 1px;
  height: 18px;
  background-color: var(--border-medium);
  margin: 0 4px;
}

.project-filter-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.proj-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.proj-filter-btn:hover {
  background-color: var(--surface-card);
  color: var(--text-secondary);
}

.proj-filter-btn.active {
  background-color: var(--surface-card-hover);
  border-color: var(--accent-lime);
  color: var(--accent-lime);
  font-weight: 600;
}

/* Studio Generic Modal System */
.studio-modal-wrap {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 24px;
}

.studio-modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(5, 7, 10, 0.85);
  backdrop-filter: blur(8px);
}

.studio-modal-card {
  position: relative;
  background-color: var(--surface-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 820px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  z-index: 2001;
}

.studio-modal-card.large {
  max-width: 1040px;
}

.modal-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background-color: var(--surface-topbar);
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}

.modal-title-wrap h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

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

.modal-close-btn {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
  transition: color var(--transition-fast);
}

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

.modal-card-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Inline New Project / New Team Box */
.new-project-inline-box {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

.new-project-inline-box h4,
.project-list-section h4,
.accounts-table-section h4,
.teams-col h4,
.users-col h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 12px 0;
}

.form-grid-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

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

.form-field.flex-1 { flex: 1; min-width: 90px; }
.form-field.flex-2 { flex: 2; min-width: 180px; }
.form-field.flex-3 { flex: 3; min-width: 240px; }

.form-field label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-field input[type="text"],
.form-field input[type="password"] {
  font-family: inherit;
  background-color: var(--surface-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-field input[type="text"]:focus,
.form-field input[type="password"]:focus {
  border-color: var(--accent-lime);
}

.form-field input[type="color"] {
  height: 34px;
  padding: 2px;
  background: transparent;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xs);
  cursor: pointer;
}

.form-action-btn-wrap {
  display: flex;
  align-items: flex-end;
}

/* Studio Data Table */
.projects-table-wrap {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.studio-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.studio-table th {
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.studio-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: middle;
}

.studio-table tr:last-child td {
  border-bottom: none;
}

.studio-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.015);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
}

.status-badge.active {
  background-color: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.status-badge.warning {
  background-color: rgba(234, 179, 8, 0.1);
  color: #eab308;
}

.status-badge.expired {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Multilogin Stats Strip */
.multilogin-stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.stat-box {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-number {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-title {
  font-size: 11px;
  color: var(--text-muted);
}

.text-success { color: #22c55e !important; }
.text-warning { color: #eab308 !important; }

/* Details / Accordion */
.studio-details-card {
  background-color: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.studio-details-card summary {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  outline: none;
}

.details-content-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-top: 14px;
}

/* Teams and Users Split Layout */
.teams-split-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.teams-card-list,
.users-card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.team-item-card,
.user-item-card {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.team-card-info,
.user-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

/* Audio Player Card in Vault Gallery */
.vault-audio-card {
  position: relative;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
  width: 100%;
  aspect-ratio: 9/16;
  transition: all var(--duration-fast);
}

.vault-audio-card:hover {
  border-color: var(--accent-lime);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.audio-card-waveform-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 60px;
  background: linear-gradient(180deg, rgba(43, 248, 77, 0.05) 0%, transparent 100%);
  border-radius: var(--radius-xs);
  color: var(--accent-lime);
}

.audio-card-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.audio-native-player {
  width: 100%;
  height: 28px;
}

.audio-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  gap: 4px;
}

.audio-card-controls {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.audio-native-player {
  width: 100%;
  height: 32px;
  border-radius: var(--radius-full);
}

.audio-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
}

.theater-audio-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  color: var(--accent-lime);
  width: 100%;
  padding: 40px;
}

/* ==========================================================================
   Project Workspace Header Banner
   ========================================================================== */

.project-vault-banner {
  margin: 0 24px 16px 24px;
  padding: 12px 18px;
  background: linear-gradient(90deg, rgba(22, 26, 35, 0.95) 0%, rgba(14, 18, 25, 0.95) 100%);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all var(--duration-fast);
}

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

.project-banner-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--accent-lime);
  box-shadow: 0 0 10px rgba(43, 248, 77, 0.5);
  flex-shrink: 0;
}

.banner-proj-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.banner-proj-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.banner-proj-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
}

.banner-proj-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background-color: rgba(43, 248, 77, 0.12);
  color: var(--accent-lime);
  letter-spacing: 0.04em;
}

.banner-proj-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.banner-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Dock Project Destination Badge */
.dock-project-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 5px 10px;
  font-size: 11px;
  color: var(--text-secondary);
  user-select: none;
  transition: all var(--duration-fast);
}

.dock-project-badge-pill:hover {
  background-color: rgba(255, 255, 255, 0.07);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.dock-proj-tag {
  color: var(--text-muted);
  font-weight: 500;
}

.dock-proj-name {
  font-weight: 600;
  color: var(--text-primary);
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Prompt Meta Strip */
.prompt-meta-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 0 6px;
  font-size: 10px;
  color: var(--text-muted);
}

.prompt-audio-estimate {
  color: var(--accent-lime);
  font-weight: 600;
}

/* User Popover Switcher */
.rail-avatar-wrap {
  position: relative;
}

.user-popover-menu {
  position: absolute;
  bottom: 0;
  left: 64px;
  width: 250px;
  background-color: var(--surface-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65);
  padding: 10px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: fadeIn 0.15s ease-out;
}

.user-popover-header {
  padding: 4px 6px 6px 6px;
}

.user-popover-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.user-popover-role {
  font-size: 10px;
  color: var(--text-muted);
}

.user-popover-team {
  font-size: 10px;
  color: var(--accent-lime);
  margin-top: 2px;
  font-weight: 500;
}

.user-popover-divider {
  height: 1px;
  background-color: var(--border-subtle);
  margin: 2px 0;
}

.user-popover-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 160px;
  overflow-y: auto;
}

.user-popover-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  transition: all var(--duration-fast);
}

.user-popover-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.user-popover-item.active {
  background-color: rgba(43, 248, 77, 0.1);
  color: var(--accent-lime);
}

.user-popover-item-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-popover-item-role {
  font-size: 9px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.user-popover-action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  cursor: pointer;
  width: 100%;
  transition: all var(--duration-fast);
}

.user-popover-action:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: var(--border-medium);
}

/* Multilogin Table Filter Bar */
.accounts-table-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.multilogin-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.multilogin-filter-tabs {
  display: flex;
  gap: 4px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.ml-filter-tab {
  background: transparent;
  border: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.ml-filter-tab:hover {
  color: var(--text-primary);
}

.ml-filter-tab.active {
  background-color: var(--surface-card);
  color: var(--accent-lime);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.ml-search-wrap input {
  min-width: 260px;
}


/* ==========================================================================
   14. Audio & Speech Studio (ElevenLabs, Mimic & Rask.ai Architecture)
   ========================================================================== */

.audio-studio-workspace {
  display: flex;
  gap: 20px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  min-height: calc(100vh - 120px);
  padding: 10px 0 60px;
}

/* Left / Main Script Stage */
.audio-stage-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  min-width: 0;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.audio-stage-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.audio-speaker-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 8px;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.audio-speaker-chip:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-cyan);
}

.speaker-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: #041014;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.speaker-meta {
  display: flex;
  flex-direction: column;
}

.speaker-tag-sub {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.speaker-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.audio-top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.audio-pill-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.audio-pill-action:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background-color: rgba(255, 255, 255, 0.06);
}

.audio-tags-insert-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tags-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.audio-tag-chip {
  padding: 3px 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  background-color: var(--accent-cyan-subtle);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.audio-tag-chip:hover {
  background-color: rgba(56, 189, 248, 0.25);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

/* Script Box */
.audio-script-box {
  flex: 1;
  display: flex;
  min-height: 220px;
}

.audio-textarea {
  width: 100%;
  height: 100%;
  min-height: 220px;
  background-color: #080a0e;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  resize: vertical;
  outline: none;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.audio-textarea:focus {
  border-color: var(--accent-lime);
  box-shadow: 0 0 0 1px var(--accent-lime-glow);
}

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

/* Director Chips */
.audio-director-strip {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.director-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.director-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.director-chip {
  flex-shrink: 0;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-fast);
}

.director-chip:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-lime);
}

/* Bottom Action Strip */
.audio-stage-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.audio-metrics-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.audio-stat-separator {
  color: var(--border-hover);
}

.audio-cta-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-audio-clear {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.btn-audio-clear:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.05);
}

.btn-audio-generate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: linear-gradient(135deg, var(--accent-lime), #22c55e);
  color: #030a04;
  font-size: 13px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 4px 16px var(--accent-lime-glow);
  transition: all var(--duration-fast);
}

.btn-audio-generate:hover {
  background: linear-gradient(135deg, var(--accent-lime-hover), #16a34a);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-lime-glow);
}

.btn-audio-generate:active {
  transform: translateY(0);
}

.btn-audio-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.shortcut-pill {
  font-size: 10px;
  font-weight: 600;
  background-color: rgba(0, 0, 0, 0.25);
  color: #030a04;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Live Audio Player Card */
.audio-live-player-card {
  margin-top: 10px;
  background: linear-gradient(180deg, #12151d, #0b0d12);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.player-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.player-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-lime);
  box-shadow: 0 0 10px var(--accent-lime);
  animation: pulse-dot 1.8s infinite;
}

.player-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.player-engine-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  background-color: rgba(43, 248, 77, 0.12);
  color: var(--accent-lime);
  border-radius: var(--radius-xs);
  border: 1px solid rgba(43, 248, 77, 0.3);
}

.player-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.player-action-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background-color: rgba(255, 255, 255, 0.09);
}

.player-track-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.player-play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--accent-lime);
  color: #030a04;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--duration-fast);
}

.player-play-btn:hover {
  background-color: var(--accent-lime-hover);
  transform: scale(1.05);
}

.player-progress-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.player-scrubber {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  background: var(--surface-card);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.player-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-lime);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(43, 248, 77, 0.6);
}

.player-time-display {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.player-speed-pills {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.speed-pill {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.speed-pill:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.speed-pill.active {
  background-color: var(--accent-lime);
  color: #030a04;
  border-color: var(--accent-lime);
}

/* Right: Studio Sidebar Rack */
.audio-studio-sidebar {
  width: 380px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  overflow-y: auto;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.audio-sidebar-tabs {
  display: flex;
  gap: 6px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.sidebar-tab {
  flex: 1;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  text-align: center;
  transition: all var(--duration-fast);
}

.sidebar-tab:hover {
  color: var(--text-primary);
}

.sidebar-tab.active {
  background-color: var(--surface-card-hover);
  color: var(--accent-lime);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Audio Creation Banner (Voice Design & Clone) */
.audio-creation-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(56, 189, 248, 0.08));
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.banner-badge-row {
  display: flex;
  align-items: center;
}

.banner-tech-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--accent-lime);
  background-color: rgba(43, 248, 77, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
}

.banner-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.banner-text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.banner-btn-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.btn-banner-action {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.btn-banner-action.primary {
  background-color: var(--accent-lime);
  color: #030a04;
  border: 1px solid var(--accent-lime);
}

.btn-banner-action.primary:hover {
  background-color: var(--accent-lime-hover);
}

.btn-banner-action.secondary {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}

.btn-banner-action.secondary:hover {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-cyan);
}

/* Audio Control Cards */
.audio-control-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

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

.card-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-link-action {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-cyan);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.card-link-action:hover {
  text-decoration: underline;
}

/* Selected Voice Card Preview */
.selected-voice-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.selected-voice-preview:hover {
  background-color: rgba(255, 255, 255, 0.07);
  border-color: var(--accent-lime);
}

.voice-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a855f7, #3b82f6);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.voice-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.voice-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.voice-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
}

.voice-lang-info {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-sample-play {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--duration-fast);
}

.btn-sample-play:hover {
  background-color: var(--accent-lime);
  color: #030a04;
  border-color: var(--accent-lime);
}

/* Engine Switcher */
.audio-engine-switcher {
  display: flex;
  gap: 4px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.engine-switch-btn {
  flex: 1;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  text-align: center;
  transition: all var(--duration-fast);
}

.engine-switch-btn:hover {
  color: var(--text-primary);
}

.engine-switch-btn.active {
  background-color: var(--surface-card);
  color: var(--accent-lime);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Custom Select Menus */
.custom-select-wrap {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: all var(--duration-fast);
}

.custom-select-trigger:hover {
  border-color: var(--border-hover);
  background-color: rgba(255, 255, 255, 0.07);
}

.custom-select-trigger.compact {
  padding: 6px 10px;
  font-size: 11px;
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background-color: var(--surface-popover);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 4px;
  z-index: 100;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  max-height: 240px;
  overflow-y: auto;
}

.custom-select-menu .menu-item {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background-color var(--duration-fast);
}

.custom-select-menu .menu-item:hover {
  background-color: rgba(255, 255, 255, 0.06);
}

.custom-select-menu .menu-item.selected {
  background-color: rgba(43, 248, 77, 0.12);
  border-left: 2px solid var(--accent-lime);
}

.custom-select-menu .item-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.custom-select-menu .item-desc {
  font-size: 10px;
  color: var(--text-muted);
}

/* Sliders */
.slider-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}

.slider-name {
  color: var(--text-secondary);
  font-weight: 500;
}

.slider-value {
  color: var(--accent-lime);
  font-family: var(--font-mono);
  font-weight: 600;
}

.studio-range {
  width: 100%;
  height: 5px;
  -webkit-appearance: none;
  background: var(--surface-canvas);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.studio-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-lime);
  cursor: pointer;
  box-shadow: 0 0 6px var(--accent-lime-glow);
}

.slider-markers {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
}

.speed-quick-pills {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.quick-pill {
  flex: 1;
  padding: 3px 6px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  cursor: pointer;
  text-align: center;
  transition: all var(--duration-fast);
}

.quick-pill:hover {
  color: var(--text-primary);
}

.quick-pill.active {
  background-color: var(--accent-lime);
  color: #030a04;
  border-color: var(--accent-lime);
  font-weight: 700;
}

.control-dual-row {
  display: flex;
  gap: 10px;
}

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

.sub-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* History Tab in Sidebar */
.history-search-row {
  margin-bottom: 12px;
}

.audio-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.empty-history-notice {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 30px 10px;
}

.audio-history-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: all var(--duration-fast);
}

.audio-history-item:hover {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: var(--border-hover);
}

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

.hist-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.hist-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 5px;
  background-color: rgba(43, 248, 77, 0.1);
  color: var(--accent-lime);
  border-radius: 3px;
}

.hist-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hist-meta {
  font-size: 10px;
  color: var(--text-muted);
}

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

.btn-hist-action {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-secondary);
  padding: 3px 6px;
  font-size: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--duration-fast);
}

.btn-hist-action:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.08);
}

/* Modals & Dropzone Styling */
.modal-instruction-text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
}

.form-row-dual {
  display: flex;
  gap: 12px;
}

.form-row-dual .form-field {
  flex: 1;
}

.audio-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-md);
  background-color: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  text-align: center;
  transition: all var(--duration-fast);
}

.audio-dropzone:hover, .audio-dropzone.dragover {
  border-color: var(--accent-lime);
  background-color: rgba(43, 248, 77, 0.04);
}

.dropzone-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.dropzone-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.dropzone-selected-file {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-lime);
  background-color: rgba(43, 248, 77, 0.1);
  padding: 4px 10px;
  border-radius: var(--radius-xs);
}

.record-mic-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.btn-mic-record {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.btn-mic-record:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-cyan);
}

.btn-mic-record.recording {
  background-color: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #ef4444;
}

.rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #64748b;
}

.btn-mic-record.recording .rec-dot {
  background-color: #ef4444;
  animation: pulse-dot 1s infinite;
}

.rec-timer {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #ef4444;
  font-weight: 700;
}

.design-preview-strip {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-top: 10px;
}

.preview-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-lime);
}

/* Voice Library Grid */
.voice-library-topbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.voice-library-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.vlib-tab {
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-fast);
}

.vlib-tab:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.vlib-tab.active {
  background-color: var(--accent-lime);
  color: #030a04;
  border-color: var(--accent-lime);
}

.vlib-search-wrap input {
  width: 100%;
}

.voice-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.voice-card-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  transition: all var(--duration-fast);
}

.voice-card-item:hover {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: var(--border-hover);
}

.voice-card-item.selected {
  border-color: var(--accent-lime);
  background-color: rgba(43, 248, 77, 0.04);
}

.vc-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vc-meta {
  flex: 1;
  min-width: 0;
}

.vc-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.vc-tags-row {
  display: flex;
  gap: 4px;
  margin-top: 2px;
}

.vc-tag {
  font-size: 10px;
  padding: 1px 5px;
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border-radius: 3px;
}

.vc-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.vc-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.btn-vc-select {
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.btn-vc-select:hover {
  background-color: var(--accent-lime);
  color: #030a04;
  border-color: var(--accent-lime);
}

.voice-card-item.selected .btn-vc-select {
  background-color: var(--accent-lime);
  color: #030a04;
  border-color: var(--accent-lime);
}

/* Responsive adjustments */
@media (max-width: 1080px) {
  .audio-studio-workspace {
    flex-direction: column;
  }
  .audio-studio-sidebar {
    width: 100%;
  }
}

/* ==========================================================================
   Uniframe - Reference Picker, Video AI Mini-Menu & Project Assignment
   ========================================================================== */

/* Reference Slot Dropdown */
.reference-slot {
  position: relative;
}

.ref-source-dropdown {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  width: 280px;
  background-color: var(--surface-popover);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
  z-index: 1200;
  overflow: hidden;
  animation: fadeInFast 0.15s ease-out;
}

.ref-source-header {
  padding: 8px 12px;
  background-color: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.ref-source-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: all var(--duration-fast);
}

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

.ref-source-item:hover {
  background-color: var(--surface-card-hover);
  color: var(--accent-lime);
}

.ref-source-item svg {
  flex-shrink: 0;
  color: var(--accent-lime);
}

.ref-source-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ref-source-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.ref-source-item:hover .ref-source-title {
  color: var(--accent-lime);
}

.ref-source-subtitle {
  font-size: 10px;
  color: var(--text-muted);
}

/* Reference Picker Modal */
.ref-picker-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ref-picker-search-box {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.ref-picker-search-box svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.ref-picker-search-box input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  background-color: var(--surface-topbar);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
  transition: border-color var(--duration-fast);
}

.ref-picker-search-box input:focus {
  border-color: var(--accent-lime);
}

.ref-picker-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ref-picker-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-lime);
  background: rgba(43, 248, 77, 0.08);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(43, 248, 77, 0.25);
}

.btn-ref-picker-confirm {
  padding: 6px 14px;
  background-color: var(--accent-lime);
  color: #000000;
  font-weight: 700;
  font-size: 12px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: opacity var(--duration-fast);
}

.btn-ref-picker-confirm:hover {
  opacity: 0.9;
}

.ref-picker-filter-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.ref-picker-pill {
  padding: 4px 10px;
  background-color: var(--surface-topbar);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-fast);
}

.ref-picker-pill:hover {
  background-color: var(--surface-card-hover);
  color: var(--text-primary);
}

.ref-picker-pill.active {
  background-color: rgba(43, 248, 77, 0.12);
  border-color: var(--accent-lime);
  color: var(--accent-lime);
  font-weight: 600;
}

.ref-picker-grid-scroll {
  overflow-y: auto;
  max-height: calc(85vh - 190px);
  padding: 2px 4px 10px 2px;
}

.ref-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.ref-picker-card {
  position: relative;
  background-color: var(--surface-popover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--duration-fast);
  display: flex;
  flex-direction: column;
}

.ref-picker-card:hover {
  border-color: var(--accent-lime);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.ref-picker-card.selected {
  border-color: var(--accent-lime);
  box-shadow: 0 0 0 2px var(--accent-lime);
}

.ref-picker-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 9/16;
  max-height: 180px;
  background-color: #030508;
  overflow: hidden;
}

.ref-picker-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-fast);
}

.ref-picker-card:hover .ref-picker-thumb {
  transform: scale(1.04);
}

.ref-picker-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(3, 7, 12, 0.85) 100%);
  display: flex;
  align-items: flex-end;
  padding: 8px;
  opacity: 0;
  transition: opacity var(--duration-fast);
}

.ref-picker-card:hover .ref-picker-card-overlay {
  opacity: 1;
}

.ref-picker-select-badge {
  width: 100%;
  padding: 4px 6px;
  background-color: var(--accent-lime);
  color: var(--accent-lime-text);
  border-radius: var(--radius-xs);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ref-picker-select-badge.is-selected {
  background-color: rgba(239, 68, 68, 0.9);
  color: #ffffff;
}

.ref-picker-corner-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-lime);
  color: #000000;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  z-index: 2;
  border: 1px solid rgba(0, 0, 0, 0.4);
}

.ref-picker-meta {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ref-picker-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ref-picker-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--text-muted);
}

.ref-picker-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

/* Theater Inspector Extensions */
.theater-video-group {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.theater-split-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.action-btn-pill.btn-dropdown-trigger {
  justify-content: space-between;
}

.theater-popover-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  background-color: var(--surface-popover);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
  z-index: 300;
  overflow: hidden;
  animation: fadeInFast 0.15s ease-out;
}

.theater-popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background-color: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.theater-video-ai-list {
  max-height: 280px;
  overflow-y: auto;
  padding: 4px;
}

.theater-video-ai-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--duration-fast);
  border-bottom: 1px solid var(--border-subtle);
}

.theater-video-ai-item:last-child {
  border-bottom: none;
}

.theater-video-ai-item:hover {
  background-color: var(--surface-card-hover);
}

.ai-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-item-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  background-color: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}

.ai-item-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ai-item-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-item-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.ai-item-desc {
  font-size: 10px;
  color: var(--text-muted);
}

.ai-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-ai-quick-act {
  padding: 4px 8px;
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.btn-ai-quick-act:hover {
  background-color: var(--surface-card-hover);
  border-color: var(--border-hover);
}

.btn-ai-quick-act.primary {
  background-color: var(--accent-lime);
  color: var(--accent-lime-text);
  border-color: transparent;
}

.btn-ai-quick-act.primary:hover {
  background-color: var(--accent-lime-hover);
}

/* Quick Video Gen Drawer in Theater */
.theater-quick-gen-box {
  background-color: rgba(12, 18, 28, 0.95);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

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

.quick-gen-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-primary);
}

.quick-gen-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-lime);
}

.quick-gen-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.quick-gen-close-btn:hover {
  color: var(--text-primary);
}

.quick-gen-textarea {
  width: 100%;
  background-color: var(--surface-topbar);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text-primary);
  font-size: 11px;
  resize: vertical;
  outline: none;
}

.quick-gen-textarea:focus {
  border-color: var(--accent-lime);
}

.quick-gen-params {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.quick-param-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.quick-param-label {
  color: var(--text-muted);
}

.quick-param-pills {
  display: flex;
  gap: 4px;
}

.quick-param-pill {
  padding: 2px 8px;
  background-color: var(--surface-topbar);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.quick-param-pill.active {
  background-color: rgba(43, 248, 77, 0.15);
  border-color: var(--accent-lime);
  color: var(--accent-lime);
}

.quick-param-val {
  color: var(--text-primary);
  font-weight: 600;
}

/* Theater Project Assignment */
.theater-project-group {
  position: relative;
}

.theater-project-list {
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
}

.theater-project-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 12px;
  transition: all var(--duration-fast);
}

.theater-project-item:hover {
  background-color: var(--surface-card-hover);
}

.theater-project-item.active {
  background-color: rgba(43, 248, 77, 0.08);
}

.theater-project-item.active .proj-item-dot {
  box-shadow: 0 0 8px currentColor;
}

.meta-val-clickable {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  transition: color var(--duration-fast);
}

.meta-val-clickable:hover {
  color: var(--accent-lime);
}

.btn-meta-edit {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast);
}

.btn-meta-edit:hover {
  color: var(--accent-lime);
  background-color: rgba(255, 255, 255, 0.05);
}

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

/* ==========================================================================
   HeyGen Avatar Panel (modo Avatar: imagem + texto/voz ou audio)
   ========================================================================== */
.avatar-panel[hidden],
.avatar-panel [hidden] {
  display: none !important;
}

.avatar-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.avatar-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.avatar-panel-heading {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.avatar-panel-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.avatar-panel-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.avatar-panel-hint.ready {
  color: var(--status-online);
}

.avatar-speech-toggle {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  background-color: var(--surface-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
}

.avatar-speech-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.avatar-speech-opt:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.05);
}

.avatar-speech-opt.active {
  color: var(--text-primary);
  background-color: rgba(168, 85, 247, 0.16);
  border-color: rgba(168, 85, 247, 0.55);
}

.avatar-speech-opt:focus-visible,
.avatar-btn:focus-visible,
.avatar-select:focus-visible,
.avatar-text-input:focus-visible,
.avatar-script-input:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 1px;
}

.avatar-speech-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.avatar-field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-script-input {
  width: 100%;
  min-height: 64px;
  max-height: 150px;
  resize: vertical;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-primary);
  background-color: var(--surface-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.avatar-script-input::placeholder,
.avatar-text-input::placeholder {
  color: var(--text-disabled);
}

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

.avatar-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.avatar-voice-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.avatar-inline-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.avatar-select,
.avatar-text-input {
  height: 30px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 12px;
  color: var(--text-primary);
  background-color: var(--surface-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
}

.avatar-select {
  max-width: 280px;
  cursor: pointer;
}

.avatar-select.grow {
  flex: 1;
  max-width: none;
  min-width: 200px;
}

.avatar-select option,
.avatar-select optgroup {
  background-color: var(--surface-popover);
  color: var(--text-primary);
}

.avatar-text-input {
  width: 200px;
}

.avatar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-fast);
}

.avatar-btn:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

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

.avatar-btn.primary {
  color: var(--accent-lime-text);
  background-color: var(--accent-lime);
  border-color: var(--accent-lime);
}

.avatar-btn.primary:hover {
  background-color: var(--accent-lime-hover);
}

.avatar-btn.ghost {
  background: transparent;
  border-color: transparent;
}

.avatar-clone-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px;
  background-color: rgba(168, 85, 247, 0.06);
  border: 1px dashed rgba(168, 85, 247, 0.4);
  border-radius: var(--radius-sm);
}

.avatar-clone-file {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-audio-player {
  width: 100%;
  height: 34px;
}

.avatar-audio-row {
  justify-content: flex-start;
}

@media (max-width: 720px) {
  .avatar-voice-controls { width: 100%; }
  .avatar-select { flex: 1; max-width: none; }
}

/* ==========================================================================
   Authentication Gate - fundo animado (WebGL) + título rotativo + card
   Base = celular (título curto acima do card). Lado a lado a partir de 1024px.
   ========================================================================== */

@property --auth-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.auth-gate-overlay {
  --auth-surface: #050608;
  --auth-card-bg: rgba(9, 10, 16, 0.74);
  --auth-field-bg: rgba(255, 255, 255, 0.04);
  --auth-field-border: rgba(255, 255, 255, 0.1);
  --auth-field-border-hover: rgba(255, 255, 255, 0.2);
  --auth-primary-bg: #f4f5f7;
  --auth-primary-bg-hover: #ffffff;
  --auth-primary-bg-active: #dfe2e8;
  --auth-primary-text: #0a0b0f;
  --auth-ring: 0 0 0 3px rgba(56, 189, 248, 0.35);
  --auth-grad: linear-gradient(92deg, #67d4ff 0%, #8b8cff 45%, #d58bff 75%, #ff8fc7 100%);

  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 32px 16px 24px;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--text-primary);
  font-family: var(--font-sans);
  background-color: var(--auth-surface);
  /* Reserva caso o WebGL não esteja disponível */
  background-image:
    radial-gradient(50% 50% at 25% 40%, rgba(99, 102, 241, 0.14), transparent 70%),
    radial-gradient(40% 40% at 88% 20%, rgba(168, 85, 247, 0.08), transparent 70%);
}

.auth-motion-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.auth-motion-canvas.is-ready {
  opacity: 1;
}

.auth-grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.12;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Entrada escalonada ---------- */

.auth-enter {
  animation: authRise 900ms var(--ease-spring) both;
  animation-delay: var(--d, 0ms);
}

@keyframes authRise {
  from { opacity: 0; transform: translateY(18px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}

/* ---------- Título ---------- */

.auth-hero {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
}

.auth-hero-eyebrow {
  display: none;
}

.auth-hero-title {
  font-size: 30px;
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.035em;
  color: #fff;
}

.auth-hero-line {
  display: inline;
}

.auth-hero-line-rest {
  display: block;
  color: rgba(248, 250, 252, 0.78);
}

.auth-word-rotator {
  display: inline-grid;
  vertical-align: baseline;
  padding-right: 0.06em;
}

.auth-word {
  grid-area: 1 / 1;
  background-image: var(--auth-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
  transform: translateY(35%);
  filter: blur(8px);
  transition: opacity 600ms var(--ease-spring), transform 700ms var(--ease-spring), filter 600ms var(--ease-spring);
}

.auth-word.is-active {
  opacity: 1;
  transform: none;
  filter: none;
}

.auth-word.is-leaving {
  opacity: 0;
  transform: translateY(-35%);
  filter: blur(8px);
}

/* ---------- Card ---------- */

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  padding: 28px 22px 16px;
  background-color: var(--auth-card-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  backdrop-filter: blur(28px) saturate(150%);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  box-shadow: 0 40px 80px -24px rgba(0, 0, 0, 0.7);
}

/* Luz que percorre a borda do card */
.auth-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  padding: 1px;
  border-radius: inherit;
  background: conic-gradient(from var(--auth-angle), transparent 0deg 250deg, rgba(103, 212, 255, 0.95) 290deg, rgba(213, 139, 255, 0.95) 325deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: authBorderSpin 7s linear infinite;
  pointer-events: none;
}

@keyframes authBorderSpin {
  to { --auth-angle: 360deg; }
}

.auth-card-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.auth-card-logo {
  display: block;
  width: 40px;
  height: auto;
  filter: drop-shadow(0 6px 18px rgba(99, 102, 241, 0.45));
}

.auth-card-wordmark {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.auth-gate-brand {
  margin-bottom: 24px;
}

.auth-gate-title {
  font-size: 28px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.auth-gate-subtitle {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.auth-gate-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.auth-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.auth-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.auth-input-container {
  position: relative;
}

.auth-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text-primary);
  background-color: var(--auth-field-bg);
  border: 1px solid var(--auth-field-border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast), background-color var(--duration-fast);
}

.auth-input.with-suffix {
  padding-right: 48px;
}

.auth-input::placeholder {
  color: var(--text-disabled);
}

.auth-input:hover {
  border-color: var(--auth-field-border-hover);
}

.auth-input:focus {
  border-color: var(--border-focus);
  background-color: rgba(255, 255, 255, 0.06);
  box-shadow: var(--auth-ring);
}

.auth-input[aria-invalid="true"] {
  border-color: var(--status-danger);
}

.auth-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-password-toggle-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--duration-fast), background-color var(--duration-fast);
}

.auth-password-toggle-btn:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.06);
}

.auth-password-toggle-btn:focus-visible {
  outline: none;
  color: var(--text-primary);
  box-shadow: var(--auth-ring);
}

.auth-forgot-link {
  padding: 2px 0;
  background: none;
  border: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: color var(--duration-fast);
}

.auth-forgot-link:hover {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-forgot-link:focus-visible {
  outline: none;
  color: var(--text-primary);
  box-shadow: var(--auth-ring);
}

.auth-error-banner {
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.45;
  color: #fecaca;
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-md);
}

.auth-submit-btn {
  position: relative;
  height: 48px;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--auth-primary-text);
  background-color: var(--auth-primary-bg);
  border: 0;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color var(--duration-fast), transform var(--duration-fast), box-shadow var(--duration-normal);
}

/* Reflexo que passa pelo botão no hover */
.auth-submit-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.9) 50%, transparent 70%);
  transform: translateX(-120%);
  pointer-events: none;
}

.auth-submit-arrow {
  position: relative;
  transition: transform var(--duration-normal) var(--ease-spring);
}

.auth-submit-btn:hover {
  background-color: var(--auth-primary-bg-hover);
  box-shadow: 0 10px 30px -10px rgba(139, 140, 255, 0.7);
}

.auth-submit-btn:hover::after {
  transform: translateX(120%);
  transition: transform 800ms ease;
}

.auth-submit-btn:hover .auth-submit-arrow {
  transform: translateX(3px);
}

.auth-submit-btn:active {
  background-color: var(--auth-primary-bg-active);
  transform: scale(0.99);
}

.auth-submit-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--auth-surface), 0 0 0 4px var(--border-focus);
}

.auth-submit-btn:disabled {
  cursor: progress;
  opacity: 0.65;
  transform: none;
  box-shadow: none;
}

.auth-submit-btn:disabled .auth-submit-arrow {
  display: none;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0;
}

.auth-divider-line {
  flex: 1;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.08);
}

.auth-divider-text {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-google-section {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.google-btn-host {
  display: flex;
  justify-content: center;
}

.google-btn-host:empty {
  display: none !important;
}

.auth-google-status {
  font-size: 12px;
  text-align: center;
  color: var(--text-muted);
}

.auth-google-status:empty {
  display: none;
}

.auth-google-local-btn {
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--auth-field-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color var(--duration-fast), border-color var(--duration-fast);
}

.auth-google-local-btn:hover {
  background-color: rgba(255, 255, 255, 0.07);
  border-color: var(--auth-field-border-hover);
}

.auth-google-local-btn:active {
  background-color: rgba(255, 255, 255, 0.1);
}

.auth-google-local-btn:focus-visible {
  outline: none;
  box-shadow: var(--auth-ring);
}

.auth-google-local-btn:disabled {
  opacity: 0.55;
  cursor: progress;
}

/* ---------- Rodapé do servidor (dentro do card) ---------- */

.auth-server-footer {
  position: relative;
  display: flex;
  justify-content: center;
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-server-pill-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 12px;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: color var(--duration-fast), border-color var(--duration-fast), background-color var(--duration-fast);
}

.auth-server-pill-trigger:hover,
.auth-server-pill-trigger[aria-expanded="true"] {
  color: var(--text-secondary);
  border-color: var(--border-medium);
  background-color: rgba(255, 255, 255, 0.03);
}

.auth-server-pill-trigger:focus-visible {
  outline: none;
  box-shadow: var(--auth-ring);
}

.auth-server-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--status-online);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.auth-server-badge {
  font-weight: 600;
  color: var(--text-primary);
}

.auth-server-chevron {
  transition: transform var(--duration-fast);
}

.auth-server-pill-trigger[aria-expanded="true"] .auth-server-chevron {
  transform: rotate(180deg);
}

.auth-server-popover {
  position: absolute;
  top: auto;
  right: auto;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: min(320px, calc(100vw - 40px));
  padding: 6px;
  background-color: var(--surface-popover);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: 0 18px 40px -8px rgba(0, 0, 0, 0.7);
  z-index: 50;
}

.auth-server-popover .menu-item {
  padding: 9px 10px;
  text-align: left;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
}

.auth-server-popover .menu-item:hover {
  color: var(--text-primary);
}

.auth-server-popover .menu-item.selected {
  color: var(--text-primary);
  font-weight: 600;
  background-color: rgba(56, 189, 248, 0.12);
  border-left: 0;
}

/* ---------- Telas largas: título à esquerda, card à direita ---------- */

@media (min-width: 1024px) {
  .auth-gate-overlay {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 64px;
    padding: 48px clamp(48px, 7vw, 120px);
  }

  .auth-hero {
    max-width: 640px;
    align-self: flex-end;
    padding-bottom: 8px;
  }

  .auth-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    padding: 6px 12px 6px 10px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(248, 250, 252, 0.8);
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .auth-hero-eyebrow-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--status-online);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
  }

  .auth-hero-title {
    font-size: clamp(52px, 5.4vw, 88px);
    line-height: 0.98;
    letter-spacing: -0.05em;
  }

  .auth-hero-line-rest {
    margin-top: 6px;
    font-size: 0.5em;
    line-height: 1.15;
    letter-spacing: -0.03em;
    max-width: 18ch;
  }

  .auth-card {
    flex: none;
    width: 440px;
    max-width: 440px;
    padding: 36px 36px 18px;
  }

  .auth-gate-title {
    font-size: 30px;
  }
}

/* ---------- Órbita dos motores (somente telas largas) ---------- */

.auth-orbit {
  display: none;
}

@media (min-width: 1024px) {
  .auth-hero {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
    flex: 1 1 auto;
    max-width: 680px;
    padding-bottom: 8px;
  }

  .auth-orbit {
    --orbit: min(500px, 54vh, 40vw);
    position: relative;
    display: block;
    flex: none;
    width: var(--orbit);
    height: var(--orbit);
    margin: auto auto 0;
  }

  .auth-orbit-track {
    position: absolute;
    left: calc(50% - var(--r));
    top: calc(50% - var(--r));
    width: calc(var(--r) * 2);
    height: calc(var(--r) * 2);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.07);
    animation: authOrbitSpin var(--spin) linear infinite;
    animation-direction: var(--dir);
  }

  /* Ponto de luz que percorre cada anel */
  .auth-orbit-track::after {
    content: "";
    position: absolute;
    left: 50%;
    top: -3px;
    width: 6px;
    height: 6px;
    margin-left: -3px;
    border-radius: 50%;
    background-color: #c7d2fe;
    box-shadow: 0 0 10px 2px rgba(139, 140, 255, 0.8);
  }

  .auth-orbit-track-outer {
    --r: calc(var(--orbit) * 0.46);
    --spin: 90s;
    --dir: normal;
    --counter: reverse;
  }

  .auth-orbit-track-inner {
    --r: calc(var(--orbit) * 0.27);
    --spin: 60s;
    --dir: reverse;
    --counter: normal;
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.06);
  }

  .auth-orbit-item {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
    transform: rotate(var(--a)) translateX(var(--r)) rotate(calc(-1 * var(--a)));
  }

  /* Gira ao contrário do anel para o selo ficar sempre de pé */
  .auth-orbit-upright {
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    animation: authOrbitSpin var(--spin) linear infinite;
    animation-direction: var(--counter);
  }

  .auth-orbit-pill {
    position: absolute;
    left: 0;
    top: 0;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px 7px 10px;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: rgba(248, 250, 252, 0.6);
    background-color: rgba(14, 15, 22, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: var(--radius-full);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: color 500ms ease, background-color 500ms ease, border-color 500ms ease, box-shadow 500ms ease;
  }

  .auth-orbit-pill svg {
    color: rgba(165, 180, 252, 0.6);
    transition: color 500ms ease;
  }

  .auth-orbit-pill.is-lit {
    color: #fff;
    background-color: rgba(40, 38, 80, 0.85);
    border-color: rgba(165, 180, 252, 0.55);
    box-shadow: 0 0 0 4px rgba(139, 140, 255, 0.12), 0 0 28px rgba(139, 140, 255, 0.45);
  }

  .auth-orbit-pill.is-lit svg {
    color: #a5f3fc;
  }

  .auth-orbit-core {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 104px;
    height: 104px;
    margin: -52px 0 0 -52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 35%, rgba(60, 58, 120, 0.55), rgba(10, 10, 18, 0.95) 70%);
    border: 1px solid rgba(165, 180, 252, 0.25);
    box-shadow: 0 0 60px rgba(99, 102, 241, 0.35);
  }

  .auth-orbit-core img {
    width: 52px;
    height: auto;
    filter: drop-shadow(0 6px 20px rgba(99, 102, 241, 0.6));
  }

  /* Ondas que saem do núcleo, como pulsos de geração */
  .auth-orbit-core::before,
  .auth-orbit-core::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 50%;
    border: 1px solid rgba(165, 180, 252, 0.45);
    animation: authCorePulse 3.6s ease-out infinite;
    pointer-events: none;
  }

  .auth-orbit-core::after {
    animation-delay: 1.8s;
  }
}

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

@keyframes authCorePulse {
  0%   { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2.6); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-orbit-track,
  .auth-orbit-upright,
  .auth-orbit-core::before,
  .auth-orbit-core::after {
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-enter,
  .auth-card::before {
    animation: none;
  }
  .auth-word,
  .auth-submit-arrow,
  .auth-motion-canvas {
    transition: none;
  }
  .auth-submit-btn:hover::after {
    transition: none;
    transform: translateX(-120%);
  }
}

.user-popover-action.logout-action {
  color: var(--status-danger);
  margin-top: 2px;
}

.user-popover-action.logout-action:hover {
  background-color: rgba(239, 68, 68, 0.12);
}

/* ==========================================================================
   Account surfaces: profile popover, team management, Multilogin table
   ========================================================================== */

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

/* Shared text inputs (email/search were falling back to the white UA style) */
.form-field input[type="email"],
.studio-input {
  background-color: var(--surface-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  font-family: inherit;
  font-size: 12px;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--duration-fast);
}

.studio-input.compact {
  padding: 6px 10px;
}

.form-field input[type="email"]:focus,
.studio-input:focus {
  border-color: var(--accent-lime);
}

.form-field input::placeholder,
.studio-input::placeholder {
  color: var(--text-disabled);
}

/* Small row-level buttons (list cards and table rows) */
.row-btn {
  flex: none;
  background-color: transparent;
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--duration-fast), border-color var(--duration-fast), color var(--duration-fast);
}

.row-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background-color: rgba(255, 255, 255, 0.04);
}

.row-btn:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.row-btn.accent {
  color: var(--accent-lime);
  border-color: rgba(43, 248, 77, 0.35);
}

.row-btn.accent:hover {
  background-color: var(--accent-lime);
  border-color: var(--accent-lime);
  color: var(--accent-lime-text);
}

.row-btn.danger:hover {
  color: var(--status-danger);
  border-color: rgba(239, 68, 68, 0.5);
  background-color: rgba(239, 68, 68, 0.08);
}

.row-btn.in-use {
  background-color: rgba(43, 248, 77, 0.12);
  border-color: transparent;
  color: var(--accent-lime);
  cursor: default;
}

/* Role chip */
.role-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  white-space: nowrap;
}

.role-chip[data-role="admin"] {
  background-color: var(--accent-cyan-subtle);
  color: var(--accent-cyan);
}

.role-chip[data-role="creator"] {
  background-color: rgba(168, 85, 247, 0.14);
  color: #c084fc;
}

/* --- Profile popover: current user only ---------------------------------- */
.user-popover-menu {
  width: 264px;
  gap: 8px;
}

.user-popover-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 0;
}

.user-popover-avatar {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-lime-text);
  background-color: var(--accent-lime);
}

.user-popover-ident {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.user-popover-name {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-popover-email {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-popover-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
}

.user-popover-meta .user-popover-team {
  margin: 0;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* --- Team & user management --------------------------------------------- */
.teams-col h4,
.users-col h4 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.count-chip {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  padding: 1px 7px;
}

.teams-split-layout {
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
}

.teams-col,
.users-col {
  min-width: 0;
}

.teams-card-list,
.users-card-list {
  max-height: 320px;
  overflow-x: hidden;
  padding-right: 4px;
}

.team-item-card,
.user-item-card {
  gap: 12px;
  border-radius: var(--radius-sm);
  transition: border-color var(--duration-fast);
}

.team-item-card:hover,
.user-item-card:hover {
  border-color: var(--border-medium);
}

.team-card-info,
.user-card-info {
  flex: 1;
  min-width: 0;
  gap: 3px;
}

.team-card-info .card-title,
.card-email {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-card-info .card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.card-title-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.you-tag {
  flex: none;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-lime);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  min-width: 0;
}

.card-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.list-empty-state {
  font-size: 12px;
  color: var(--text-muted);
  padding: 16px 12px;
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-sm);
  text-align: center;
}

@media (max-width: 760px) {
  .teams-split-layout {
    grid-template-columns: 1fr;
  }
}

/* --- Multilogin accounts table ------------------------------------------- */
.multilogin-filter-bar {
  width: 100%;
  justify-content: space-between;
}

.multilogin-filter-tabs {
  flex-wrap: wrap;
}

.ml-filter-tab {
  white-space: nowrap;
}

.ml-search-wrap {
  flex: 1;
  min-width: 220px;
  max-width: 320px;
}

.ml-search-wrap input {
  width: 100%;
  min-width: 0;
}

.stat-box {
  min-width: 0;
}

.accounts-table {
  table-layout: fixed;
  min-width: 860px;
}

.accounts-table thead th {
  background-color: var(--surface-card);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.accounts-table .col-account  { width: 30%; }
.accounts-table .col-platform { width: 17%; }
.accounts-table .col-teams    { width: 19%; }
.accounts-table .col-status   { width: 16%; }
.accounts-table .col-check    { width: 9%; }
.accounts-table .col-action   { width: 9%; text-align: right; }

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

.cell-primary {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cell-secondary {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.platform-tag {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  background-color: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-xs);
  padding: 2px 6px;
}

.team-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.team-chip {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.team-chip[data-team="criativos"] { background-color: rgba(16, 185, 129, 0.14); color: #34d399; }
.team-chip[data-team="afiliados"] { background-color: rgba(59, 130, 246, 0.16); color: #60a5fa; }
.team-chip[data-team="vsl"]       { background-color: rgba(168, 85, 247, 0.16); color: #c084fc; }

.status-dot-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.status-dot-label::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background-color: currentColor;
  flex: none;
}

.status-dot-label.is-ok      { color: var(--status-online); }
.status-dot-label.is-expired { color: var(--status-warning); }

.accounts-table .col-check .cell-secondary {
  font-size: 12px;
}

.table-empty-cell {
  text-align: center;
  padding: 24px 14px !important;
  color: var(--text-muted);
}

/* ============================================================================
   Banco de Referências Salvas (Receitas, Avatares, Produtos)
   ============================================================================ */

.ref-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  padding: 4px;
}

.ref-bank-card {
  position: relative;
  background-color: var(--surface-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.ref-bank-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-lime);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.ref-bank-card.is-active-ref {
  border-color: var(--accent-lime);
  box-shadow: 0 0 0 2px rgba(43, 248, 77, 0.4);
}

.ref-bank-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background-color: #030508;
  overflow: hidden;
  cursor: pointer;
}

.ref-bank-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-normal);
}

.ref-bank-card:hover .ref-bank-thumb {
  transform: scale(1.05);
}

.ref-bank-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: var(--radius-xs);
  backdrop-filter: blur(8px);
  z-index: 2;
}

.ref-bank-badge.badge-receitas {
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.ref-bank-badge.badge-avatar {
  background: rgba(168, 85, 247, 0.25);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.ref-bank-badge.badge-produtos {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.ref-bank-badge.badge-outros {
  background: rgba(59, 130, 246, 0.25);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.ref-bank-active-slot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--accent-lime);
  color: var(--accent-lime-text);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  z-index: 2;
}

.ref-bank-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.ref-bank-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.ref-bank-prompt {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 30px;
}

.ref-bank-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.ref-bank-tag-pill {
  font-size: 9px;
  padding: 2px 6px;
  background-color: var(--surface-topbar);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
}

.ref-bank-footer {
  padding: 8px 12px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--surface-topbar);
}

.btn-ref-use {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  background-color: rgba(43, 248, 77, 0.12);
  color: var(--accent-lime);
  border: 1px solid rgba(43, 248, 77, 0.3);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.btn-ref-use:hover {
  background-color: var(--accent-lime);
  color: #000000;
}

.btn-ref-use.is-selected {
  background-color: var(--accent-lime);
  color: #000000;
  border-color: var(--accent-lime);
}

.ref-bank-actions-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-ref-icon-action {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.btn-ref-icon-action:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
  background: var(--surface-card);
}

.btn-ref-icon-action.danger:hover {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.08);
}

.ref-form-grid {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 12px;
  align-items: start;
}

.ref-form-grid .form-field.flex-2 {
  grid-column: span 2;
}

.ref-form-grid .form-field.flex-full {
  grid-column: span 2;
}

.ref-upload-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

@media (max-width: 640px) {
  .ref-form-grid {
    grid-template-columns: 1fr;
  }
  .ref-form-grid .form-field.flex-2,
  .ref-form-grid .form-field.flex-full {
    grid-column: span 1;
  }
}


/* ============================================================================
   Painel de Gestão de Equipe & Permissões (Estilo GEXPOWER Multi-Tenant)
   ============================================================================ */
.studio-modal-card.gex-permissions-card {
  max-width: 980px;
  width: 95vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.5rem;
  overflow-x: hidden;
  box-sizing: border-box;
  background: #0b101e;
  border: 1px solid #1e293b;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.gex-modal-top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  flex-shrink: 0;
}

.gex-header-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.gex-header-title-wrap h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  color: #f8fafc;
}

.gex-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gex-btn-refresh {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid #3b82f6;
  color: #60a5fa;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.gex-btn-refresh:hover {
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}

.gex-btn-refresh:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.spin-anim {
  animation: gex-spin 1s linear infinite;
}

@keyframes gex-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.gex-main-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  flex-shrink: 0;
}

.gex-tab-btn {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid #1e293b;
  background: #070b14;
  color: #94a3b8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.gex-tab-btn:hover {
  border-color: #334155;
  color: #f1f5f9;
}

.gex-tab-btn.active {
  background: rgba(37, 99, 235, 0.15);
  border-color: #2563eb;
  color: #60a5fa;
}

.gex-tab-content {
  display: none;
  flex: 1;
  min-height: 0;
}

.gex-tab-content.active {
  display: flex;
  flex-direction: column;
}

.gex-split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 1rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
}

.gex-col-left,
.gex-col-right {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.gex-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

.gex-section-header h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #94a3b8;
  margin: 0;
}

.gex-counter {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 600;
}

.gex-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.gex-filter-pill {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid #1e293b;
  background: #070b14;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.gex-filter-pill:hover {
  border-color: #334155;
  color: #f1f5f9;
}

.gex-filter-pill.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: #3b82f6;
  color: #93c5fd;
}

.gex-search-wrap {
  position: relative;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
}

.gex-search-wrap svg {
  position: absolute;
  left: 8px;
  pointer-events: none;
}

.gex-search-wrap input {
  width: 100%;
  padding: 6px 26px 6px 26px;
  background: #070b14;
  border: 1px solid #1e293b;
  border-radius: 6px;
  color: #fff;
  font-size: 0.75rem;
  outline: none;
  box-sizing: border-box;
}

.gex-search-wrap input:focus {
  border-color: #3b82f6;
}

.gex-search-clear {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px;
}

.gex-search-clear:hover {
  color: #f1f5f9;
}

.gex-items-list {
  min-height: 140px;
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  margin-bottom: 0.75rem;
  padding-right: 0.25rem;
}

.gex-item-card {
  padding: 0.5rem 0.7rem;
  border-radius: 6px;
  margin-bottom: 0.35rem;
  background: #070b14;
  border: 1px solid #1e293b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  transition: all 0.15s ease;
}

.gex-item-card:hover {
  border-color: #334155;
  background: #0c1222;
}

.gex-item-card.selected {
  background: rgba(59, 130, 246, 0.1);
  border-color: #3b82f6;
}

.gex-card-main-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  overflow: hidden;
}

.gex-dot-indicator {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.gex-card-texts {
  min-width: 0;
  overflow: hidden;
}

.gex-card-title {
  font-size: 0.825rem;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gex-card-sub {
  font-size: 0.7rem;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.gex-badge-role {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.gex-badge-role.admin {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.gex-badge-role.operator {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.4);
}

.gex-btn-del-mini {
  background: none;
  border: none;
  color: #ef4444;
  opacity: 0.6;
  cursor: pointer;
  padding: 3px;
  display: flex;
  align-items: center;
  border-radius: 4px;
  transition: opacity 0.15s;
}

.gex-btn-del-mini:hover {
  opacity: 1;
  background: rgba(239, 68, 68, 0.15);
}

.gex-bottom-form {
  background: #070b14;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid #1e293b;
}

.gex-form-title {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.gex-input,
.gex-select {
  width: 100%;
  background: #0b101e;
  border: 1px solid #1e293b;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.75rem;
  color: #fff;
  margin-bottom: 0.45rem;
  box-sizing: border-box;
  outline: none;
}

.gex-input:focus,
.gex-select:focus {
  border-color: #3b82f6;
}

.gex-form-row {
  display: flex;
  gap: 0.4rem;
}

.gex-form-hint {
  font-size: 0.68rem;
  color: #64748b;
  margin: 0 0 0.5rem 0;
}

.gex-btn-submit-pill {
  width: 100%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 7px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: opacity 0.15s;
}

.gex-btn-submit-pill:hover {
  opacity: 0.92;
}

/* Painel de Detalhes da Direita */
.gex-detail-card {
  background: #070b14;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
  min-height: 520px;
  max-height: 620px;
  box-sizing: border-box;
  overflow-x: hidden;
}

.gex-detail-header {
  margin-bottom: 0.65rem;
  border-bottom: 1px solid #1e293b;
  padding-bottom: 0.65rem;
  flex-shrink: 0;
}

.gex-detail-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.gex-sub-tabs {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.5rem;
  background: #050811;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid #1e293b;
}

.gex-sub-tab {
  flex: 1;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.gex-sub-tab.active {
  background: #1e293b;
  color: #38bdf8;
}

.gex-tools-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
  flex-shrink: 0;
}

.gex-btn-shortcut {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid #3b82f6;
  color: #93c5fd;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.66rem;
  cursor: pointer;
}

.gex-btn-shortcut.secondary {
  background: rgba(100, 116, 139, 0.15);
  border-color: #475569;
  color: #cbd5e1;
}

.gex-tools-scroll {
  flex: 1;
  min-height: 220px;
  max-height: 310px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.25rem;
}

.gex-tool-card {
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  margin-bottom: 0.35rem;
  background: #0b101e;
  border: 1px solid #1e293b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  transition: all 0.15s ease;
}

.gex-tool-card:hover {
  border-color: #334155;
}

.gex-tool-card.checked {
  border-color: #06b6d4;
  background: rgba(6, 182, 212, 0.08);
}

.gex-tool-info-title {
  font-size: 0.825rem;
  font-weight: 600;
  color: #fff;
}

.gex-tool-info-cat {
  font-size: 0.7rem;
  color: #94a3b8;
}

.gex-checkbox-custom {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #070b14;
  flex-shrink: 0;
  transition: all 0.15s;
}

.gex-tool-card.checked .gex-checkbox-custom {
  background: #06b6d4;
  border-color: #06b6d4;
  color: #070b14;
}

.gex-banner-info {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid #2563eb;
  color: #93c5fd;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  line-height: 1.4;
  margin-bottom: 0.85rem;
}

.gex-banner-warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid #f59e0b;
  color: #fcd34d;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  line-height: 1.4;
  margin-bottom: 0.85rem;
}

.gex-bottom-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #1e293b;
  flex-shrink: 0;
}

.gex-btn-action-neutral {
  background: #1e293b;
  border: 1px solid #334155;
  color: #f1f5f9;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.gex-btn-action-neutral:hover {
  background: #334155;
}

.gex-btn-action-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border: none;
  color: #fff;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.gex-btn-action-primary:hover {
  opacity: 0.92;
}

.gex-toast-status {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  margin-top: 0.5rem;
}

.gex-toast-status.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid #10b981;
  color: #6ee7b7;
}

.gex-toast-status.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #fca5a5;
}

@media (max-width: 768px) {
  .gex-split-grid {
    grid-template-columns: 1fr;
  }
}
