/* ==========================================================================
   SHIGUANG OPTIC MEDIA LAB — Apple Liquid Glass & Spatial Light Theme
   Default: Daylight Optical Quartz (No Default Black Theme)
   ========================================================================== */

:root,
:root[data-theme="light"] {
  color-scheme: light;
  --canvas: #edf2f9;
  --canvas-sub: #e4ecf7;
  --text: #0f172a;
  --secondary: #334155;
  --muted: #64748b;
  --subtle: #94a3b8;

  /* Apple Liquid Glass Tokens (Light) */
  --glass-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0.52) 50%, rgba(242, 248, 255, 0.68) 100%);
  --glass-bg-strong: linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(246, 250, 255, 0.75));
  --glass-inset: rgba(255, 255, 255, 0.56);
  --glass-recessed: rgba(226, 236, 248, 0.55);
  --glass-border: rgba(255, 255, 255, 0.85);
  --glass-border-outer: rgba(15, 23, 42, 0.07);
  --glass-specular-top: rgba(255, 255, 255, 0.96);
  --glass-specular-bottom: rgba(255, 255, 255, 0.45);
  --glass-shadow:
    0 20px 50px -14px rgba(15, 23, 42, 0.07),
    0 6px 18px -4px rgba(37, 99, 235, 0.04),
    0 0 0 1px rgba(15, 23, 42, 0.05),
    inset 0 1.5px 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 1px 0 rgba(255, 255, 255, 0.5);
  --glass-shadow-hover:
    0 26px 60px -12px rgba(37, 99, 235, 0.12),
    0 8px 24px -4px rgba(15, 23, 42, 0.06),
    0 0 0 1px rgba(37, 99, 235, 0.22),
    inset 0 1.5px 1.5px 0 #ffffff,
    inset 0 -1px 1px 0 rgba(255, 255, 255, 0.65);
  --glass-spotlight: radial-gradient(460px circle at var(--glass-x, 50%) var(--glass-y, 0%), rgba(56, 189, 248, 0.16), rgba(99, 102, 241, 0.06) 45%, transparent 72%);
  --glass-rim-highlight: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.98), rgba(56, 189, 248, 0.45), rgba(255, 255, 255, 0.98), transparent);

  /* Brand & Tech Accents */
  --accent-blue: #2563eb;
  --accent-cyan: #0891b2;
  --accent-teal: #0d9488;
  --accent-indigo: #4f46e5;
  --accent-emerald: #059669;
  --accent-amber: #d97706;
  --accent-danger: #e11d48;

  /* Controls & Inputs */
  --input-bg: rgba(255, 255, 255, 0.72);
  --input-bg-focus: rgba(255, 255, 255, 0.95);
  --input-border: rgba(148, 163, 184, 0.32);
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.13);

  /* Ambient Orbs */
  --orb-1: rgba(56, 189, 248, 0.34);
  --orb-2: rgba(99, 102, 241, 0.24);
  --orb-3: rgba(45, 212, 191, 0.26);
  --grid-line: rgba(37, 99, 235, 0.045);

  --radius-xl: 26px;
  --radius-lg: 22px;
  --radius: 18px;
  --radius-sm: 12px;
  --spring: cubic-bezier(0.22, 1, 0.36, 1);

  font-family: "SF Pro Display", "SF Pro Text", Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* Optional Deep Space Dark Mode (Toggled via Header Button) */
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #070d17;
  --canvas-sub: #0b1424;
  --text: #f1f5f9;
  --secondary: #cbd5e1;
  --muted: #94a3b8;
  --subtle: #64748b;

  --glass-bg: linear-gradient(135deg, rgba(22, 35, 56, 0.74) 0%, rgba(15, 25, 42, 0.62) 55%, rgba(20, 38, 60, 0.70) 100%);
  --glass-bg-strong: linear-gradient(145deg, rgba(24, 39, 62, 0.90), rgba(14, 24, 40, 0.86));
  --glass-inset: rgba(15, 23, 42, 0.55);
  --glass-recessed: rgba(6, 12, 24, 0.62);
  --glass-border: rgba(186, 230, 253, 0.16);
  --glass-border-outer: rgba(255, 255, 255, 0.05);
  --glass-specular-top: rgba(224, 242, 254, 0.24);
  --glass-specular-bottom: rgba(0, 0, 0, 0.45);
  --glass-shadow:
    0 24px 56px -14px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(186, 230, 253, 0.12),
    inset 0 1px 0 0 rgba(224, 242, 254, 0.22),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.45);
  --glass-shadow-hover:
    0 28px 64px -12px rgba(6, 182, 212, 0.18),
    0 0 0 1px rgba(56, 189, 248, 0.35),
    inset 0 1px 0 0 rgba(224, 242, 254, 0.35);
  --glass-spotlight: radial-gradient(440px circle at var(--glass-x, 50%) var(--glass-y, 0%), rgba(56, 189, 248, 0.15), rgba(99, 102, 241, 0.07) 45%, transparent 72%);
  --glass-rim-highlight: linear-gradient(90deg, transparent, rgba(165, 243, 252, 0.45), rgba(129, 140, 248, 0.35), transparent);

  --accent-blue: #38bdf8;
  --accent-cyan: #22d3ee;
  --accent-teal: #2dd4bf;
  --accent-indigo: #818cf8;
  --accent-emerald: #34d399;
  --accent-amber: #fbbf24;
  --accent-danger: #fb7185;

  --input-bg: rgba(9, 17, 30, 0.65);
  --input-bg-focus: rgba(13, 24, 42, 0.90);
  --input-border: rgba(148, 163, 184, 0.22);
  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.24);

  --orb-1: rgba(14, 165, 233, 0.18);
  --orb-2: rgba(99, 102, 241, 0.15);
  --orb-3: rgba(20, 184, 166, 0.14);
  --grid-line: rgba(148, 163, 184, 0.04);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-size: 14px;
  background-color: var(--canvas);
  color: var(--text);
  overflow-x: hidden;
  transition: background-color 0.4s var(--spring), color 0.3s ease;
}

/* ==========================================================================
   Ambient Liquid Mesh & Precision Grid
   ========================================================================== */

.ambient-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
  background: radial-gradient(circle at 50% 0%, var(--canvas-sub), var(--canvas) 75%);
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(85px);
  will-change: transform;
  animation: orb-float 22s ease-in-out infinite alternate;
}

.orb-primary {
  width: 58vw;
  height: 58vw;
  max-width: 780px;
  max-height: 780px;
  top: -18%;
  right: -8%;
  background: radial-gradient(circle, var(--orb-1) 0%, transparent 70%);
}

.orb-cyan {
  width: 50vw;
  height: 50vw;
  max-width: 680px;
  max-height: 680px;
  bottom: -15%;
  left: -10%;
  background: radial-gradient(circle, var(--orb-3) 0%, transparent 70%);
  animation-duration: 28s;
  animation-delay: -6s;
}

.orb-violet {
  width: 42vw;
  height: 42vw;
  max-width: 560px;
  max-height: 560px;
  top: 32%;
  left: 28%;
  background: radial-gradient(circle, var(--orb-2) 0%, transparent 72%);
  animation-duration: 25s;
  animation-delay: -12s;
}

.ambient-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 25%, #000 35%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 25%, #000 35%, transparent 85%);
}

@keyframes orb-float {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-3%, 4%, 0) scale(1.06); }
  100% { transform: translate3d(4%, -3%, 0) scale(0.96); }
}

/* ==========================================================================
   Base Elements & Controls
   ========================================================================== */

button, input, textarea, select {
  font: inherit;
}

button, a, input, textarea, select, summary {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
  color: inherit;
  border: 0;
  background: none;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, p {
  margin: 0;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 3px;
}

input, textarea, select {
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03), 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: border-color 0.22s var(--spring), background-color 0.22s var(--spring), box-shadow 0.22s var(--spring);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] select {
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  background: var(--input-bg-focus);
  border-color: var(--accent-blue) !important;
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.14), inset 0 1px 1px rgba(255, 255, 255, 0.8);
}

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

option {
  color: var(--text);
  background: var(--canvas);
}

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

[hidden] {
  display: none !important;
}

.icon-definitions {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.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;
}

/* ==========================================================================
   Apple Liquid Glass Material System
   ========================================================================== */

.glass-surface,
.card {
  position: relative;
  isolation: isolate;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(32px) saturate(190%);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  transition: transform 0.32s var(--spring), box-shadow 0.32s var(--spring), border-color 0.32s var(--spring);
}

/* Interactive cursor refraction spotlight */
.glass-surface::before,
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--glass-spotlight);
  pointer-events: none;
  z-index: -1;
  opacity: 0.95;
  transition: opacity 0.3s ease;
}

/* Specular prism rim along the top edge */
.glass-surface::after,
.card::after {
  content: "";
  position: absolute;
  top: -1px;
  left: 10%;
  right: 10%;
  height: 1.5px;
  background: var(--glass-rim-highlight);
  pointer-events: none;
  border-radius: 2px;
}

/* ==========================================================================
   App Shell & Spatial Floating Dock (Sidebar)
   ========================================================================== */

.app-shell {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 16px;
  height: calc(100vh - 32px);
  margin: 16px 0 16px 16px;
  padding: 24px 10px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-strong);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(36px) saturate(200%);
  -webkit-backdrop-filter: blur(36px) saturate(200%);
  box-shadow: var(--glass-shadow);
  z-index: 30;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
  margin-bottom: 30px;
  text-align: center;
}

.brand strong {
  display: block;
  font-size: 16px;
  letter-spacing: 1.5px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text), var(--accent-blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand small {
  display: block;
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 1.8px;
  color: var(--accent-cyan);
  margin-top: 3px;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 13px);
  grid-template-rows: repeat(2, 13px);
  gap: 3.5px;
  transform: rotate(-8deg);
  filter: drop-shadow(0 6px 14px rgba(37, 99, 235, 0.22));
  transition: transform 0.35s var(--spring);
}

.brand:hover .brand-mark {
  transform: rotate(0deg) scale(1.06);
}

.brand-mark i {
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  border-radius: 4.5px;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

.brand-mark i:nth-child(2) {
  background: linear-gradient(135deg, #2dd4bf, #0891b2);
}

.brand-mark i:nth-child(3) {
  background: linear-gradient(135deg, #818cf8, #4f46e5);
}

.brand-mark i:nth-child(4) {
  background: linear-gradient(135deg, #60a5fa, #0284c7);
}

.nav {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.nav-glider {
  display: none;
}

.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 12px 4px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  transition: all 0.25s var(--spring);
}

.nav-icon-wrap {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  transition: transform 0.25s var(--spring), background 0.25s var(--spring);
}

.nav-item svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.75;
}

.nav-item:hover {
  color: var(--text);
  background: var(--glass-inset);
}

.nav-item:hover .nav-icon-wrap {
  transform: translateY(-1px) scale(1.04);
}

.nav-item.active {
  color: var(--accent-blue);
  font-weight: 600;
  border-color: var(--glass-border);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(235, 245, 255, 0.72));
  box-shadow:
    0 8px 20px -6px rgba(37, 99, 235, 0.18),
    0 0 0 1px rgba(37, 99, 235, 0.12),
    inset 0 1px 1px #ffffff;
}

:root[data-theme="dark"] .nav-item.active {
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.18), rgba(37, 99, 235, 0.08));
  border-color: rgba(56, 189, 248, 0.3);
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.nav-item.active .nav-icon-wrap {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(8, 145, 178, 0.08));
}

.nav-count {
  position: absolute;
  top: 7px;
  right: 8px;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 99px;
  color: var(--accent-blue);
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  font-size: 9px;
  font-weight: 600;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 24px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.connection-card {
  display: flex;
  justify-content: center;
  gap: 6px;
  align-items: center;
  width: 100%;
  padding: 9px 6px;
  border-radius: 12px;
  background: var(--glass-inset);
  border: 1px solid var(--line);
  transition: transform 0.2s var(--spring), border-color 0.2s;
}

.connection-card:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.25);
}

.connection-copy strong {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--secondary);
}

.connection-copy small {
  display: none;
}

.status-dot,
.tiny-dot,
.telemetry-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
  flex: none;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.16);
}

.status-dot.offline,
.telemetry-dot.offline {
  background: var(--accent-amber);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.16);
}

.profile {
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--line);
  width: 100%;
  padding-top: 14px;
}

.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.6);
}

.profile-copy {
  display: none;
}

/* ==========================================================================
   Main Container & Topbar with Live Telemetry
   ========================================================================== */

.main {
  width: 100%;
  max-width: 1640px;
  min-width: 0;
  padding: 0 38px 40px;
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 16px;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  margin-top: 16px;
  padding: 10px 20px;
  border-radius: 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  gap: 16px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.desktop-crumb {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.6px;
  color: var(--text);
  white-space: nowrap;
}

.desktop-crumb b {
  font-weight: 500;
  color: var(--accent-cyan);
  margin-left: 6px;
}

.crumb-slash {
  color: var(--subtle);
}

.breadcrumb strong {
  color: var(--secondary);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.mobile-brand {
  display: none;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11.5px;
}

.telemetry-pills {
  display: flex;
  align-items: center;
  gap: 8px;
}

.telemetry-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 99px;
  background: var(--glass-inset);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 500;
  color: var(--secondary);
  white-space: nowrap;
  transition: all 0.2s var(--spring);
}

.telemetry-pill:hover {
  border-color: rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
}

.telemetry-pill svg {
  width: 13px;
  height: 13px;
  color: var(--accent-blue);
}

.date-label {
  padding: 0 4px;
  white-space: nowrap;
}

.private-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid rgba(13, 148, 136, 0.22);
  border-radius: 99px;
  background: rgba(13, 148, 136, 0.07);
  color: var(--accent-teal);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.private-badge svg {
  width: 13px;
  height: 13px;
}

.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--glass-inset);
  border: 1px solid var(--line-strong);
  color: var(--secondary);
  transition: transform 0.25s var(--spring), background 0.25s, color 0.25s;
}

.theme-toggle:hover {
  transform: rotate(12deg) scale(1.06);
  color: var(--accent-blue);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

:root[data-theme="light"] .moon-icon { display: none; }
:root[data-theme="dark"] .sun-icon { display: none; }

/* ==========================================================================
   Workspace Welcome & Overview Metrics
   ========================================================================== */

.view {
  animation: view-enter 0.32s var(--spring);
}

.welcome-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 30px 0 24px;
  gap: 28px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.8px;
  color: var(--accent-blue);
  margin-bottom: 10px;
  text-transform: uppercase;
}

.eyebrow-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.7px;
  line-height: 1.35;
  color: var(--text);
}

.title-dot {
  color: var(--accent-cyan);
  margin-left: 3px;
}

.hero-description {
  color: var(--secondary);
  font-size: 13.5px;
  line-height: 1.75;
  margin-top: 8px;
  max-width: 680px;
}

.overview-metrics {
  display: flex;
  flex: none;
  align-items: center;
  border-radius: 20px;
  padding: 14px 8px;
}

.overview-metrics > .metric-item {
  min-width: 106px;
  text-align: center;
  padding: 2px 22px;
  border-right: 1px solid var(--line);
}

.overview-metrics > .metric-item:last-child {
  border-right: 0;
}

.overview-metrics span {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  display: block;
}

.overview-metrics strong {
  font-size: 27px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  display: block;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.overview-metrics strong.metric-highlight {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.overview-metrics small {
  display: block;
  margin-top: 4px;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: var(--subtle);
}

/* ==========================================================================
   Optical Pipeline Topology Console
   ========================================================================== */

.pipeline-console {
  padding: 18px 24px 22px;
  margin-bottom: 24px;
  overflow: hidden;
}

.pipeline-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 15px;
}

.caption-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--accent-cyan);
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(8, 145, 178, 0.08);
  border: 1px solid rgba(8, 145, 178, 0.16);
}

.caption-badge i {
  width: 5px;
  height: 5px;
  display: inline-block;
  background: var(--accent-cyan);
  border-radius: 50%;
}

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

.caption-sub b {
  color: var(--subtle);
  margin: 0 6px;
}

.pipeline-track {
  display: grid;
  grid-template-columns: 1fr 44px 1.12fr 44px 1fr 44px 1.15fr;
  align-items: center;
  gap: 8px;
}

.pipeline-stage {
  min-width: 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--glass-inset);
  border: 1px solid var(--line);
  transition: transform 0.25s var(--spring), border-color 0.25s, box-shadow 0.25s;
}

.pipeline-stage:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow: 0 8px 20px -8px rgba(37, 99, 235, 0.12);
}

.pipeline-index {
  display: block;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 1.2px;
  font-size: 8.5px;
  margin-bottom: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.pipeline-stage-main {
  display: flex;
  align-items: center;
  gap: 11px;
}

.pipeline-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(8, 145, 178, 0.06));
  border: 1px solid rgba(37, 99, 235, 0.18);
  color: var(--accent-blue);
  flex: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

:root[data-theme="dark"] .pipeline-icon {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.pipeline-icon svg {
  width: 18px;
  height: 18px;
}

.pipeline-stage strong {
  display: block;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.4;
}

.pipeline-stage small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
  line-height: 1.4;
}

.compute-stage {
  border-color: rgba(8, 145, 178, 0.25);
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.07), rgba(37, 99, 235, 0.04));
}

.compute-stage .pipeline-icon {
  color: var(--accent-cyan);
  border-color: rgba(8, 145, 178, 0.28);
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.16), rgba(45, 212, 191, 0.08));
}

.output-stage .pipeline-icon {
  color: var(--accent-indigo);
  border-color: rgba(79, 70, 229, 0.25);
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.14), rgba(129, 140, 248, 0.06));
}

.pipeline-connector {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
}

.connector-beam {
  height: 2px;
  flex: 1;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.15), var(--accent-cyan));
  position: relative;
  overflow: hidden;
}

.connector-beam::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, #ffffff, transparent);
  animation: beam-flow 2.6s ease-in-out infinite;
}

@keyframes beam-flow {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.pipeline-connector svg {
  width: 15px;
  height: 15px;
  margin-left: -4px;
}

/* ==========================================================================
   Creation Grid: Import Composer & Architecture Card
   ========================================================================== */

.creation-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(300px, 1fr);
  gap: 24px;
}

.import-card {
  padding: 26px 28px;
}

.card-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.card-heading > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

h2 {
  font-size: 16.5px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.2px;
}

.section-number {
  color: var(--accent-blue);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.4px;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.08);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.subtle-label {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
}

/* Segmented Source Tabs (Apple iOS/macOS Sliding Pill Style) */
.source-tabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 5px;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--glass-recessed);
  border-radius: 14px;
  margin-bottom: 20px;
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.06);
}

.tab-glider {
  display: none;
}

.source-tab {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 10px 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.25s var(--spring);
}

.source-tab svg {
  width: 16px;
  height: 16px;
}

.source-tab.active {
  color: var(--accent-blue);
  font-weight: 600;
  border-color: var(--glass-border);
  background: var(--input-bg-focus);
  box-shadow: 0 4px 14px -2px rgba(15, 23, 42, 0.08), inset 0 1px 0 #ffffff;
}

:root[data-theme="dark"] .source-tab.active {
  box-shadow: 0 4px 14px -2px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.source-tab:hover:not(.active) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.35);
}

/* Source Inputs */
.url-field {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--input-border);
  border-radius: 14px;
  background: var(--input-bg);
  padding: 4px 6px 4px 12px;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: border-color 0.22s, box-shadow 0.22s, background-color 0.22s;
}

.url-field:focus-within {
  background: var(--input-bg-focus);
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.14);
}

.url-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(37, 99, 235, 0.09);
  color: var(--accent-blue);
  flex: none;
}

.url-icon-badge svg {
  width: 16px;
  height: 16px;
}

.url-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none !important;
  background: none !important;
  padding: 12px 10px 12px 0;
  font-size: 14px;
}

.input-help {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.75;
  margin-top: 9px;
}

.source-input > textarea {
  width: 100%;
  padding: 14px 16px;
  min-height: 144px;
  font-size: 14px;
  border-radius: 14px;
}

/* Upload Dropzone */
.upload-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 9px;
  border: 1.5px dashed rgba(37, 99, 235, 0.35);
  border-radius: 16px;
  padding: 26px 20px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.04), rgba(8, 145, 178, 0.03));
  cursor: pointer;
  transition: all 0.25s var(--spring);
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent-blue);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.09), rgba(8, 145, 178, 0.06));
  transform: translateY(-1px);
}

.upload-icon-orb {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent-blue);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.upload-zone svg {
  width: 22px;
  height: 22px;
}

.upload-zone strong {
  font-size: 13.5px;
  color: var(--text);
  font-weight: 600;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.upload-zone span {
  font-size: 11.5px;
  color: var(--muted);
}

.upload-zone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-zone:focus-within {
  outline: 2px solid var(--accent-blue);
  outline-offset: 3px;
}

/* Heterogeneous Compute Target Selector */
.processing-options {
  margin-top: 20px;
}

.processing-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--secondary);
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 10px;
}

.processing-label .text-button {
  font-size: 11.5px;
  color: var(--accent-blue);
}

.processing-nodes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.processing-node {
  position: relative;
  display: block;
  cursor: pointer;
}

.processing-node > input {
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
  opacity: 0;
  margin: 0;
  z-index: 2;
  cursor: pointer;
}

.node-card {
  height: 100%;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 16px;
  gap: 8px 11px;
  align-items: center;
  padding: 14px 15px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  background: var(--glass-inset);
  transition: all 0.25s var(--spring);
}

.processing-node:hover:not(.unavailable) .node-card {
  border-color: rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.node-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--line);
  color: var(--secondary);
  transition: all 0.25s var(--spring);
}

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

.node-copy strong {
  display: block;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
}

.node-copy small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 2px;
}

.node-radio {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--subtle);
  align-self: start;
  margin-top: 2px;
  transition: all 0.2s var(--spring);
}

.node-status {
  grid-column: 1 / 4;
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 3px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.node-status::before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--subtle);
  flex: none;
}

.node-status.online {
  color: var(--accent-emerald);
}

.node-status.online::before {
  background: var(--accent-emerald);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.16);
}

.processing-node > input:checked + .node-card {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.09), rgba(8, 145, 178, 0.05)), var(--input-bg-focus);
  border-color: var(--accent-blue);
  box-shadow:
    0 10px 24px -8px rgba(37, 99, 235, 0.18),
    0 0 0 1px rgba(37, 99, 235, 0.2),
    inset 0 1px 0 #ffffff;
}

:root[data-theme="dark"] .processing-node > input:checked + .node-card {
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.processing-node > input:checked + .node-card .node-radio {
  border: 5px solid var(--accent-blue);
  background: #ffffff;
}

.processing-node > input:checked + .node-card .node-icon {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  border-color: transparent;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.processing-node > input:focus-visible + .node-card {
  outline: 2px solid var(--accent-blue);
  outline-offset: 3px;
}

.processing-node.unavailable,
.processing-node.unavailable > input {
  cursor: not-allowed;
}

.processing-node.unavailable .node-card {
  border-style: dashed;
  opacity: 0.65;
}

.node-hint {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.75;
  font-size: 11.5px;
}

.node-hint.waiting {
  color: var(--accent-amber);
  font-weight: 500;
}

.text-processing-note {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 15px;
  margin-top: 18px;
  border: 1px solid rgba(8, 145, 178, 0.24);
  border-radius: 12px;
  background: rgba(8, 145, 178, 0.06);
  color: var(--accent-cyan);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.65;
}

.text-processing-note svg {
  width: 16px;
  height: 16px;
}

/* Form Options & Platform Toggles */
.form-options {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 15px;
  margin-top: 20px;
}

.field-label {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--secondary);
  font-size: 12.5px;
  font-weight: 600;
}

.field-label > span {
  position: absolute;
  left: 60px;
  top: 1px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.field-label input,
.field-label select {
  width: 100%;
  min-width: 0;
  height: 43px;
  padding: 9px 13px;
  font-size: 13.5px;
  font-weight: 400;
}

.destination-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
}

.destination-row > span {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--secondary);
  white-space: nowrap;
}

.platform-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.platform-toggle {
  position: relative;
  cursor: pointer;
}

.platform-toggle input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.platform-toggle > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--glass-inset);
  color: var(--secondary);
  font-size: 12.5px;
  font-weight: 500;
  transition: all 0.2s var(--spring);
}

.platform-toggle input:checked + span {
  border-color: var(--accent-blue);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(8, 145, 178, 0.06));
  color: var(--accent-blue);
  font-weight: 600;
  box-shadow: 0 4px 12px -4px rgba(37, 99, 235, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

:root[data-theme="dark"] .platform-toggle input:checked + span {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.platform-toggle input:focus-visible + span {
  outline: 2px solid var(--accent-blue);
  outline-offset: 3px;
}

.platform-toggle svg {
  width: 13px;
  height: 13px;
  opacity: 0;
  transform: scale(0.7);
  transition: all 0.2s var(--spring);
}

.platform-toggle input:checked + span svg {
  opacity: 1;
  transform: scale(1);
}

.douyin-icon {
  font-size: 15px;
  color: var(--accent-indigo);
}

.wechat-icon {
  color: var(--accent-emerald);
  font-size: 12px;
}

.advanced-options {
  margin-top: 16px;
  color: var(--secondary);
  font-size: 12px;
}

.advanced-options summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s;
}

.advanced-options summary:hover {
  color: var(--accent-blue);
}

.advanced-options summary::after {
  content: "+";
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-blue);
}

.advanced-options[open] summary::after {
  content: "−";
}

.advanced-body {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 13px;
  background: var(--glass-inset);
  border: 1px solid var(--line);
}

.advanced-options p {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.75;
  margin-top: 10px;
}

.import-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 20px;
}

.import-footer > span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.6;
}

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

/* ==========================================================================
   Liquid Glass Buttons
   ========================================================================== */

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 43px;
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.2s var(--spring), box-shadow 0.2s var(--spring), background 0.2s;
}

.button svg {
  width: 16px;
  height: 16px;
}

.button:hover:not(:disabled) {
  transform: translateY(-1.5px);
}

.button:active:not(:disabled) {
  transform: translateY(0.5px) scale(0.985);
}

.button.primary {
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb 0%, #0891b2 55%, #0d9488 100%);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    0 10px 24px -6px rgba(37, 99, 235, 0.38),
    0 2px 6px rgba(8, 145, 178, 0.2),
    inset 0 1px 1px rgba(255, 255, 255, 0.55);
  overflow: hidden;
}

.button.primary:hover:not(:disabled) {
  box-shadow:
    0 14px 30px -6px rgba(37, 99, 235, 0.48),
    0 4px 10px rgba(8, 145, 178, 0.25),
    inset 0 1px 1px rgba(255, 255, 255, 0.75);
}

.button.primary::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 25%, rgba(255, 255, 255, 0.42) 48%, transparent 70%);
  transform: translateX(-115%);
  pointer-events: none;
}

.button.primary:hover::before {
  transform: translateX(115%);
  transition: transform 0.65s ease;
}

.button.secondary {
  color: var(--text);
  border: 1px solid var(--line-strong);
  background: var(--input-bg);
  box-shadow: 0 4px 12px -4px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

:root[data-theme="dark"] .button.secondary {
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.button.secondary:hover:not(:disabled) {
  border-color: rgba(37, 99, 235, 0.35);
  color: var(--accent-blue);
  background: var(--input-bg-focus);
}

.button:disabled {
  opacity: 0.48;
}

.button.compact {
  min-height: 36px;
  padding: 8px 13px;
  font-size: 12px;
  border-radius: 10px;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  background: none;
  color: var(--accent-blue);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
  transition: color 0.2s, transform 0.2s;
}

.text-button svg {
  width: 14px;
  height: 14px;
}

.text-button:hover {
  color: var(--accent-cyan);
}

/* ==========================================================================
   Workflow Architecture Card & Acoustic Spectrum
   ========================================================================== */

.workflow-card {
  display: flex;
  flex-direction: column;
  padding: 26px 24px 22px;
}

.workflow-heading .section-number {
  display: inline-block;
  margin-bottom: 8px;
}

.workflow-heading h2 {
  font-size: 17px;
  color: var(--text);
}

.signal-diagram {
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 21px, var(--grid-line) 22px),
    repeating-linear-gradient(90deg, transparent, transparent 27px, var(--grid-line) 28px),
    var(--glass-inset);
  padding: 14px 14px 12px;
  margin: 18px 0 22px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.signal-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 8.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 1px;
}

.signal-caption > span:last-child {
  font-size: 10px;
  letter-spacing: 0;
  color: var(--accent-cyan);
}

.signal-wave {
  width: 100%;
  height: 60px;
  stroke-width: 1.5;
  margin: 10px 0 6px;
  filter: drop-shadow(0 3px 8px rgba(37, 99, 235, 0.18));
}

.signal-segments {
  display: flex;
  gap: 6px;
}

.signal-segments span {
  flex: 1;
  text-align: center;
  padding-top: 7px;
  border-top: 2px solid rgba(37, 99, 235, 0.35);
  color: var(--accent-blue);
  font-size: 10px;
  font-weight: 600;
}

.signal-segments span:nth-child(2) {
  border-color: rgba(8, 145, 178, 0.4);
  color: var(--accent-cyan);
}

.signal-segments span:nth-child(3) {
  border-color: rgba(79, 70, 229, 0.38);
  color: var(--accent-indigo);
}

.workflow {
  list-style: none;
  margin: 0;
  padding: 0;
}

.workflow li {
  display: flex;
  gap: 12px;
  position: relative;
  margin-bottom: 20px;
}

.step-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: rgba(37, 99, 235, 0.07);
  color: var(--accent-blue);
  flex: none;
}

.step-icon svg {
  width: 15px;
  height: 15px;
}

.workflow strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.workflow p {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.75;
  margin-top: 4px;
}

.workflow-bottom {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  margin-top: auto;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.65;
}

.workflow-bottom strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.workflow-bottom svg {
  width: 16px;
  height: 16px;
  color: var(--accent-blue);
  margin-left: auto;
}

.review-orbit {
  display: block;
  width: 32px;
  height: 32px;
  border: 1.5px solid rgba(37, 99, 235, 0.35);
  border-radius: 50%;
  position: relative;
  flex: none;
  animation: orbit-spin 12s linear infinite;
}

.review-orbit::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px dashed rgba(8, 145, 178, 0.45);
  border-radius: 50%;
}

.review-orbit::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-blue);
  top: -1px;
  right: 3px;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.5);
}

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

/* ==========================================================================
   Project Cards, Asset Grid & Queue
   ========================================================================== */

.recent-section {
  margin-top: 30px;
}

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

.section-header > div {
  display: flex;
  align-items: center;
  gap: 14px;
}

.section-header h2 {
  font-size: 16px;
  color: var(--text);
}

.section-header > div > span {
  font-size: 12px;
  color: var(--muted);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.project-card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  text-align: left;
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  transition: transform 0.28s var(--spring), box-shadow 0.28s var(--spring), border-color 0.28s;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--glass-shadow-hover);
}

.project-cover {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: 16px 20px;
  background:
    linear-gradient(125deg, rgba(37, 99, 235, 0.08), rgba(8, 145, 178, 0.04)),
    repeating-linear-gradient(90deg, var(--grid-line) 0, var(--grid-line) 1px, transparent 1px, transparent 20px);
  border-bottom: 1px solid var(--line);
}

.project-card:nth-child(3n + 2) .project-cover {
  background: linear-gradient(125deg, rgba(8, 145, 178, 0.09), rgba(13, 148, 136, 0.04));
}

.project-card:nth-child(3n) .project-cover {
  background: linear-gradient(125deg, rgba(79, 70, 229, 0.08), rgba(37, 99, 235, 0.04));
}

.cover-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 11px;
  background: var(--input-bg-focus);
  color: var(--accent-blue);
  box-shadow: 0 4px 10px -2px rgba(37, 99, 235, 0.12);
}

.cover-icon svg {
  width: 17px;
  height: 17px;
}

.project-cover .source-tag {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--secondary);
  text-align: right;
}

.source-tag small {
  display: block;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 3px;
}

.project-body {
  padding: 18px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-body h3 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1.6;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

.project-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.project-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  margin-top: auto;
  padding-top: 16px;
}

/* Status & Mode Pills */
.status-pill,
.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: var(--glass-inset);
  color: var(--secondary);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill.completed {
  color: var(--accent-emerald);
  border-color: rgba(5, 150, 105, 0.25);
  background: rgba(5, 150, 105, 0.08);
}

.status-pill.failed {
  color: var(--accent-danger);
  border-color: rgba(225, 29, 72, 0.25);
  background: rgba(225, 29, 72, 0.08);
}

.status-pill.generating,
.status-pill.transcribing,
.status-pill.downloading,
.status-pill.queued {
  color: var(--accent-blue);
  border-color: rgba(37, 99, 235, 0.25);
  background: rgba(37, 99, 235, 0.08);
}

/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 140px;
  padding: 26px 30px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 20px;
  background: var(--glass-inset);
}

.empty-main {
  display: flex;
  align-items: center;
  gap: 18px;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 15px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.18);
  color: var(--accent-blue);
  flex: none;
}

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

.empty-state h3 {
  font-size: 14.5px;
  font-weight: 650;
  color: var(--text);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.75;
}

.page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 32px 0 12px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
}

.page-footer > span:first-child,
.page-footer > span:last-child {
  font-size: 9.5px;
  letter-spacing: 1.2px;
  font-weight: 600;
}

/* ==========================================================================
   Secondary Views: Library, Tasks, Settings
   ========================================================================== */

.view-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 32px 0 24px;
}

.view-heading h1 {
  font-size: 30px;
  margin-bottom: 8px;
}

.view-heading p {
  color: var(--secondary);
  font-size: 13.5px;
  line-height: 1.75;
}

.library-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  margin-bottom: 22px;
  border-radius: 16px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  max-width: 420px;
  padding-left: 13px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 11px;
  color: var(--muted);
}

.search-field:focus-within {
  border-color: var(--accent-blue);
  background: var(--input-bg-focus);
}

.search-field svg {
  width: 16px;
  height: 16px;
  color: var(--accent-blue);
}

.search-field input {
  border: 0;
  background: none !important;
  box-shadow: none !important;
  padding: 10px 10px 10px 0;
  font-size: 13.5px;
  min-width: 0;
  width: 100%;
}

.library-toolbar select {
  font-size: 13px;
  padding: 9px 13px;
  height: 40px;
}

.toolbar-count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

/* Task Queue View */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.stat-row > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-radius: 18px;
}

.stat-row span {
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary);
}

.stat-row strong {
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stat-row strong.stat-highlight {
  color: var(--accent-blue);
}

.stat-row strong.stat-danger {
  color: var(--accent-danger);
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-row {
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 18px 22px;
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(24px);
}

.task-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.18);
  color: var(--accent-blue);
  flex: none;
}

.task-icon svg {
  width: 18px;
  height: 18px;
}

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

.task-info strong {
  display: block;
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-info > p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.task-progress {
  height: 5px;
  background: rgba(37, 99, 235, 0.12);
  border-radius: 99px;
  margin-top: 10px;
  max-width: 320px;
  overflow: hidden;
}

.task-progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
  border-radius: inherit;
  transition: width 0.35s var(--spring);
}

/* Settings & Heterogeneous Node Pairing */
.settings-grid {
  display: grid;
  grid-template-columns: 1.12fr 1fr;
  gap: 22px;
}

.settings-card {
  padding: 26px 28px;
}

.capability-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.capability-row:last-of-type {
  border-bottom: 0;
}

.capability-row strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.capability-row small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.capability-badge {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-amber);
  background: rgba(217, 119, 6, 0.09);
  border: 1px solid rgba(217, 119, 6, 0.24);
  border-radius: 99px;
  white-space: nowrap;
}

.capability-badge.available {
  color: var(--accent-emerald);
  background: rgba(5, 150, 105, 0.09);
  border-color: rgba(5, 150, 105, 0.24);
}

.settings-footnote {
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--muted);
  margin-top: 18px;
}

.settings-tip {
  padding: 26px 28px;
}

.tip-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.tip-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(8, 145, 178, 0.08));
  color: var(--accent-blue);
  flex: none;
}

.tip-icon {
  width: 22px;
  height: 22px;
}

.settings-tip p {
  font-size: 12.5px;
  color: var(--secondary);
  line-height: 1.8;
}

.environment-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 11px 18px;
  padding: 18px;
  margin: 18px 0;
  border-radius: 14px;
  background: var(--glass-inset);
  border: 1px solid var(--line);
  font-size: 11.5px;
}

.environment-list code {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.environment-list span {
  color: var(--muted);
}

.settings-tip #logout-button {
  margin-top: 18px;
}

.local-worker-settings {
  margin-top: 22px;
  padding: 28px 30px;
}

.local-worker-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.local-worker-heading > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.local-worker-description {
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.8;
  margin-top: 14px;
  max-width: 880px;
}

.worker-info {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0;
  padding: 16px 20px;
  border: 1px solid var(--line-strong);
  background: var(--glass-inset);
  border-radius: 15px;
}

.worker-metric span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.worker-metric strong {
  display: block;
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
  margin-top: 4px;
}

.worker-setup {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  list-style: none;
  padding: 0;
  margin: 22px 0;
}

.worker-setup li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: 14px;
  background: var(--glass-inset);
  border: 1px solid var(--line);
}

.worker-setup li > span {
  color: var(--accent-blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 7px;
  border-radius: 7px;
  background: rgba(37, 99, 235, 0.09);
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.worker-setup strong {
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
}

.worker-setup p {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.75;
  margin-top: 6px;
}

.worker-setup code {
  color: var(--accent-cyan);
  font-size: 11px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.worker-footnote {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.75;
}

.about-note {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 38px 0 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.brand-mark.small {
  grid-template-columns: repeat(2, 7px);
  grid-template-rows: repeat(2, 7px);
  gap: 2px;
}

.brand-mark.small i {
  border-radius: 2.5px;
}

/* ==========================================================================
   Liquid Glass Dialogs: Draft Editor & Login
   ========================================================================== */

dialog.glass-dialog {
  border: 1px solid var(--glass-border);
  padding: 0;
  color: var(--text);
  background: var(--glass-bg-strong);
  border-radius: 26px;
  box-shadow:
    0 32px 90px -16px rgba(15, 23, 42, 0.24),
    0 0 0 1px rgba(15, 23, 42, 0.08),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
}

:root[data-theme="dark"] dialog.glass-dialog {
  box-shadow:
    0 32px 90px -16px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(186, 230, 253, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.32);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}

.editor-dialog {
  width: min(1140px, calc(100vw - 56px));
  height: min(800px, calc(100vh - 56px));
  max-width: none;
  max-height: calc(100vh - 56px);
}

.editor-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 24px 30px 14px;
}

.editor-header .eyebrow {
  font-size: 9.5px;
  letter-spacing: 1.2px;
  color: var(--accent-blue);
  margin-bottom: 6px;
}

.editor-header h2 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
  overflow-wrap: anywhere;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--glass-inset);
  border: 1px solid var(--line-strong);
  color: var(--secondary);
  flex: none;
  transition: all 0.2s var(--spring);
}

.icon-button:hover {
  transform: scale(1.06);
  color: var(--accent-danger);
  border-color: rgba(225, 29, 72, 0.3);
}

.icon-button svg {
  width: 16px;
  height: 16px;
}

.editor-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 30px 18px;
  color: var(--muted);
  font-size: 11.5px;
}

.review-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  color: var(--accent-amber);
  border: 1px solid rgba(217, 119, 6, 0.25);
  background: rgba(217, 119, 6, 0.08);
  border-radius: 99px;
  font-weight: 600;
}

.review-label svg {
  width: 12px;
  height: 12px;
}

.editor-meta a {
  margin-left: auto;
  color: var(--accent-blue);
  font-weight: 600;
}

.editor-tabs {
  display: flex;
  gap: 8px;
  padding: 8px 30px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--glass-recessed);
  overflow-x: auto;
}

.editor-tabs button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 10px;
  color: var(--secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s var(--spring);
}

.editor-tabs button svg {
  width: 15px;
  height: 15px;
}

.editor-tabs button:hover:not(.active) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.4);
}

.editor-tabs button.active {
  color: var(--accent-blue);
  font-weight: 600;
  background: var(--input-bg-focus);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08), inset 0 1px 0 #ffffff;
}

:root[data-theme="dark"] .editor-tabs button.active {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.editor-content {
  flex: 1;
  overflow: auto;
  min-height: 0;
  padding: 24px 30px;
}

.editor-content .field-label {
  margin-bottom: 18px;
  color: var(--secondary);
  font-size: 12.5px;
}

.editor-content .field-label input {
  height: 44px;
  font-size: 14px;
}

.editor-content .field-label textarea {
  width: 100%;
  padding: 14px 16px;
  min-height: 110px;
  font-size: 14px;
}

.editor-content .field-label textarea.long-text {
  min-height: 280px;
}

.editor-content .field-label textarea.transcript-text {
  min-height: 340px;
}

.editor-content .title-label {
  margin-bottom: 22px;
}

.editor-content h3 {
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  margin-bottom: 12px;
}

.editor-notice {
  padding: 12px 16px;
  border-left: 3px solid var(--accent-blue);
  border-radius: 0 10px 10px 0;
  background: rgba(37, 99, 235, 0.06);
  color: var(--secondary);
  font-size: 12.5px;
  line-height: 1.75;
  margin-bottom: 20px;
}

.editor-notice.warning {
  border-color: var(--accent-amber);
  color: var(--accent-amber);
  background: rgba(217, 119, 6, 0.08);
}

.insight-summary {
  padding: 18px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--glass-inset);
  color: var(--text);
  font-size: 14px;
  line-height: 1.9;
  margin-bottom: 24px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.insight-points {
  display: flex;
  flex-direction: column;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 10px;
}

.insight-points li {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--glass-inset);
  border: 1px solid var(--line);
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text);
  overflow-wrap: anywhere;
}

.point-number {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent-blue);
  font-size: 11px;
  font-weight: 700;
  flex: none;
  margin-top: 1px;
}

.editor-empty {
  min-height: 230px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  color: var(--muted);
  line-height: 1.8;
  font-size: 13.5px;
}

.editor-empty svg {
  width: 34px;
  height: 34px;
  color: var(--accent-blue);
}

.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  border-top: 1px solid var(--line);
  background: var(--glass-inset);
}

.editor-footer-left,
.editor-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.danger {
  color: var(--accent-danger);
}

.editor-footer-left > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.editor-actions select {
  padding: 7px 11px;
  max-width: 145px;
  height: 36px;
  font-size: 12px;
}

.editor-processing {
  margin: 0 30px 16px;
  padding: 12px 16px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.07);
  color: var(--accent-blue);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.75;
}

.shot-head,
.shot-row {
  display: grid;
  grid-template-columns: 90px 1fr 1.3fr;
  gap: 12px;
  margin-bottom: 10px;
}

.shot-head {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 0 4px;
}

.shot-row input,
.shot-row textarea {
  padding: 10px 12px;
  min-width: 0;
  font-size: 13px;
  line-height: 1.7;
}

.shot-row textarea {
  min-height: 78px;
}

.metadata-line {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  margin: 10px 0 18px;
}

/* Match the shared dialog selector so its padding reset cannot override this inset. */
dialog.login-dialog {
  width: min(440px, calc(100vw - 36px));
  padding: 36px;
}

.login-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.login-dialog .eyebrow {
  font-size: 9px;
  margin-bottom: 8px;
}

.login-dialog h2 {
  font-size: 22px;
  line-height: 1.45;
  margin-bottom: 10px;
  color: var(--text);
}

.login-dialog p:not(.form-error) {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 24px;
}

.login-dialog .field-label {
  margin-bottom: 20px;
}

.login-dialog input {
  height: 45px;
  font-size: 15px;
}

.login-dialog .button {
  width: 100%;
  margin-top: 6px;
}

.form-error {
  color: var(--accent-danger);
  background: rgba(225, 29, 72, 0.08);
  border: 1px solid rgba(225, 29, 72, 0.24);
  padding: 11px 14px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.7;
  margin-top: 14px;
  overflow-wrap: anywhere;
}

.service-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 12px 18px;
  margin-top: 16px;
  border-color: rgba(217, 119, 6, 0.35);
  color: var(--accent-amber);
  font-size: 12.5px;
  font-weight: 500;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 12px 22px;
  max-width: 90vw;
  border: 1px solid var(--glass-border);
  border-radius: 99px;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  box-shadow: 0 16px 40px -8px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(37, 99, 235, 0.16);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.6;
}

.toast.error {
  border-color: rgba(225, 29, 72, 0.35);
  color: var(--accent-danger);
}

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

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 1220px) {
  .main { padding: 0 26px 36px; }
  .creation-grid { grid-template-columns: minmax(0, 1.75fr) minmax(275px, 1fr); gap: 18px; }
  .date-label { display: none; }
  .pipeline-track { grid-template-columns: 1fr 24px 1.1fr 24px 1fr 24px 1.1fr; gap: 6px; }
  .worker-info, .worker-setup { grid-template-columns: 1fr; }
}

@media (max-width: 1020px) {
  .app-shell { grid-template-columns: 94px minmax(0, 1fr); }
  .sidebar { margin-left: 12px; padding-left: 8px; padding-right: 8px; }
  .main { padding: 0 22px 32px; }
  .welcome-row { flex-direction: column; align-items: flex-start; gap: 18px; }
  .creation-grid { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: 1fr; }
  .pipeline-track { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .pipeline-connector { display: none; }
}

@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    inset: auto 12px 12px;
    width: auto;
    height: 66px;
    margin: 0;
    padding: 6px 10px;
    border-radius: 22px;
    flex-direction: row;
  }
  .sidebar .brand,
  .sidebar-bottom { display: none; }
  .nav { flex-direction: row; height: 100%; gap: 6px; }
  .nav-item { flex: 1; justify-content: center; gap: 3px; padding: 4px 2px; font-size: 10px; }
  .nav-icon-wrap { width: 28px; height: 28px; }
  .main { padding: 0 16px 104px; }
  .topbar { padding: 8px 14px; border-radius: 16px; }
  .desktop-crumb,
  .telemetry-pills { display: none; }
  .mobile-brand { display: block; font-size: 17px; font-weight: 700; color: var(--accent-blue); }
  h1 { font-size: 26px; }
  .overview-metrics { width: 100%; justify-content: space-around; }
  .overview-metrics > .metric-item { min-width: 0; flex: 1; padding: 2px 10px; }
  .processing-nodes,
  .form-options,
  .project-grid,
  .stat-row { grid-template-columns: 1fr; }
  .import-footer { flex-direction: column; align-items: stretch; }
  .import-actions { justify-content: flex-end; }
  .editor-dialog { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; border: 0; }
  .editor-header, .editor-meta, .editor-tabs, .editor-content, .editor-footer { padding-left: 18px; padding-right: 18px; }
  .shot-head, .shot-row { grid-template-columns: 68px 1fr 1fr; gap: 8px; }
  .toast { bottom: 88px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ========================================================================== 
   Account & Administration — additive extension of the user's light/dark glass.
   Existing workbench visuals and theme tokens remain unchanged.
   ========================================================================== */
.sidebar .nav { min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.sidebar-bottom { flex: none; }
.sidebar .brand strong { max-width: 82px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile { border: 0; background: transparent; color: inherit; cursor: pointer; width: 100%; }
.profile-copy strong { max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-trigger { cursor: pointer; font: inherit; }
.account-trigger #header-user { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-trigger small { font-size: 10px; color: var(--muted); border-left: 1px solid var(--line-strong); padding-left: 7px; }
.admin-tabbar { display: flex; align-items: center; gap: 7px; padding: 7px; margin-bottom: 20px; border-radius: 16px; }
.admin-tabbar button { position: relative; min-height: 44px; padding: 11px 23px; border-radius: 11px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 600; transition: background .2s var(--spring), color .2s; }
.admin-tabbar button.active { color: var(--accent-blue); background: var(--glass-bg-strong); box-shadow: var(--glass-shadow); }
.admin-form { padding: 28px; margin-bottom: 35px; }
.admin-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.admin-field-grid .field-label { min-width: 0; }
.admin-form .field-label { font-size: 13px; color: var(--secondary); gap: 10px; }
.admin-form input, .admin-form select, .management-dialog input, .management-dialog select { min-width: 0; font-size: 14px; }
.admin-form .field-label small, .management-dialog .field-label small { display: block; color: var(--muted); font-size: 12px; line-height: 1.8; font-weight: 400; }
.admin-toggle-field { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 17px 18px; border: 1px solid var(--line); border-radius: 13px; background: var(--glass-inset); cursor: pointer; min-height: 77px; }
.admin-toggle-field strong { display: block; color: var(--secondary); font-size: 13px; font-weight: 600; line-height: 1.8; }
.admin-toggle-field small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.admin-toggle-field input { width: 18px; height: 18px; margin: 4px 0 0; padding: 0; accent-color: var(--accent-blue); flex: none; cursor: pointer; }
.admin-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 27px; padding-top: 22px; border-top: 1px solid var(--line); }
.admin-form-footer > span { color: var(--muted); font-size: 12px; line-height: 1.8; }
.admin-inline-actions { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.admin-help { color: var(--muted); font-size: 12px; line-height: 1.9; }
.api-secret-panel { margin-top: 25px; padding: 23px; background: var(--glass-inset); border: 1px solid var(--line); border-radius: 15px; }
.api-secret-panel > div { display: flex; align-items: center; gap: 12px; margin-bottom: 11px; }
.api-secret-panel > div > strong { font-size: 14px; color: var(--secondary); }
.api-secret-panel > .field-label { margin: 18px 0; }
.admin-checkbox, .permission-checkboxes label { display: flex; align-items: center; gap: 10px; font-size: 13px; line-height: 1.8; color: var(--secondary); cursor: pointer; }
.admin-checkbox input, .permission-checkboxes input { width: 17px; height: 17px; padding: 0; margin: 0; flex: none; accent-color: var(--accent-blue); }
.danger-checkbox { color: var(--accent-danger); }
.admin-toolbar { display: flex; gap: 13px; align-items: center; padding: 17px 19px; margin-bottom: 20px; }
.admin-toolbar .search-field { flex: 1; max-width: none; min-width: 200px; }
.admin-toolbar > select { min-height: 43px; padding: 10px 12px; font-size: 13px; }
.admin-filter-field { display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: var(--muted); min-width: 0; }
.admin-filter-field input { width: 100%; min-height: 43px; padding: 10px 12px; font-size: 14px; }
.admin-filter-grow { flex: 1; }
#audit-filter-form { align-items: flex-end; }
.admin-table-wrap { overflow-x: auto; border-radius: 19px; }
.admin-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.admin-table th { padding: 17px 20px; font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; background: var(--glass-inset); border-bottom: 1px solid var(--line); }
.admin-table td { padding: 20px; color: var(--secondary); border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: var(--glass-inset); }
.table-user strong { display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.table-user small { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; }
.self-label { font-size: 10px; color: var(--accent-blue); font-weight: 400; white-space: nowrap; }
.table-badges { display: flex; flex-direction: column; gap: 7px; align-items: flex-start; }
.admin-badge { display: inline-flex; align-items: center; justify-content: center; padding: 4px 8px; font-size: 11px; line-height: 1.4; color: var(--accent-blue); border: 1px solid var(--line); background: var(--glass-inset); border-radius: 6px; white-space: nowrap; }
.admin-badge.active { color: var(--accent-emerald); }
.admin-badge.pending { color: var(--accent-amber); }
.admin-badge.disabled { color: var(--accent-danger); }
.table-permissions { display: flex; flex-direction: column; gap: 7px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.table-date { font-size: 12px; line-height: 1.8; white-space: nowrap; color: var(--muted) !important; }
.table-actions { display: flex; flex-wrap: wrap; gap: 9px 13px; min-width: 130px; }
.table-actions .text-button { font-size: 12px; }
.table-actions .text-button:disabled { opacity: .4; cursor: not-allowed; }
.admin-pagination { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 20px 0 35px; color: var(--muted); font-size: 12px; }
.admin-pagination > div { display: flex; align-items: center; gap: 14px; }
.admin-pagination .button { font-size: 12px; }
.admin-empty { padding: 28px 10px; color: var(--muted); font-size: 13px; line-height: 1.9; text-align: center; }
.audit-action { display: inline-block; color: var(--accent-cyan); font-size: 12px; overflow-wrap: anywhere; }
.audit-target { max-width: 400px; color: var(--secondary); font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.audit-details { margin-top: 8px; font-size: 12px; color: var(--muted); }
.audit-details summary { color: var(--accent-blue); cursor: pointer; }
.audit-details pre { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 480px; font-size: 11px; line-height: 1.8; padding: 12px; background: var(--glass-recessed); border-radius: 9px; }
.auth-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--glass-recessed); border-radius: 12px; margin: 0 0 23px; }
.auth-switch button { background: transparent; color: var(--muted); border-radius: 9px; padding: 11px; font-size: 13px; }
.auth-switch button.active { background: var(--glass-bg-strong); color: var(--accent-blue); box-shadow: 0 2px 8px var(--line); }
.login-dialog { max-height: calc(100dvh - 40px); overflow-y: auto; }
.login-dialog .admin-help { margin: 12px 0 20px; font-size: 12px; }
.admin-success { padding: 13px 15px; color: var(--accent-emerald); background: var(--glass-inset); border: 1px solid var(--line); border-radius: 10px; font-size: 13px; line-height: 1.9; margin: 15px 0; }
.management-dialog { width: min(660px, calc(100vw - 40px)); max-width: none; max-height: calc(100dvh - 50px); overflow-y: auto; }
.management-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 27px 28px 21px; border-bottom: 1px solid var(--line); }
.management-header .eyebrow { font-size: 9px; margin-bottom: 9px; }
.management-header h2 { font-size: 20px; color: var(--text); line-height: 1.6; overflow-wrap: anywhere; }
.management-content { padding: 25px 28px; }
.management-content .field-label { margin-bottom: 20px; font-size: 13px; }
.management-content .field-label input, .management-content .field-label select { font-size: 14px; height: 44px; }
.management-content .field-label > .normal-label { position: static; font-size: 13px; color: var(--secondary); }
.management-content h3 { font-size: 15px; margin: 2px 0 21px; color: var(--secondary); }
.management-content .admin-field-grid { gap: 0 20px; }
.management-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 28px; border-top: 1px solid var(--line); background: var(--glass-inset); }
.management-footer > span { color: var(--muted); font-size: 12px; }
.permission-checkboxes { display: flex; gap: 15px 25px; flex-wrap: wrap; margin: 4px 0 20px; }
.account-summary { padding: 19px 20px; border: 1px solid var(--line); background: var(--glass-inset); border-radius: 14px; margin-bottom: 27px; }
.account-summary > div:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: 11px; }
.account-summary strong { font-size: 17px; color: var(--text); overflow-wrap: anywhere; }
.account-summary > div:first-child span { font-size: 12px; color: var(--muted); }
.account-badges { display: flex; gap: 7px; margin-top: 12px; }
.account-summary p { font-size: 12px; line-height: 1.8; color: var(--muted); margin-top: 13px; }
#password-form .button { margin-top: 20px; }

@media (max-width: 1100px) {
  .admin-toolbar { flex-wrap: wrap; }
  .admin-toolbar .search-field { flex-basis: 100%; }
  .admin-toolbar > select { flex: 1; }
  .admin-table th, .admin-table td { padding-left: 16px; padding-right: 16px; }
  .admin-field-grid { gap: 22px 18px; }
  .admin-form-footer { flex-wrap: wrap; }
  .admin-form-footer .admin-inline-actions { margin-left: auto; }
  .account-trigger #header-user { max-width: 60px; }
  .account-trigger small { display: none; }
}
@media (max-width: 720px) {
  .sidebar .nav { overflow-x: auto; overflow-y: hidden; gap: 5px; scrollbar-width: none; }
  .sidebar .nav::-webkit-scrollbar { display: none; }
  .sidebar .nav-item { flex: 1 0 67px; min-width: 67px; }
  .account-trigger { padding: 7px 9px; gap: 5px; font-size: 11px; }
  .account-trigger #header-user { max-width: 55px; }
  .admin-tabbar { gap: 3px; padding: 5px; overflow-x: auto; }
  .admin-tabbar button { flex: 1 0 auto; padding: 11px 13px; font-size: 12px; min-height: 43px; }
  .admin-form { padding: 23px 18px; }
  .admin-field-grid { grid-template-columns: minmax(0,1fr); gap: 22px; }
  .admin-form input:not([type="checkbox"]), .admin-form select, .management-content .field-label input, .management-content .field-label select, .login-dialog input, .admin-toolbar input, .admin-toolbar select { font-size: 16px; min-height: 45px; }
  .admin-toggle-field { padding: 16px; }
  .admin-form-footer { flex-direction: column; align-items: stretch; gap: 16px; }
  .admin-form-footer .admin-inline-actions { margin-left: 0; justify-content: flex-end; }
  .admin-inline-actions .button { font-size: 12px; }
  .api-secret-panel { padding: 19px 16px; }
  .admin-toolbar { padding: 15px; gap: 11px; }
  .admin-toolbar .search-field { min-width: 0; flex-basis: 100%; }
  .admin-filter-field { width: 100%; }
  #audit-filter-form .button { margin-left: auto; }
  .admin-table { min-width: 700px; }
  .audit-table { min-width: 680px; }
  .admin-pagination { flex-wrap: wrap; font-size: 11px; gap: 14px; }
  .admin-pagination > div { margin-left: auto; gap: 10px; }
  .admin-pagination .button { font-size: 12px; min-height: 40px; }
  .management-dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 30px); border-radius: 20px; }
  .management-header { padding: 23px 20px 18px; }
  .management-header h2 { font-size: 19px; }
  .management-content { padding: 22px 20px; }
  .management-content .admin-field-grid { gap: 0; }
  .management-footer { padding: 17px 20px; flex-wrap: wrap; }
  .management-footer > .admin-inline-actions { margin-left: auto; }
  .permission-checkboxes { flex-direction: column; gap: 14px; }
  .account-summary { padding: 17px; }
  dialog.login-dialog { padding: 28px 24px; }
}

/* Ownership is a protected identity, separate from editable administrator roles. */
.admin-badge.owner {
  color: var(--accent-indigo);
  background: color-mix(in srgb, var(--accent-indigo) 8%, var(--glass-inset));
  border-color: color-mix(in srgb, var(--accent-indigo) 24%, transparent);
}
.owner-protection-note {
  display: block;
  max-width: 200px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}
.admin-policy-note {
  margin: 0 0 24px;
  padding: 15px 17px;
  border-left: 3px solid var(--accent-cyan);
  border-radius: 0 11px 11px 0;
  background: var(--glass-inset);
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.9;
}

/* Keep all seven desktop navigation destinations visible on shorter displays. */
@media (min-width: 721px) and (max-height: 850px) {
  .sidebar { padding-top: 18px; padding-bottom: 12px; }
  .sidebar .brand { gap: 8px; margin-bottom: 16px; }
  .sidebar .nav { gap: 4px; }
  .sidebar .nav-item { padding: 6px 4px; gap: 3px; line-height: 14px; }
  .sidebar .nav-icon-wrap { width: 28px; height: 28px; }
  .sidebar-bottom { padding-top: 12px; gap: 8px; }
  .sidebar .connection-card { padding-top: 7px; padding-bottom: 7px; }
  .sidebar .profile { padding-top: 10px; }
}
.admin-filter-field select {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  font-size: 14px;
}
@media (max-width: 720px) {
  .admin-filter-field select { font-size: 16px; min-height: 45px; }
}
