/* ═══════════════════════════════════════════════════════════════════════════
   Flow Playwright Controller — "GRAPHITE TECH" Design System
   Linear / Vercel style dark theme:
   Deep graphite #0A0A0C, hairline borders, specular highlights,
   electric indigo #5E6AD2, mono data tags, and smooth spring micro-interactions.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Brand — Electric Indigo */
  --primary: #5E6AD2;
  --primary-hover: #6B76E5;
  --primary-dark: #9AA2F2;
  --primary-light: rgba(94, 106, 210, 0.22);
  --primary-tint: rgba(94, 106, 210, 0.14);

  /* Neutrals & Surfaces */
  --bg: #0A0A0C;
  --surface: #141418;
  --surface2: #1C1C22;
  --surface3: #26262E;
  --text: #F7F8F8;
  --muted: #8A8F98;
  --muted-dark: #62666D;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.16);
  --border: rgba(255, 255, 255, 0.08);

  /* Status Colors */
  --accent: #5E6AD2;
  --accent2: #6B76E5;
  --green: #4CC38A;
  --green-bg: rgba(76, 195, 138, 0.12);
  --green-border: rgba(76, 195, 138, 0.28);
  --red: #EB5757;
  --red-bg: rgba(235, 87, 87, 0.12);
  --red-border: rgba(235, 87, 87, 0.28);
  --yellow: #F2C94C;
  --yellow-bg: rgba(242, 201, 76, 0.12);
  --yellow-border: rgba(242, 201, 76, 0.28);

  /* Glass Effects */
  --glass-bg: rgba(20, 20, 24, 0.72);
  --glass-bg-soft: rgba(24, 24, 28, 0.5);
  --glass-bg-solid: rgba(24, 24, 29, 0.96);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, 0.06);

  /* Shadows */
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.3);
  --shadow-island: 0 8px 30px rgba(0, 0, 0, 0.45);
  --shadow-pill: 0 4px 18px rgba(94, 106, 210, 0.38), 0 1px 2px rgba(0, 0, 0, 0.4);

  /* Typography & Timing */
  --mono: "SF Mono", "Consolas", "Menlo", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --font-title: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --r: 10px;
  --spring: cubic-bezier(0.32, 0.72, 0, 1);
}

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

html {
  height: 100%;
  background-color: #0A0A0C;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--sans);
  color: var(--text);
  background-color: #0A0A0C;
  background-image:
    radial-gradient(55% 45% at 78% -8%, rgba(94, 106, 210, 0.13), transparent 62%),
    radial-gradient(45% 40% at 8% 108%, rgba(64, 143, 227, 0.07), transparent 60%),
    linear-gradient(180deg, #0B0B0E 0%, #09090B 100%);
  background-attachment: fixed;
  color-scheme: dark;
  line-height: 1.5;
  font-size: 13.5px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Custom Sleek Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* ── Container Layout & Sidebar Rail ─────────────────────────────────────── */
.app-shell {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: #0A0A0C;
}

.app-content {
  flex: 1;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ── Sidebar Rail ("Liquid Glass" / Linear style) ────────────────────────── */
.sidebar {
  position: relative;
  width: 68px;
  height: 100vh;
  flex-shrink: 0;
  z-index: 50;
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border-right: 1px solid var(--line);
  box-shadow: var(--glass-edge), 4px 0 24px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  transition: width 0.3s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
}

.sidebar:hover,
.sidebar.is-expanded {
  width: 236px;
  box-shadow: var(--glass-edge), 12px 0 36px rgba(0, 0, 0, 0.55);
}

.sidebar-header {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  cursor: pointer;
  user-select: none;
}

.sidebar:not(.is-expanded):not(:hover) .sidebar-brand-text {
  display: none;
}

.sidebar:not(.is-expanded):not(:hover) .sidebar-toggle-btn {
  display: none;
}

.sidebar-brand-icon {
  font-size: 1.35rem;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(180deg, #6B76E5 0%, #5E6AD2 100%);
  box-shadow: 0 2px 8px rgba(94, 106, 210, 0.35);
  flex-shrink: 0;
  transition: transform 0.2s var(--spring);
}

.sidebar-brand:hover .sidebar-brand-icon {
  transform: scale(1.05);
}

.sidebar-brand-text {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.015em;
  background: linear-gradient(90deg, #F7F8F8 0%, #C7CCF4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}

.sidebar-toggle-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 14px;
  flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--line-2);
  color: var(--text);
}

.sidebar-cta {
  padding: 12px 14px;
  flex-shrink: 0;
}

.sidebar-cta-btn {
  width: 100%;
  height: 36px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, #6B76E5 0%, #5E6AD2 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 10px;
  gap: 10px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: all 0.2s var(--spring);
  overflow: hidden;
}

.sidebar-cta-btn:hover {
  background: linear-gradient(180deg, #7883EE 0%, #6B76E5 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), var(--shadow-pill);
}

.sidebar-cta-btn:active {
  transform: scale(0.97);
}

.cta-icon {
  font-size: 14px;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 38px;
  padding: 0 11px;
  border-radius: 9px;
  text-decoration: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}

.sidebar-nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.sidebar-nav-item:active {
  transform: scale(0.98);
}

.sidebar-nav-item.active {
  background: rgba(94, 106, 210, 0.14);
  color: #F7F8F8;
  border-color: rgba(94, 106, 210, 0.32);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.sidebar-nav-item.active .nav-icon {
  color: #9AA2F2;
}

.nav-icon {
  font-size: 15px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}

.sidebar-label {
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.22s cubic-bezier(0.32, 0.72, 0, 1), transform 0.22s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar:hover .sidebar-label,
.sidebar.is-expanded .sidebar-label {
  opacity: 1;
  transform: translateX(0);
}

.sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.sidebar-action-btn {
  background: transparent;
  width: 100%;
  text-align: left;
}

.app {
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  padding: 20px 28px 64px;
}

body.is-embedded .app {
  padding: 14px 22px 48px;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  position: relative;
}

body.is-embedded header {
  margin-bottom: 18px;
  padding-bottom: 14px;
}

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

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(94, 106, 210, 0.12);
  border: 1px solid rgba(94, 106, 210, 0.25);
  box-shadow: 0 4px 14px rgba(94, 106, 210, 0.15);
  transition: transform 0.2s var(--spring);
}

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

header h1 {
  margin: 0;
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.022em;
  background: linear-gradient(90deg, #F7F8F8 0%, #C7CCF4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: -0.01em;
}

/* ── Status Bar (Glass Pill) ─────────────────────────────────────────────── */
.status-bar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--line-2);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  box-shadow: var(--glass-edge), 0 2px 8px rgba(0, 0, 0, 0.35);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

@keyframes status-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(76, 195, 138, 0.6);
  }
  50% {
    transform: scale(1.15);
    box-shadow: 0 0 0 5px rgba(76, 195, 138, 0);
  }
}

.status-dot.online {
  background: var(--green);
  animation: status-pulse 2.2s infinite ease-in-out;
}

.status-dot.offline {
  background: var(--red);
  box-shadow: 0 0 6px rgba(235, 87, 87, 0.4);
}

.badge {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #C7CCF4;
  border: 1px solid var(--line);
  letter-spacing: 0.02em;
}

.badge-profile {
  background: rgba(94, 106, 210, 0.14);
  color: #9AA2F2;
  border: 1px solid rgba(94, 106, 210, 0.32);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.badge-profile:hover {
  background: rgba(94, 106, 210, 0.25);
  border-color: rgba(94, 106, 210, 0.55);
  color: #ffffff;
  transform: translateY(-1px);
}


/* ── Action Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  box-shadow: var(--glass-edge);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
              box-shadow 0.15s ease, transform 0.1s ease;
}

.btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.24);
}

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

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

.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 0.75rem;
  border-radius: 7px;
}

.btn-primary {
  background: linear-gradient(180deg, #6B76E5 0%, #5E6AD2 100%);
  border-color: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 3px rgba(0, 0, 0, 0.4);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #7883EE 0%, #6B76E5 100%);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), var(--shadow-pill);
}

.btn-outline, .video-link {
  background: rgba(94, 106, 210, 0.12) !important;
  color: #9AA2F2 !important;
  border: 1px solid rgba(94, 106, 210, 0.35) !important;
  border-radius: 6px !important;
  transition: all 0.15s ease;
}

.btn-outline:hover, .video-link:hover {
  background: rgba(94, 106, 210, 0.24) !important;
  border-color: rgba(94, 106, 210, 0.55) !important;
  color: #FFFFFF !important;
  box-shadow: 0 2px 10px rgba(94, 106, 210, 0.25);
}

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

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line-2);
  color: var(--text);
}

.btn-danger {
  background: var(--red-bg);
  color: #F29B9B;
  border-color: var(--red-border);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(235, 87, 87, 0.22);
  border-color: rgba(235, 87, 87, 0.45);
  color: #FFFFFF;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  font-size: 0.82rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-2);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s var(--spring);
}

.btn-back:hover {
  background: rgba(94, 106, 210, 0.16);
  border-color: rgba(94, 106, 210, 0.4);
  color: #C7CCF4;
}

.btn-back .back-arrow {
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.2s var(--spring);
}

.btn-back:hover .back-arrow {
  transform: translateX(-3px);
}

.btn-open-chrome {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(94, 106, 210, 0.12);
  border: 1px solid rgba(94, 106, 210, 0.3);
  color: #9AA2F2;
  font-weight: 500;
  border-radius: 999px;
  transition: all 0.2s var(--spring);
}

.btn-open-chrome:hover:not(:disabled) {
  background: rgba(94, 106, 210, 0.22);
  border-color: rgba(94, 106, 210, 0.5);
  color: #FFFFFF;
  box-shadow: 0 2px 10px rgba(94, 106, 210, 0.25);
}

.btn-open-chrome.online {
  background: var(--green-bg);
  border-color: var(--green-border);
  color: #8ADFB6;
}

.btn-open-live-jev {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.3);
  color: #FACC15;
  font-weight: 500;
  border-radius: 999px;
  transition: all 0.2s var(--spring);
}

.btn-open-live-jev:hover:not(:disabled) {
  background: rgba(234, 179, 8, 0.22);
  border-color: rgba(234, 179, 8, 0.5);
  color: #FFFFFF;
  box-shadow: 0 2px 10px rgba(234, 179, 8, 0.25);
}

.btn-open-live-jev.online {
  background: rgba(234, 179, 8, 0.25);
  border-color: #FACC15;
  color: #FEF08A;
}

/* ── Main Grid & Panels ──────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: minmax(380px, 480px) 1fr;
  gap: 20px;
  align-items: start;
}

.right-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

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

.panel {
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--glass-edge), 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.panel-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.panel-head h2 {
  margin: 0;
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
}

.panel-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: -0.01em;
}

.panel-body {
  padding: 18px;
}

/* ── Form Controls & Inputs ──────────────────────────────────────────────── */
.form-group {
  margin-bottom: 14px;
}

label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--muted);
}

input[type="text"],
input[type="search"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-dark);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3.5px rgba(94, 106, 210, 0.22);
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Prompt & Attachments ────────────────────────────────────────────────── */
.prompt-input-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.prompt-input-row textarea {
  flex: 1;
  min-width: 0;
}

.prompt-attachment {
  align-self: flex-end;
  min-width: 44px;
  min-height: 40px;
  height: 40px;
  font-size: 1.15rem;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-2);
}

.prompt-attachment:hover {
  background: rgba(94, 106, 210, 0.14);
  border-color: rgba(94, 106, 210, 0.35);
  color: #9AA2F2;
}

/* ── Asset Picker ────────────────────────────────────────────────────────── */
.asset-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.asset-picker small {
  color: var(--muted-dark);
  font-size: 0.75rem;
  line-height: 1.4;
  display: block;
}

.asset-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.asset-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 0.76rem;
}

.asset-chip button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0 3px;
  font-size: 0.9rem;
  transition: color 0.15s ease;
}

.asset-chip button:hover {
  color: var(--red);
}

.asset-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-role {
  max-width: 110px;
  padding: 2px 5px;
  font-size: 0.72rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #C7CCF4;
}

.media-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.media-thumb {
  width: 42px;
  height: 30px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: var(--surface2);
  vertical-align: middle;
}

.media-thumb-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ── Options Dropdown (Collapsible & Compact) ────────────────────────────── */
.options-dropdown {
  margin-top: 10px;
  margin-bottom: 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 20, 26, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.options-dropdown:hover {
  border-color: rgba(94, 106, 210, 0.35);
  background: rgba(18, 20, 26, 0.72);
}

.options-dropdown[open] {
  border-color: rgba(94, 106, 210, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(94, 106, 210, 0.2);
}

.options-dropdown-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background 0.15s ease;
}

.options-dropdown-summary::-webkit-details-marker {
  display: none;
}

.options-dropdown-summary:hover {
  background: rgba(255, 255, 255, 0.03);
}

.options-summary-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.options-summary-icon {
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(94, 106, 210, 0.12);
  border: 1px solid rgba(94, 106, 210, 0.25);
  color: var(--primary);
  flex-shrink: 0;
}

.options-summary-text {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.options-summary-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.options-summary-badge {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--primary-glow);
  background: rgba(94, 106, 210, 0.12);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(94, 106, 210, 0.25);
  letter-spacing: 0.02em;
}

.options-summary-chevron {
  font-size: 0.85rem;
  color: var(--muted);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.15s ease;
}

.options-dropdown[open] .options-summary-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

.options-dropdown-content {
  padding: 12px 14px 14px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.16);
  animation: optionsFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.options-dropdown-content .option-card {
  margin-bottom: 12px;
}

.options-dropdown-content .flow-options-grid {
  margin-bottom: 12px;
}

.options-dropdown-content .advanced-section {
  margin-bottom: 0;
}

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

/* ── Option Card & Toggles ───────────────────────────────────────────────── */
.option-card {
  background: rgba(94, 106, 210, 0.06);
  border: 1px solid rgba(94, 106, 210, 0.18);
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
}

.option-card > .toggle-container:first-child {
  grid-column: 1 / -1;
  background: rgba(94, 106, 210, 0.08);
  border: 1px solid rgba(94, 106, 210, 0.22);
}

.toggle-container {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background 0.15s ease;
}

@media (max-width: 580px) {
  .option-card {
    grid-template-columns: 1fr;
  }
}

.toggle-container:hover {
  background: rgba(255, 255, 255, 0.03);
}

.toggle-container input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.toggle-label strong {
  display: block;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text);
}

.toggle-label small {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  margin-top: 2px;
}

.advanced-section {
  margin-bottom: 14px;
  font-size: 0.82rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
}

.advanced-section summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
  user-select: none;
  outline: none;
}

.advanced-section summary:hover {
  color: var(--text);
}

/* ── Actions & Messages ──────────────────────────────────────────────────── */
.actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.actions .btn-primary {
  flex: 1;
  height: 40px;
  font-size: 14px;
}

.msg {
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 0.82rem;
  margin-bottom: 12px;
  display: none;
  border: 1px solid transparent;
}

.msg.ok {
  display: block;
  background: var(--green-bg);
  color: #8ADFB6;
  border-color: var(--green-border);
}

.msg.err {
  display: block;
  background: var(--red-bg);
  color: #F29B9B;
  border-color: var(--red-border);
}

/* ── Live Log Box (High-tech IDE Terminal) ────────────────────────────────── */
.log-box {
  margin: 0;
  padding: 14px 16px;
  background: #08090D;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: #ABB2BF;
  height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.flow-results-panel .tbl-wrap {
  max-height: 240px;
  overflow-y: auto;
}

/* ── Pipeline Rows & Trace Steps (CRITICAL TEST CONTRACT) ─────────────────── */
.pipeline-row td {
  padding: 0;
  background: rgba(94, 106, 210, 0.03);
}

.pipeline-panel {
  padding: 14px 18px 16px 54px;
  border-top: 1px solid var(--line);
}

.pipeline-panel strong {
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-family: var(--mono);
}

.pipeline-list {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.pipeline-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
}

.pipeline-icon {
  width: 18px;
  text-align: center;
  font-weight: 700;
  font-family: var(--mono);
}

.pipeline-step small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 1px;
}

.pipeline-done .pipeline-icon { color: var(--green); }
.pipeline-running .pipeline-icon { color: var(--yellow); }
.pipeline-pending .pipeline-icon { color: var(--muted); }

.pipeline-stalled .pipeline-icon,
.pipeline-stalled .pipeline-step-label,
.pipeline-stalled .pipeline-step-label small {
  color: var(--yellow);
}

.pipeline-failed .pipeline-icon,
.pipeline-failed .pipeline-step-label,
.pipeline-failed .pipeline-step-label small {
  color: var(--red);
}

/* Fallback Step rule - must have border-left|background|outline and NOT set color directly */
.pipeline-fallback {
  padding: 4px 8px;
  margin-left: -8px;
  border-left: 2px solid var(--accent);
  border-radius: 4px;
  background: rgba(94, 106, 210, 0.08);
}

.pipeline-empty {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

/* ── Tables & Lists ──────────────────────────────────────────────────────── */
.tbl-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

th, td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

tr:hover:not(.pipeline-row) td {
  background: rgba(255, 255, 255, 0.025);
}

td code {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: #C7CCF4;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 5px;
}

.empty-cell {
  text-align: center;
  color: var(--muted);
  padding: 32px 16px;
}

/* ── Tags / Status Chips ─────────────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.tag-pending, .tag-queued {
  background: var(--yellow-bg);
  color: #F5D77A;
  border-color: var(--yellow-border);
}

.tag-running {
  background: rgba(94, 106, 210, 0.16);
  color: #9AA2F2;
  border-color: rgba(94, 106, 210, 0.32);
}

.tag-completed {
  background: var(--green-bg);
  color: #8ADFB6;
  border-color: var(--green-border);
}

.tag-failed, .tag-cancelled {
  background: var(--red-bg);
  color: #F29B9B;
  border-color: var(--red-border);
}

/* ── Jobs Toolbar & Pagination ───────────────────────────────────────────── */
.jobs-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) repeat(3, minmax(140px, auto));
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.jobs-toolbar label {
  margin: 0;
}

.jobs-toolbar label > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.jobs-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.78rem;
}

.jobs-page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.flow-results-summary {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.78rem;
}

/* ── Visual Workflow Nodes Pipeline (Apple / FlowNode Graphite Style) ───── */
.workflow-nodes-panel {
  margin-bottom: 24px;
  background: linear-gradient(180deg, rgba(20, 20, 26, 0.75) 0%, rgba(13, 13, 17, 0.9) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.workflow-nodes-panel .panel-head {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.workflow-nodes-panel .panel-head-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.workflow-nodes-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(94, 106, 210, 0.4), rgba(10, 132, 255, 0.4), transparent);
  pointer-events: none;
}

.workflow-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-2);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}

.workflow-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-dark);
  transition: all 0.25s ease;
}

.workflow-status-badge.is-running {
  background: rgba(255, 159, 10, 0.12);
  border-color: rgba(255, 159, 10, 0.35);
  color: #FFBA4D;
}
.workflow-status-badge.is-running .workflow-badge-dot {
  background: #FF9F0A;
  box-shadow: 0 0 8px #FF9F0A;
  animation: apl-blink 1s infinite;
}

.workflow-status-badge.is-success {
  background: rgba(52, 199, 89, 0.12);
  border-color: rgba(52, 199, 89, 0.35);
  color: #8ADFB6;
}
.workflow-status-badge.is-success .workflow-badge-dot {
  background: #34C759;
  box-shadow: 0 0 8px #34C759;
}

.workflow-canvas {
  display: flex;
  align-items: center;
  padding: 16px 20px 22px;
  overflow-x: auto;
  gap: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
  -webkit-overflow-scrolling: touch;
}

.workflow-canvas::-webkit-scrollbar {
  height: 6px;
}
.workflow-canvas::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

/* ── Node Card ── */
.apl-node {
  position: relative;
  flex: 0 0 200px;
  background: rgba(18, 18, 24, 0.82);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border-radius: 16px;
  border: 0.5px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: all 0.25s cubic-bezier(0.32, 0.72, 0, 1);
  cursor: pointer;
  user-select: none;
}

.apl-node:hover {
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.apl-node:active {
  transform: translateY(0);
}

.apl-node.is-active,
.apl-node.is-selected {
  border-color: var(--accent, #5E6AD2);
  box-shadow: 0 0 0 2px var(--accent-soft, rgba(94, 106, 210, 0.25)), 0 8px 24px rgba(0, 0, 0, 0.45);
}

/* Node Run States */
.apl-node.state-running {
  border-color: rgba(255, 159, 10, 0.65);
  animation: apl-pulse 1.4s ease-in-out infinite;
}

.apl-node.state-success {
  border-color: rgba(52, 199, 89, 0.6);
  box-shadow: 0 0 0 1px rgba(52, 199, 89, 0.25), 0 6px 20px rgba(52, 199, 89, 0.12);
}

.apl-node.state-error {
  border-color: rgba(255, 59, 48, 0.65);
  box-shadow: 0 0 0 1px rgba(255, 59, 48, 0.25), 0 6px 20px rgba(255, 59, 48, 0.16);
}

@keyframes apl-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 159, 10, 0.25), 0 8px 24px rgba(0, 0, 0, 0.4);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(255, 159, 10, 0.05), 0 8px 24px rgba(255, 159, 10, 0.2);
  }
}

/* ── Node Body, Icon, Text ── */
.apl-body {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
}

.apl-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft, rgba(255, 255, 255, 0.06));
  color: var(--accent, #9AA2F2);
  font-size: 17px;
  box-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.1), 0 2px 5px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}

.apl-node:hover .apl-icon {
  transform: scale(1.08);
}

.apl-text {
  min-width: 0;
  flex: 1;
}

.apl-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.015em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.apl-subtitle {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.005em;
  transition: color 0.2s ease;
}

.apl-node.state-running .apl-subtitle {
  color: #FFBA4D;
  font-weight: 600;
}

.apl-node.state-success .apl-subtitle {
  color: #8ADFB6;
}

/* ── Status Capsule ── */
.apl-status {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 9px;
  background: #23232A;
  border: 2px solid #0D0D11;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 9px;
  font-weight: 800;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  transition: all 0.25s cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 5;
}

.apl-status .status-sym {
  line-height: 1;
  font-size: 9px;
}

.apl-status[data-state="idle"] {
  background: #2A2A32;
  color: #71717A;
}

.apl-status[data-state="running"] {
  background: #FF9F0A;
  color: #FFFFFF;
  animation: apl-blink 1s infinite;
  box-shadow: 0 0 8px rgba(255, 159, 10, 0.6);
}

.apl-status[data-state="success"] {
  background: #34C759;
  color: #FFFFFF;
  box-shadow: 0 0 8px rgba(52, 199, 89, 0.5);
}

.apl-status[data-state="error"] {
  background: #FF453A;
  color: #FFFFFF;
  box-shadow: 0 0 8px rgba(255, 69, 58, 0.6);
}

@keyframes apl-blink {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

/* ── Handles (Ports) ── */
.apl-handle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 5px;
  background: #18181E;
  border: 2px solid var(--accent, #5E6AD2);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease;
  z-index: 3;
}

.apl-handle.handle-target {
  left: -5px;
  border-color: #636366;
}

.apl-handle.handle-source {
  right: -5px;
  border-color: var(--accent, #5E6AD2);
}

.apl-node:hover .apl-handle {
  transform: translateY(-50%) scale(1.25);
  border-color: #FFFFFF;
}

/* ── Animated Connector Wire ── */
.node-wire {
  flex: 0 0 28px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  border-radius: 1px;
}

.node-wire .wire-pulse {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 14px;
  background: linear-gradient(90deg, transparent, rgba(154, 162, 242, 0.8), transparent);
  animation: wire-pulse 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.node-wire.wire-active {
  background: rgba(255, 159, 10, 0.3);
}

.node-wire.wire-active .wire-pulse {
  background: linear-gradient(90deg, transparent, #FF9F0A, #FFBA4D, transparent);
  animation-duration: 1.2s;
}

.node-wire.wire-success {
  background: rgba(52, 199, 89, 0.3);
}

.node-wire.wire-success .wire-pulse {
  background: linear-gradient(90deg, transparent, #34C759, #8ADFB6, transparent);
  animation-duration: 3s;
}

@keyframes wire-pulse {
  0% {
    left: -20px;
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    left: 100%;
    opacity: 0;
  }
}

@media (max-width: 820px) {
  .jobs-toolbar {
    grid-template-columns: 1fr 1fr;
  }
  .jobs-search {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .jobs-toolbar {
    grid-template-columns: 1fr;
  }
  .jobs-search {
    grid-column: auto;
  }
  .jobs-pagination {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ── Sidebar Mode Switcher ────────────────────────────────────────────────── */
.sidebar-mode-switcher {
  display: flex;
  gap: 6px;
  padding: 6px;
  margin: 0 10px 10px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.sidebar-mode-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  white-space: nowrap;
}

.sidebar-mode-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-mode-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 10px rgba(94, 106, 210, 0.35);
}

.mode-icon {
  font-size: 1rem;
}

.mode-pill-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, #FF3366, #FF9900);
  color: #fff;
  line-height: 1.2;
}

.sidebar-collapsed .sidebar-mode-switcher {
  flex-direction: column;
  padding: 4px;
  margin: 0 6px 10px 6px;
}

.sidebar-collapsed .sidebar-mode-btn .sidebar-label,
.sidebar-collapsed .sidebar-mode-btn .mode-pill-badge {
  display: none;
}

/* ── View Containers ──────────────────────────────────────────────────────── */
.view-container {
  animation: viewFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ── Pipeline Studio Header & Stats ───────────────────────────────────────── */
.studio-header-panel {
  margin-bottom: 16px;
  background: linear-gradient(180deg, rgba(30, 24, 45, 0.45) 0%, rgba(18, 20, 26, 0.75) 100%);
  border-color: rgba(168, 85, 247, 0.25);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(168, 85, 247, 0.12);
}

.studio-header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.studio-title-block {
  max-width: 680px;
}

.studio-badge-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.studio-title-icon {
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.studio-badge-title h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  color: #fff;
}

.badge-studio-pro {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.45);
  color: #D8B4FE;
}

.studio-title-block p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}

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

.studio-stat-item {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.studio-stat-item .stat-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.studio-stat-item .stat-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-mono);
}

.stat-badge-online {
  color: #34C759 !important;
}

/* ── Studio Presets Quick Bar ─────────────────────────────────────────────── */
.studio-presets-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
}

.presets-row-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

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

.btn-preset {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.btn-preset:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(168, 85, 247, 0.4);
  transform: translateY(-1px);
}

.btn-preset.active {
  background: rgba(168, 85, 247, 0.18);
  border-color: rgba(168, 85, 247, 0.55);
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.2), 0 0 0 1px rgba(168, 85, 247, 0.3);
}

.preset-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.preset-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.preset-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}

.preset-meta small {
  font-size: 0.72rem;
  color: var(--muted);
}

/* ── Studio Node Palette Toolbar ─────────────────────────────────────────── */
.studio-palette-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  flex-wrap: wrap;
}

.palette-left,
.palette-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.palette-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-right: 4px;
}

.btn-add-node {
  background: rgba(94, 106, 210, 0.1);
  border-color: rgba(94, 106, 210, 0.25);
  color: #C5CAFD;
  transition: all 0.2s ease;
}

.btn-add-node:hover {
  background: rgba(94, 106, 210, 0.22);
  border-color: rgba(94, 106, 210, 0.45);
  color: #fff;
}

/* ── Studio Interactive Canvas Panel ─────────────────────────────────────── */
.studio-canvas-panel {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.studio-canvas-scroll {
  padding: 30px 24px;
  overflow-x: auto;
  overflow-y: hidden;
  min-height: 480px;
  background:
    radial-gradient(circle at 50% 50%, rgba(94, 106, 210, 0.03) 0%, transparent 80%),
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 100% 100%, 24px 24px;
  background-position: center, 0 0;
  display: flex;
  align-items: center;
}

.studio-nodes-container {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: max-content;
}

/* ── Apple HIG Studio Node Card ──────────────────────────────────────────── */
.studio-node-card {
  width: 280px;
  min-width: 280px;
  background: rgba(18, 20, 26, 0.85);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.04);
  position: relative;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.studio-node-card:hover {
  border-color: rgba(94, 106, 210, 0.5);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(94, 106, 210, 0.3);
  transform: translateY(-2px);
}

.studio-node-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.studio-node-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.studio-node-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: var(--node-accent-soft, rgba(94, 106, 210, 0.15));
  border: 1px solid var(--node-accent-border, rgba(94, 106, 210, 0.3));
  color: var(--node-accent-color, #9AA2F2);
  flex-shrink: 0;
}

.studio-node-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.studio-node-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.studio-node-kind {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.studio-node-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-node-tool {
  background: transparent;
  border: none;
  color: var(--muted);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all 0.15s ease;
}

.btn-node-tool:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.btn-node-delete:hover {
  background: rgba(255, 59, 48, 0.15);
  color: #FF3B30;
}

/* Node Preview & Meta Pill */
.studio-node-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.studio-meta-badge {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--primary-glow);
  background: rgba(94, 106, 210, 0.12);
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(94, 106, 210, 0.25);
}

.studio-meta-status {
  font-size: 0.72rem;
  color: #34C759;
  display: flex;
  align-items: center;
  gap: 4px;
}

.studio-meta-status::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34C759;
  box-shadow: 0 0 6px #34C759;
}

/* Node Body & Fields */
.studio-node-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.studio-field-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.studio-textarea {
  width: 100%;
  height: 72px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #fff;
  font-size: 0.8rem;
  line-height: 1.4;
  padding: 6px 8px;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

.studio-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.studio-params-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
}

.studio-select,
.studio-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #fff;
  font-size: 0.78rem;
  padding: 5px 6px;
  font-family: inherit;
}

.studio-select:focus,
.studio-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Port Handles on Card */
.studio-port {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #12141A;
  border: 2px solid var(--muted);
  transform: translateY(-50%);
  z-index: 2;
  transition: all 0.2s ease;
}

.studio-port-in {
  left: -7px;
  border-color: #5E6AD2;
}

.studio-port-out {
  right: -7px;
  border-color: #34C759;
}

.studio-node-card:hover .studio-port-in {
  box-shadow: 0 0 10px #5E6AD2;
}

.studio-node-card:hover .studio-port-out {
  box-shadow: 0 0 10px #34C759;
}

/* Node Wire Connector */
.studio-wire-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 36px;
  height: 2px;
  background: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.studio-wire-pulse {
  position: absolute;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5E6AD2;
  box-shadow: 0 0 8px #5E6AD2;
  animation: studioWirePulse 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes studioWirePulse {
  0% {
    left: 0%;
    opacity: 0.2;
  }
  50% {
    opacity: 1;
  }
  100% {
    left: 100%;
    opacity: 0.2;
  }
}

/* ── Studio Execution Footer Bar ─────────────────────────────────────────── */
.studio-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: rgba(18, 20, 26, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.studio-footer-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 650px;
}

.studio-footer-info .footer-icon {
  font-size: 1.1rem;
  color: #FFB340;
}

.btn-run-pipeline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(94, 106, 210, 0.4);
}

/* ── Sidebar Nav Target Highlight Flash ──────────────────── */
@keyframes sidebarFlash {
  0%   { box-shadow: 0 0 0 0 rgba(94, 106, 210, 0.5); }
  30%  { box-shadow: 0 0 0 4px rgba(94, 106, 210, 0.35); }
  100% { box-shadow: 0 0 0 0 rgba(94, 106, 210, 0); }
}
.sidebar-highlight-flash {
  animation: sidebarFlash 1.2s ease-out;
}

/* ── Inline Config Summary Badge (in Job Form) ──────────── */
.config-summary-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(94, 106, 210, 0.08);
  border: 1px solid rgba(94, 106, 210, 0.15);
  margin-top: 4px;
}
.config-inline-icon {
  font-size: 1rem;
  flex-shrink: 0;
}
.config-inline-badge {
  flex: 1;
  font-size: 0.82rem;
  color: var(--text-secondary, #8b8fa3);
  font-weight: 500;
}
.config-summary-inline .btn {
  flex-shrink: 0;
  font-size: 0.78rem;
}

/* ── Compact Studio Top Bar ─────────────────────────────── */
.studio-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: rgba(30, 30, 40, 0.7);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-wrap: wrap;
}
.studio-topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.studio-topbar-icon { font-size: 1.1rem; }
.studio-topbar-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.studio-topbar-stats {
  display: flex;
  gap: 6px;
  margin-left: auto;
}
.studio-chip {
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(255,255,255,0.07);
  color: #a0a4b8;
  font-weight: 600;
  white-space: nowrap;
}
.studio-chip-online {
  background: rgba(52, 199, 89, 0.15);
  color: #34c759;
}
.studio-topbar-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ── Studio Toolbar (presets + node palette) ─────────────── */
.studio-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: rgba(30, 30, 40, 0.45);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  flex-wrap: wrap;
  overflow-x: auto;
}
.studio-toolbar-presets,
.studio-toolbar-nodes {
  display: flex;
  align-items: center;
  gap: 5px;
}
.toolbar-section-label {
  font-size: 0.7rem;
  color: #666;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 2px;
  white-space: nowrap;
}
.studio-toolbar-divider {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.1);
  margin: 0 4px;
}
.studio-preset-chip,
.studio-node-chip {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: #b0b4c8;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  font-weight: 500;
}
.studio-preset-chip:hover,
.studio-node-chip:hover {
  background: rgba(94, 106, 210, 0.15);
  border-color: rgba(94, 106, 210, 0.3);
  color: #d0d4f0;
}
.studio-preset-chip.active {
  background: rgba(94, 106, 210, 0.2);
  border-color: rgba(94, 106, 210, 0.5);
  color: #fff;
}

/* ── Profile Management Modal ────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 16, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog {
  background: #141724;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
  width: 100%;
  max-width: 880px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-title-icon {
  font-size: 1.4rem;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(94, 106, 210, 0.15);
  border: 1px solid rgba(94, 106, 210, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
}

.modal-subtitle {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.btn-close-modal:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.profile-modal-top-bar {
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.015);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.profile-current-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}

.badge-profile-current {
  background: rgba(52, 199, 89, 0.15);
  color: #8ADFB6;
  border: 1px solid rgba(52, 199, 89, 0.35);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

.profile-search-filter-bar {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(0, 0, 0, 0.15);
}

.profile-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.profile-search-box .search-icon {
  position: absolute;
  left: 14px;
  font-size: 0.9rem;
  color: var(--muted);
  pointer-events: none;
}

.profile-search-input {
  width: 100%;
  padding: 10px 38px 10px 38px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  font-size: 0.85rem !important;
  color: #fff !important;
  transition: all 0.15s ease !important;
}

.profile-search-input:focus {
  border-color: var(--primary) !important;
  background: rgba(255, 255, 255, 0.07) !important;
  box-shadow: 0 0 0 3px rgba(94, 106, 210, 0.25) !important;
}

.btn-clear-search {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 6px;
  font-size: 0.85rem;
}

.btn-clear-search:hover {
  color: #fff;
}

.profile-filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-filter-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.74rem;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 500;
}

.profile-filter-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.profile-filter-chip.active {
  background: rgba(94, 106, 210, 0.25);
  border-color: rgba(94, 106, 210, 0.6);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 10px rgba(94, 106, 210, 0.2);
}

.profile-modal-body {
  padding: 16px 20px;
  flex: 1;
  overflow-y: auto;
  min-height: 320px;
  max-height: 52vh;
}

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

.profile-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.18s ease;
}

.profile-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(94, 106, 210, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.profile-card.active {
  background: rgba(52, 199, 89, 0.06);
  border-color: rgba(52, 199, 89, 0.45);
  box-shadow: 0 0 14px rgba(52, 199, 89, 0.15);
}

.profile-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-card-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(94, 106, 210, 0.15);
  border: 1px solid rgba(94, 106, 210, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  color: #9AA2F2;
}

.profile-card-main {
  flex: 1;
  min-width: 0;
}

.profile-card-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-card-email {
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.profile-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.profile-card-folder {
  font-family: var(--mono, monospace);
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  color: #a0a4b8;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-card-synced {
  font-size: 0.68rem;
  background: rgba(94, 106, 210, 0.12);
  color: #9AA2F2;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(94, 106, 210, 0.2);
}

.profile-card-active-tag {
  font-size: 0.68rem;
  background: rgba(52, 199, 89, 0.15);
  color: #8ADFB6;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  border: 1px solid rgba(52, 199, 89, 0.3);
}

.profile-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.profile-card-actions .btn {
  flex: 1;
  font-size: 0.74rem;
  height: 28px;
  padding: 0 8px;
  border-radius: 7px;
}

.profile-loading-state,
.profile-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--muted);
  gap: 12px;
  grid-column: 1 / -1;
}

.profile-empty-state .empty-icon {
  font-size: 2rem;
  opacity: 0.6;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(94, 106, 210, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.profile-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.78rem;
  color: var(--muted);
}

.profile-source-hint {
  font-size: 0.72rem;
  color: var(--muted-dark);
  margin-left: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Newcomer / Beginner UI/UX Enhancements (UX-001 -> UX-008)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. Onboarding Quick Start Banner (UX-001) ── */
.onboarding-banner {
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(94, 106, 210, 0.12) 0%, rgba(20, 20, 26, 0.85) 100%);
  border: 1px solid rgba(94, 106, 210, 0.32);
  border-radius: 14px;
  padding: 16px 20px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
  transition: all 0.25s ease;
}

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

.onboarding-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.onboarding-icon {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(94, 106, 210, 0.2);
  border-radius: 10px;
  border: 1px solid rgba(94, 106, 210, 0.4);
}

.onboarding-title-wrap h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
}

.onboarding-title-wrap p {
  margin: 2px 0 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.btn-dismiss-onboarding {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.15s;
}

.btn-dismiss-onboarding:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.onboarding-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.onboarding-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 12px 14px;
  transition: all 0.2s ease;
}

.onboarding-step:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(94, 106, 210, 0.3);
}

.ostep-number {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

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

.ostep-content strong {
  display: block;
  font-size: 0.86rem;
  color: #fff;
  margin-bottom: 2px;
}

.ostep-content p {
  margin: 0 0 8px 0;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.35;
}

.ostep-action {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 6px;
}

.ostep-badge {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--green);
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
}

/* ── 2. Prompt Meta, Counter, Shortcuts & Chips (UX-004) ── */
.label-with-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.prompt-char-count {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.prompt-char-count.char-warning {
  color: var(--yellow);
  font-weight: 600;
}

.prompt-shortcuts-hint {
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.prompt-shortcuts-hint kbd {
  font-family: var(--mono);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.7rem;
  color: var(--text);
}

.prompt-suggestions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.prompt-suggestions-label {
  font-size: 0.72rem;
  color: var(--muted-dark);
  font-weight: 500;
  margin-right: 2px;
}

.btn-prompt-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.74rem;
  color: var(--text);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.32, 0.72, 0, 1);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-prompt-chip:hover {
  background: rgba(94, 106, 210, 0.18);
  border-color: rgba(94, 106, 210, 0.45);
  color: #fff;
  transform: translateY(-1px);
}

.btn-prompt-chip:active {
  transform: translateY(0);
}

.field-flash {
  animation: flash-pulse 0.8s ease;
}

@keyframes flash-pulse {
  0% { box-shadow: 0 0 0 2px var(--primary); }
  100% { box-shadow: none; }
}

/* ── 3. Asset Dropzone (UX-003) ── */
.asset-dropzone {
  margin-top: 8px;
  margin-bottom: 8px;
  border: 1.5px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.asset-dropzone:hover,
.asset-dropzone.drag-over {
  border-color: var(--primary);
  background: rgba(94, 106, 210, 0.08);
  color: #fff;
}

.dropzone-icon {
  font-size: 1.1rem;
}

.dropzone-text {
  font-size: 0.76rem;
  color: var(--muted);
}

/* ── 4. Config & Studio Navigation Actions (UX-005, UX-008) ── */
.config-footer-actions {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
}

.studio-help-banner {
  background: rgba(94, 106, 210, 0.08);
  border: 1px solid rgba(94, 106, 210, 0.25);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text);
}

.studio-help-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.studio-file-picker-row {
  display: flex;
  gap: 6px;
}

.studio-file-picker-row .studio-input {
  flex: 1;
}

.btn-studio-pick-file {
  white-space: nowrap;
  padding: 0 10px;
}
