:root {
  color-scheme: dark;
  --bg-app: #171326;
  --bg-sidebar: #1d1830;
  --bg-panel: #252037;
  --bg-panel-2: #302a45;
  --bg-panel-3: #161223;
  --bg-input: #201a30;
  --bg-subtle: rgba(255, 255, 255, 0.04);
  --bg-overlay: rgba(11, 8, 22, 0.78);
  --line: #433b5f;
  --line-soft: #332c49;
  --text: #f4f0ff;
  --text-muted: #b8b1c9;
  --muted: #a9a0bd;
  --muted-2: #746c8c;
  --accent: #9b7cf5;
  --accent-strong: #7e55ed;
  --accent-soft: rgba(155, 124, 245, 0.18);
  --accent-text: #d8caff;
  --accent-2: #2fd2bf;
  --accent-2-strong: #23b9aa;
  --danger: #ff5b68;
  --danger-text: #ff9aa3;
  --danger-soft: rgba(255, 91, 104, 0.18);
  --warn: #ffc94d;
  --warn-text: #ffd97a;
  --warn-soft: rgba(255, 201, 77, 0.16);
  --ok: #36d99a;
  --ok-text: #a7f0ce;
  --ok-soft: rgba(54, 217, 154, 0.16);
  --blue: #58a6ff;
  --blue-text: #c8e4ff;
  --queued-text: #d6c2ff;
  --button-text: #f4f0ff;
  --font-xs: 10px;
  --font-sm: 11px;
  --font-md: 12px;
  --font-lg: 14px;
  --font-xl: 16px;
  --font-2xl: 20px;
  --font-display: 24px;
  --leading-tight: 1.2;
  --leading-ui: 1.35;
  --leading-body: 1.45;
  --space-1: 4px;
  --space-2: 6px;
  --space-3: 8px;
  --space-4: 10px;
  --space-5: 12px;
  --space-6: 16px;
  --space-7: 20px;
  --space-8: 24px;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
  --queue-table-min-width: 1220px;
  --scrollbar-track: #120f1d;
  --scrollbar-thumb: #5a516f;
  --scrollbar-thumb-hover: #7a6a95;

  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-title: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --text-body: 12px;
  --text-label: 11px;
  --text-meta: 10px;
  --text-md: 13px;
  --text-card-title: 13px;
  --text-section-title: 15px;
  --text-page-title: 20px;

  --foreground: #f7f8f8;
  --heading: #ffffff;
  --surface: #1e1a2e;
  --primary: #9b7cf5;
  --primary-dark: #c4b5fd;
  --primary-50: rgba(155, 124, 245, 0.14);
  --glass-bg: rgba(23, 23, 26, 0.72);
  --glass-bg-strong: rgba(28, 28, 33, 0.95);
  --glass-border: rgba(255, 255, 255, 0.08);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg-app: #e2e9f1;
  --bg-sidebar: #dbe4ee;
  --bg-panel: #f1f4f8;
  --bg-panel-2: #f7f9fc;
  --bg-panel-3: #e8eef6;
  --bg-input: #f9fbfd;
  --bg-subtle: rgba(28, 39, 58, 0.055);
  --bg-overlay: rgba(31, 41, 55, 0.42);
  --line: #b9c5d5;
  --line-soft: #ccd6e3;
  --text: #172033;
  --text-muted: #536174;
  --muted: #536174;
  --muted-2: #728094;
  --accent: #5f55b4;
  --accent-strong: #4f469d;
  --accent-soft: rgba(95, 85, 180, 0.1);
  --accent-text: #4b438f;
  --accent-2: #147c73;
  --accent-2-strong: #0f665f;
  --danger: #b42334;
  --danger-text: #9f1f2f;
  --danger-soft: rgba(180, 35, 52, 0.1);
  --warn: #9a6500;
  --warn-text: #7a4b00;
  --warn-soft: rgba(154, 101, 0, 0.12);
  --ok: #12825b;
  --ok-text: #0f6848;
  --ok-soft: rgba(18, 130, 91, 0.12);
  --blue: #2f5ea8;
  --blue-text: #244f94;
  --queued-text: #514997;
  --button-text: #ffffff;
  --shadow: 0 12px 28px rgba(42, 55, 75, 0.11);
  --scrollbar-track: #d8e1eb;
  --scrollbar-thumb: #9ba9ba;
  --scrollbar-thumb-hover: #8493a6;

  --foreground: #111827;
  --heading: #0f172a;
  --surface: #ffffff;
  --primary: #2563eb;
  --primary-dark: #1e3a8a;
  --primary-50: #eff6ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg-app);
  font-family: var(--font-sans);
  font-size: var(--text-body, 12px);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  letter-spacing: -0.02em;
  font-weight: var(--weight-bold);
}

button, input, select, textarea {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(23, 19, 38, 0.95), rgba(20, 31, 46, 0.94)),
    var(--bg-app);
}

.auth-gate[hidden] {
  display: none;
}

.auth-panel {
  width: min(440px, calc(100vw - 32px));
  display: grid;
  gap: 18px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-panel);
  box-shadow: var(--shadow);
}

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

.auth-brand h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.auth-brand p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.auth-field {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.auth-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
}

.auth-input-row input {
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: var(--bg-input);
  color: var(--text);
  font: inherit;
}

.auth-input-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.auth-icon-btn,
.auth-primary-btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-panel-2);
  color: var(--button-text);
  font-weight: 800;
  cursor: pointer;
}

.auth-icon-btn {
  height: 44px;
}

.auth-primary-btn {
  width: 100%;
  min-height: 46px;
  background: var(--accent-strong);
}

.auth-actions {
  display: grid;
  gap: 10px;
}

.auth-google-btn {
  width: 100%;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-panel-2);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.auth-google-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.auth-google-mark {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  color: #1a73e8;
  font-size: 14px;
  font-weight: 900;
}

.auth-primary-btn:disabled,
.auth-icon-btn:disabled,
.auth-google-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-status {
  min-height: 18px;
  color: var(--text-muted);
  font-size: 13px;
}

.auth-status[data-tone="ok"] {
  color: var(--ok-text);
}

.auth-status[data-tone="error"] {
  color: var(--danger-text);
}

.auth-status[data-tone="warn"] {
  color: var(--warn-text);
}

.app-shell.auth-locked {
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
}

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

button {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--accent);
  color: var(--button-text);
  padding: 0 14px;
  cursor: pointer;
  font-weight: 700;
}

button:hover:not(:disabled) {
  background: var(--accent-strong);
}

button:disabled {
  cursor: default;
  opacity: 0.52;
}

button.secondary,
.toggle-btn {
  background: var(--bg-panel-2);
  border-color: var(--line);
  color: var(--text);
}

button.danger {
  background: var(--danger-soft);
  border-color: rgba(255, 91, 104, 0.48);
  color: var(--danger-text);
}

button.danger:hover:not(:disabled) {
  background: rgba(255, 91, 104, 0.28);
}

button.secondary:hover:not(:disabled),
.toggle-btn:hover:not(:disabled) {
  background: var(--accent-soft);
}

* {
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

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

*::-webkit-scrollbar-thumb {
  min-width: 36px;
  min-height: 36px;
  border: 3px solid var(--scrollbar-track);
  border-radius: 999px;
  background: var(--scrollbar-thumb);
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

*::-webkit-scrollbar-corner {
  background: var(--scrollbar-track);
}

.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  height: 100vh;
  min-width: 1120px;
  overflow: hidden;
  background: var(--bg-app);
  transition: grid-template-columns 300ms cubic-bezier(0.32, 0.72, 0, 1);
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 68px minmax(0, 1fr);
}

.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border-right: 1px solid var(--line-soft);
  background: var(--bg-sidebar);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 26px 16px 22px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(145deg, var(--bg-panel-2), var(--bg-panel-3));
  color: var(--accent-2);
  font-weight: 900;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.05);
}

.brand h1,
.brand p,
.top-title h2,
.top-title p {
  margin: 0;
}

.brand h1 {
  font-size: 18px;
  line-height: 1.05;
}

.brand p {
  margin-top: 5px;
  color: var(--warn);
  font-size: 10px;
  font-weight: var(--weight-bold, 700);
}

.tool-nav {
  display: grid;
  gap: 2px;
  padding: 0 0 16px;
}

.nav-item {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 11px;
  width: 100%;
  height: 62px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 16px 0 24px;
  text-align: left;
  font-size: var(--text-body, 12px);
  font-weight: var(--weight-semibold, 600);
}

.nav-item .nav-icon {
  width: 20px;
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0;
  flex: 0 0 auto;
}

.nav-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 1;
  visibility: visible;
  transition: opacity 150ms ease, visibility 150ms ease;
}

.nav-item.active {
  background: #6422c6;
  color: #fff;
}

.nav-item.active .nav-icon {
  color: #fff;
}

.nav-item:hover:not(:disabled) {
  background: #5721a8;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
  padding: 18px 12px;
  border-top: 1px solid var(--line-soft);
}

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: var(--bg-panel-2);
  color: var(--muted);
  text-align: left;
  min-height: 50px;
  color: #ff9c9c;
}

.app-shell.sidebar-collapsed .brand {
  justify-content: center;
  padding: 22px 8px 18px;
}

.app-shell.sidebar-collapsed .brand-mark {
  width: 38px;
  height: 38px;
}

.startup-loading {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 38%, rgba(89, 72, 139, 0.2), transparent 42%),
    rgba(18, 14, 31, 0.97);
  color: var(--text);
  transition: opacity 180ms ease, visibility 180ms ease;
}

.startup-loading[hidden] {
  display: none !important;
}

.startup-loading.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.startup-loading-card {
  width: min(560px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-panel) 96%, transparent);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.startup-loading-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.startup-loading-mark {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, var(--bg-panel-2), var(--bg-panel-3));
  color: var(--accent-2);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.025);
  font-size: 24px;
}

.startup-loading-brand h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.startup-loading-brand p {
  margin: 7px 0 0;
  color: var(--text-muted);
  font-size: 16px;
}

.startup-loading-track {
  height: 10px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--bg-panel-3);
}

.startup-loading-bar {
  width: 8%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--blue));
  transition: width 180ms ease;
}

.startup-loading-detail {
  min-height: 20px;
  margin-top: 13px;
  color: var(--text-muted);
  font-size: 14px;
}

.startup-loading[data-tone="error"] .startup-loading-bar {
  background: var(--danger);
}

.startup-loading[data-tone="error"] .startup-loading-detail {
  color: var(--danger-text);
}

@media (max-width: 560px) {
  .startup-loading {
    padding: 16px;
  }

  .startup-loading-card {
    padding: 22px;
  }

  .startup-loading-brand h1 {
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .startup-loading,
  .startup-loading-bar {
    transition: none;
  }
}

.app-shell.sidebar-collapsed .brand-copy,
.app-shell.sidebar-collapsed .logout-btn {
  display: none;
}

.app-shell.sidebar-collapsed .tool-nav {
  padding-bottom: 12px;
}

.app-shell.sidebar-collapsed .nav-item {
  justify-content: center;
  height: 56px;
  padding: 0;
}

.app-shell.sidebar-collapsed .nav-item .nav-icon {
  width: auto;
  font-size: 16px;
}

.app-shell.sidebar-collapsed .nav-label {
  flex: 0 0 0;
  width: 0;
  min-width: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-shell.sidebar-collapsed .sidebar-footer {
  padding: 12px 10px 16px;
}

.main-region {
  display: grid;
  grid-template-rows: 58px 54px minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  background: var(--bg-app);
}

.app-shell.header-hidden .main-region {
  grid-template-rows: 0 54px minmax(0, 1fr);
}

.app-shell.header-hidden .top-status-bar {
  height: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}

.nav-item-toggle[aria-pressed="true"] {
  color: var(--text);
  background: rgba(100, 34, 198, 0.18);
}

.top-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 16px 6px;
}

.top-title h2 {
  font-size: 14px;
}

.top-title p {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 700;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.status-pill,
.version-pill,
.lang-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-panel-2);
  color: var(--muted);
  padding: 0 13px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.strong {
  background: var(--bg-panel);
  color: var(--text);
}

.lang-pill {
  gap: 6px;
  padding: 5px;
}

.lang-btn {
  min-height: 34px;
  min-width: 36px;
  padding: 0 8px;
  border-radius: 10px;
  opacity: 0.56;
}

.lang-btn.active {
  background: var(--accent);
  color: #fff;
  opacity: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.square-btn,
.icon-btn {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  width: 36px;
  padding: 0;
}

.square-btn.active {
  border-color: rgba(47, 210, 191, 0.55);
  background: rgba(47, 210, 191, 0.18);
  color: var(--accent-2);
}

.trash-btn,
.tool-btn {
  width: auto;
  min-width: 0;
  padding: 0 10px;
  font-size: 11px;
}

.upscale-all-btn {
  margin-left: auto;
  min-width: 132px;
  font-size: 11px;
}

.watermark-all-btn {
  min-width: 138px;
  font-size: 11px;
}

.download-all-btn {
  min-width: 112px;
  font-size: 11px;
}

.compact-grid,
.toggle-grid,
.reference-grid,
.segmented-row {
  display: grid;
  gap: 8px;
}

.compact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.reference-grid,
.segmented-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--bg-panel-3);
  padding: 0 10px;
  color: var(--muted);
  font-weight: 800;
}

.check-row input {
  width: 15px;
  height: 15px;
}

.inline-counter {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 36px;
  color: var(--muted);
  font-weight: 900;
}

.ref-mode-btn.active {
  border-color: rgba(47, 210, 191, 0.7);
  background: rgba(47, 210, 191, 0.18);
  color: #d7fffb;
}

.queue-stats {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 900;
  white-space: nowrap;
}

.project-tabs[hidden],
.work-area[hidden] {
  display: none;
}

.project-tabs {
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-height: 54px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.012);
  overflow-x: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.project-tabs::-webkit-scrollbar {
  display: none;
}

.project-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 150px;
  max-width: 340px;
  height: 38px;
  padding: 0 6px 0 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg-panel-2);
  color: var(--text);
  box-shadow: none;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.project-tab.active {
  border-color: rgba(155, 124, 245, 0.85);
  background: #3b325b;
  box-shadow: inset 0 -2px 0 var(--accent-2);
}

.project-tab:hover {
  border-color: rgba(155, 124, 245, 0.72);
  background: #352d4f;
}

.project-tab-main {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  height: 100%;
  min-height: 0;
  padding: 0 0 0 14px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.project-tab-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-tab-close {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #c7bddf;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.project-tab-close:hover,
.project-tab-close:focus {
  background: var(--danger-soft);
  color: #ff9aa3;
  outline: none;
}

.project-add {
  display: grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg-panel-2);
  color: #eee7ff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.project-add:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.project-add:disabled {
  cursor: wait;
  opacity: 0.65;
}

.work-area {
  display: grid;
  grid-template-columns: 402px minmax(0, 1fr);
  min-height: 0;
  min-width: 0;
  border-top: 1px solid transparent;
  transition: grid-template-columns 220ms cubic-bezier(0.2, 0, 0, 1);
}

.work-area.config-rail-collapsed {
  grid-template-columns: 0 minmax(0, 1fr) !important;
}

.work-area.config-rail-collapsed .config-rail {
  visibility: hidden;
  pointer-events: none;
  border-right-color: transparent;
}

.agent-chat-panel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  width: min(960px, calc(100vw - 236px));
  height: min(640px, calc(100vh - 92px));
  min-width: 620px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.agent-chat-panel[data-size="fullscreen"] {
  inset: 14px;
  width: auto;
  height: auto;
  min-width: 0;
  border-radius: 8px;
}

.agent-chat-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 61;
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  min-height: 58px;
  border: 1px solid rgba(47, 210, 191, 0.5);
  border-radius: 999px;
  background: var(--accent);
  color: var(--button-text);
  padding: 0;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.32);
  font-size: 24px;
  line-height: 1;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease, bottom 160ms ease;
}

.agent-chat-fab:hover:not(:disabled) {
  background: var(--accent-strong);
  transform: translateY(-2px);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.38);
}

.agent-chat-fab.active {
  bottom: min(676px, calc(100vh - 74px));
  background: var(--accent-2);
  color: #061b1b;
}

.agent-chat-fab.active[data-size="fullscreen"] {
  bottom: 22px;
  right: 22px;
}

.agent-chat-fab[hidden] {
  display: none;
}

.agent-chat-workbench {
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr) 176px;
  min-height: 0;
}

.agent-chat-main {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  border-inline: 1px solid var(--line-soft);
}


.agent-chat-sidebar,
.agent-chat-inspector {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding: 8px;
  background: var(--bg-panel-2);
}

.agent-chat-side-section,
.agent-chat-inspector section {
  display: grid;
  gap: 6px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 8px;
}

.agent-chat-side-section[data-collapsed="true"],
.agent-chat-inspector section[data-collapsed="true"] {
  padding-bottom: 5px;
}

.agent-chat-side-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.agent-chat-collapse-btn {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 4px;
  font-size: 10px;
  font-weight: 900;
  text-align: left;
  text-transform: uppercase;
}

.agent-chat-collapse-btn:hover {
  background: var(--bg-panel-3);
  color: var(--text);
}

.agent-chat-collapse-btn span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-chat-caret {
  color: var(--accent-2);
  font-size: 11px;
  line-height: 1;
}

.agent-chat-section-count {
  min-width: 20px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--bg-panel-3);
  color: var(--muted);
  padding: 1px 5px;
  font-size: 10px;
  text-align: center;
}

.agent-chat-section-count[data-active="true"] {
  border-color: rgba(47, 210, 191, 0.48);
  background: rgba(47, 210, 191, 0.1);
  color: var(--accent-2);
}

.agent-chat-section-body[hidden] {
  display: none;
}

.agent-chat-session-list,
.agent-chat-prompt-list,
.agent-chat-inspector-list {
  display: grid;
  gap: 6px;
}

.agent-chat-session-item,
.agent-chat-prompt-item,
.agent-chat-inspector-check,
.agent-chat-inspector-box {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--bg-panel-3);
  color: var(--text);
  padding: 7px;
  font-size: 11px;
  text-align: left;
}

.agent-chat-session-item,
.agent-chat-prompt-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 6px;
}

.agent-chat-session-item[data-active="true"],
.agent-chat-prompt-item[data-active="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.agent-chat-session-item span,
.agent-chat-prompt-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-chat-session-item small,
.agent-chat-prompt-item small {
  grid-column: 1 / -1;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-chat-session-delete {
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.agent-chat-inspector h4 {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.agent-chat-inspector-heading {
  min-height: 26px;
}

.agent-chat-inspector-check {
  display: flex;
  align-items: center;
  gap: 6px;
}

.agent-chat-side-empty {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.agent-chat-panel[hidden] {
  display: none;
}

.agent-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-panel-2);
}

.agent-chat-header h3,
.agent-chat-header p {
  margin: 0;
}

.agent-chat-header h3 {
  font-size: 14px;
}

.agent-chat-header p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.agent-chat-skills {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  overflow-x: auto;
  overscroll-behavior: contain;
}

.agent-chat-chip {
  min-height: 28px;
  min-width: max-content;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-panel-3);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 800;
}

.agent-chat-messages {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding: 12px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.agent-chat-empty {
  display: grid;
  gap: 7px;
  justify-items: start;
  margin: auto;
  color: var(--muted);
  text-align: left;
}

.agent-chat-empty strong {
  color: var(--text);
  font-size: 14px;
}

.agent-chat-empty code {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-panel-3);
  color: var(--accent-2);
  padding: 4px 7px;
}

.agent-chat-message {
  display: grid;
  gap: 5px;
  max-width: 88%;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--bg-panel-2);
  padding: 9px 10px;
}

.agent-chat-message[data-role="user"] {
  justify-self: end;
  background: var(--accent-soft);
  border-color: rgba(155, 124, 245, 0.36);
}

.agent-chat-message[data-role="assistant"] {
  justify-self: start;
}

.agent-chat-message[data-tone="error"] {
  border-color: rgba(255, 91, 104, 0.42);
  background: var(--danger-soft);
}

.agent-chat-message[data-tone="thinking"] {
  border-color: rgba(47, 210, 191, 0.42);
  background: rgba(47, 210, 191, 0.08);
}

.agent-chat-role {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.agent-chat-content {
  word-break: break-word;
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
}

.agent-chat-content p,
.agent-chat-content ul,
.agent-chat-content ol {
  margin: 0 0 6px;
}

.agent-chat-content p:last-child,
.agent-chat-content ul:last-child,
.agent-chat-content ol:last-child {
  margin-bottom: 0;
}

.agent-chat-content ul,
.agent-chat-content ol {
  padding-left: 18px;
}

.agent-chat-content code {
  border-radius: 4px;
  background: var(--bg-panel-3);
  padding: 1px 4px;
  color: var(--accent-2);
}

.agent-chat-md-heading {
  display: block;
  margin-bottom: 5px;
}

.agent-chat-code-block {
  position: relative;
  margin: 6px 0;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--bg-panel-3);
  overflow: hidden;
}

.agent-chat-code-block pre {
  margin: 0;
  padding: 28px 8px 8px;
  overflow: auto;
}

.agent-chat-code-block code {
  background: transparent;
  padding: 0;
  color: var(--text);
  white-space: pre;
}

.agent-chat-copy-code {
  position: absolute;
  top: 4px;
  right: 4px;
  min-height: 20px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--bg-panel-2);
  color: var(--muted);
  font-size: 10px;
}

.agent-chat-thinking-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  width: max-content;
  min-height: 26px;
  margin-top: 2px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--bg-panel-3);
  color: var(--accent-2);
  padding: 0 9px;
  font-size: 11px;
}

.agent-chat-thinking-toggle:hover:not(:disabled) {
  background: var(--accent-soft);
}

.agent-chat-thinking-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent-2);
  box-shadow: 0 0 0 rgba(47, 210, 191, 0.5);
  animation: agentThinkingPulse 1.1s ease-in-out infinite;
}

@keyframes agentThinkingPulse {
  0% {
    transform: scale(0.82);
    opacity: 0.55;
    box-shadow: 0 0 0 0 rgba(47, 210, 191, 0.34);
  }
  70% {
    transform: scale(1);
    opacity: 1;
    box-shadow: 0 0 0 6px rgba(47, 210, 191, 0);
  }
  100% {
    transform: scale(0.82);
    opacity: 0.55;
    box-shadow: 0 0 0 0 rgba(47, 210, 191, 0);
  }
}

.agent-chat-thinking-details {
  display: grid;
  gap: 5px;
  margin-top: 3px;
}

.agent-chat-thinking-details[hidden] {
  display: none;
}

.agent-chat-thinking-row {
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--bg-panel-3);
  color: var(--muted);
  padding: 5px 7px;
  font-size: 11px;
  line-height: 1.35;
}

.agent-chat-step-block {
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--bg-panel-3);
  padding: 6px 7px;
}

.agent-chat-step-block > span {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-2);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.agent-chat-step-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.agent-chat-step-list li {
  padding-left: 2px;
}

.agent-chat-events {
  display: grid;
  gap: 4px;
  margin-top: 2px;
}

.agent-chat-event {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  min-height: 24px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--bg-panel-3);
  padding: 3px 6px;
}

.agent-chat-event span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.agent-chat-event code {
  overflow: hidden;
  color: var(--accent-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line-soft);
  background: var(--bg-panel-2);
}

.agent-chat-form textarea {
  width: 100%;
  min-height: 48px;
  max-height: 100px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg-input);
  color: var(--text);
  padding: 8px 9px;
}

.agent-chat-form button {
  min-height: 48px;
}

.config-rail {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  min-width: 0;
  border-right: 1px solid var(--line-soft);
  background: var(--bg-app);
}

.rail-scroll {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 10px 14px 16px;
}

.config-section {
  padding: 12px 6px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.collapsible-section {
  padding-top: 6px;
}

.collapse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
}

.section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: #b398ff;
  text-align: left;
  font-size: 12px;
  font-weight: 900;
}

.section-toggle:hover:not(:disabled) {
  background: rgba(155, 124, 245, 0.08);
}

.section-toggle-icon {
  color: var(--muted);
  font-size: 12px;
}

.section-content {
  padding-top: 8px;
}

.collapsible-section.is-collapsed {
  padding-bottom: 6px;
}

.collapsible-section.is-collapsed .section-content {
  display: none;
}

.config-section h3 {
  margin: 0 0 16px;
  color: #b398ff;
  font-size: 15px;
}

.section-subtitle,
.section-label {
  margin: 0 0 10px;
  color: #b398ff;
  font-size: 12px;
  font-weight: 900;
}

.section-label {
  color: var(--muted);
  font-size: 11px;
}

.profile-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  margin-bottom: 10px;
  color: var(--text);
}

.profile-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.status-line {
  min-height: 22px;
  color: var(--muted);
  font-size: 11px;
}

.status-line[data-tone="ok"] {
  color: var(--ok);
}

.status-line[data-tone="error"] {
  color: var(--danger);
}

.small-btn {
  min-width: 102px;
}

.primary-wide {
  width: 100%;
  min-height: 46px;
  margin: 4px 0 14px;
  background: var(--accent);
  font-size: 12px;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 11px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.config-select-heading,
.settings-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.active-value-badge {
  flex: 0 0 auto;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 7px;
  background: var(--bg-panel-2);
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
}

.active-value-badge[data-active="true"] {
  border-color: color-mix(in srgb, var(--ok) 52%, var(--line));
  background: color-mix(in srgb, var(--ok) 14%, transparent);
  color: var(--ok);
}

select.is-active,
input.is-active {
  border-color: color-mix(in srgb, var(--ok) 45%, var(--line));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ok) 14%, transparent);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text);
  outline: none;
}

input[type="checkbox"] {
  width: 24px;
  height: 24px;
  padding: 0;
  accent-color: var(--accent-2);
}

thead input[type="checkbox"] {
  width: 28px;
  height: 28px;
}

input,
select {
  height: 34px;
  padding: 0 11px;
}

textarea {
  min-height: 120px;
  padding: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.button-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.path-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
}

.workflow-stepper {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin: 12px 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-panel);
}

.step {
  display: grid;
  justify-items: center;
  gap: 7px;
  color: var(--muted);
  text-align: center;
}

.step span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.step.active span {
  background: var(--ok);
}

.step b {
  font-size: 10px;
}

.tier-grid,
.mode-grid {
  display: grid;
  gap: 10px;
}

.tier-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 10px;
}

.tier-grid[data-locked="true"] {
  grid-template-columns: 1fr;
}

.aspect-ratio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: -4px 0 12px;
}

.tier-btn,
.aspect-ratio-btn,
.mode-card {
  min-height: 58px;
  border: 2px solid var(--line);
  background: transparent;
  color: var(--text);
}

.tier-btn.active,
.aspect-ratio-btn.active,
.mode-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.tier-btn:disabled {
  cursor: default;
  opacity: 1;
}

.aspect-ratio-btn {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 76px;
  padding: 8px;
}

.aspect-ratio-btn span:not(.aspect-shape) {
  font-size: 13px;
  font-weight: 900;
}

.aspect-ratio-btn small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.aspect-shape {
  display: block;
  border: 2px solid currentColor;
  border-radius: 4px;
  background: var(--bg-subtle);
}

.aspect-shape.landscape {
  width: 38px;
  height: 22px;
}

.aspect-shape.portrait {
  width: 22px;
  height: 38px;
}

.mode-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.asset-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}

.asset-picker-grid button {
  min-height: 32px;
  padding: 0 8px;
  font-size: 11px;
}

.image-subsection {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.018);
  display: grid;
  gap: 8px;
}

.image-subsection[hidden] {
  display: none;
}

.image-subsection-label {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.3px;
}

.image-mode-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.image-mode-btn {
  min-height: 32px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.image-mode-btn:hover {
  border-color: rgba(120, 168, 255, 0.55);
  color: var(--text);
}

.image-mode-btn.active {
  background: linear-gradient(135deg, #2980b9, #3498db);
  color: #fff;
  border-color: #2471a3;
}

/* ---- Slot grid (Material card style) ---------------------------------- */

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
  padding: 4px 0 2px;
}

.slot-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  outline: none;
  cursor: pointer;
  user-select: none;
}

.slot-card-surface {
  position: relative;
  width: 100%;
  border-radius: 12px;
  background: var(--bg-panel-3);
  border: 1px solid var(--line-soft);
  overflow: hidden;
  transition: transform 160ms cubic-bezier(0.2, 0, 0, 1),
              box-shadow 160ms cubic-bezier(0.2, 0, 0, 1),
              border-color 160ms cubic-bezier(0.2, 0, 0, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.slot-grid[data-aspect="landscape"] .slot-card-surface { aspect-ratio: 16 / 9; }
.slot-grid[data-aspect="portrait"] .slot-card-surface { aspect-ratio: 9 / 16; }

.slot-card:hover .slot-card-surface,
.slot-card:focus-visible .slot-card-surface {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32);
  border-color: var(--accent);
}

.slot-card.is-dragover .slot-card-surface {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(47, 210, 191, 0.22);
}

.slot-card-thumb {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 160ms ease-out;
}

.slot-card.is-filled .slot-card-thumb {
  opacity: 1;
}

.slot-card.is-empty .slot-card-surface {
  border-style: dashed;
  border-color: var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0.0));
}

.slot-card-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted-2);
  pointer-events: none;
  transition: color 160ms ease-out;
}

.slot-card.is-filled .slot-card-empty {
  display: none;
}

.slot-card:hover .slot-card-empty {
  color: var(--accent);
}

.slot-card-empty-icon {
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px dashed currentColor;
}

.slot-card-empty-label {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.slot-card-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: rgba(20, 16, 32, 0.72);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  letter-spacing: 0.02em;
}

.slot-card-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: rgba(20, 16, 32, 0.72);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 140ms ease-out, transform 140ms ease-out, background 140ms ease-out;
}

.slot-card.is-filled:hover .slot-card-remove,
.slot-card.is-filled:focus-within .slot-card-remove {
  opacity: 1;
  transform: scale(1);
}

.slot-card-remove:hover {
  background: var(--danger);
}

.slot-card-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 8px 6px;
  font-size: 11px;
  color: var(--text);
  background: linear-gradient(180deg, rgba(20, 16, 32, 0) 0%, rgba(20, 16, 32, 0.88) 100%);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease-out;
}

.slot-card.is-filled .slot-card-caption {
  opacity: 1;
}

.slot-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 16, 32, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease-out;
}

.slot-card.is-uploading .slot-card-overlay,
.slot-card.is-done .slot-card-overlay,
.slot-card.is-error .slot-card-overlay {
  opacity: 1;
}

.slot-card-overlay-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.slot-card.is-uploading .slot-card-overlay-icon {
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: var(--accent);
  animation: slot-card-spin 720ms linear infinite;
}

.slot-card.is-done .slot-card-overlay-icon {
  background: var(--ok);
}
.slot-card.is-done .slot-card-overlay-icon::after {
  content: "✓";
  color: #0b1f17;
}

.slot-card.is-error .slot-card-overlay-icon {
  background: var(--danger);
}
.slot-card.is-error .slot-card-overlay-icon::after {
  content: "!";
  color: #2a0a0d;
}

.slot-card.is-error .slot-card-surface {
  border-color: var(--danger);
}

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

.slot-progress {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin-top: 2px;
}

.slot-progress.is-hidden {
  visibility: hidden;
}

.slot-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

.slot-progress[data-tone="ok"] .slot-progress-bar {
  background: var(--ok);
}

.slot-progress[data-tone="error"] .slot-progress-bar {
  background: var(--danger);
}

.slot-progress-label {
  position: absolute;
  inset: 0;
  display: none;
}

.getid-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0 0;
}

.getid-btn {
  min-height: 30px;
  min-width: 110px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 900;
  color: #fff;
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  letter-spacing: 0.4px;
  transition: filter 0.15s ease;
}

.getid-btn:hover:not(:disabled) {
  filter: brightness(1.1);
}

.getid-btn:disabled {
  background: #95a5a6 !important;
  border-color: #7f8c8d !important;
  color: #ecf0f1 !important;
  cursor: progress;
}

.getid-btn-start {
  background: linear-gradient(90deg, #2980b9, #3498db);
  border-color: #2471a3;
}

.getid-btn-end {
  background: linear-gradient(90deg, #8e44ad, #9b59b6);
  border-color: #7d3c98;
}

.getid-btn-segment {
  background: linear-gradient(90deg, #27ae60, #2ecc71);
  border-color: #1e8449;
}

.getid-status {
  flex: 1;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.getid-status[data-tone="ok"] {
  color: #2ecc71;
}

.getid-status[data-tone="error"] {
  color: #ff8a91;
}

.refs-cell {
  text-align: center;
  vertical-align: middle;
  padding: 4px;
}

.refs-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  align-items: center;
  max-height: 92px;
  overflow: auto;
  overscroll-behavior: contain;
}

.ref-thumb {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.04);
}

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

.ref-thumb[data-reference-state="unavailable"] {
  display: grid;
  place-items: center;
  border-style: dashed;
  color: var(--muted-2);
}

.ref-thumb-unavailable {
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.ref-thumb-tag {
  position: absolute;
  left: 1px;
  bottom: 1px;
  font-size: 8px;
  font-weight: 900;
  padding: 0 3px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  letter-spacing: 0.3px;
}

.ref-thumb-tag[data-kind="start"] { background: rgba(41, 128, 185, 0.85); }
.ref-thumb-tag[data-kind="end"] { background: rgba(142, 68, 173, 0.85); }
.ref-thumb-tag[data-kind="segment"] { background: rgba(39, 174, 96, 0.85); }

.refs-empty {
  font-size: 11px;
  color: var(--muted-2);
}

.asset-summary {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.add-footer {
  padding: 10px 14px 12px;
  border-top: 1px solid var(--line-soft);
  background: #181326;
  box-shadow: 0 -12px 26px rgba(0, 0, 0, 0.2);
}

.add-queue-btn {
  flex: 1;
  min-height: 50px;
}

.reset-btn {
  width: 104px;
  min-height: 50px;
}

.warning-line {
  display: none;
  margin-top: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--bg-panel-2);
  color: var(--muted);
  place-items: center;
  font-weight: 900;
}

.warning-line.visible { display: grid; }
.warning-line[data-tone="warn"],
.warning-line[data-tone="error"] {
  border-color: rgba(255, 91, 104, 0.35);
  background: var(--danger-soft);
  color: #ff8a91;
}
.warning-line[data-tone="ok"] {
  border-color: rgba(72, 219, 151, 0.35);
  background: rgba(72, 219, 151, 0.1);
  color: #7ff0be;
}
.warning-line[data-tone="neutral"] {
  border-color: var(--line-soft);
  background: var(--bg-panel-2);
  color: var(--muted);
}

.queue-workspace {
  position: relative;
  display: grid;
  grid-template-rows: 50px minmax(0, 1fr) 62px 154px;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  padding: 0 10px;
}

.queue-workspace.logs-collapsed {
  grid-template-rows: 50px minmax(0, 1fr) 62px 31px;
}

.queue-toolbar {
  display: grid;
  grid-template-columns: 36px 46px 46px 46px 84px 72px minmax(220px, 1fr) 120px;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.run-btn, .poll-btn { background: var(--accent-2); color: #061b1b; }
.run-btn:hover:not(:disabled), .poll-btn:hover:not(:disabled) { background: var(--accent-2-strong); }
.toggle-btn.active { border-color: var(--accent); color: var(--accent-2); }

.search-input,
.status-filter {
  height: 40px;
  background: var(--bg-panel-2);
}

.queue-surface {
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: auto;
  overflow-x: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border: 1px solid var(--line-soft);
  background: var(--bg-panel-3);
}

.queue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  padding: 14px;
}

.queue-grid[hidden] {
  display: none !important;
}

/* When the queue is in grid view, suppress the table chrome entirely. */
.queue-surface[data-view-mode="grid"] table,
.queue-surface[data-view-mode="grid"] thead,
table.is-grid-mode,
table.is-grid-mode thead {
  display: none !important;
}

.task-card {
  display: grid;
  grid-template-rows: auto auto auto auto;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-panel-2);
  padding: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  transition: transform 160ms cubic-bezier(0.2, 0, 0, 1),
              box-shadow 160ms cubic-bezier(0.2, 0, 0, 1),
              border-color 160ms cubic-bezier(0.2, 0, 0, 1);
}

.task-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  border-color: rgba(155, 124, 245, 0.55);
}

.task-card[data-status="error"] {
  border-color: rgba(255, 91, 104, 0.55);
}

.task-card[data-status="completed"] {
  border-color: rgba(54, 217, 154, 0.45);
}

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

.task-card-headline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.task-card-select {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.task-card-id {
  font-weight: 900;
  font-size: 13px;
  color: var(--text);
  letter-spacing: 0.02em;
}

.task-card-headline .status-badge {
  margin-left: auto;
  font-size: 10px;
}

.task-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.task-chip {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  max-width: 100%;
  text-overflow: ellipsis;
  overflow: hidden;
}

.task-chip[data-variant="tier"] {
  background: var(--accent-soft);
  border-color: rgba(155, 124, 245, 0.4);
  color: var(--accent);
}

.task-chip[data-variant="aspect"] {
  background: rgba(47, 210, 191, 0.14);
  border-color: rgba(47, 210, 191, 0.34);
  color: var(--accent-2);
}

.task-chip[data-variant="retry"] {
  background: var(--warn-soft);
  border-color: rgba(255, 201, 77, 0.4);
  color: var(--warn);
}

.task-chip[data-variant="provider-grok"],
.provider-badge-grok {
  background: rgba(24, 24, 27, 0.82);
  border-color: rgba(255, 255, 255, 0.22);
  color: #f4f4f5;
}

.provider-badge {
  border: 1px solid var(--line-soft);
}

.task-card-media {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #080c14;
  aspect-ratio: 16 / 9;
  width: 100%;
}

.task-card[data-aspect="portrait"] .task-card-media {
  aspect-ratio: 16 / 9;
  background: #080c14;
}
.task-card[data-aspect="portrait"] .task-card-media .output-ready,
.task-card[data-aspect="portrait"] .task-card-media .output-preview {
  display: flex;
  align-items: center;
  justify-content: center;
}

.task-card[data-aspect="portrait"] .task-card-media .output-thumb,
.task-card-media .output-thumb.portrait-thumb {
  position: relative !important;
  inset: auto !important;
  width: auto !important;
  height: 100% !important;
  aspect-ratio: 9 / 16 !important;
  max-width: 60% !important;
  margin: 0 auto !important;
  display: block !important;
  border-radius: 4px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.task-card-media > * { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; }
.task-card-media .output-ready,
.task-card-media .output-preview,
.task-card-media .output-thumb { border-radius: 10px; }
.task-card-media .output-ready { display: block; height: 100%; align-content: stretch; }

.task-card-media .output-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border: 0;
  padding: 0;
  background: #080c14;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}

.task-card-media .output-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  transition: transform 0.25s ease;
}

.task-card:hover .output-thumb {
  transform: scale(1.02);
}

.task-card-media .output-waiting {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  gap: 6px;
  background: linear-gradient(135deg, rgba(155, 124, 245, 0.08), rgba(47, 210, 191, 0.06));
}

.task-card-media .error-note {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  background: rgba(255, 91, 104, 0.08);
}

.task-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.task-card-prompt {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line-soft);
}

.task-card-error {
  font-size: 11px;
  line-height: 1.4;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255, 91, 104, 0.08);
  border: 1px solid rgba(255, 91, 104, 0.28);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-card-body .refs-stack {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.task-card-body .refs-empty {
  font-size: 10px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.task-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}

.task-card-actions-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.task-card-actions-hint {
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.task-card-actions-toggle {
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 140ms ease-out, color 140ms ease-out, border-color 140ms ease-out, transform 160ms ease-out;
}

.task-card-actions-toggle:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.task-card-actions[data-expanded="true"] .task-card-actions-toggle {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.task-card-actions-drawer[hidden] {
  display: none !important;
}

.task-card-actions-drawer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line-soft);
  animation: task-card-drawer-in 160ms cubic-bezier(0.2, 0, 0, 1);
}

@keyframes task-card-drawer-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.task-card-actions-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.task-card-actions-group-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.task-card-actions-group .action-stack {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  max-height: none;
  justify-content: flex-start;
}

.task-card-actions-group .icon-btn {
  flex: 0 0 auto;
}

table {
  display: block;
  width: 100%;
  min-width: var(--queue-table-min-width);
  border-collapse: collapse;
  table-layout: fixed;
}

thead,
tbody {
  display: grid;
  align-content: start;
  width: 100%;
}

tbody {
  grid-auto-rows: auto;
}

thead tr,
tbody tr {
  display: grid;
  grid-template-columns: 56px 64px minmax(240px, 0.9fr) minmax(260px, 1.15fr) minmax(240px, 1.05fr) 150px 96px 76px;
  width: 100%;
}

thead tr {
  position: sticky;
  top: 0;
  z-index: 2;
}

thead th {
  height: 58px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--muted);
  text-align: center;
  font-size: 10px;
  font-weight: 900;
}

.sort-header {
  width: 100%;
  min-height: 30px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}


.sort-header:hover:not(:disabled),
.sort-header.active {
  background: rgba(155, 124, 245, 0.16);
  color: var(--text);
}

th,
td {
  display: block;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  vertical-align: top;
  overflow: hidden;
  overflow-wrap: anywhere;
}

tbody tr {
  min-height: 164px;
  overflow: hidden;
  background: #1b1629;
}

tbody tr:not(.extend-sub-row) {
  height: 164px;
  max-height: 164px;
}

tbody tr[data-status="running"] {
  background: #171f2d;
}

tbody tr[data-status="queued"] {
  background: #1d1a2c;
}

tbody tr[data-status="completed"] {
  background: #14231f;
}

tbody tr[data-status="error"] {
  background: #261820;
}

.select-col,
.stt-col,
.task-col,
.prompt-col,
.output-col,
.refs-col,
.extend-col,
.actions-col {
  width: 100%;
}

.select-cell,
.stt-cell,
.refs-cell {
  text-align: center;
  vertical-align: middle;
}

.select-col,
.select-cell,
.stt-col,
.stt-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-inline: 6px;
}

.select-col input[type="checkbox"],
.select-cell input[type="checkbox"] {
  flex: 0 0 auto;
  margin: 0;
}

.task-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.task-cell {
  min-width: 0;
}

.task-meta {
  margin-top: 6px;
  display: grid;
  gap: 2px;
  max-height: 66px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.task-meta span::before {
  content: "↯ ";
  color: var(--muted-2);
}

.task-meta .provider-badge::before {
  content: "";
}

.task-meta span:nth-child(2)::before {
  content: "◺ ";
}

.task-meta span:nth-child(3)::before {
  content: "🎬 ";
}

.prompt-box {
  height: 104px;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 2px solid var(--accent);
  border-radius: 6px;
  padding: 12px;
  color: var(--text);
  background: #211a31;
  font-size: 11px;
}

.output-waiting {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  height: 104px;
  min-height: 0;
  overflow: hidden;
  border: 3px dashed #30475d;
  border-radius: 10px;
  color: var(--muted-2);
  background: #101827;
  text-align: center;
  font-weight: 800;
}

.output-icon {
  font-size: 18px;
  line-height: 1;
  opacity: 0.72;
}

.output-ready,
.error-note {
  position: relative;
  display: grid;
  height: 104px;
  min-height: 0;
  overflow: hidden;
  align-content: start;
}

.output-download-link {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(10, 14, 24, 0.88);
  color: var(--text);
  font-size: 10px;
  font-weight: 900;
  text-decoration: none;
}

.output-preview {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090e18;
  cursor: pointer;
}

.output-preview.is-portrait {
  display: flex;
  align-items: center;
  justify-content: center;
}

.output-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #090e18;
}

.output-preview-label {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(10, 14, 24, 0.78);
  color: var(--text);
  font-size: 10px;
  font-weight: 900;
}

.output-path {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.error-note {
  color: #ff9aa3;
}

.action-stack {
  display: grid;
  justify-content: center;
  gap: 6px;
  max-height: 168px;
  overflow: hidden;
}

.action-stack .icon-btn {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  height: 32px;
  padding: 0;
  color: #d7cff4;
  font-size: 12px;
}

.queue-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
}

.queue-footer button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 11px;
  white-space: nowrap;
}

.page-label {
  min-width: 54px;
  text-align: center;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.empty-state {
  position: absolute;
  inset: 80px 0 auto;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
  pointer-events: none;
}

.empty-state[hidden] {
  display: none;
}

.log-dock {
  min-height: 0;
  overflow: hidden;
  border-top: 1px solid var(--line);
  background: #0f0f18;
}

.log-dock header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 31px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--muted);
  padding: 0 14px;
  font-weight: 900;
}

.log-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.log-toggle-btn {
  display: inline-grid;
  place-items: center;
  width: 24px;
  min-width: 24px;
  min-height: 22px;
  padding: 0;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1;
}

.log-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.log-dock header button {
  min-height: 26px;
  background: transparent;
  color: var(--muted);
  padding: 0 8px;
  font-size: 10px;
}

.log-search-input,
.log-tone-filter {
  height: 24px;
  border-radius: 6px;
  background: var(--bg-panel-3);
  color: var(--muted);
  font-size: 10px;
}

.log-search-input {
  width: 180px;
}

.log-tone-filter {
  width: 104px;
  padding: 0 6px;
}

.log-body {
  display: block;
  width: 100%;
  height: calc(100% - 31px);
  min-width: 0;
  min-height: 0;
  resize: none;
  overflow: auto;
  overscroll-behavior: contain;
  border: 0;
  outline: none;
  padding: 10px 16px;
  background: transparent;
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  line-height: 1.65;
  white-space: pre;
}

.queue-workspace.logs-collapsed .log-body {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.toggle-btn.active,
.run-btn.active,
.poll-btn.active {
  background: var(--accent);
  border-color: var(--accent-strong);
  color: #fff;
}

button.is-busy {
  opacity: 0.7;
  cursor: progress;
}

.task-progress-stack {
  display: grid;
  gap: 4px;
  margin-top: 6px;
}

.task-progress-row {
  display: grid;
  grid-template-columns: 54px minmax(56px, 1fr) 34px;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.task-progress-label,
.task-progress-value {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.task-progress-value {
  text-align: right;
}

.task-progress {
  height: 4px;
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 99px;
  overflow: hidden;
}

.task-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 200ms ease-out;
}

.task-progress-bar[data-status="error"] {
  background: var(--danger);
}

.task-progress-bar[data-status="completed"] {
  background: var(--ok);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-panel-2);
  color: var(--muted);
  border: 1px solid var(--line);
}

.status-badge[data-status="running"] {
  background: rgba(88, 166, 255, 0.18);
  border-color: rgba(88, 166, 255, 0.4);
  color: var(--blue-text);
}

.status-badge[data-status="completed"] {
  background: rgba(54, 217, 154, 0.16);
  border-color: rgba(54, 217, 154, 0.4);
  color: var(--ok-text);
}

.status-badge[data-status="error"] {
  background: var(--danger-soft);
  border-color: rgba(255, 91, 104, 0.45);
  color: var(--danger-text);
}

.status-badge[data-status="pending"] {
  background: var(--warn-soft);
  border-color: rgba(255, 201, 77, 0.45);
  color: var(--warn-text);
}

.status-badge[data-status="queued"] {
  background: rgba(176, 132, 255, 0.18);
  border-color: rgba(176, 132, 255, 0.45);
  color: var(--queued-text);
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.task-meta span {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--bg-panel-3);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.task-error-line {
  margin-top: 4px;
  color: var(--danger-text);
  font-size: 10px;
  font-weight: 700;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  display: grid;
  place-items: center;
  z-index: 99;
}

.dialog-backdrop[hidden] {
  display: none;
}

.dialog-card {
  width: min(640px, 90vw);
  max-height: 80vh;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  padding: 16px 18px;
}

.dialog-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 8px;
}

.dialog-card header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 900;
}

.dialog-card textarea {
  min-height: 220px;
  width: 100%;
  resize: vertical;
  background: var(--bg-panel-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}

.dialog-card footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.video-preview-card {
  width: min(980px, 92vw);
  max-height: 88vh;
  transition: width 0.25s ease;
}

.video-preview-card[data-aspect="portrait"] {
  width: min(440px, 92vw);
}

.video-preview-card video {
  display: block;
  width: 100%;
  max-height: 68vh;
  aspect-ratio: 16 / 9;
  background: #050712;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
}

.video-preview-card[data-aspect="portrait"] video {
  aspect-ratio: 9 / 16;
  max-height: 72vh;
}

.update-card {
  width: min(540px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
  padding: 0;
  overflow: hidden;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.update-window-bar {
  position: relative;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-panel-3);
  color: var(--text);
  border-bottom: 1px solid var(--line);
}

.update-window-controls {
  position: absolute;
  left: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mac-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgb(0 0 0 / 25%);
}

.mac-dot.red {
  background: #ff5f57;
}

.mac-dot.yellow {
  background: #febc2e;
}

.mac-dot.green {
  background: #28c840;
}

.update-window-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.2px;
  color: var(--text-muted, #b8b1c9);
}

.update-window-close {
  position: absolute;
  right: 6px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted, #b8b1c9);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.update-window-close:hover {
  background: rgb(255 255 255 / 8%);
  color: var(--text);
}

.update-body {
  display: grid;
  gap: 14px;
  min-height: 0;
  overflow: auto;
  padding: 18px 18px 12px;
}

.update-title {
  margin: 0;
}

.update-version-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
}

.update-version-card {
  min-height: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  padding: 14px 10px;
  border-radius: 10px;
  background: var(--bg-panel-3);
  border: 1px solid var(--line);
}

.update-version-label {
  color: var(--text-muted, #a89fbf);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.update-version-number {
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.update-version-arrow {
  align-self: center;
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  line-height: 1;
}

.update-status-line {
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.update-status-line[data-tone="ok"] {
  color: var(--accent-2);
}

.update-status-line[data-tone="warn"] {
  color: #ffd58c;
}

.update-status-line[data-tone="error"] {
  color: #ff9aa3;
}

.update-progress-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
}

.update-progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg-panel-3);
  border: 1px solid var(--line);
}

.update-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.16s ease;
}

.update-progress-text {
  color: var(--text-muted, #a89fbf);
  font-size: 11px;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.update-changelog-title {
  color: var(--text-muted, #b8b1c9);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.update-changelog-list {
  min-height: 80px;
  max-height: 26vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-panel-3);
  color: var(--text-muted, #b8b1c9);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.update-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line);
}

.update-primary-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
}

.update-check-btn,
.update-support-btn {
  min-width: 0;
  min-height: 34px;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: normal;
  overflow-wrap: anywhere;
}

.update-check-btn {
  border: 0;
  background: var(--accent);
  color: #ffffff;
}

.update-check-btn:hover {
  background: var(--accent-strong);
}

.update-support-btn {
  border: 1px solid var(--accent-2);
  background: transparent;
  color: var(--accent-2);
}

.update-support-btn:hover {
  background: rgb(47 210 191 / 12%);
}

.update-secondary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: min(232px, 100%);
  min-width: 0;
}

.update-secondary-actions .secondary {
  min-width: 0;
  min-height: 28px;
  margin: 0;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 480px) {
  .update-body {
    padding: 14px 14px 10px;
  }

  .update-actions {
    grid-template-columns: 1fr;
    padding: 10px 14px 14px;
  }

  .update-version-grid,
  .update-primary-actions {
    grid-template-columns: 1fr;
  }

  .update-version-arrow {
    transform: rotate(90deg);
  }

  .update-secondary-actions {
    width: 100%;
  }
}

.project-manager-card {
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 56px);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 0;
  padding: 0;
  overflow: hidden;
  background: #2b2540;
  border-color: #514969;
  border-radius: 14px;
}

.project-manager-header {
  min-height: 72px;
  padding: 16px 20px;
  border-bottom: 1px solid #514969;
}

.dialog-card header.project-manager-header h3 {
  font-size: 18px;
  line-height: 1.1;
}


.project-manager-header p {
  margin: 5px 0 0;
  color: #c3b9d7;
  font-size: 12px;
  font-weight: 900;
}

.project-manager-close {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 34px;
  border-radius: 8px;
  background: #262139;
  border: 1px solid #514969;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
}

.project-manager-create {
  padding: 14px 20px;
  border-bottom: 1px solid #514969;
}

.project-manager-create-title {
  margin-bottom: 8px;
  color: #c3b9d7;
  font-size: 13px;
  font-weight: 900;
}

.project-manager-create-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px 150px;
  gap: 10px;
}

.project-manager-create-row input {
  min-height: 38px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
}

.project-manager-create-row button {
  min-height: 38px;
  margin: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
}

.project-manager-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px 0;
}

.project-manager-tab {
  min-height: 34px;
  min-width: 112px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid #514969;
  border-radius: 8px;
  background: #262139;
  color: #c3b9d7;
  font-size: 12px;
  font-weight: 900;
}

.project-manager-tab.is-active {
  border-color: #00dfcb;
  background: #133d38;
  color: var(--text);
}

.project-manager-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding: 12px 20px 16px;
}

.project-manager-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 112px auto;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 10px;
  border: 1px solid #38324e;
  border-radius: 8px;
  background: #241f36;
}

.project-manager-row.is-active {
  border-color: #00dfcb;
  background: #133d38;
}

.project-manager-marker {
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
  text-align: center;
}

.project-manager-copy {
  min-width: 0;
}

.project-manager-title {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-manager-meta {
  display: none;
}

.project-manager-date {
  color: #c3b9d7;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

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

.project-manager-action {
  min-height: 32px;
  min-width: 54px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
}

.project-manager-action.danger {
  border-color: #b83a4b;
  color: #ff8d9a;
}

.project-manager-empty {
  display: grid;
  place-items: center;
  min-height: 120px;
  border: 1px dashed #514969;
  border-radius: 8px;
  color: #c3b9d7;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.project-manager-footer {
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid #514969;
}

.project-manager-pagination,
.project-manager-footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-manager-footer button {
  min-height: 34px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
}

.project-manager-pagination span {
  color: #c3b9d7;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .project-manager-create-row,
  .project-manager-footer {
    grid-template-columns: 1fr;
  }

  .project-manager-row {
    grid-template-columns: 24px minmax(0, 1fr) auto;
  }

  .project-manager-date {
    display: none;
  }
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.extension-section-header {
  justify-content: space-between;
  align-items: flex-start;
}

.extension-section-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.icon-text-btn {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 6px;
}

.profile-pro-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-pro-section[hidden] {
  display: none;
}

.profile-pro-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-pro-status .status-pill {
  width: 100%;
  max-width: 100%;
  text-align: center;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--bg-panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-pro-status .status-pill[data-tone="ok"] {
  background: rgba(54, 217, 154, 0.16);
  border-color: rgba(54, 217, 154, 0.45);
  color: #a7f0ce;
}

.profile-pro-status .status-pill[data-tone="error"] {
  background: var(--danger-soft);
  border-color: rgba(255, 91, 104, 0.45);
  color: #ff9aa3;
}

.connection-status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 8px 0 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.connection-status-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.connection-status-icon {
  font-size: 13px;
  line-height: 1;
}

.connection-status-legend-item[data-tone="connected"] .connection-status-icon {
  color: #22C55E;
}

.connection-status-legend-item[data-tone="pending"] .connection-status-icon {
  color: #FACC15;
}

.connection-status-legend-item[data-tone="disconnected"] .connection-status-icon {
  color: #FF5B68;
}

.launch-bridge-btn {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-weight: 900;
}

.launch-bridge-btn[hidden] {
  display: none;
}

.profile-pro-hint {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.profile-pro-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-pro-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-panel-2);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-pro-card[data-tone="success"] {
  border-color: rgba(54, 217, 154, 0.45);
  background: rgba(54, 217, 154, 0.08);
}

.profile-pro-card[data-tone="primary"] {
  border-color: rgba(155, 124, 245, 0.45);
}

.profile-pro-card[data-tone="info"] {
  border-color: rgba(88, 166, 255, 0.45);
}

.profile-pro-card .pp-credit-progress {
  position: relative;
  height: 4px;
  width: 100%;
  background: rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}

.profile-pro-card .pp-credit-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #FACC15, #F59E0B);
  border-radius: 999px;
  transition: width 350ms ease-out;
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.6);
}

.profile-pro-card .pp-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-pro-card .pp-source-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--bg-panel-3);
  font-size: 13px;
}

.profile-pro-card .pp-name {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 12px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-pro-card .pp-active-pill {
  padding: 1px 6px;
  border-radius: 99px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.06em;
  background: var(--accent);
  color: #fff;
}

.profile-pro-card .pp-dot {
  font-size: 12px;
}

.profile-pro-card .pp-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.profile-pro-card .pp-meta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--bg-panel-3);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.profile-pro-card .pp-badge {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-panel-3);
  border: 1px solid var(--line);
  color: var(--muted);
}

.profile-pro-card .pp-badge[data-tone="success"] {
  background: rgba(54, 217, 154, 0.18);
  border-color: rgba(54, 217, 154, 0.45);
  color: #a7f0ce;
}

.profile-pro-card .pp-badge[data-tone="primary"] {
  background: rgba(155, 124, 245, 0.2);
  border-color: rgba(155, 124, 245, 0.45);
  color: #d7c8ff;
}

.profile-pro-card .pp-badge[data-tone="info"] {
  background: rgba(88, 166, 255, 0.18);
  border-color: rgba(88, 166, 255, 0.45);
  color: #c8e4ff;
}

.profile-pro-card .pp-badge[data-tone="danger"] {
  background: var(--danger-soft);
  border-color: rgba(255, 91, 104, 0.5);

  color: #ff9aa3;
}

.profile-pro-card .pp-meta.pp-ttl[data-ttl-state="ok"] {
  background: rgba(54, 217, 154, 0.14);
  border-color: rgba(54, 217, 154, 0.4);
  color: #a7f0ce;
}

.profile-pro-card .pp-meta.pp-ttl[data-ttl-state="warn"] {
  background: var(--warn-soft);
  border-color: rgba(255, 201, 77, 0.45);
  color: #ffe58a;
}

.profile-pro-card .pp-meta.pp-ttl[data-ttl-state="expired"] {
  background: var(--danger-soft);
  border-color: rgba(255, 91, 104, 0.5);
  color: #ff9aa3;
  font-weight: 700;
}

.profile-pro-card .pp-cookie-row {
  min-width: 0;
  padding: 4px 6px;
  border: 1px solid rgba(88, 166, 255, 0.24);
  border-radius: 6px;
  background: rgba(88, 166, 255, 0.09);
  color: #c8e4ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-pro-card .pp-action-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.profile-pro-card .pp-action-row button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.profile-pro-card .pp-action-row .pp-link-btn {
  flex: 1;
  text-align: left;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
}

/* Generate Now One-Click Button */
.generate-now-btn {
  background: linear-gradient(135deg, #7c3aed 0%, #3b82f6 100%) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.35) !important;
  transition: all 0.2s ease !important;
}
.generate-now-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.5) !important;
  filter: brightness(1.08);
}
.generate-now-btn:active:not(:disabled) {
  transform: translateY(0);
}

/* Quick Start Onboarding Card in Empty Queue */
.quick-start-card {
  max-width: 720px;
  margin: 32px auto;
  padding: 24px;
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  text-align: left;
}
.quick-start-header {
  margin-bottom: 20px;
}
.quick-start-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.25), rgba(59, 130, 246, 0.25));
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.quick-start-header h3 {
  margin: 0 0 6px 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-main, #f8fafc);
}
.quick-start-header p {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-dim, #94a3b8);
}
.quick-start-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.quick-start-step {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  transition: border-color 0.2s;
}
.quick-start-step:hover {
  border-color: rgba(139, 92, 246, 0.4);
}
.quick-start-step .step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #6366f1;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  margin-bottom: 10px;
}
.quick-start-step .step-info h4 {
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-main, #f1f5f9);
}
.quick-start-step .step-info p {
  margin: 0 0 14px 0;
  font-size: 12px;
  color: var(--color-text-dim, #94a3b8);
  line-height: 1.4;
}
.quick-start-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
  cursor: pointer;
  transition: all 0.15s;
}
.quick-start-action-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.quick-start-action-btn.primary {
  background: #6366f1;
  border-color: #818cf8;
}
.quick-start-action-btn.primary:hover {
  background: #4f46e5;
}

/* Auth Help Note */
.auth-help-note {
  margin-top: 14px;
  font-size: 12px;
  color: var(--color-text-dim, #94a3b8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.auth-help-note a {
  color: #818cf8;
  text-decoration: underline;
  cursor: pointer;
}

/* Dashboard Start CTA Button */
.dashboard-start-btn {
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.dashboard-start-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Scan Profile Empty Steps */
.scan-empty-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0 18px 0;
  max-width: 440px;
  text-align: left;
}
.scan-empty-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--color-text-main, #e2e8f0);
}
.scan-empty-step span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.3);
  border: 1px solid rgba(99, 102, 241, 0.6);
  color: #a5b4fc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.scan-empty-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* Friendly Task Card Error */
.task-card-error-friendly {
  border-left: 3px solid #ef4444;
  padding: 6px 8px;
  background: rgba(239, 68, 68, 0.12);
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.4;
  color: #fca5a5;
  margin-top: 6px;
}
.task-card-error-tip {
  display: block;
  font-weight: 600;
  color: #fecaca;
  margin-top: 3px;
}


.profile-pro-card .pp-action-row .pp-link-btn[data-linked="true"] {
  background: rgba(54, 217, 154, 0.18);
  border-color: rgba(54, 217, 154, 0.45);
  color: #a7f0ce;
}

.profile-pro-card .pp-action-row .pp-restart-btn {
  justify-content: center;
  text-align: center;
  color: #ffd7a8;
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.14);
}

.profile-pro-card .pp-action-row .pp-restart-btn:disabled {
  cursor: wait;
  opacity: 0.75;
}

.profile-pro-card .pp-icon-btn {
  width: 28px;
  min-width: 28px;
  padding: 0;
  font-size: 13px;
}

.profile-pro-card .pp-icon-btn.danger {
  background: var(--danger-soft);
  border-color: rgba(255, 91, 104, 0.45);
  color: #ff9aa3;
}

.profile-pro-card.is-active {
  outline: 2px solid var(--accent);
  outline-offset: 0;
}

.profile-pro-count {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.compact-field {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.compact-field input {
  min-height: 30px;
  font-size: 11px;
}

@media (max-width: 1280px) {
  .app-shell {
    grid-template-columns: 190px minmax(0, 1fr);
    min-width: 1024px;
  }

  .work-area {
    grid-template-columns: 372px minmax(0, 1fr);
  }

  .work-area.config-rail-collapsed {
    grid-template-columns: 0 minmax(0, 1fr);
  }

  .brand h1 {
    font-size: 17px;
  }

  .nav-item {
    padding-left: 22px;
    font-size: 11px;
  }
}


/* Inline extend sub-rows (chain history + drafts + bulk paste) */
tbody tr.extend-sub-row {
  min-height: 56px;
  max-height: none;
  height: auto;
  background: rgba(155, 124, 245, 0.05);
  border-left: 3px solid rgba(155, 124, 245, 0.45);
}

tbody tr.extend-sub-row[data-status="running"] {
  background: rgba(244, 211, 94, 0.08);
  border-left-color: #f4d35e;
}

tbody tr.extend-sub-row[data-status="completed"] {
  background: rgba(95, 215, 120, 0.06);
  border-left-color: #5fd778;
}

tbody tr.extend-sub-row[data-status="error"] {
  background: rgba(255, 119, 119, 0.06);
  border-left-color: #ff7777;
}

tbody tr.extend-sub-row[data-status="queued"] {
  background: rgba(155, 124, 245, 0.04);
  border-left-color: rgba(155, 124, 245, 0.25);
  opacity: 0.85;
}

tbody tr.extend-sub-row[data-status="draft"] {
  background: rgba(255, 255, 255, 0.02);
  border-left-style: dashed;
}

.extend-indent-cell {
  text-align: center;
  color: rgba(155, 124, 245, 0.7);
  font-size: 16px;
  line-height: 1;
}

.extend-stt-label {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
}

.extend-stt-label.extend-stt-running {
  background: rgba(244, 211, 94, 0.18);
  color: #f4d35e;
  font-weight: 700;
}

.extend-task-cell .extend-child-title {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.78);
  white-space: nowrap;
}

.extend-child-progress {
  margin-top: 6px;
}

.extend-prompt-box {
  height: auto;
  min-height: 32px;
  max-height: 96px;
  font-size: 12px;
  white-space: pre-wrap;
  background: rgba(0, 0, 0, 0.18);
  padding: 6px 8px;
  border-radius: 6px;
}

.extend-queued-prompt {
  font-style: italic;
  color: rgba(255, 255, 255, 0.6);
}

.extend-draft-textarea {
  width: 100%;
  min-height: 48px;
  resize: vertical;
  font-family: inherit;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.22);
  color: inherit;
  border: 1px solid rgba(155, 124, 245, 0.3);
  border-radius: 8px;
  padding: 6px 8px;
}

.extend-bulk-cell {
  padding: 6px 10px;
}

.extend-bulk-textarea {
  width: 100%;
  resize: vertical;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
  font-size: 12px;
  background: rgba(0, 0, 0, 0.28);
  color: inherit;
  border: 1px dashed rgba(155, 124, 245, 0.5);
  border-radius: 8px;
  padding: 8px 10px;
}

.extend-output-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.extend-row-error {
  font-size: 11px;
  color: #ff9b9b;
  word-break: break-word;
}

.action-stack {
  flex-wrap: wrap;
  max-width: 70px;
}

.icon-btn.active {
  background: rgba(155, 124, 245, 0.22);
  border-color: rgba(155, 124, 245, 0.55);
  color: #d8caff;
}

.extend-post-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
}

.extend-post-cell .icon-btn {
  font-size: 11px;
  padding: 2px 6px;
}

.extend-post-progress {
  flex: 1 1 100%;
  margin-top: 4px;
}

/* ── Dashboard view ─────────────────────────────────────────────── */
.dashboard-view {
  grid-row: 2 / span 2;
  min-width: 0;
  min-height: 0;
  background: var(--bg-app);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dashboard-view[hidden] {
  display: none;
}

.dashboard-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dashboard-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0 8px;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
}

.dashboard-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.dashboard-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.dashboard-actions {
  position: absolute;
  top: 4px;
  right: 0;
  display: flex;
  gap: 8px;
}

.dashboard-action-btn {
  min-width: 0;
  background: var(--bg-panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.dashboard-action-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.dashboard-action-danger {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-soft);
}

.dashboard-auto-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dashboard-auto-refresh[aria-pressed="true"] {
  border-color: var(--accent-2);
  background: rgba(47, 210, 191, 0.12);
  color: var(--accent-2);
}

.dashboard-auto-refresh[aria-pressed="false"] {
  opacity: 0.7;
}

.dashboard-welcome-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(155, 124, 245, 0.18), rgba(47, 210, 191, 0.08));
  border: 1px solid var(--accent-soft);
  border-radius: 12px;
}

.dashboard-welcome-greeting {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-welcome-emoji {
  font-size: 28px;
  line-height: 1;
}

.dashboard-welcome-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.dashboard-welcome-sub {
  font-size: 12px;
  color: var(--muted);
}

.dashboard-welcome-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-welcome-pill {
  background: var(--bg-panel-3);
  color: var(--text);
  border: 1px solid var(--line-soft);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
}

.dashboard-welcome-pill-muted {
  color: var(--muted);
}

.dashboard-action-danger:hover {
  background: var(--danger);
  color: var(--text);
  border-color: var(--danger);
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-card {
  background: var(--bg-panel);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow);
}

.dashboard-card[data-card="total"] { border-left: 3px solid var(--accent); }
.dashboard-card[data-card="running"] { border-left: 3px solid var(--blue); }
.dashboard-card[data-card="completed"] { border-left: 3px solid var(--ok); }
.dashboard-card[data-card="errors"] { border-left: 3px solid var(--danger); }

.dashboard-card-icon {
  font-size: 18px;
  line-height: 1;
}

.dashboard-card-value {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.1;
}

.dashboard-card-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dashboard-section {
  background: var(--bg-panel);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dashboard-section-head {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}


.dashboard-section-head h3 {
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.dashboard-rate-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-2);
}

.dashboard-progress {
  height: 8px;
  background: var(--bg-panel-3);
  border-radius: 999px;
  overflow: hidden;
}

.dashboard-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  transition: width 0.25s ease;
}

.dashboard-section-text {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-ports-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  gap: 8px;
}

.dashboard-port-row {
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 10px;
  padding: 9px 10px;
  background: var(--bg-panel-2);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: hidden;
}

.dashboard-port-main {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.dashboard-port-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.12);
}

.dashboard-port-row[data-tone="running"] .dashboard-port-dot {
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-soft);
}

.dashboard-port-row[data-tone="offline"] .dashboard-port-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.dashboard-port-row[data-tone="remote"] .dashboard-port-dot {
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(86, 156, 214, 0.18);
}

.dashboard-port-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.dashboard-port-row code {
  grid-column: 1 / -1;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
}

.dashboard-port-status {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
  justify-self: end;
}

.dashboard-port-row[data-tone="running"] .dashboard-port-status {
  color: var(--ok);
}

.dashboard-port-row[data-tone="offline"] .dashboard-port-status {
  color: var(--danger);
}

.dashboard-badge {
  min-width: 0;
  max-width: 100%;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--bg-panel-3);
  color: var(--muted);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
}

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

.dashboard-project-card {
  background: var(--bg-panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.dashboard-project-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.dashboard-project-card.active {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 1px var(--accent-2) inset;
}

.dashboard-project-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  word-break: break-word;
}

.dashboard-project-pill {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent-2);
  color: #0e1418;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dashboard-project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}

.dashboard-project-meta span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.dashboard-project-meta .meta-error {
  color: var(--danger);
}

.dashboard-project-meta .meta-running {
  color: var(--blue);
}

.dashboard-project-progress {
  height: 5px;
  background: var(--bg-panel-3);
  border-radius: 999px;
  overflow: hidden;
}

.dashboard-project-progress-fill {
  height: 100%;
  background: var(--accent-2);
  border-radius: 999px;
}

.dashboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dashboard-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-panel-2);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.dashboard-list-item:hover {
  border-color: var(--accent);
}

.dashboard-list-item .list-stt {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  min-width: 28px;
}

.dashboard-list-item .list-prompt {
  flex: 1 1 auto;
  font-size: 12px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-list-item .list-meta {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--muted);
}

.dashboard-list-item.error {
  border-left: 3px solid var(--danger);
}

.dashboard-list-item .list-error {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--danger);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-empty {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 12px 0;
}

.row-flash {
  animation: rowFlash 1.6s ease-out;
}

@keyframes rowFlash {
  0% { background: var(--accent-soft); }
  100% { background: transparent; }
}

/* ── Veo3 Kit view ──────────────────────────────────────────────── */
.flowkit-view {
  grid-row: 2 / span 2;
  min-width: 0;
  min-height: 0;
  background: var(--bg-app);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.flowkit-view[hidden] {
  display: none;
}

.flowkit-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.flowkit-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0 8px;
  border-bottom: 1px solid var(--line-soft);
}

.flowkit-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.flowkit-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.flowkit-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.flowkit-panel {
  background: var(--bg-panel);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.flowkit-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(180px, 1fr) minmax(180px, 1fr);
  gap: 12px;
}

.flowkit-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.flowkit-field select,
.flowkit-field input {
  min-height: 36px;
}

.flowkit-status {
  color: var(--muted);
  border: 1px solid var(--line-soft);
  background: var(--bg-panel-3);
  border-radius: 8px;
  padding: 8px 10px;
}

.flowkit-status[data-tone="ok"] {
  color: var(--ok-text);
  border-color: var(--ok);
}

.flowkit-status[data-tone="error"] {
  color: var(--danger-text);
  border-color: var(--danger);
}

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

.flowkit-two-col {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
}

.flowkit-list {
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.flowkit-list-item {
  position: relative;
  isolation: isolate;
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 100%;
  min-height: 72px;
  text-align: left;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
  cursor: pointer;
}


.flowkit-list-item::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--bg-panel-2);
  pointer-events: none;
  transition: background 0.15s ease;
}

.flowkit-list-item:hover:not(:disabled),
.flowkit-list-item.selected {
  border-color: var(--accent);
}

.flowkit-list-item:hover:not(:disabled)::before,
.flowkit-list-item.selected::before {
  background: var(--accent-soft);
}

.flowkit-list-item.ready {
  border-left: 3px solid var(--ok);
}

.flowkit-list-item.ready::before {
  background: linear-gradient(90deg, rgba(54, 217, 154, 0.14), var(--bg-panel-2) 42%);
}

.flowkit-list-item.warn {
  border-left: 3px solid var(--warn);
}

.flowkit-list-item.warn::before {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.16), var(--bg-panel-2) 42%);
}

.flowkit-list-item strong {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  position: relative;
  z-index: 1;
}

.flowkit-list-item span {
  font-size: 11px;
  color: var(--muted);
  position: relative;
  z-index: 1;
}

.flowkit-list-item p {
  margin: 0;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.flowkit-list-item.selected strong,
.flowkit-list-item.selected p {
  color: var(--text);
}

.flowkit-list-item.selected span {
  color: var(--accent-2);
}

.flowkit-empty {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
}

.flowkit-prompt-preview {
  width: 100%;
  min-height: 240px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text);
  padding: 12px;
  line-height: 1.45;
}

/* ── Settings view ──────────────────────────────────────────────── */
.settings-view {
  grid-row: 2 / span 2;
  min-width: 0;
  min-height: 0;
  background: var(--bg-app);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.settings-view[hidden] {
  display: none;
}

.settings-layout {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 0;
}

.settings-toc {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--line-soft);
  padding: 20px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-toc h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0 6px;
}

.settings-toc nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-toc-link {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.settings-toc-link:hover,
.settings-toc-link.active {
  background: var(--accent-soft);
  color: var(--text);
}

.settings-cards {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-card {
  background: var(--bg-panel);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-margin-top: 16px;
}

.settings-card.flash {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
  transition: border-color 0.6s ease, box-shadow 0.6s ease;
}

.settings-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.settings-card-desc {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.settings-provider-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.settings-provider-tab {
  min-height: 58px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  text-align: left;
  background: var(--bg-panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.settings-provider-tab:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.settings-provider-tab.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.settings-provider-tab-main {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  min-width: 0;
}

.settings-provider-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--bg-panel-3);
  font-size: 13px;
  line-height: 1;
}

.settings-provider-tab small {
  padding-left: 32px;
  font-size: 11px;
  color: var(--muted);
}

.settings-provider-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--bg-panel-3);
  padding: 12px;
}

.settings-provider-panel[hidden] {
  display: none;
}

.settings-provider-panel-secondary {
  background: transparent;
}

.settings-provider-panel-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.settings-provider-note {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--bg-panel-2);
  color: var(--muted);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
}

.settings-provider-note code {
  color: var(--text);
}

.settings-subtitle {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.settings-about-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.settings-row > label {
  font-size: 12px;
  color: var(--muted);
}

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

.settings-grid .settings-row {
  grid-template-columns: 160px minmax(0, 1fr);
}

.settings-input {
  width: 100%;
  background: var(--bg-panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-family: inherit;
}

.settings-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-panel-3);
}

.settings-row select {
  background: var(--bg-panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-family: inherit;
}

.settings-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-input-row .settings-input {
  flex: 1 1 auto;
}

.settings-connection-status {
  flex: 1 1 auto;
  min-height: 30px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-panel-2);
  color: var(--muted);
  padding: 6px 10px;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-connection-status[data-tone="ok"] {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.1);
  color: #86efac;
}

.settings-connection-status[data-tone="error"] {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.1);
  color: #fecaca;
}

.settings-btn {
  background: var(--bg-panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.settings-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.settings-btn-danger {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-soft);
}

.settings-btn-danger:hover {
  background: var(--danger);
  color: var(--text);
  border-color: var(--danger);
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.settings-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 4px;
}

.settings-system-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.settings-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
}


.settings-info-grid {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 6px 14px;
  background: var(--bg-panel-3);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px 14px;
}

.settings-info-row {
  display: contents;
}

.settings-info-row > span:first-child {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.settings-info-row > span:last-child {
  color: var(--text);
  font-size: 12px;
  word-break: break-all;
}

.settings-info-path {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 11px !important;
}

.settings-about-link {
  color: var(--accent-2);
  text-decoration: none;
}

.settings-about-link:hover {
  color: var(--accent-2-strong);
  text-decoration: underline;
}

/* Light theme: soft, low-glare surfaces with explicit contrast for status text. */
html[data-theme="light"] button.secondary,
html[data-theme="light"] .toggle-btn,
html[data-theme="light"] .settings-btn,
html[data-theme="light"] .dashboard-action-btn {
  color: var(--text);
}

html[data-theme="light"] .nav-item.active,
html[data-theme="light"] .nav-item:hover:not(:disabled) {
  background: var(--accent);
  color: #ffffff;
}

html[data-theme="light"] .nav-item.active .nav-icon,
html[data-theme="light"] .nav-item:hover:not(:disabled) .nav-icon {
  color: #ffffff;
}

html[data-theme="light"] .nav-item-toggle[aria-pressed="true"],
html[data-theme="light"] .project-tabs,
html[data-theme="light"] .image-subsection,
html[data-theme="light"] .task-card-prompt,
html[data-theme="light"] .task-card-actions-drawer,
html[data-theme="light"] .extend-prompt-box {
  background: rgba(111, 82, 214, 0.055);
}

html[data-theme="light"] .project-tab.active,
html[data-theme="light"] .project-tab:hover {
  background: #e9eef7;
}

html[data-theme="light"] .project-tab-close,
html[data-theme="light"] .project-add,
html[data-theme="light"] .action-stack .icon-btn {
  color: var(--text);
}

html[data-theme="light"] .section-toggle,
html[data-theme="light"] .config-section h3,
html[data-theme="light"] .section-subtitle,
html[data-theme="light"] .task-chip[data-variant="tier"] {
  color: var(--accent-text);
}

html[data-theme="light"] .ref-mode-btn.active {
  color: var(--accent-2);
}

html[data-theme="light"] .slot-card-badge,
html[data-theme="light"] .slot-card-remove,
html[data-theme="light"] .output-preview-label {
  background: rgba(23, 32, 51, 0.78);
  color: #ffffff;
}

html[data-theme="light"] .slot-card-caption {
  color: #ffffff;
  background: linear-gradient(180deg, rgba(23, 32, 51, 0) 0%, rgba(23, 32, 51, 0.72) 100%);
}

html[data-theme="light"] .slot-card-overlay {
  background: rgba(23, 32, 51, 0.34);
}

html[data-theme="light"] .slot-card.is-empty .slot-card-surface {
  background: #edf2f8;
}

html[data-theme="light"] .slot-progress,
html[data-theme="light"] .task-progress,
html[data-theme="light"] .profile-pro-card .pp-credit-progress {
  background: rgba(23, 32, 51, 0.1);
}

html[data-theme="light"] .getid-status[data-tone="ok"] {
  color: var(--ok-text);
}

html[data-theme="light"] .getid-status[data-tone="error"],
html[data-theme="light"] .warning-line,
html[data-theme="light"] .error-note,
html[data-theme="light"] .extend-row-error {
  color: var(--danger-text);
}

html[data-theme="light"] .add-footer,
html[data-theme="light"] .log-dock,
html[data-theme="light"] .project-manager-card,
html[data-theme="light"] .project-manager-close,
html[data-theme="light"] .project-manager-tab,
html[data-theme="light"] .project-manager-row,
html[data-theme="light"] .prompt-box,
html[data-theme="light"] .output-waiting {
  background: var(--bg-panel-2);
}

html[data-theme="light"] .output-preview,
html[data-theme="light"] .output-thumb,
html[data-theme="light"] .task-card-media,
html[data-theme="light"] .video-preview-card video {
  background: #080c14;
}

html[data-theme="light"] .project-manager-card,
html[data-theme="light"] .project-manager-header,
html[data-theme="light"] .project-manager-create,
html[data-theme="light"] .project-manager-footer,
html[data-theme="light"] .project-manager-close,
html[data-theme="light"] .project-manager-tab,
html[data-theme="light"] .project-manager-empty,
html[data-theme="light"] .project-manager-row {
  border-color: var(--line);
}

html[data-theme="light"] .project-manager-header p,
html[data-theme="light"] .project-manager-create-title,
html[data-theme="light"] .project-manager-tab,
html[data-theme="light"] .project-manager-empty,
html[data-theme="light"] .project-manager-date,
html[data-theme="light"] .project-manager-pagination span {
  color: var(--muted);
}

html[data-theme="light"] .project-manager-tab.is-active,
html[data-theme="light"] .project-manager-row.is-active {
  border-color: var(--accent-2);
  background: rgba(20, 124, 115, 0.1);
}

html[data-theme="light"] .project-manager-tab.is-active {
  color: var(--text);
}

html[data-theme="light"] tbody tr {
  background: #f7f9fc;
}

html[data-theme="light"] tbody tr[data-status="running"] {
  background: #eaf1fa;
}

html[data-theme="light"] tbody tr[data-status="queued"] {
  background: #eeeaf9;
}

html[data-theme="light"] tbody tr[data-status="completed"] {
  background: #eaf4ef;
}

html[data-theme="light"] tbody tr[data-status="error"] {
  background: #f8e9ec;
}

html[data-theme="light"] .prompt-box {
  border-color: rgba(111, 82, 214, 0.5);
}

html[data-theme="light"] .output-waiting {
  border-color: #b6c4d8;
  color: var(--muted);
}

html[data-theme="light"] .log-body {
  color: #244f94;
}

html[data-theme="light"] .status-badge[data-status="running"],
html[data-theme="light"] .profile-pro-card .pp-badge[data-tone="info"],
html[data-theme="light"] .profile-pro-card .pp-cookie-row {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.24);
  color: var(--blue-text);
}

html[data-theme="light"] .status-badge[data-status="completed"],
html[data-theme="light"] .profile-pro-status .status-pill[data-tone="ok"],
html[data-theme="light"] .profile-pro-card .pp-badge[data-tone="success"],
html[data-theme="light"] .profile-pro-card .pp-meta.pp-ttl[data-ttl-state="ok"],
html[data-theme="light"] .profile-pro-card .pp-action-row .pp-link-btn[data-linked="true"] {
  background: rgba(18, 130, 91, 0.1);
  border-color: rgba(18, 130, 91, 0.24);
  color: var(--ok-text);
}

html[data-theme="light"] .status-badge[data-status="error"],
html[data-theme="light"] .profile-pro-status .status-pill[data-tone="error"],
html[data-theme="light"] .profile-pro-card .pp-badge[data-tone="danger"],
html[data-theme="light"] .profile-pro-card .pp-meta.pp-ttl[data-ttl-state="expired"] {
  background: var(--danger-soft);
  border-color: rgba(180, 35, 52, 0.24);
  color: var(--danger-text);
}

html[data-theme="light"] .status-badge[data-status="pending"],
html[data-theme="light"] .profile-pro-card .pp-meta.pp-ttl[data-ttl-state="warn"],
html[data-theme="light"] .extend-stt-label.extend-stt-running {
  background: var(--warn-soft);
  border-color: rgba(154, 101, 0, 0.24);
  color: var(--warn-text);
}

html[data-theme="light"] .status-badge[data-status="queued"],
html[data-theme="light"] .profile-pro-card .pp-badge[data-tone="primary"],
html[data-theme="light"] .icon-btn.active {
  background: var(--accent-soft);
  border-color: rgba(111, 82, 214, 0.24);
  color: var(--queued-text);
}

html[data-theme="light"] tbody tr.extend-sub-row,
html[data-theme="light"] tbody tr.extend-sub-row[data-status="queued"] {
  background: rgba(111, 82, 214, 0.055);
}

html[data-theme="light"] tbody tr.extend-sub-row[data-status="running"] {
  background: rgba(154, 101, 0, 0.08);
}

html[data-theme="light"] tbody tr.extend-sub-row[data-status="completed"] {
  background: rgba(18, 130, 91, 0.07);
}

html[data-theme="light"] tbody tr.extend-sub-row[data-status="error"] {
  background: rgba(180, 35, 52, 0.07);
}

html[data-theme="light"] tbody tr.extend-sub-row[data-status="draft"],
html[data-theme="light"] .extend-draft-textarea,
html[data-theme="light"] .extend-bulk-textarea {
  background: rgba(23, 32, 51, 0.04);
}

html[data-theme="light"] .extend-stt-label,
html[data-theme="light"] .extend-task-cell .extend-child-title,
html[data-theme="light"] .extend-queued-prompt {
  color: var(--text);
}

/* === Agent Chat: suggestions, context meter, skill library === */
.agent-chat-header-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.agent-chat-copy-session-btn {
  width: auto;
  min-width: 70px;
  padding-inline: 9px;
  white-space: nowrap;
}

.agent-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px 4px;
  border-bottom: 1px dashed var(--line-soft);
}

.agent-chat-suggestion {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-panel-2);
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
  text-align: left;
}

.agent-chat-suggestion:hover {
  border-color: var(--accent);
}

.agent-chat-suggestion-cmd {
  font-family: var(--font-mono, ui-monospace, monospace);
  color: var(--accent-text);
  font-weight: 700;
}

.agent-chat-suggestion-desc {
  font-size: 10px;
  color: var(--text-soft);
}

.agent-chat-context-meter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 11px;
  color: var(--text-soft);
}

.agent-chat-context-meter[data-state="off"] {
  opacity: 0.55;
}

.agent-chat-context-meter[data-tone="warn"] {
  color: #c98a1a;
}

.agent-chat-context-meter[data-tone="danger"] {
  color: #d04444;
}

.agent-chat-context-msgs {
  color: var(--text-soft);
}

.agent-chat-context-bar {
  flex: 1 1 auto;
  min-width: 80px;
  height: 4px;
  background: var(--bg-panel-3);
  border-radius: 999px;
  overflow: hidden;
}

.agent-chat-context-bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 200ms ease;
}

.agent-chat-context-meter[data-tone="warn"] .agent-chat-context-bar-fill {
  background: #c98a1a;
}

.agent-chat-context-meter[data-tone="danger"] .agent-chat-context-bar-fill {
  background: #d04444;
}

.skill-library-card {
  width: min(720px, 92vw);
  max-height: min(80vh, 720px);
  display: flex;
  flex-direction: column;
}

.skill-library-tabs {
  display: flex;
  gap: 6px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line-soft);
}

.skill-library-tab {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-panel-2);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}

.skill-library-tab.active {
  background: var(--accent);
  color: var(--accent-bg, #fff);
  border-color: var(--accent);
}

.skill-library-panel {
  padding: 12px;
  overflow: auto;
}

.skill-library-list {
  display: grid;
  gap: 10px;
}

.skill-library-item {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-panel-2);
}

.skill-library-item header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}

.skill-library-item code {
  font-family: var(--font-mono, ui-monospace, monospace);
  color: var(--accent-text);
  font-weight: 700;
}

.skill-library-item p {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
}

.skill-library-body {
  margin: 0;
  padding: 8px;
  background: var(--bg-panel-3);
  border-radius: 8px;
  font-size: 11px;
  white-space: pre-wrap;
  max-height: 140px;
  overflow: auto;
}


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

.skill-library-action {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-panel-3);
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
}

.skill-library-action:hover {
  border-color: var(--accent);
}

.skill-library-form {
  display: grid;
  gap: 10px;
}

.skill-library-form label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--text-soft);
}

.skill-library-form input,
.skill-library-form textarea {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-panel-3);
  color: var(--text);
  font-size: 12px;
}

.skill-library-form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.skill-library-error {
  color: #d04444;
  font-size: 12px;
}

.skill-library-empty {
  margin: 0;
  font-size: 12px;
  color: var(--text-soft);
}

.youtube-prompt-tool {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--bg-panel-3);
}

.youtube-prompt-tool label {
  display: grid;
  gap: 6px;
}

.youtube-prompt-tool input,
.youtube-prompt-tool textarea,
.youtube-frame-config select {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text);
}

.youtube-manual-transcript {
  min-height: 78px;
  resize: vertical;
}

.youtube-tool-tabs,
.youtube-progress-tabs {
  display: flex;
  gap: 6px;
}

.youtube-tool-tab,
.youtube-progress-tab {
  flex: 1;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-panel-2);
  color: var(--text-muted);
  cursor: pointer;
}

.youtube-tool-tab.is-active,
.youtube-progress-tab.is-active {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.youtube-tool-panel {
  display: grid;
  gap: 8px;
}

.youtube-tool-panel[hidden],
.youtube-prompt-progress[hidden],
.youtube-prompt-progress-open[hidden],
.youtube-prompt-retry[hidden],
.youtube-progress-panel[hidden],
.youtube-progress-resume[hidden],
.youtube-frame-config label[hidden],
.youtube-frame-card-prompt[hidden] {
  display: none;
}

.youtube-frame-config {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.youtube-prompt-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.youtube-prompt-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
}

.youtube-prompt-progress-track,
.youtube-progress-track-large,
.youtube-progress-prompt-track {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: var(--bg-panel-2);
  border: 1px solid var(--line-soft);
}

.youtube-prompt-progress-bar,
.youtube-progress-bar-large,
.youtube-progress-prompt-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--ok));
  transition: width 180ms ease;
}

.youtube-prompt-progress-label,
.youtube-progress-percent {
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
}

.youtube-progress-card {
  width: min(1120px, calc(100vw - 28px));
  height: min(840px, calc(100vh - 28px));
  max-height: calc(100vh - 28px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.youtube-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.youtube-progress-header > div {
  min-width: 0;
}

.youtube-progress-header h3,
.youtube-progress-header p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.youtube-progress-header p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.youtube-progress-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-panel-2);
  color: var(--text);
  cursor: pointer;
}

.youtube-progress-body {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

.youtube-progress-meter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: center;
  gap: 10px;
}

.youtube-progress-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.youtube-progress-stat {
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--bg-panel-3);
  color: var(--text);
  cursor: pointer;
}

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

.youtube-progress-stat strong {
  font-size: 18px;
}

.youtube-progress-status {
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--bg-panel-3);
  color: var(--text-muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.youtube-progress-status[data-tone="ok"] {
  color: var(--ok-text);
}

.youtube-progress-status[data-tone="error"] {
  color: var(--danger-text);
}

.youtube-progress-table-wrap {
  height: 100%;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
}

.youtube-progress-table {
  display: table;
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  table-layout: fixed;
}

.youtube-progress-table colgroup {
  display: table-column-group;
}

.youtube-progress-table col {
  display: table-column;
}

.youtube-progress-table thead {
  display: table-header-group;
}

.youtube-progress-table tbody {
  display: table-row-group;
}

.youtube-progress-table tr {
  display: table-row;
  width: auto;
}

.youtube-progress-table th,
.youtube-progress-table td {
  display: table-cell;
}

.youtube-progress-table th,
.youtube-progress-table td {
  padding: 8px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  text-align: left;
  font-size: 12px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.youtube-progress-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg-panel-2);
  color: var(--text-muted);
}

.youtube-progress-col-index,
.youtube-progress-table th:nth-child(1),
.youtube-progress-table td:nth-child(1) {
  width: 52px;
}

.youtube-progress-col-srt,
.youtube-progress-table th:nth-child(2),
.youtube-progress-table td:nth-child(2) {
  width: 32%;
}

.youtube-progress-col-prompt {
  width: auto;
}

.youtube-progress-col-status,
.youtube-progress-table th:nth-child(4),
.youtube-progress-table td:nth-child(4) {
  width: 118px;
}

.youtube-progress-panel {
  min-height: 0;
  overflow: hidden;
}

.youtube-progress-timeline {
  color: var(--accent);
  font-size: 11px;
  margin-bottom: 4px;
}

.youtube-progress-srt-text {
  color: var(--text);
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.youtube-progress-status-cell {
  color: var(--text-muted);
}

.youtube-progress-table tr[data-status="done"] .youtube-progress-status-cell {
  color: var(--ok-text);
}

.youtube-progress-table tr[data-status="running"] {
  background: var(--warn-soft);
}

.youtube-progress-prompt-wait {
  display: grid;
  gap: 5px;
}

.youtube-progress-prompt-wait-top {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 11px;
}

.youtube-frame-preview-section {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  height: 100%;
  min-height: 0;
}

.youtube-frame-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.youtube-frame-preview-header > div {
  min-width: 0;
}

.youtube-frame-preview-header h4,
.youtube-frame-preview-header p {
  margin: 0;
}

.youtube-frame-preview-header p {
  color: var(--text-muted);
  font-size: 12px;
}

.youtube-frame-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow: auto;
}

.youtube-frame-empty,
.youtube-frame-card {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--bg-panel-3);
}

.youtube-frame-empty {
  padding: 14px;
  color: var(--text-muted);
}

.youtube-frame-card {
  overflow: hidden;
}

.youtube-frame-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--bg-panel-2);
}

.youtube-frame-card img.youtube-frame-clickable {
  cursor: pointer;
}

.youtube-frame-card-meta {
  display: grid;
  gap: 5px;
  padding: 9px;
  font-size: 12px;
  min-width: 0;
}

.youtube-frame-card-meta span,
.youtube-frame-card-meta p {
  margin: 0;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.youtube-frame-card-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.youtube-frame-card-actions button {
  min-width: 0;
  padding-inline: 6px;
}

.extension-client-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.extension-settings-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.extension-settings-heading .settings-card-title {
  margin: 0;
}

.extension-connection-controls,
.extension-connection-indicator {
  display: inline-flex;
  align-items: center;
}

.extension-connection-controls {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.extension-connection-indicator {
  min-height: 30px;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--bg-panel-3);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.extension-connection-icon {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 15%, transparent);
}

.extension-connection-indicator[data-state="connected"] {
  border-color: color-mix(in srgb, var(--ok) 45%, var(--line-soft));
  color: var(--ok);
}

.extension-connection-indicator[data-state="degraded"],
.extension-connection-indicator[data-state="refreshing"] {
  border-color: color-mix(in srgb, var(--warn) 45%, var(--line-soft));
  color: var(--warn);
}

.extension-connection-indicator[data-state="disconnected"] {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line-soft));
  color: var(--danger);
}

.extension-connection-indicator[data-state="disabled"],
.extension-connection-indicator[data-state="unknown"] {
  color: var(--text-muted);
}

.extension-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
}

.extension-refresh-btn[data-refreshing="true"] .extension-refresh-icon {
  animation: extensionRefreshSpin 800ms linear infinite;
}

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

.extension-client-empty,
.extension-client-row {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--bg-panel-3);
  padding: 10px 12px;
}

.extension-client-empty {
  color: var(--text-muted);
  font-size: 13px;
}

.extension-client-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 2fr) auto;
  gap: 10px;
  align-items: center;
}

.extension-client-row[data-ready="true"] {
  border-color: color-mix(in srgb, var(--ok) 45%, var(--line-soft));
}

.extension-client-list-compact .extension-client-row {
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
}

.extension-client-list-compact .extension-client-counts {
  justify-self: start;
}

.extension-client-actions {
  display: inline-flex;
  justify-content: flex-end;
  gap: 6px;
}

.extension-client-list-compact .extension-client-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.extension-client-title {
  color: var(--text-main);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.extension-client-meta,
.extension-client-counts {
  color: var(--text-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.extension-client-counts {
  justify-self: end;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .extension-settings-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .extension-connection-controls {
    justify-content: flex-start;
  }

  .youtube-frame-config,
  .youtube-prompt-actions,
  .youtube-progress-stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .youtube-progress-card {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    max-height: calc(100vh - 20px);
  }

  .youtube-progress-table {
    min-width: 700px;
  }

  .youtube-progress-header h3 {
    font-size: 13px;
  }

  .extension-client-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .extension-client-counts {
    justify-self: start;
    white-space: normal;
  }
}

@media (max-width: 980px) {
  .agent-chat-panel {
    left: 10px;
    right: 10px;
    width: auto;
    min-width: 0;
  }

  .agent-chat-workbench {
    grid-template-columns: minmax(0, 1fr);
  }

  .agent-chat-sidebar,
  .agent-chat-inspector {
    display: none;
  }

  .agent-chat-main {
    border-inline: 0;
  }
}

/* ── Library view ─────────────────────────────────────────────── */
.library-view {
  grid-row: 2 / span 2;
  min-width: 0;
  min-height: 0;
  background: var(--bg-app);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 20px 24px 28px;
}

.library-view[hidden] {
  display: none;
}

.library-header,
.library-toolbar,
.library-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.library-header {
  justify-content: space-between;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 12px;
}

.library-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
}

.library-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.library-actions {
  display: flex;
  gap: 8px;
  min-width: 0;
}

.library-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px) auto auto;
  min-width: 0;
}

.library-summary {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.library-page-size {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.library-page-size select {
  min-width: 58px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text);
}

.library-grid {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  align-content: start;
  gap: 16px;
  padding: 4px 6px 16px;
}

.library-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-panel-2);
  padding: 12px;
  box-sizing: border-box;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.library-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.library-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #080c14;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.library-media-backdrop,
.task-card-media-backdrop {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

.library-media-blur-bg,
.task-card-media-blur-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(14px) brightness(0.4) saturate(1.4);
  transform: scale(1.2);
}

.library-card-thumbnail {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.library-card-thumbnail.portrait-thumb {
  width: auto;
  height: 100%;
  aspect-ratio: 9 / 16;
  max-width: 60%;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.library-card:hover .library-card-thumbnail {
  transform: scale(1.03);
}

.library-card-media img[data-thumbnail-state="placeholder"],
.output-thumb[data-thumbnail-state="placeholder"] {
  background: linear-gradient(135deg, #111827, #253349);
}

.library-preview-label {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 3;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(5, 7, 18, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.library-preview-label .preview-icon {
  font-size: 9px;
  color: #a78bfa;
}

.library-card:hover .library-preview-label {
  background: rgba(99, 102, 241, 0.9);
  border-color: rgba(255, 255, 255, 0.4);
}

.library-aspect-badge,
.task-card-aspect-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.3px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.library-aspect-badge.badge-portrait,
.task-card-aspect-badge.badge-portrait {
  background: rgba(139, 92, 246, 0.88);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

.library-aspect-badge.badge-landscape,
.task-card-aspect-badge.badge-landscape {
  background: rgba(15, 23, 42, 0.75);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.library-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}

.library-card-body h3 {
  margin: 0;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
}

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

.library-card-meta .task-chip {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 4px;
}

.library-card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  height: 34px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.library-card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
  width: 100%;
}

.library-action-btn {
  width: 100%;
  height: 28px;
  padding: 0 6px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 6px !important;
  border: 1px solid var(--line-soft) !important;
  background: var(--bg-input, rgba(255, 255, 255, 0.08)) !important;
  color: var(--text) !important;
  cursor: pointer;
  transition: all 0.15s ease;
}

.library-action-btn:hover {
  background: rgba(99, 102, 241, 0.15) !important;
  border-color: rgba(99, 102, 241, 0.4) !important;
  color: var(--primary, #6366f1) !important;
}

.library-action-wide {
  grid-column: 1 / -1;
}

.library-action-btn .action-icon {
  font-size: 11px;
  opacity: 0.85;
}

.library-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 38px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 0 2px;
}

.library-pager button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

@media (max-width: 780px) {
  .library-toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .library-summary,
  .library-page-size {
    justify-self: start;
  }
}

.mcp-view {
  grid-row: 2 / span 2;
  min-height: 0;
  overflow: auto;
  background:
    radial-gradient(circle at 90% 0%, rgba(37, 99, 235, 0.11), transparent 30%),
    var(--bg, #090c14);
}

.mcp-page {
  width: calc(100% - 48px);
  max-width: 1180px;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 34px 0 56px;
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 22px;
}

.mcp-header,
.mcp-section-heading,
.mcp-secret,
.mcp-key-row,
.mcp-setup-card {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.mcp-header,
.mcp-section-heading {
  flex-wrap: wrap;
}

.mcp-header > div:first-child,
.mcp-section-heading > div:first-child {
  min-width: 0;
  flex: 1 1 420px;
}

.mcp-header h2 {
  margin: 5px 0 7px;
  color: var(--text, #f6f8ff);
  font-size: 28px;
}

.mcp-header p,
.mcp-section-heading p,
.mcp-setup-card p {
  margin: 0;
  color: var(--muted, #8f96a9);
}

.mcp-eyebrow {
  color: #5b8cff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.mcp-section {
  min-width: 0;
  padding: 22px;
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 16px;
  background: rgba(20, 24, 35, 0.9);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.12);
}

.mcp-section h3 {
  margin: 0 0 5px;
  color: var(--text, #f6f8ff);
  font-size: 18px;
}

.mcp-section code {
  padding: 3px 7px;
  border-radius: 6px;
  color: #dce7ff;
  background: rgba(91, 140, 255, 0.14);
}

.mcp-create {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.mcp-create input,
.mcp-section select {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 9px;
  color: var(--text, #f6f8ff);
  background: #0d111b;
}

.mcp-create input {
  width: 230px;
}

.mcp-view button {
  min-height: 36px;
  padding: 0 13px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  background: #3178f6;
}

.mcp-view button:hover {
  filter: brightness(1.08);
}

.mcp-view button.secondary {
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #b8c0d4;
  background: transparent;
}

.mcp-secret {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(34, 197, 94, 0.42);
  border-radius: 12px;
  background: rgba(34, 197, 94, 0.08);
}

.mcp-secret[hidden] {
  display: none;
}

.mcp-secret > div {
  display: grid;
  gap: 3px;
}

.mcp-secret span {
  color: #9aa4b9;
  font-size: 12px;
}

.mcp-secret code {
  min-width: 230px;
  overflow-wrap: anywhere;
}

.mcp-keys-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.mcp-key-row {
  flex-wrap: wrap;
  padding: 15px 16px;
  border: 1px solid rgba(148, 163, 184, 0.11);
  border-radius: 12px;
  background: rgba(8, 11, 19, 0.52);
}

.mcp-key-row[data-selected="true"] {
  border-color: rgba(91, 140, 255, 0.48);
  background: rgba(91, 140, 255, 0.1);
}

.mcp-key-main {
  display: grid;
  flex: 1 1 260px;
  gap: 5px;
  min-width: 0;
}

.mcp-key-main strong {
  color: var(--text, #f6f8ff);
}

.mcp-key-meta {
  color: #8992a7;
  font-size: 12px;
}

.mcp-key-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.mcp-key-panel {
  display: grid;
  flex: 1 0 100%;
  gap: 10px;
  min-width: 0;
  margin-top: 2px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.mcp-key-panel-hint {
  color: #9aa4b9;
  font-size: 12px;
}

.mcp-key-panel code,
.mcp-key-panel pre {
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 10px;
  color: #cbd8f5;
  font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #070a11;
}

.mcp-key-row[data-status="revoked"] {
  opacity: 0.58;
}

.mcp-key-row .mcp-select.active {
  background: rgba(34, 197, 94, 0.72);
}

.mcp-key-row .mcp-revoke {
  color: #fb7185;
  background: transparent;
}

.mcp-client-tabs {
  display: flex;
  gap: 5px;
  margin: 18px 0 12px;
  overflow-x: auto;
}

.mcp-client-tabs button {
  color: #8992a7;
  background: transparent;
}

.mcp-client-tabs button.active {
  color: #fff;
  background: rgba(91, 140, 255, 0.17);
}

.mcp-setup-card {
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 17px;
  border-radius: 12px;
  background: #0b0f18;
}

.mcp-setup-card pre {
  flex-basis: 100%;
  max-height: 260px;
  margin: 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 10px;
  color: #cbd8f5;
  font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  background: #070a11;
}

.mcp-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.mcp-metrics > div {
  display: grid;
  gap: 8px;
  padding: 15px;
  border: 1px solid rgba(148, 163, 184, 0.11);
  border-radius: 12px;
  color: #8992a7;
  background: rgba(8, 11, 19, 0.5);
}

.mcp-usage-metrics > .mcp-usage-metric-card {
  display: grid;
  gap: 8px;
  min-height: 86px;
  padding: 15px;
  border: 1px solid rgba(148, 163, 184, 0.11);
  border-radius: 12px;
  color: #8992a7;
  text-align: left;
  background: rgba(8, 11, 19, 0.5);
  cursor: pointer;
}

.mcp-usage-metrics > .mcp-usage-metric-card:hover,
.mcp-usage-metrics > .mcp-usage-metric-card[data-active="true"] {
  border-color: rgba(91, 140, 255, 0.48);
  color: #cbd5e1;
  background: rgba(91, 140, 255, 0.12);
}

.mcp-usage-metrics > .mcp-usage-metric-card:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.9);
  outline-offset: 2px;
}

.mcp-metrics strong {
  color: var(--text, #f6f8ff);
  font-size: 24px;
}

.mcp-activity-wrap {
  margin-top: 16px;
  overflow-x: auto;
}

.mcp-activity-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 220px) minmax(130px, 180px) auto;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

.mcp-activity-toolbar input,
.mcp-activity-toolbar select,
.mcp-activity-page-size select {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  background: #0b0f18;
  color: var(--text, #f6f8ff);
}

.mcp-activity-page-size {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #8992a7;
  white-space: nowrap;
}

.mcp-activity-page-size select {
  width: 76px;
}

.mcp-activity-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  color: #aeb7ca;
  font-size: 13px;
}

.mcp-activity-table th,
.mcp-activity-table td {
  padding: 11px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  text-align: left;
}

.mcp-activity-table th {
  color: #70798d;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mcp-activity-status {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 99px;
  color: #4ade80;
  background: rgba(34, 197, 94, 0.1);
}

.mcp-activity-status.failed {
  color: #fb7185;
  background: rgba(244, 63, 94, 0.1);
}

.mcp-activity-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
  color: #8992a7;
  font-size: 12px;
  font-weight: 800;
}

.mcp-empty,
.mcp-status {
  color: #818a9e;
  text-align: center;
}

.mcp-status[data-tone="error"] {
  color: #fb7185;
}

.mcp-status[data-tone="ok"] {
  color: #4ade80;
}

@media (max-width: 860px) {
  .mcp-activity-toolbar {
    grid-template-columns: 1fr;
  }

  .mcp-activity-pager {
    justify-content: space-between;
  }
}

html[data-theme="light"] .mcp-view {
  background: #f4f7fc;
}

html[data-theme="light"] .mcp-section {
  border-color: #dfe5ef;
  background: #fff;
  box-shadow: 0 12px 30px rgba(31, 41, 55, 0.06);
}

html[data-theme="light"] .mcp-create input,
html[data-theme="light"] .mcp-section select,
html[data-theme="light"] .mcp-setup-card,
html[data-theme="light"] .mcp-setup-card pre,
html[data-theme="light"] .mcp-key-panel code,
html[data-theme="light"] .mcp-key-panel pre,
html[data-theme="light"] .mcp-key-row,
html[data-theme="light"] .mcp-usage-metrics > .mcp-usage-metric-card,
html[data-theme="light"] .mcp-metrics > div {
  color: #253047;
  border-color: #dfe5ef;
  background: #f8faff;
}

html[data-theme="light"] .mcp-usage-metrics > .mcp-usage-metric-card:hover,
html[data-theme="light"] .mcp-usage-metrics > .mcp-usage-metric-card[data-active="true"] {
  border-color: rgba(37, 99, 235, 0.5);
  background: #eef4ff;
}

html[data-theme="light"] .mcp-header h2,
html[data-theme="light"] .mcp-section h3,
html[data-theme="light"] .mcp-key-main strong,
html[data-theme="light"] .mcp-metrics strong {
  color: #141b2d;
}

@media (max-width: 850px) {
  .mcp-page { width: min(100% - 24px, 1180px); padding-top: 20px; }
  .mcp-header, .mcp-section-heading { align-items: flex-start; flex-direction: column; }
  .mcp-header > div:first-child, .mcp-section-heading > div:first-child { width: 100%; flex: 0 1 auto; }
  .mcp-create { width: 100%; }
  .mcp-create input { flex: 1; min-width: 0; width: auto; }
  .mcp-secret { align-items: stretch; flex-direction: column; }
  .mcp-key-row { align-items: stretch; flex-direction: column; }
  .mcp-key-actions { flex-wrap: wrap; }
  .mcp-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .app-shell.sidebar-collapsed:has(.mcp-view:not([hidden])) {
    min-width: 0;
    grid-template-columns: 68px minmax(0, 1fr);
  }
  .app-shell.sidebar-collapsed:has(.mcp-view:not([hidden])) .main-region {
    grid-template-columns: minmax(0, 1fr);
  }
  .app-shell.sidebar-collapsed:has(.mcp-view:not([hidden])) .mcp-view {
    min-width: 0;
    width: 100%;
  }
  .mcp-page { width: calc(100% - 16px); gap: 14px; }
  .mcp-section { padding: 16px; }
  .mcp-metrics { grid-template-columns: minmax(0, 1fr); }
  .mcp-header p, .mcp-section-heading p, .mcp-section code { overflow-wrap: anywhere; }
}

.model-health-status {
  display: block;
  margin: 7px 0 0;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.model-health-status[data-tone="ok"] { color: var(--success); }
.model-health-status[data-tone="warn"] { color: var(--warning); }
.model-health-status[data-tone="error"] { color: var(--danger); }

@media (max-width: 850px) {
  .model-health-status {
    font-size: 11px;
    overflow-wrap: anywhere;
  }
}

/* ── Prominent Scan Profile Hero Button & CTA ─────────────────────── */
.scan-profile-hero-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  margin: 6px 0 10px 0;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.25) 0%, rgba(14, 165, 233, 0.35) 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.65);
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: #ffffff;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.scan-profile-hero-btn:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.4) 0%, rgba(14, 165, 233, 0.5) 100%);
  border-color: #38bdf8;
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(56, 189, 248, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.scan-profile-hero-btn:active {
  transform: translateY(0);
}

.scan-profile-hero-btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.scan-hero-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(56, 189, 248, 0.3);
  border: 1px solid rgba(56, 189, 248, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.scan-hero-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.scan-hero-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.2px;
  line-height: 1.25;
}

.scan-hero-subtitle {
  font-size: 11px;
  color: #bae6fd;
  line-height: 1.2;
}

.scan-hero-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.3);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.6);
  white-space: nowrap;
  flex-shrink: 0;
}

html[data-theme="light"] .scan-profile-hero-btn {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  border-color: #0284c7;
  color: #0369a1;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.2);
}

html[data-theme="light"] .scan-hero-title {
  color: #0c4a6e;
}

html[data-theme="light"] .scan-hero-subtitle {
  color: #0369a1;
}

html[data-theme="light"] .scan-hero-icon-box {
  background: rgba(2, 132, 199, 0.15);
  border-color: #0284c7;
}

html[data-theme="light"] .scan-hero-badge {
  background: rgba(2, 132, 199, 0.15);
  color: #0284c7;
  border-color: #0284c7;
}

/* Prominent sidebar scan action */
.cp-sidebar-btn.cp-sidebar-btn-prominent {
  padding: 0.55rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(14, 165, 233, 0.35));
  border: 1.5px solid rgba(56, 189, 248, 0.6);
  color: #38bdf8;
  box-shadow: 0 3px 10px rgba(56, 189, 248, 0.2);
  cursor: pointer;
  transition: all 0.15s ease;
}

.cp-sidebar-btn.cp-sidebar-btn-prominent:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.4), rgba(14, 165, 233, 0.5));
  color: #ffffff;
  border-color: #38bdf8;
  transform: translateY(-1px);
}

/* Prominent modal scan button */
.chrome-scan-btn-prominent {
  min-height: 34px !important;
  padding: 6px 16px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  background: linear-gradient(135deg, #2563eb, #0284c7) !important;
  border: 1px solid #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 3px 12px rgba(14, 165, 233, 0.35) !important;
}

.chrome-scan-btn-prominent:hover {
  background: linear-gradient(135deg, #1d4ed8, #0369a1) !important;
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.5) !important;
}

/* Prominent quick-start scan button */
.quick-start-scan-prominent {
  padding: 8px 16px !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  background: linear-gradient(135deg, #2563eb, #0284c7) !important;
  border: 1px solid #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 3px 12px rgba(37, 99, 235, 0.3) !important;
}

.mcp-queue-metrics > .mcp-queue-metric-card {
  display: grid;
  gap: 8px;
  min-height: 86px;
  padding: 15px;
  border: 1px solid rgba(148, 163, 184, 0.11);
  border-radius: 12px;
  color: #8992a7;
  text-align: left;
  background: rgba(8, 11, 19, 0.5);
  cursor: pointer;
}

.mcp-queue-metrics > .mcp-queue-metric-card:hover,
.mcp-queue-metrics > .mcp-queue-metric-card[data-active="true"] {
  border-color: rgba(91, 140, 255, 0.48);
  color: #cbd5e1;
  background: rgba(91, 140, 255, 0.12);
}

.mcp-queue-metrics > .mcp-queue-metric-card:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.9);
  outline-offset: 2px;
}

.mcp-queue-metrics > .mcp-queue-metric-card strong {
  color: var(--text, #f6f8ff);
  font-size: 24px;
}

.mcp-queue-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.mcp-queue-toolbar input,
.mcp-queue-toolbar select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 9px;
  color: var(--text, #f6f8ff);
  background: #0d111b;
}

.mcp-queue-toolbar input,
.mcp-queue-toolbar select {
  min-height: 38px;
  padding: 0 12px;
}

.mcp-queue-toolbar input {
  grid-column: span 2;
}

.mcp-queue-list {
  margin-top: 16px;
}

.mcp-queue-bulkbar,
.mcp-queue-pager {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  color: #8992a7;
  font-size: 12px;
}

.mcp-queue-bulkbar {
  justify-content: space-between;
}

.mcp-queue-check,
.mcp-queue-page-size {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
}

.mcp-queue-page-size {
  margin-left: auto;
}

.mcp-queue-page-size select {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 9px;
  color: var(--text, #f6f8ff);
  background: #0d111b;
}

.mcp-queue-pager {
  justify-content: flex-end;
}

.mcp-queue-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(148, 163, 184, 0.11);
  border-radius: 12px;
  background: rgba(8, 11, 19, 0.52);
}

.mcp-queue-table {
  display: table;
  width: 100%;
  min-width: 1215px;
  border-collapse: collapse;
  table-layout: fixed;
  color: #aeb7ca;
  font-size: 13px;
}

.mcp-queue-table thead {
  display: table-header-group;
}

.mcp-queue-table tbody {
  display: table-row-group;
}

.mcp-queue-table tr {
  display: table-row;
}

.mcp-queue-table th,
.mcp-queue-table td {
  display: table-cell;
  padding: 11px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  text-align: left;
  vertical-align: middle;
}

.mcp-queue-table th:nth-child(1),
.mcp-queue-table td:nth-child(1) {
  width: 44px;
}

.mcp-queue-table th:nth-child(2),
.mcp-queue-table td:nth-child(2) {
  width: 64px;
}

.mcp-queue-table th:nth-child(3),
.mcp-queue-table td:nth-child(3) {
  width: 190px;
}

.mcp-queue-table th:nth-child(4),
.mcp-queue-table td:nth-child(4) {
  width: 150px;
}

.mcp-queue-table th:nth-child(5),
.mcp-queue-table td:nth-child(5) {
  width: 105px;
}

.mcp-queue-table th:nth-child(6),
.mcp-queue-table td:nth-child(6) {
  width: 130px;
}

.mcp-queue-table th:nth-child(7),
.mcp-queue-table td:nth-child(7) {
  width: 160px;
}

.mcp-queue-table th:nth-child(8),
.mcp-queue-table td:nth-child(8) {
  width: 145px;
}

.mcp-queue-table th:last-child,
.mcp-queue-table td:last-child {
  width: 267px;
}

.mcp-queue-table th {
  color: #70798d;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  background: rgba(13, 17, 27, 0.72);
}

.mcp-queue-row:hover td {
  background: rgba(91, 140, 255, 0.06);
}

.mcp-queue-row[data-selected="true"] td {
  background: rgba(91, 140, 255, 0.08);
}

.mcp-queue-focus-target {
  outline: 2px solid rgba(250, 204, 21, 0.85);
  outline-offset: -2px;
}

.mcp-queue-row td {
  overflow: hidden;
}

.mcp-queue-row-check {
  width: 16px;
  height: 16px;
}

.mcp-queue-title-cell {
  min-width: 0;
}

.mcp-queue-item-title {
  display: block;
  color: var(--text, #f6f8ff);
  font-weight: 800;
  overflow-x: auto;
  overflow-y: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.mcp-queue-notes {
  display: block;
  margin-top: 4px;
  color: #8992a7;
  font-size: 11px;
  overflow-x: auto;
  overflow-y: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.mcp-queue-id-cell,
.mcp-queue-tool-cell {
  max-width: 190px;
}

.mcp-queue-scroll-text {
  display: block;
  max-width: 100%;
  padding-bottom: 2px;
  overflow-x: auto;
  overflow-y: hidden;
  text-overflow: clip;
  white-space: nowrap;
  scrollbar-width: thin;
}

.mcp-queue-item-title::-webkit-scrollbar,
.mcp-queue-notes::-webkit-scrollbar,
.mcp-queue-scroll-text::-webkit-scrollbar {
  height: 6px;
}

.mcp-queue-payload::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.mcp-queue-item-title::-webkit-scrollbar-thumb,
.mcp-queue-notes::-webkit-scrollbar-thumb,
.mcp-queue-scroll-text::-webkit-scrollbar-thumb,
.mcp-queue-payload::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.42);
}

.mcp-queue-item-title::-webkit-scrollbar-track,
.mcp-queue-notes::-webkit-scrollbar-track,
.mcp-queue-scroll-text::-webkit-scrollbar-track,
.mcp-queue-payload::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.34);
}

.mcp-queue-updated-cell {
  color: #8992a7;
}

.mcp-queue-progress {
  display: grid;
  grid-template-columns: minmax(54px, 1fr) 42px;
  align-items: center;
  gap: 8px;
}

.mcp-queue-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
}

.mcp-queue-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22d3ee, #4ade80);
}

.mcp-queue-progress-text {
  color: #dbeafe;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.mcp-queue-type,
.mcp-queue-status {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 99px;
  overflow-wrap: normal;
  white-space: nowrap;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.12);
}

.mcp-queue-status[data-tone="completed"] {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.1);
}

.mcp-queue-status[data-tone="failed"],
.mcp-queue-status[data-tone="error"] {
  color: #fb7185;
  background: rgba(244, 63, 94, 0.1);
}

.mcp-queue-status[data-tone="running"] {
  color: #facc15;
  background: rgba(250, 204, 21, 0.1);
}

.mcp-queue-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.mcp-queue-actions button {
  flex: 0 0 auto;
}

.mcp-queue-payload {
  max-height: 210px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 10px;
  color: #cbd8f5;
  font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre;
  overflow-wrap: normal;
  background: #070a11;
}

.mcp-queue-detail-row[hidden] {
  display: none;
}

.mcp-queue-detail-row td {
  padding-top: 0;
  background: rgba(7, 10, 17, 0.36);
}

html[data-theme="light"] .mcp-queue-toolbar input,
html[data-theme="light"] .mcp-queue-toolbar select,
html[data-theme="light"] .mcp-queue-page-size select,
html[data-theme="light"] .mcp-queue-metrics > .mcp-queue-metric-card,
html[data-theme="light"] .mcp-queue-table-wrap,
html[data-theme="light"] .mcp-queue-payload {
  color: #253047;
  border-color: #dfe5ef;
  background: #f8faff;
}

html[data-theme="light"] .mcp-queue-metrics > .mcp-queue-metric-card:hover,
html[data-theme="light"] .mcp-queue-metrics > .mcp-queue-metric-card[data-active="true"] {
  border-color: rgba(37, 99, 235, 0.5);
  background: #eef4ff;
}

html[data-theme="light"] .mcp-queue-table th {
  background: #eef3fb;
}

html[data-theme="light"] .mcp-queue-item-title {
  color: #141b2d;
}

@media (max-width: 850px) {
  .mcp-queue-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mcp-queue-toolbar input {
    grid-column: 1 / -1;
  }
  .mcp-queue-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .mcp-queue-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }
}

html[data-theme="light"] {
  color-scheme: light;
  --primary: #2563eb;
  --primary-dark: #1e3a8a;
  --primary-light: #dbeafe;
  --primary-50: #eff6ff;
  --foreground: #111827;
  --heading: #0f172a;
  --surface: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-bg-strong: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.55);
  --border: #e5e7eb;
  --bg-app: #eef0f7;
  --bg-sidebar: rgba(255, 255, 255, 0.65);
  --bg-panel: rgba(255, 255, 255, 0.65);
  --bg-panel-2: rgba(255, 255, 255, 0.78);
  --bg-panel-3: rgba(239, 246, 255, 0.72);
  --bg-input: rgba(255, 255, 255, 0.82);
  --bg-subtle: rgba(37, 99, 235, 0.06);
  --bg-overlay: rgba(15, 23, 42, 0.34);
  --line: rgba(229, 231, 235, 0.95);
  --line-soft: rgba(229, 231, 235, 0.68);
  --text: #111827;
  --text-muted: #6b7280;
  --muted: #6b7280;
  --muted-2: #9ca3af;
  --accent: #2563eb;
  --accent-strong: #1e3a8a;
  --accent-soft: #eff6ff;
  --accent-text: #1e3a8a;
  --accent-2: #34C759;
  --accent-2-strong: #1F7D38;
  --danger: #e11d48;
  --danger-text: #9f1239;
  --danger-soft: #fff1f2;
  --warn: #f59e0b;
  --warn-text: #92400e;
  --warn-soft: #fff7ed;
  --ok: #198754;
  --ok-text: #0f5132;
  --ok-soft: #e8f8ec;
  --blue: #2563eb;
  --blue-text: #1e3a8a;
  --queued-text: #1d4ed8;
  --button-text: #ffffff;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-island: 0 8px 30px rgba(0, 0, 0, 0.06);
  --shadow-pill: 0 4px 16px rgba(37, 99, 235, 0.12), 0 1px 2px rgba(0, 0, 0, 0.04);
  --scrollbar-track: rgba(255, 255, 255, 0.45);
  --scrollbar-thumb: rgba(156, 163, 175, 0.62);
  --scrollbar-thumb-hover: rgba(107, 114, 128, 0.72);
  --tone-audio: #34C759;
  --tone-audio-soft: #E8F8EC;
  --tone-audio-text: #1F7D38;
  --tone-video: #FF2D55;
  --tone-video-soft: #FCE5EB;
  --tone-video-text: #A11D38;
  --tone-magic: #AF52DE;
  --tone-magic-soft: #F4E9FB;
  --tone-magic-text: #702A98;
  --tone-compose: #5856D6;
  --tone-compose-soft: #ECECFB;
  --tone-compose-text: #3E3CA8;
  --tone-debug: #FF9500;
  --tone-debug-soft: #FFF1DD;
  --tone-debug-text: #A86200;
  --tone-output: #8E8E93;
  --tone-output-soft: #EFEFF4;
  --tone-output-text: #3C3C43;
}

html[data-theme="light"] body,
html[data-theme="light"] .app-shell,
html[data-theme="light"] .dashboard-view,
html[data-theme="light"] .flowkit-view,
html[data-theme="light"] .library-view,
html[data-theme="light"] .settings-view,
html[data-theme="light"] .mcp-view,
html[data-theme="light"] .mcp-queue-view {
  background:
    radial-gradient(60% 50% at 85% 5%, rgba(255, 200, 220, 0.55), transparent 60%),
    radial-gradient(55% 50% at 5% 25%, rgba(180, 215, 255, 0.55), transparent 65%),
    radial-gradient(55% 50% at 95% 95%, rgba(200, 230, 255, 0.50), transparent 60%),
    radial-gradient(70% 60% at 0% 100%, rgba(230, 215, 255, 0.50), transparent 65%),
    linear-gradient(180deg, #f6f7fb 0%, #eef0f7 100%);
  background-attachment: fixed;
  color: var(--foreground);
}

body,
.app-shell,
.dashboard-view,
.flowkit-view,
.library-view,
.settings-view,
.mcp-view,
.mcp-queue-view {
  background:
    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: var(--foreground);
}

html[data-theme="light"] .auth-gate,
html[data-theme="light"] .startup-loading {
  background:
    radial-gradient(60% 50% at 85% 5%, rgba(255, 200, 220, 0.55), transparent 60%),
    radial-gradient(55% 50% at 5% 25%, rgba(180, 215, 255, 0.55), transparent 65%),
    radial-gradient(55% 50% at 95% 95%, rgba(200, 230, 255, 0.50), transparent 60%),
    radial-gradient(70% 60% at 0% 100%, rgba(230, 215, 255, 0.50), transparent 65%),
    linear-gradient(180deg, #f6f7fb 0%, #eef0f7 100%);
}

.sidebar,
.top-status-bar,
.auth-panel,
.startup-loading-card,
.dashboard-card,
.dashboard-section,
.dashboard-welcome-banner,
.flowkit-panel,
.settings-card,
.settings-toc,
.queue-surface,
.task-card,
.log-dock,
.dialog-card,
.update-card,
.project-manager-create,
.project-manager-row,
.profile-pro-card,
.library-card,
.library-toolbar,
.mcp-card,
.mcp-panel,
.mcp-queue-metrics > .mcp-queue-metric-card,
.mcp-queue-table-wrap,
.mcp-queue-payload,
.agent-chat-panel,
.agent-chat-sidebar {
  background: var(--glass-bg);
  border-color: var(--glass-border);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}

.dashboard-header h2,
.flowkit-header h2,
.library-header h2,
.settings-card-title,
.top-title h2,
.auth-brand h1,
.startup-loading-brand h1 {
  background: linear-gradient(to right, #ffffff 0%, #c4b5fd 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

html[data-theme="light"] .dashboard-header h2,
html[data-theme="light"] .flowkit-header h2,
html[data-theme="light"] .library-header h2,
html[data-theme="light"] .settings-card-title,
html[data-theme="light"] .top-title h2,
html[data-theme="light"] .auth-brand h1,
html[data-theme="light"] .startup-loading-brand h1 {
  background: linear-gradient(to right, #0f172a 0%, #2563eb 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

button,
.dashboard-action-btn,
.settings-btn,
.icon-btn,
.square-btn,
.logout-btn,
.project-manager-action,
.mcp-queue-actions button {
  border-radius: 999px;
  box-shadow: var(--shadow-pill);
}

button,
.auth-primary-btn,
.run-btn,
.poll-btn,
.launch-bridge-btn,
.update-check-btn {
  background: var(--primary);
  color: #ffffff;
}

button:hover:not(:disabled),
.run-btn:hover:not(:disabled),
.poll-btn:hover:not(:disabled),
.dashboard-action-btn:hover {
  background: var(--primary-dark);
  border-color: rgba(37, 99, 235, 0.45);
  color: #ffffff;
}

button.secondary,
.toggle-btn,
.dashboard-action-btn,
.settings-btn,
.icon-btn,
.square-btn,
.auth-google-btn,
.project-manager-action,
.mcp-queue-actions button {
  background: var(--glass-bg-strong);
  border-color: var(--line);
  color: var(--foreground);
}

input,
select,
textarea,
.search-input,
.status-filter,
.settings-input,
.flowkit-field input,
.flowkit-field select,
.mcp-queue-toolbar input,
.mcp-queue-toolbar select,
.mcp-queue-page-size select,
.dialog-card textarea {
  background: var(--bg-input);
  border-color: var(--line);
  border-radius: 12px;
  color: var(--foreground);
}

input:focus,
select:focus,
textarea:focus,
.settings-input:focus,
.mcp-queue-toolbar input:focus,
.mcp-queue-toolbar select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.brand-mark,
.startup-loading-mark,
.dashboard-card-icon,
.slot-card-empty-icon,
.output-icon,
.pp-source-icon {
  background: var(--primary-50);
  border-color: var(--primary-light);
  color: var(--primary);
  border-radius: 14px;
}

.nav-item {
  border-radius: 999px;
  margin: 0 10px;
  width: calc(100% - 20px);
  height: 46px;
  padding: 0 14px;
}

.nav-item .nav-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
}

html[data-theme="light"] .nav-item .nav-icon {
  background: var(--primary-50);
  color: var(--primary);
}

.nav-item-link {
  box-sizing: border-box;
  cursor: pointer;
  text-decoration: none;
}

.nav-item-link::after {
  content: "↗";
  margin-left: auto;
  font-size: 11px;
  opacity: 0.64;
}

.app-shell.sidebar-collapsed .nav-item-link::after {
  display: none;
}

.nav-item.active,
.nav-item:hover:not(:disabled) {
  background: var(--primary);
  color: #ffffff;
}

.nav-item.active .nav-icon,
.nav-item:hover:not(:disabled) .nav-icon {
  background: transparent;
  color: #ffffff;
}

html[data-theme="light"] .nav-item.active .nav-icon,
html[data-theme="light"] .nav-item:hover:not(:disabled) .nav-icon {
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

.sidebar-footer,
.logout-btn {
  min-width: 0;
}

.logout-btn {
  max-width: 100%;
  min-height: 44px;
  padding: 8px 16px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.22;
}

.logout-btn {
  align-items: flex-start;
}

.dashboard-card[data-card="total"],
.mcp-queue-metrics > .mcp-queue-metric-card[data-type="queue"] {
  border-left-color: var(--tone-compose);
}

.dashboard-card[data-card="running"],
.task-chip[data-variant="aspect"] {
  border-left-color: var(--tone-video);
}

.dashboard-card[data-card="completed"],
.task-card[data-status="completed"] {
  border-left-color: var(--tone-audio);
}

.dashboard-card[data-card="errors"],
.task-card[data-status="error"] {
  border-left-color: var(--tone-video);
}

html[data-theme="light"] .dashboard-welcome-banner {
  background:
    linear-gradient(135deg, rgba(239, 246, 255, 0.82), rgba(244, 233, 251, 0.70)),
    var(--glass-bg);
}

.queue-surface,
.mcp-queue-table-wrap {
  border-radius: 18px;
}

.task-card,
.dashboard-card,
.dashboard-section,
.settings-card,
.dialog-card,
.profile-pro-card,
.library-card,
.mcp-card,
.mcp-panel,
.mcp-queue-metrics > .mcp-queue-metric-card {
  border-radius: 24px;
}

.mcp-queue-table,
.mcp-queue-table th,
.mcp-queue-table td {
  color: var(--foreground);
  border-color: var(--line-soft);
}

html[data-theme="light"] .mcp-queue-table th {
  background: rgba(239, 246, 255, 0.76);
  color: var(--muted);
}

.mcp-queue-row:hover td,
.mcp-queue-row[data-selected="true"] td {
  background: rgba(37, 99, 235, 0.06);
}

.queue-surface tbody tr:not(.extend-sub-row) {
  background: rgba(255, 255, 255, 0.68);
  color: var(--foreground);
}

.queue-surface tbody tr:not(.extend-sub-row):hover {
  background: rgba(239, 246, 255, 0.82);
}

.queue-surface tbody tr[data-status="running"]:not(.extend-sub-row),
.queue-surface tbody tr[data-status="queued"]:not(.extend-sub-row) {
  background: rgba(239, 246, 255, 0.82);
}

.queue-surface tbody tr[data-status="completed"]:not(.extend-sub-row) {
  background: rgba(232, 248, 236, 0.74);
}

.queue-surface tbody tr[data-status="error"]:not(.extend-sub-row) {
  background: rgba(255, 241, 242, 0.82);
}

html[data-theme="light"] .mcp-queue-payload,
html[data-theme="light"] pre,
html[data-theme="light"] code,
html[data-theme="light"] .prompt-box,
html[data-theme="light"] .extend-prompt-box,
html[data-theme="light"] .extend-draft-textarea,
html[data-theme="light"] .flowkit-prompt-preview {
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--line);
  color: var(--foreground);
}

.mcp-queue-payload,
pre,
code,
.extend-draft-textarea,
.flowkit-prompt-preview {
  background: rgba(0, 0, 0, 0.35);
  border-color: var(--line-soft);
  color: var(--foreground);
}

.task-card-media,
.output-preview,
.video-preview-card video,
.slot-card.is-filled .slot-card-surface {
  background: #090e18;
}

.dialog-backdrop {
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.danger,
button.danger,
.dashboard-action-danger,
.project-manager-action.danger,
.logout-btn {
  background: var(--danger-soft);
  border-color: rgba(225, 29, 72, 0.26);
  color: var(--danger-text);
}

.danger:hover:not(:disabled),
button.danger:hover:not(:disabled),
.dashboard-action-danger:hover:not(:disabled),
.project-manager-action.danger:hover:not(:disabled) {
  background: #ffe4e6;
  color: var(--danger-text);
}

.main-region,
.project-tabs,
.config-rail,
.config-section,
.section-toggle,
.check-row,
.tier-btn,
.mode-card,
.slot-card-surface,
.refs-tray,
.project-manager-card,
.project-manager-tab,
.project-manager-list,
.update-version-card,
.flowkit-list-item,
.settings-provider-tab,
.settings-provider-panel,
.settings-info-row,
.settings-toggle,
.agent-chat-header,
.agent-chat-message,
.agent-chat-session-item,
.agent-chat-prompt-item,
.agent-chat-inspector-check,
.agent-chat-inspector-box,
.agent-chat-code-block,
.mcp-header,
.mcp-section,
.mcp-secret,
.mcp-key-row,
.mcp-setup-card,
.mcp-metrics > div,
.mcp-usage-metrics > .mcp-usage-metric-card,
.mcp-activity-wrap,
.mcp-activity-toolbar input,
.mcp-activity-toolbar select,
.mcp-activity-page-size select,
.mcp-activity-table {
  background: var(--glass-bg);
  border-color: var(--glass-border);
  color: var(--foreground);
  box-shadow: var(--shadow-card);
}

.mcp-header {
  padding: 22px;
  border: 1px solid var(--glass-border);
  border-radius: 24px;
}

.mcp-section {
  border-radius: 24px;
}

.mcp-queue-toolbar,
.mcp-queue-bulkbar,
.mcp-queue-pager,
.mcp-queue-list > .mcp-empty {
  border-radius: 18px;
}

.project-manager-card,
.project-manager-create,
.project-manager-footer,
.project-manager-close,
.project-manager-tab,
.project-manager-empty,
.project-manager-row {
  background: var(--glass-bg-strong);
  border-color: var(--glass-border);
  color: var(--foreground);
}

.project-manager-card {
  border-radius: 24px;
}

.project-manager-create,
.project-manager-footer {
  border-color: var(--line-soft);
}

.project-manager-tab.is-active,
.project-manager-row.is-active {
  background: var(--primary-50);
  border-color: rgba(37, 99, 235, 0.42);
  color: var(--primary-dark);
}

.project-manager-marker {
  color: var(--primary);
}

.project-manager-action.danger {
  background: var(--danger-soft);
  border-color: rgba(225, 29, 72, 0.26);
  color: var(--danger-text);
}

.project-tab,
.project-add,
.section-toggle,
.add-footer,
.settings-provider-tab,
.mcp-client-tabs button,
.mcp-view button.secondary {
  background: var(--glass-bg-strong);
  border-color: var(--line);
  color: var(--foreground);
}

.add-footer {
  border-top-color: var(--glass-border);
  box-shadow: 0 -8px 24px rgba(37, 99, 235, 0.07);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}

.add-footer .button-row {
  min-width: 0;
}

.project-tab.active,
.project-tab:hover,
.settings-provider-tab.active,
.mcp-client-tabs button.active,
.mcp-usage-metrics > .mcp-usage-metric-card:hover,
.mcp-usage-metrics > .mcp-usage-metric-card[data-active="true"] {
  background: var(--primary-50);
  border-color: rgba(37, 99, 235, 0.42);
  color: var(--primary-dark);
}

.agent-chat-message[data-role="user"],
.agent-chat-message[data-tone="thinking"],
.flowkit-list-item:hover:not(:disabled),
.flowkit-list-item.selected,
.mcp-key-row[data-selected="true"],
.mcp-key-row .mcp-select.active {
  background: var(--primary-50);
  border-color: var(--primary-light);
  color: var(--primary-dark);
}

.agent-chat-fab,
.lang-btn.active,
.mcp-view button {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.update-card {
  background: var(--glass-bg-strong);
  border-color: var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--shadow-island);
  color: var(--foreground);
}

.update-window-bar {
  background: rgba(255, 255, 255, 0.52);
  border-bottom-color: var(--glass-border);
  color: var(--muted);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}

.update-window-title,
.update-version-label,
.update-progress-text,
.update-changelog-title {
  color: var(--muted);
}

.update-window-close {
  border-radius: 999px;
  color: var(--muted);
}

.update-window-close:hover {
  background: var(--primary-50);
  color: var(--primary-dark);
}

.update-version-card,
.update-changelog-list,
.update-progress-track {
  background: var(--glass-bg);
  border-color: var(--glass-border);
  color: var(--foreground);
  box-shadow: var(--shadow-card);
}

.update-version-card {
  border-radius: 18px;
}

.update-version-number {
  color: var(--heading);
}

.update-version-arrow {
  color: var(--primary);
}

.update-status-line {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--primary-50);
  color: var(--primary-dark);
}

.update-status-line[data-tone="ok"] {
  background: var(--ok-soft);
  border-color: rgba(25, 135, 84, 0.24);
  color: var(--ok-text);
}

.update-status-line[data-tone="warn"] {
  background: var(--warn-soft);
  border-color: rgba(245, 158, 11, 0.28);
  color: var(--warn-text);
}

.update-status-line[data-tone="error"] {
  background: var(--danger-soft);
  border-color: rgba(225, 29, 72, 0.28);
  color: var(--danger-text);
}

.update-progress-track {
  background: rgba(239, 246, 255, 0.82);
}

.update-progress-bar {
  background: var(--primary);
}

.update-actions {
  background: rgba(255, 255, 255, 0.42);
  border-top-color: var(--glass-border);
}

.update-check-btn {
  background: var(--primary);
  box-shadow: var(--shadow-pill);
}

.update-check-btn:hover {
  background: var(--primary-dark);
}

.update-support-btn {
  background: var(--glass-bg-strong);
  border-color: rgba(37, 99, 235, 0.28);
  color: var(--primary-dark);
}

.update-support-btn:hover {
  background: var(--primary-50);
  border-color: rgba(37, 99, 235, 0.42);
  color: var(--primary-dark);
}

.rail-scroll {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px 14px 18px;
}

.config-section {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  background: var(--glass-bg-strong);
  box-shadow: var(--shadow-card);
}

.config-section.collapsible-section {
  padding-top: 14px;
}

.config-section.collapsible-section.is-collapsed {
  padding-bottom: 14px;
}

.config-section .collapse-header {
  min-height: 38px;
}

.config-rail .section-toggle {
  min-height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--primary-dark);
}

.config-rail .section-toggle:hover:not(:disabled) {
  background: transparent;
  color: var(--primary);
}

.config-section .section-toggle-icon {
  color: var(--primary);
}

.config-section .section-content {
  display: grid;
  gap: 12px;
  padding-top: 12px;
}

.config-section .section-content > *,
.config-section .section-content > label,
.config-section .compact-grid > label,
.config-section .toggle-grid > label {
  margin-bottom: 0;
}

.config-section .compact-grid,
.config-section .toggle-grid,
.config-section .mode-grid,
.config-section .aspect-ratio-grid,
.config-section .tier-grid,
.config-section .youtube-prompt-tool,
.config-section .profile-pro-cards {
  gap: 10px;
}

.config-section .workflow-stepper {
  margin: 0;
  border-radius: 18px;
  background: var(--glass-bg);
  border-color: var(--glass-border);
  box-shadow: var(--shadow-card);
}

.config-section .check-row,
.config-section .settings-toggle,
.config-section .mode-card,
.config-section .tier-btn,
.config-section .aspect-ratio-btn {
  border-radius: 14px;
}

.queue-footer .tool-btn,
.queue-footer .upscale-all-btn,
.queue-footer .watermark-all-btn,
.queue-footer .download-all-btn {
  color: var(--foreground);
}

.queue-footer .tool-btn:hover:not(:disabled),
.queue-footer .upscale-all-btn:hover:not(:disabled),
.queue-footer .watermark-all-btn:hover:not(:disabled),
.queue-footer .download-all-btn:hover:not(:disabled) {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #ffffff;
}

.queue-footer .trash-btn:hover:not(:disabled) {
  background: var(--danger);
  border-color: var(--danger);
  color: #ffffff;
}

#mcpUsagePeriod,
#mcpUsagePeriod option {
  background: var(--bg-input);
  color: var(--foreground);
}

.mcp-usage-metrics > .mcp-usage-metric-card span {
  color: var(--muted);
}

.mcp-usage-metrics > .mcp-usage-metric-card strong {
  color: var(--heading);
}

.mcp-usage-metrics > .mcp-usage-metric-card:hover span,
.mcp-usage-metrics > .mcp-usage-metric-card[data-active="true"] span {
  color: var(--primary-dark);
}

.mcp-usage-metrics > .mcp-usage-metric-card:hover strong,
.mcp-usage-metrics > .mcp-usage-metric-card[data-active="true"] strong {
  color: var(--primary-dark);
}

.mcp-create input {
  background: var(--bg-input);
  border-color: var(--line-soft);
  color: var(--foreground);
}

.mcp-create input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.mcp-key-row {
  background: var(--glass-bg-strong);
  border-color: var(--glass-border);
  color: var(--foreground);
}

.mcp-key-row[data-selected="true"] {
  background: var(--primary-50);
  border-color: var(--primary-light);
  color: var(--primary-dark);
}

.mcp-key-row[data-status="revoked"] {
  background: var(--glass-bg);
  opacity: 0.72;
}

.mcp-key-main strong {
  color: var(--heading);
}

.mcp-key-main code {
  background: var(--primary-50);
  border: 1px solid rgba(37, 99, 235, 0.2);
  color: var(--primary-dark);
}

.mcp-key-meta,
.mcp-key-panel-hint,
.mcp-secret span {
  color: var(--muted);
}

.mcp-key-panel {
  border-top-color: var(--line-soft);
}

.mcp-key-panel code,
.mcp-key-panel pre {
  background: var(--bg-input);
  border-color: var(--line-soft);
  color: var(--foreground);
}

.mcp-activity-table {
  background: transparent;
  color: var(--foreground);
}

.mcp-activity-table th,
.mcp-activity-table td {
  border-bottom-color: var(--line-soft);
}

.mcp-activity-table th {
  color: var(--primary-dark);
}

.mcp-activity-table td {
  color: var(--foreground);
}

.mcp-activity-table tbody tr:hover {
  background: var(--primary-50);
}

.mcp-activity-status {
  background: var(--ok-soft);
  color: var(--ok-text);
}

.mcp-activity-status.failed {
  background: var(--danger-soft);
  color: var(--danger-text);
}

.mcp-activity-table .mcp-empty {
  color: var(--muted);
}

.mcp-section code {
  background: var(--primary-50);
  border: 1px solid rgba(37, 99, 235, 0.18);
  color: var(--primary-dark);
}

.mcp-setup-card p,
.mcp-metrics > div span,
.mcp-activity-page-size,
.mcp-activity-pager,
.mcp-empty,
.mcp-status {
  color: var(--muted);
}

.mcp-metrics > div strong {
  color: var(--heading);
}

.mcp-client-tabs button {
  color: var(--foreground);
}

.mcp-client-tabs button.active {
  color: var(--primary-dark);
}

.mcp-setup-card pre {
  background: var(--bg-input);
  border-color: var(--line-soft);
  color: var(--foreground);
}

.mcp-secret code {
  background: var(--ok-soft);
  border-color: rgba(25, 135, 84, 0.24);
  color: var(--ok-text);
}

.mcp-status[data-tone="error"] {
  color: var(--danger-text);
}

.mcp-status[data-tone="ok"] {
  color: var(--ok-text);
}

.mcp-key-row .mcp-select.active {
  background: var(--ok-soft);
  border-color: rgba(25, 135, 84, 0.24);
  color: var(--ok-text);
}

.mcp-key-row .mcp-revoke {
  color: var(--danger-text);
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at 16% 8%, rgba(147, 197, 253, 0.48), transparent 28%),
    radial-gradient(circle at 82% 14%, rgba(251, 207, 232, 0.46), transparent 30%),
    radial-gradient(circle at 68% 86%, rgba(187, 247, 208, 0.42), transparent 28%),
    linear-gradient(135deg, #f8fbff 0%, #eef6ff 48%, #fff8fb 100%);
}

html[data-theme="light"] .app-shell {
  background: transparent;
}

html[data-theme="light"] .sidebar,
html[data-theme="light"] .top-status-bar {
  background: rgba(255, 255, 255, 0.66);
  border-color: rgba(37, 99, 235, 0.14);
  box-shadow: 0 12px 36px rgba(38, 54, 89, 0.09);
}

html[data-theme="light"] .main-region {
  background: rgba(255, 255, 255, 0.36);
}

html[data-theme="light"] .project-tabs {
  background: rgba(255, 255, 255, 0.48);
  border-bottom-color: rgba(37, 99, 235, 0.14);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}

html[data-theme="light"] .project-tab,
html[data-theme="light"] .project-add {
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(38, 54, 89, 0.08);
}

html[data-theme="light"] .project-tab.active,
html[data-theme="light"] .nav-item.active,
html[data-theme="light"] .mcp-client-tabs button.active {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  border-color: rgba(37, 99, 235, 0.3);
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.24);
}

html[data-theme="light"] .project-tab.active .project-tab-close,
html[data-theme="light"] .nav-item.active .nav-icon,
html[data-theme="light"] .mcp-client-tabs button.active {
  color: #ffffff;
}

html[data-theme="light"] .dashboard-action-btn,
html[data-theme="light"] .add-queue-btn,
html[data-theme="light"] .mcp-create button,
html[data-theme="light"] .mcp-download-btn,
html[data-theme="light"] .mcp-setup-card > button,
html[data-theme="light"] .auth-primary-btn,
html[data-theme="light"] .primary-wide,
html[data-theme="light"] .agent-chat-fab {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  border-color: rgba(37, 99, 235, 0.28);
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.22);
}

html[data-theme="light"] .dashboard-action-btn:hover:not(:disabled),
html[data-theme="light"] .add-queue-btn:hover:not(:disabled),
html[data-theme="light"] .mcp-create button:hover:not(:disabled),
html[data-theme="light"] .mcp-download-btn:hover,
html[data-theme="light"] .mcp-setup-card > button:hover:not(:disabled),
html[data-theme="light"] .primary-wide:hover:not(:disabled) {
  filter: brightness(0.96) saturate(1.08);
}

html[data-theme="light"] .dashboard-section,
html[data-theme="light"] .mcp-header,
html[data-theme="light"] .mcp-section,
html[data-theme="light"] .settings-card,
html[data-theme="light"] .project-manager-card {
  border-color: rgba(37, 99, 235, 0.14);
  box-shadow: 0 16px 46px rgba(38, 54, 89, 0.1);
}

html[data-theme="light"] .dashboard-card,
html[data-theme="light"] .config-section,
html[data-theme="light"] .queue-surface,
html[data-theme="light"] .mcp-metrics > div,
html[data-theme="light"] .mcp-usage-metrics > .mcp-usage-metric-card {
  border-color: rgba(37, 99, 235, 0.13);
  box-shadow: 0 12px 34px rgba(38, 54, 89, 0.08);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}

html[data-theme="light"] #librarySearchInput {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(239, 246, 255, 0.66) 54%, rgba(253, 242, 248, 0.58));
  border-color: rgba(37, 99, 235, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 10px 28px rgba(38, 54, 89, 0.08);
  backdrop-filter: blur(18px) saturate(165%);
  -webkit-backdrop-filter: blur(18px) saturate(165%);
}

html[data-theme="light"] #librarySearchInput::placeholder {
  color: rgba(71, 85, 105, 0.76);
}

html[data-theme="light"] #librarySearchInput:hover {
  border-color: rgba(37, 99, 235, 0.28);
}

html[data-theme="light"] #librarySearchInput:focus {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(239, 246, 255, 0.78) 54%, rgba(253, 242, 248, 0.7));
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14), 0 14px 34px rgba(38, 54, 89, 0.11);
}

html[data-theme="light"] .queue-surface tbody tr:not(.extend-sub-row) {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(239, 246, 255, 0.58) 58%, rgba(253, 242, 248, 0.48));
  box-shadow: inset 4px 0 rgba(37, 99, 235, 0.28), inset 0 1px rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px) saturate(155%);
  -webkit-backdrop-filter: blur(16px) saturate(155%);
  transition: background 160ms ease, box-shadow 160ms ease, outline-color 160ms ease;
}

html[data-theme="light"] .queue-surface tbody tr[data-status="running"]:not(.extend-sub-row),
html[data-theme="light"] .queue-surface tbody tr[data-status="queued"]:not(.extend-sub-row) {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(219, 234, 254, 0.68) 56%, rgba(238, 242, 255, 0.58));
  box-shadow: inset 4px 0 rgba(37, 99, 235, 0.66), inset 0 1px rgba(255, 255, 255, 0.82);
}

html[data-theme="light"] .queue-surface tbody tr[data-status="completed"]:not(.extend-sub-row) {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(220, 252, 231, 0.58) 54%, rgba(239, 246, 255, 0.5));
  box-shadow: inset 4px 0 rgba(22, 163, 74, 0.58), inset 0 1px rgba(255, 255, 255, 0.82);
}

html[data-theme="light"] .queue-surface tbody tr[data-status="error"]:not(.extend-sub-row) {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(255, 228, 230, 0.6) 54%, rgba(253, 242, 248, 0.56));
  box-shadow: inset 4px 0 rgba(225, 29, 72, 0.52), inset 0 1px rgba(255, 255, 255, 0.82);
}

html[data-theme="light"] .queue-surface tbody tr:not(.extend-sub-row):hover {
  outline: 1px solid rgba(37, 99, 235, 0.24);
  outline-offset: -1px;
}

html[data-theme="light"] #projectManagerDialog {
  background: rgba(30, 41, 59, 0.22);
  backdrop-filter: blur(16px) saturate(135%);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
}

html[data-theme="light"] .project-manager-card {
  background:
    radial-gradient(circle at 12% 8%, rgba(191, 219, 254, 0.5), transparent 34%),
    radial-gradient(circle at 88% 16%, rgba(251, 207, 232, 0.42), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(248, 250, 252, 0.72));
  border-color: rgba(37, 99, 235, 0.18);
  box-shadow: 0 28px 80px rgba(38, 54, 89, 0.2), inset 0 1px rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
}

html[data-theme="light"] .project-manager-header {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(239, 246, 255, 0.58) 58%, rgba(253, 242, 248, 0.5));
  border-bottom-color: rgba(37, 99, 235, 0.12);
}

html[data-theme="light"] .project-manager-create {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.58), rgba(239, 246, 255, 0.46));
  border-bottom-color: rgba(37, 99, 235, 0.12);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .project-manager-create-row input {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(239, 246, 255, 0.62), rgba(253, 242, 248, 0.54));
  border-color: rgba(37, 99, 235, 0.18);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.82);
}

html[data-theme="light"] .project-manager-tabs {
  background: rgba(255, 255, 255, 0.34);
}

html[data-theme="light"] .project-manager-tab {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(37, 99, 235, 0.14);
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(38, 54, 89, 0.07);
}

html[data-theme="light"] .project-manager-tab.is-active {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  border-color: rgba(37, 99, 235, 0.34);
  color: #ffffff;
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.22);
}

html[data-theme="light"] .project-manager-list {
  background: rgba(248, 250, 252, 0.34);
  box-shadow: none;
}

html[data-theme="light"] .project-manager-row {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(239, 246, 255, 0.54) 62%, rgba(253, 242, 248, 0.46));
  border-color: rgba(37, 99, 235, 0.14);
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(38, 54, 89, 0.07), inset 0 1px rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

html[data-theme="light"] .project-manager-row:hover {
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: 0 12px 30px rgba(38, 54, 89, 0.1), inset 0 1px rgba(255, 255, 255, 0.86);
}

html[data-theme="light"] .project-manager-row.is-active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(219, 234, 254, 0.66) 56%, rgba(238, 242, 255, 0.58));
  border-color: rgba(37, 99, 235, 0.42);
  box-shadow: inset 4px 0 rgba(37, 99, 235, 0.72), 0 12px 30px rgba(37, 99, 235, 0.11);
  color: var(--foreground);
}

html[data-theme="light"] .project-manager-footer {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.62), rgba(239, 246, 255, 0.48) 58%, rgba(253, 242, 248, 0.44));
  border-top-color: rgba(37, 99, 235, 0.12);
}

html[data-theme="light"] .project-manager-close {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(37, 99, 235, 0.14);
  box-shadow: 0 8px 22px rgba(38, 54, 89, 0.08);
}

html[data-theme="light"] #updateDialog {
  background: rgba(30, 41, 59, 0.22);
  backdrop-filter: blur(16px) saturate(135%);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
}

html[data-theme="light"] .update-card {
  background:
    radial-gradient(circle at 10% 6%, rgba(191, 219, 254, 0.52), transparent 36%),
    radial-gradient(circle at 90% 14%, rgba(251, 207, 232, 0.44), transparent 36%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(248, 250, 252, 0.74));
  border-color: rgba(37, 99, 235, 0.18);
  box-shadow: 0 28px 80px rgba(38, 54, 89, 0.2), inset 0 1px rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
}

html[data-theme="light"] .update-window-bar {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(239, 246, 255, 0.6) 58%, rgba(253, 242, 248, 0.52));
  border-bottom-color: rgba(37, 99, 235, 0.12);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.82);
}

html[data-theme="light"] .update-body {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.42), rgba(239, 246, 255, 0.38) 54%, rgba(253, 242, 248, 0.34));
}

html[data-theme="light"] .update-version-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(219, 234, 254, 0.58));
  border-color: rgba(37, 99, 235, 0.16);
  box-shadow: 0 12px 30px rgba(38, 54, 89, 0.08), inset 0 1px rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

html[data-theme="light"] .update-version-card:last-child {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(253, 242, 248, 0.62));
}

html[data-theme="light"] .update-status-line {
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.78), 0 8px 22px rgba(38, 54, 89, 0.06);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
}

html[data-theme="light"] .update-progress-track {
  background: linear-gradient(90deg, rgba(219, 234, 254, 0.76), rgba(238, 242, 255, 0.68));
  border-color: rgba(37, 99, 235, 0.14);
  box-shadow: inset 0 1px 3px rgba(38, 54, 89, 0.08);
}

html[data-theme="light"] .update-progress-bar,
html[data-theme="light"] .update-check-btn {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
}

html[data-theme="light"] .update-changelog-list {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(239, 246, 255, 0.52) 60%, rgba(253, 242, 248, 0.48));
  border-color: rgba(37, 99, 235, 0.14);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(38, 54, 89, 0.07), inset 0 1px rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

html[data-theme="light"] .update-actions {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.64), rgba(239, 246, 255, 0.5) 58%, rgba(253, 242, 248, 0.46));
  border-top-color: rgba(37, 99, 235, 0.12);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .update-check-btn,
html[data-theme="light"] .update-support-btn,
html[data-theme="light"] .update-secondary-actions .secondary {
  border-radius: 12px;
}

html[data-theme="light"] .update-check-btn {
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.22);
}

html[data-theme="light"] .update-support-btn,
html[data-theme="light"] .update-secondary-actions .secondary {
  background: rgba(255, 255, 255, 0.66);
  border-color: rgba(37, 99, 235, 0.16);
  box-shadow: 0 8px 22px rgba(38, 54, 89, 0.07), inset 0 1px rgba(255, 255, 255, 0.8);
}

html[data-theme="light"] .profile-pro-card .pp-action-row .pp-restart-btn {
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(254, 243, 199, 0.7);
}

/* Mobile layout contract: the page fits the viewport; dense data owns its scroll. */
@media (max-width: 1024px) {
  html,
  body {
    overflow: hidden;
  }

  .app-shell,
  .app-shell.sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
    width: 100%;
  }

  .sidebar {
    display: grid;
    grid-template-rows: auto auto auto;
    min-height: 0;
    max-height: 164px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    overflow: hidden;
  }

  .brand,
  .app-shell.sidebar-collapsed .brand {
    justify-content: flex-start;
    padding: 10px 14px 8px;
  }

  .brand-mark,
  .app-shell.sidebar-collapsed .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-copy,
  .app-shell.sidebar-collapsed .brand-copy {
    display: block;
  }

  .brand h1 {
    font-size: 16px;
  }

  .tool-nav,
  .app-shell.sidebar-collapsed .tool-nav {
    display: flex;
    gap: 6px;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 10px 8px;
    scrollbar-width: none;
  }

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

  .nav-item,
  .app-shell.sidebar-collapsed .nav-item {
    flex: 0 0 auto;
    justify-content: flex-start;
    width: auto;
    min-width: 86px;
    height: 42px;
    padding: 0 11px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    font-size: 11px;
  }

  .nav-item .nav-icon,
  .app-shell.sidebar-collapsed .nav-item .nav-icon {
    width: 18px;
    font-size: 13px;
  }

  .nav-label,
  .app-shell.sidebar-collapsed .nav-label {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .sidebar-footer,
  .app-shell.sidebar-collapsed .sidebar-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0 10px 8px;
    border-top: 0;
  }

  .logout-btn,
  .app-shell.sidebar-collapsed .logout-btn {
    flex: 1 1 0;
    justify-content: center;
    min-height: 36px;
    padding: 0 8px;
    font-size: 11px;
    text-align: center;
  }

  .app-shell.sidebar-collapsed .logout-btn {
    display: flex;
  }

  .main-region {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    min-width: 0;
    min-height: 0;
    overflow: hidden;
  }

  .main-region > *,
  .settings-layout,
  .settings-cards,
  .dashboard-scroll,
  .mcp-page,
  .mcp-queue-page {
    min-width: 0;
    max-width: 100%;
  }

  .top-status-bar {
    align-items: stretch;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
    padding: 9px 12px 7px;
  }

  .top-actions {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .status-pill,
  .version-pill,
  .lang-pill {
    min-height: 38px;
  }

  .work-area {
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
  }

  .work-area.config-rail-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .config-rail {
    max-height: min(44vh, 360px);
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .queue-workspace {
    min-width: 0;
    overflow-x: hidden;
    padding: 0 8px;
  }

  .queue-toolbar {
    grid-template-columns: repeat(4, minmax(36px, auto)) minmax(0, 1fr);
    gap: 6px;
    overflow-x: auto;
  }

  .queue-toolbar .search-input,
  .queue-toolbar .status-filter {
    min-width: 120px;
  }

  .queue-surface {
    width: 100%;
    min-width: 0;
  }

  .queue-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-toc {
    max-height: 90px;
    overflow: hidden;
    padding: 10px 12px;
  }

  .settings-toc h3 {
    margin: 0 0 6px;
  }

  .settings-toc nav {
    flex-direction: row;
    min-width: max-content;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
  }

  .settings-toc-link {
    min-height: 38px;
    white-space: nowrap;
  }

  .dashboard-scroll,
  .mcp-page,
  .mcp-queue-page {
    padding-left: 12px;
    padding-right: 12px;
  }

  .dashboard-header {
    padding-top: 0;
  }

  .dashboard-actions {
    position: static;
    flex-wrap: wrap;
  }

  .dashboard-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .agent-chat-panel {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    height: min(640px, calc(100vh - 20px));
    min-width: 0;
  }

  .dialog-card,
  .project-manager-card,
  .update-card {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }
}

@media (max-width: 480px) {
  .sidebar {
    max-height: 154px;
  }

  .nav-item,
  .app-shell.sidebar-collapsed .nav-item {
    min-width: 78px;
    padding: 0 8px;
  }

  .top-actions {
    justify-content: space-between;
  }

  .top-actions > * {
    flex: 0 0 auto;
  }

  .queue-toolbar {
    grid-template-columns: repeat(2, minmax(36px, 1fr));
    padding: 6px 0;
  }

  .queue-toolbar .search-input,
  .queue-toolbar .status-filter {
    grid-column: 1 / -1;
    width: 100%;
  }

  .dashboard-cards {
    grid-template-columns: minmax(0, 1fr);
  }
}

.mcp-download-btn {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: 9px;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.2);
  gap: 7px;
}

.mcp-download-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.mcp-download-btn:hover {
  border-color: rgba(37, 99, 235, 0.45);
  color: #ffffff;
  filter: brightness(0.96) saturate(1.08);
}
@media (prefers-reduced-motion: reduce) {
  .app-shell,
  .nav-label {
    transition: none;
  }
}

.config-rail.minimal-config-mode #configOverviewSection,
.config-rail.minimal-config-mode #extensionConfigOptions,
.config-rail.minimal-config-mode #profileProSection,
.config-rail.minimal-config-mode #paygateSection,
.config-rail.minimal-config-mode #openGpuStudioBtn,
.config-rail.minimal-config-mode #addPromptsBtn,
.config-rail.minimal-config-mode #executionSection,
.config-rail.minimal-config-mode #channelSection,
.config-rail.minimal-config-mode #outputSection {
  display: none !important;
}

.app-shell:not(.advanced-operator-mode) .gpu-image-advanced-fields,
.gpu-image-advanced-fields[hidden] {
  display: none !important;
}

#libraryEmptyState {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

#libraryEmptyCreateBtn {
  min-height: 36px;
}

.youtube-prompt-tool[hidden] {
  display: none !important;
}

.config-rail input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-content: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid rgba(99, 120, 168, 0.5);
  border-radius: 6px;
  background-color: rgba(250, 252, 255, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 2px 7px rgba(37, 99, 235, 0.1);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.config-rail input[type="checkbox"]::after {
  content: "✓";
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  transform: scale(0);
  transition: transform 140ms ease;
}

.config-rail input[type="checkbox"]:checked {
  border-color: rgba(79, 70, 229, 0.78);
  background-color: #4f46e5;
  background-image: linear-gradient(135deg, #2563eb 0%, #6d5ce7 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 4px 10px rgba(79, 70, 229, 0.25);
}

.config-rail input[type="checkbox"]:checked::after {
  transform: scale(1);
}

.config-rail input[type="checkbox"]:hover {
  border-color: rgba(37, 99, 235, 0.78);
  transform: translateY(-1px);
}

.config-rail input[type="checkbox"]:focus-visible {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2), 0 4px 12px rgba(79, 70, 229, 0.22);
}

html[data-theme="dark"] .config-rail input[type="checkbox"]:not(:checked) {
  border-color: rgba(180, 196, 235, 0.48);
  background-color: rgba(54, 48, 82, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 2px 8px rgba(5, 8, 20, 0.24);
}

@media (prefers-reduced-motion: reduce) {
  .config-rail input[type="checkbox"],
  .config-rail input[type="checkbox"]::after {
    transition: none;
  }
}

.task-card-prompt-section {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  min-width: 0;
}

.task-card-prompt-toggle {
  align-self: flex-end;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--accent-text);
  background: rgba(111, 82, 214, 0.07);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.2;
}

.task-card-prompt-toggle:hover {
  border-color: rgba(111, 82, 214, 0.42);
  background: rgba(111, 82, 214, 0.13);
}

.task-card-prompt-toggle:focus-visible {
  outline: 2px solid rgba(79, 70, 229, 0.38);
  outline-offset: 2px;
}

.task-card-prompt[hidden] {
  display: none !important;
}

.queue-grid.minimal-grid-card-mode .task-chip[data-variant="tier"],
.queue-grid.minimal-grid-card-mode .task-chip[data-variant="aspect"],
.queue-grid.minimal-grid-card-mode .task-chip[data-variant="duration"],
.queue-grid.minimal-grid-card-mode .task-chip[data-variant="mode"],
.queue-grid.minimal-grid-card-mode .task-chip[data-variant="channel"] {
  display: none;
}

.queue-grid.minimal-grid-card-mode .output-preview-label,
.queue-grid.minimal-grid-card-mode .output-download-link {
  display: none;
}

.app-shell.minimal-grid-card-mode .queue-footer .upscale-all-btn,
.app-shell.minimal-grid-card-mode .queue-footer .watermark-all-btn,
.app-shell.minimal-grid-card-mode #agentChatToggleBtn,
.app-shell.minimal-grid-card-mode #agentChatPanel {
  display: none;
}

/* ── Config & Prompt Rail Drag Resizer ────────────────────────────────── */
.config-rail-resizer {
  position: absolute;
  top: 0;
  right: -5px;
  bottom: 0;
  width: 10px;
  cursor: col-resize;
  z-index: 45;
  touch-action: none;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  outline: none;
}

.config-rail-resizer-line {
  width: 2px;
  height: 100%;
  background: transparent;
  border-radius: 1px;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
  pointer-events: none;
}

.config-rail-resizer:hover .config-rail-resizer-line,
.config-rail-resizer.is-active .config-rail-resizer-line,
body.config-rail-resizing .config-rail-resizer-line {
  background: var(--primary, #3b82f6);
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.45);
}

.config-rail-resizer::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 4px;
  height: 28px;
  border-radius: 2px;
  background: var(--line, rgba(255, 255, 255, 0.2));
  opacity: 0;
  transition: opacity 0.15s ease, background-color 0.15s ease;
  pointer-events: none;
}

.config-rail-resizer:hover::after,
.config-rail-resizer.is-active::after,
body.config-rail-resizing .config-rail-resizer::after {
  opacity: 1;
  background: var(--primary, #3b82f6);
}

.config-rail-resizer:focus-visible .config-rail-resizer-line {
  background: var(--primary, #3b82f6);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4);
}

/* ── Expand Grip (visible when rail is collapsed) ─────────────────────── */
.config-rail-expand-grip {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 10px;
  cursor: col-resize;
  z-index: 45;
  touch-action: none;
  user-select: none;
  background: transparent;
}

.config-rail-expand-grip-line {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.config-rail-expand-grip:hover .config-rail-expand-grip-line,
.config-rail-expand-grip.is-active .config-rail-expand-grip-line {
  background: var(--primary, #3b82f6);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
}

.work-area.config-rail-collapsed .config-rail-expand-grip {
  display: block;
}

/* ── Dragging State (disable selection & transitions) ─────────────────── */
body.config-rail-resizing {
  cursor: col-resize !important;
  user-select: none !important;
}

body.config-rail-resizing * {
  user-select: none !important;
  cursor: col-resize !important;
}

.work-area.config-rail-resizing {
  transition: none !important;
}

/* Typography refresh: Motions-inspired hierarchy and density layer.
 * Keep this file last in renderer/styles.css so it is the single rollback boundary
 * for the visual refresh; behaviour and semantic state styles stay in earlier parts.
 */

:root {
  --motion-spring: cubic-bezier(0.32, 0.72, 0, 1);
  --motion-radius-sm: 8px;
  --motion-radius-md: 12px;
  --motion-shadow-soft: 0 10px 28px rgba(31, 41, 71, 0.08);
}

body {
  font-size: var(--font-sm);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app-shell {
  transition: grid-template-columns 300ms var(--motion-spring);
}

.brand h1 {
  font-size: var(--font-xl);
  line-height: var(--leading-tight);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  border-radius: 10px;
}

.brand p,
.sidebar-footer,
.logout-btn {
  font-size: var(--font-sm);
  line-height: var(--leading-ui);
}

.nav-item {
  height: 42px;
  margin-inline: 8px;
  width: calc(100% - 16px);
  padding-inline: 16px;
  gap: var(--space-3);
  border-radius: var(--motion-radius-sm);
  font-size: var(--font-md);
  line-height: var(--leading-ui);
  font-weight: 600;
  transition: background 160ms var(--motion-spring), color 160ms var(--motion-spring), transform 160ms var(--motion-spring);
}

.nav-item .nav-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--motion-radius-sm);
  font-size: 16px;
}

.app-shell.sidebar-collapsed .nav-item {
  height: 56px;
}

.top-title h2 {
  font-size: var(--font-xl);
  line-height: var(--leading-tight);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.dashboard-header h2,
.flowkit-header h2,
.library-header h2,
.mcp-header h2 {
  font-size: var(--font-xl);
  line-height: var(--leading-tight);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.dashboard-card-value,
.mcp-metrics strong,
.mcp-queue-metrics > .mcp-queue-metric-card strong {
  font-size: var(--font-2xl);
  line-height: var(--leading-tight);
}

.dashboard-scroll {
  gap: 12px;
  padding: 14px 16px 22px;
}

.dashboard-cards {
  gap: 10px;
}

.dashboard-card {
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
}

.dashboard-card-icon {
  font-size: var(--font-lg);
}

.dashboard-card-label {
  font-size: var(--font-xs);
}

.dashboard-section {
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--motion-radius-md);
}

.dashboard-welcome-banner {
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
}

.dashboard-welcome-emoji {
  font-size: var(--font-2xl);
}

.dashboard-welcome-title {
  font-size: var(--font-md);
}

.dashboard-welcome-sub,
.dashboard-welcome-pill,
.dashboard-port-name {
  font-size: var(--font-sm);
}

.dashboard-port-row {
  padding: 7px 8px;
}

.dashboard-port-row code,
.dashboard-port-status {
  font-size: var(--font-xs);
}

.top-title p {
  font-size: var(--font-sm);
  line-height: var(--leading-ui);
  font-weight: 500;
}

.status-pill,
.version-pill,
.lang-pill {
  min-height: 36px;
  font-size: var(--font-sm);
  line-height: var(--leading-ui);
  font-weight: 600;
}

.config-section h3 {
  font-size: var(--font-lg);
  line-height: var(--leading-ui);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.config-section {
  padding: 10px 12px;
  border-radius: var(--motion-radius-md);
  box-shadow: var(--motion-shadow-soft);
}

.rail-scroll {
  gap: 10px;
  padding: 12px 10px 14px;
}

.config-section.collapsible-section {
  padding-top: 10px;
}

.config-section.collapsible-section.is-collapsed {
  padding-bottom: 10px;
}

.config-section .section-content {
  gap: 8px;
  padding-top: 8px;
}

.config-section .compact-grid,
.config-section .toggle-grid,
.config-section .mode-grid,
.config-section .aspect-ratio-grid,
.config-section .tier-grid,
.config-section .youtube-prompt-tool,
.config-section .profile-pro-cards {
  gap: 8px;
}

.config-rail .section-toggle {
  min-height: 36px;
  border-radius: var(--motion-radius-sm);
  font-size: var(--font-lg);
  line-height: var(--leading-ui);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.section-subtitle {
  font-size: var(--font-md);
  line-height: var(--leading-ui);
  font-weight: 600;
}

.section-label,
.config-rail label {
  font-size: var(--font-sm);
  line-height: var(--leading-ui);
  font-weight: 600;
}

.config-rail .status-line,
.config-rail .profile-card p,
.config-rail .section-hint,
.config-rail .settings-hint {
  font-size: var(--font-sm);
  line-height: var(--leading-ui);
  font-weight: 500;
}

.config-rail input:not([type="checkbox"]),
.config-rail select,
.config-rail textarea {
  min-height: 36px;
  border-radius: var(--motion-radius-sm);
  font-size: var(--font-md);
  line-height: var(--leading-body);
}

.config-rail button,
.queue-toolbar button,
.queue-footer button {
  font-weight: 600;
}

.primary-wide {
  min-height: 40px;
  font-size: var(--font-md);
  line-height: var(--leading-ui);
  font-weight: 700;
}

.queue-toolbar {
  font-size: var(--font-sm);
  line-height: var(--leading-ui);
}

.queue-toolbar button,
.queue-toolbar input,
.queue-toolbar select {
  min-height: 36px;
}

.top-actions > *,
.config-rail button,
.queue-toolbar button,
.queue-footer button,
.search-input,
.status-filter {
  border-radius: var(--motion-radius-sm);
}

.status-pill,
.version-pill,
.lang-pill {
  border-radius: var(--motion-radius-sm);
}

.queue-surface {
  border-radius: var(--motion-radius-md);
  box-shadow: var(--motion-shadow-soft);
}

.queue-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  padding: 10px;
}

.task-card {
  gap: 7px;
  padding: 9px;
  border-radius: var(--motion-radius-md);
  box-shadow: var(--motion-shadow-soft);
  transition: transform 180ms var(--motion-spring), box-shadow 180ms var(--motion-spring), border-color 180ms var(--motion-spring);
}

.task-card:hover {
  transform: translateY(-2px);
}

.config-section h3,
.section-subtitle,
.task-card-id {
  letter-spacing: -0.01em;
}

.search-input,
.status-filter {
  font-size: var(--font-md);
  line-height: var(--leading-body);
}

.task-card-id {
  font-size: var(--font-sm);
  line-height: var(--leading-ui);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.task-chip,
.task-card-headline .status-badge {
  height: 18px;
  padding-inline: 6px;
  font-size: 9px;
  line-height: 1.25;
  font-weight: 600;
}

.task-card-prompt {
  font-size: var(--font-sm);
  line-height: var(--leading-body);
  font-weight: 400;
}

.task-card-prompt-toggle {
  font-size: var(--font-xs);
  line-height: var(--leading-ui);
  font-weight: 600;
}

.status-badge {
  font-size: 9px;
  line-height: var(--leading-ui);
  font-weight: 700;
}

.library-view {
  gap: 10px;
  padding: 14px 16px 20px;
}

.library-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.library-card {
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
}

.library-card-body {
  gap: 6px;
}

.library-card-body h3 {
  font-size: var(--font-sm);
}

.library-card-body p {
  height: 34px;
  font-size: var(--font-xs);
}

.mcp-page {
  width: calc(100% - 32px);
  gap: 14px;
  padding: 22px 0 36px;
}

.mcp-section {
  padding: 14px;
  border-radius: var(--motion-radius-md);
}

.mcp-section h3 {
  font-size: var(--font-lg);
}

.mcp-metrics {
  gap: 10px;
  margin-top: 12px;
}

.mcp-metrics > div,
.mcp-usage-metrics > .mcp-usage-metric-card,
.mcp-queue-metrics > .mcp-queue-metric-card {
  gap: 4px;
  min-height: 64px;
  padding: 10px;
  border-radius: 10px;
  font-size: var(--font-xs);
}

.queue-footer .tool-btn,
.queue-footer .upscale-all-btn,
.queue-footer .watermark-all-btn,
.queue-footer .download-all-btn {
  font-size: var(--font-sm);
  line-height: var(--leading-ui);
}

@media (max-width: 1024px) {
  .nav-item {
    height: 40px;
    font-size: var(--font-sm);
  }

  .top-title h2 {
    font-size: var(--font-lg);
  }
}

@media (max-width: 480px) {
  .queue-workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: max-content minmax(240px, max-content) max-content minmax(96px, max-content);
    overflow-x: hidden;
    overflow-y: auto;
  }

  .queue-workspace > * {
    min-width: 0;
    max-width: 100%;
  }

  .queue-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-height: 50px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 0;
  }

  .queue-toolbar > * {
    flex: 0 0 auto;
  }

  .queue-toolbar .search-input {
    width: 190px;
    min-width: 190px;
  }

  .queue-toolbar .status-filter {
    width: 120px;
    min-width: 120px;
  }

  .queue-surface {
    min-height: 240px;
  }

  .queue-grid {
    gap: 10px;
    padding: 8px;
  }

  .task-card {
    min-width: 0;
    padding: 8px;
  }
}

@media (min-width: 1025px) {
  .app-shell.sidebar-collapsed .nav-item {
    margin-inline: 6px;
    width: calc(100% - 12px);
    border-radius: var(--motion-radius-sm);
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-label,
  .app-shell,
  .nav-item,
  .task-card {
    transition: none;
  }
}

/* Compact secondary cards: keep this final so Settings and management surfaces
 * share the same Motions-inspired density as Dashboard, Queue, Library and MCP.
 */

.settings-cards {
  gap: 10px;
  padding: 14px 16px 20px;
}

.settings-card {
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--motion-radius-md);
}

.settings-card-title {
  font-size: var(--font-md);
  line-height: var(--leading-ui);
}

.settings-card-desc {
  font-size: var(--font-sm);
  line-height: var(--leading-body);
}

.settings-provider-tab {
  min-height: 48px;
  padding: 6px 8px;
  font-size: var(--font-sm);
}

.profile-pro-card {
  gap: 4px;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: var(--font-sm);
}

.profile-pro-card .pp-source-icon {
  font-size: var(--font-sm);
}

.profile-pro-card .pp-meta,
.profile-pro-card .pp-badge {
  font-size: 9px;
}

.project-manager-row {
  grid-template-columns: 20px minmax(0, 1fr) 96px auto;
  gap: 8px;
  min-height: 44px;
  padding: 0 8px;
  border-radius: 8px;
}

.project-manager-marker,
.project-manager-title {
  font-size: var(--font-md);
}

.mcp-card,
.mcp-panel {
  border-radius: var(--motion-radius-md);
  font-size: var(--font-sm);
}

/* Give Config & Prompts and the queue table more usable horizontal space. */
@media (min-width: 1025px) {
  .work-area {
    grid-template-columns: 350px minmax(0, 1fr);
  }
}

.rail-scroll {
  gap: 6px;
  padding: 8px 6px 10px;
}

.config-section,
.config-section.collapsible-section {
  padding: 8px 10px;
}

.config-section.collapsible-section.is-collapsed {
  padding-bottom: 8px;
}

.config-section .section-content {
  gap: 6px;
  padding-top: 6px;
}

.config-section .compact-grid,
.config-section .toggle-grid,
.config-section .mode-grid,
.config-section .aspect-ratio-grid,
.config-section .tier-grid,
.config-section .youtube-prompt-tool,
.config-section .profile-pro-cards {
  gap: 6px;
}

.config-section h3,
.config-rail .section-toggle,
.config-rail input:not([type="checkbox"]),
.config-rail select,
.config-rail textarea {
  font-size: var(--font-md);
}

.section-subtitle,
.section-label,
.config-rail label,
.config-rail button,
.config-rail .status-line,
.config-rail .profile-card p,
.config-rail .section-hint,
.config-rail .settings-hint {
  font-size: var(--font-xs);
}

.config-rail input:not([type="checkbox"]),
.config-rail select {
  min-height: 34px;
}

.queue-workspace {
  padding-inline: 6px;
}

.queue-toolbar {
  gap: 6px;
}

.queue-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  padding: 8px;
}

.task-card {
  gap: 5px;
  padding: 7px;
}

.task-card-id,
.task-card-prompt,
.task-card-progress-label,
.task-card-output-path {
  font-size: var(--font-xs);
}

.task-chip,
.task-card-headline .status-badge,
.task-card-actions-hint,
.task-card-actions-group-label {
  font-size: 8px;
}

.task-card-prompt-toggle {
  font-size: 9px;
}

.task-card-id {
  font-size: var(--text-card-title, 13px);
  font-weight: var(--weight-bold, 700);
}

.task-card-prompt {
  font-size: var(--text-body, 12px);
  line-height: var(--leading-body, 1.45);
}

.task-card-prompt.prompt-box {
  display: -webkit-box;
  height: auto;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: var(--text-body, 12px);
  line-height: var(--leading-body, 1.45);
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line-soft);
  color: var(--text);
}

.task-card-prompt.prompt-box.is-expanded {
  display: block;
  height: auto;
  -webkit-line-clamp: unset;
  overflow: visible;
  white-space: pre-wrap;
}

html[data-theme="light"] .task-card-prompt.prompt-box {
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--line);
  color: var(--foreground);
}

.task-chip,
.dashboard-badge,
.dashboard-welcome-pill,
.status-pill,
.mcp-queue-type,
.mcp-queue-status,
.profile-pro-card .pp-badge,
.profile-pro-card .pp-meta {
  background: var(--primary-50);
  border-color: var(--primary-light);
  color: var(--primary-dark);
}

.task-chip[data-variant="tier"],
.mode-card.active {
  background: var(--tone-magic-soft);
  border-color: rgba(175, 82, 222, 0.32);
  color: var(--tone-magic-text);
}

.task-chip[data-variant="aspect"],
.provider-badge {
  background: var(--tone-video-soft);
  border-color: rgba(255, 45, 85, 0.30);
  color: var(--tone-video-text);
}

.status-badge[data-status="running"],
.status-badge[data-status="queued"],
.mcp-queue-status[data-tone="running"] {
  background: var(--primary-50);
  border-color: var(--primary-light);
  color: var(--primary-dark);
}

.status-badge[data-status="completed"],
.profile-pro-status .status-pill[data-tone="ok"],
.mcp-queue-status[data-tone="completed"] {
  background: var(--ok-soft);
  border-color: rgba(25, 135, 84, 0.24);
  color: var(--ok-text);
}

.status-badge[data-status="pending"],
.warning-line[data-tone="warn"] {
  background: var(--warn-soft);
  border-color: rgba(245, 158, 11, 0.26);
  color: var(--warn-text);
}

.status-badge[data-status="error"],
.warning-line[data-tone="error"],
.mcp-queue-status[data-tone="failed"],
.mcp-queue-status[data-tone="error"] {
  background: var(--danger-soft);
  border-color: rgba(225, 29, 72, 0.24);
  color: var(--danger-text);
}

.task-card-progress-label,
.task-card-output-path {
  font-size: var(--text-meta, 10px);
}

.task-chip,
.task-card-headline .status-badge {
  font-size: 10.5px;
  font-weight: var(--weight-semibold, 600);
}

.task-card-actions-hint,
.task-card-actions-group-label {
  font-size: 10px;
}

.task-card-prompt-toggle {
  font-size: 10px;
}

.queue-surface table {
  min-width: 1160px;
}

.queue-surface thead tr,
.queue-surface tbody tr {
  grid-template-columns: 48px 56px minmax(220px, 0.9fr) minmax(240px, 1.15fr) minmax(220px, 1.05fr) 136px 96px 110px;
}

@media (max-width: 1600px) {
  .queue-surface table {
    min-width: 840px;
    width: 100%;
  }
  .queue-surface thead tr,
  .queue-surface tbody tr {
    grid-template-columns: 36px 44px minmax(160px, 0.85fr) minmax(180px, 1.25fr) minmax(160px, 1fr) 72px 92px 88px;
  }
}

.queue-surface th,
.queue-surface td {
  padding: 8px;
}

.queue-surface th.extend-col,
.queue-surface td.extend-cell {
  padding: 8px 4px;
}

html:not([data-theme="light"]) .queue-surface tbody tr:not(.extend-sub-row) {
  background: var(--surface, #1e1a2e);
  color: var(--foreground);
}

html:not([data-theme="light"]) .queue-surface tbody tr:not(.extend-sub-row):hover {
  background: rgba(155, 124, 245, 0.08);
}

html:not([data-theme="light"]) .queue-surface tbody tr[data-status="running"]:not(.extend-sub-row),
html:not([data-theme="light"]) .queue-surface tbody tr[data-status="queued"]:not(.extend-sub-row) {
  background: rgba(155, 124, 245, 0.1);
}

html:not([data-theme="light"]) .queue-surface tbody tr[data-status="completed"]:not(.extend-sub-row) {
  background: rgba(54, 217, 154, 0.08);
}

html:not([data-theme="light"]) .queue-surface tbody tr[data-status="error"]:not(.extend-sub-row) {
  background: rgba(255, 91, 104, 0.1);
}

.task-card-actions-group .action-stack {
  display: grid;
  grid-template-columns: repeat(4, minmax(32px, 1fr));
  width: 100%;
  max-width: none;
  justify-content: stretch;
}

.task-card-actions-group .icon-btn {
  width: 100%;
  max-width: none;
}

@media (max-width: 480px) {
  .queue-workspace {
    padding-inline: 0;
  }
}

.active-extension-pill {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-panel-2);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.active-extension-pill[hidden] {
  display: none;
}

.active-extension-pill::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  content: "";
}

.active-extension-pill[data-tone="ready"] {
  border-color: rgba(34, 197, 94, 0.32);
}

.active-extension-pill[data-tone="ready"]::before {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.16);
}

.active-extension-pill[data-tone="warning"] {
  border-color: rgba(245, 158, 11, 0.32);
}

.active-extension-pill[data-tone="warning"]::before {
  background: #f59e0b;
}

.active-extension-pill[data-tone="offline"] {
  border-color: rgba(255, 91, 104, 0.32);
}

.active-extension-pill[data-tone="offline"]::before {
  background: #ff5b68;
  box-shadow: 0 0 0 2px rgba(255, 91, 104, 0.16);
}

.active-extension-pill:hover {
  border-color: rgba(155, 124, 245, 0.72);
  transform: translateY(-1px);
}

.active-extension-pill:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.active-extension-card {
  width: min(460px, 90vw);
}

.active-extension-refresh-btn {
  min-width: 142px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 22%, transparent) var(--progress, 0%), transparent var(--progress, 0%));
  transition: background-size 120ms ease, border-color 120ms ease;
}

.active-extension-refresh-btn[data-progress="0"] { --progress: 0%; }
.active-extension-refresh-btn[data-progress="5"] { --progress: 5%; }
.active-extension-refresh-btn[data-progress="10"] { --progress: 10%; }
.active-extension-refresh-btn[data-progress="15"] { --progress: 15%; }
.active-extension-refresh-btn[data-progress="20"] { --progress: 20%; }
.active-extension-refresh-btn[data-progress="25"] { --progress: 25%; }
.active-extension-refresh-btn[data-progress="30"] { --progress: 30%; }
.active-extension-refresh-btn[data-progress="35"] { --progress: 35%; }
.active-extension-refresh-btn[data-progress="40"] { --progress: 40%; }
.active-extension-refresh-btn[data-progress="45"] { --progress: 45%; }
.active-extension-refresh-btn[data-progress="50"] { --progress: 50%; }
.active-extension-refresh-btn[data-progress="55"] { --progress: 55%; }
.active-extension-refresh-btn[data-progress="60"] { --progress: 60%; }
.active-extension-refresh-btn[data-progress="65"] { --progress: 65%; }
.active-extension-refresh-btn[data-progress="70"] { --progress: 70%; }
.active-extension-refresh-btn[data-progress="75"] { --progress: 75%; }
.active-extension-refresh-btn[data-progress="80"] { --progress: 80%; }
.active-extension-refresh-btn[data-progress="85"] { --progress: 85%; }
.active-extension-refresh-btn[data-progress="90"] { --progress: 90%; }
.active-extension-refresh-btn[data-progress="100"] { --progress: 100%; }

.active-extension-details {
  display: grid;
  gap: 16px;
}

.active-extension-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--bg-panel-2);
}

.active-extension-status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted);
}

.active-extension-status-dot[data-tone="ready"] {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

.active-extension-status-dot[data-tone="warning"] {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14);
}

.active-extension-name {
  color: var(--text);
  font-size: 17px;
  font-weight: 900;
}

.active-extension-status {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.active-extension-meta {
  display: grid;
  gap: 8px;
  margin: 0;
}

.active-extension-meta > div {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
}

.active-extension-meta dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.active-extension-meta dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.active-extension-refresh-schedule {
  display: grid;
  justify-items: start;
  gap: 8px;
}

.active-extension-refresh-countdown {
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid rgba(155, 124, 245, 0.38);
  border-radius: 999px;
  background: rgba(155, 124, 245, 0.1);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.active-extension-refresh-countdown:hover {
  border-color: rgba(155, 124, 245, 0.72);
}

.active-extension-refresh-schedule-details {
  display: grid;
  gap: 6px;
  width: 100%;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--bg-panel-2);
}

.active-extension-refresh-schedule-details[hidden] {
  display: none;
}

.active-extension-refresh-schedule-details > div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
}

.active-extension-refresh-schedule-details dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.active-extension-refresh-schedule-details dd {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

html[data-theme="light"] .active-extension-pill[data-tone="ready"] {
  border-color: rgba(22, 163, 74, 0.28);
  background: rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .active-extension-pill[data-tone="warning"] {
  border-color: rgba(217, 119, 6, 0.28);
  background: rgba(255, 255, 255, 0.72);
}

.pipeline-action-btn {
  position: relative;
  z-index: 1;
  width: auto;
  min-width: 72px;
  min-height: 36px;
  border-color: #5546d8 !important;
  background: linear-gradient(135deg, #6355e7 0%, #7862ee 100%) !important;
  color: #ffffff !important;
  font-size: 10px !important;
  font-weight: 900;
  text-shadow: 0 1px 1px rgba(24, 17, 75, 0.3);
  box-shadow: 0 4px 12px rgba(85, 70, 216, 0.3);
  white-space: nowrap;
}

.action-stack .pipeline-action-btn {
  width: 72px !important;
  min-width: 72px !important;
}

/* Compact table cells wrap their controls instead of clipping a tall one-column stack. */
.queue-surface table .extend-action-stack {
  display: grid !important;
  grid-template-columns: repeat(2, 32px) !important;
  justify-content: center !important;
  align-content: center !important;
  gap: 4px 6px !important;
  width: 100% !important;
  max-width: none !important;
  max-height: none !important;
  overflow: visible !important;
}

.queue-surface table .task-action-stack {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: center;
  gap: 6px;
  width: 100%;
  max-width: none;
  max-height: none;
  overflow: visible;
}

.queue-surface table .extend-action-stack .icon-btn,
.queue-surface table .task-action-stack .icon-btn {
  flex: 0 0 32px;
  border-color: rgba(55, 65, 125, 0.3) !important;
  background: #ffffff !important;
  color: #27305f !important;
  box-shadow: 0 2px 7px rgba(37, 46, 92, 0.14);
  text-shadow: none;
}

.queue-surface table .extend-action-stack .icon-btn:hover:not(:disabled),
.queue-surface table .task-action-stack .icon-btn:hover:not(:disabled) {
  border-color: #5b50d6 !important;
  background: #eeecff !important;
  color: #352b9b !important;
}

.queue-surface table .extend-action-stack .icon-btn:disabled,
.queue-surface table .task-action-stack .icon-btn:disabled {
  opacity: 0.72;
  border-color: #ccd1e2 !important;
  background: #f4f6fb !important;
  color: #747b96 !important;
  box-shadow: none;
}

.queue-surface table .task-action-stack .pipeline-action-btn {
  flex-basis: 100%;
  width: 100% !important;
  min-width: 0 !important;
}

.task-card-actions-group .task-action-stack .pipeline-action-btn {
  grid-column: 1 / -1;
  width: 100% !important;
  min-width: 0 !important;
}

.pipeline-action-btn:hover:not(:disabled),
.pipeline-action-btn:focus-visible {
  border-color: #3f32bc !important;
  background: linear-gradient(135deg, #5143d3 0%, #6650dc 100%) !important;
  color: #ffffff !important;
}

html[data-theme="light"] .pipeline-action-btn {
  border-color: #5546d8 !important;
  background: linear-gradient(135deg, #6355e7 0%, #7862ee 100%) !important;
  color: #ffffff !important;
  text-shadow: 0 1px 1px rgba(24, 17, 75, 0.3);
  box-shadow: 0 4px 12px rgba(85, 70, 216, 0.3);
}

html[data-theme="light"] .pipeline-action-btn:hover:not(:disabled),
html[data-theme="light"] .pipeline-action-btn:focus-visible {
  border-color: #3f32bc !important;
  background: linear-gradient(135deg, #5143d3 0%, #6650dc 100%) !important;
  color: #ffffff !important;
}

html[data-theme="light"] .queue-surface table .extend-action-stack .icon-btn,
html[data-theme="light"] .queue-surface table .task-action-stack .icon-btn {
  border-color: rgba(55, 65, 125, 0.3) !important;
  background: #ffffff !important;
  color: #27305f !important;
  box-shadow: 0 2px 7px rgba(37, 46, 92, 0.14);
  text-shadow: none;
}

html[data-theme="light"] .queue-surface table .extend-action-stack .icon-btn:hover:not(:disabled),
html[data-theme="light"] .queue-surface table .task-action-stack .icon-btn:hover:not(:disabled) {
  border-color: #5b50d6 !important;
  background: #eeecff !important;
  color: #352b9b !important;
}

html[data-theme="light"] .queue-surface table .extend-action-stack .icon-btn:disabled,
html[data-theme="light"] .queue-surface table .task-action-stack .icon-btn:disabled {
  opacity: 0.72;
  border-color: #ccd1e2 !important;
  background: #f4f6fb !important;
  color: #747b96 !important;
  box-shadow: none;
}

html[data-theme="light"] .queue-surface table thead th:last-child {
  color: #27305f;
}

/* Pipeline is also an icon button; keep its primary treatment above the generic white icon rule. */
.queue-surface table .task-action-stack .pipeline-action-btn,
html[data-theme="light"] .queue-surface table .task-action-stack .pipeline-action-btn {
  border-color: #5546d8 !important;
  background: linear-gradient(135deg, #6355e7 0%, #7862ee 100%) !important;
  color: #ffffff !important;
  text-shadow: 0 1px 1px rgba(24, 17, 75, 0.3);
  box-shadow: 0 4px 12px rgba(85, 70, 216, 0.3);
}

.queue-surface table .task-action-stack .pipeline-action-btn:hover:not(:disabled),
.queue-surface table .task-action-stack .pipeline-action-btn:focus-visible {
  border-color: #3f32bc !important;
  background: linear-gradient(135deg, #5143d3 0%, #6650dc 100%) !important;
  color: #ffffff !important;
}

/* Keep the row actions discoverable even when the wide table is horizontally scrolled. */
.queue-surface table thead th:last-child,
.queue-surface table tbody td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: var(--bg-panel-3);
  box-shadow: -8px 0 12px rgba(15, 10, 30, 0.14);
}

.queue-surface table thead th:last-child {
  z-index: 3;
}

/* Grid action drawer uses the same readable hierarchy as Compact actions. */
.task-card-actions-group-label {
  color: #293158 !important;
  font-size: 9px !important;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}

.task-card-actions-group .icon-btn:not(.pipeline-action-btn) {
  border-color: rgba(55, 65, 125, 0.3) !important;
  background: #ffffff !important;
  color: #27305f !important;
  box-shadow: 0 2px 7px rgba(37, 46, 92, 0.14);
  text-shadow: none;
}

.task-card-actions-group .icon-btn:not(.pipeline-action-btn):hover:not(:disabled) {
  border-color: #5b50d6 !important;
  background: #eeecff !important;
  color: #352b9b !important;
}

.task-card-actions-group .icon-btn.danger:not(:disabled) {
  border-color: rgba(180, 35, 52, 0.5) !important;
  background: #fff1f2 !important;
  color: #b42334 !important;
}

.task-card-actions-group .icon-btn:not(.pipeline-action-btn):disabled {
  opacity: 0.78;
  border-color: #ccd1e2 !important;
  background: #eef1f7 !important;
  color: #656d88 !important;
  box-shadow: none;
}

.pipeline-dialog-card {
  width: min(520px, 90vw);
}

.pipeline-dialog-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.pipeline-checklist {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
}

.pipeline-check-item {
  display: flex;
  flex-wrap: wrap;
  align-self: start;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-panel-3);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}

.pipeline-check-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.pipeline-check-details {
  flex: 1 1 100%;
  min-width: 0;
  margin: 8px 0 0 30px;
}

.pipeline-curl {
  margin: 0;
  max-height: 180px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.pipeline-request-btn {
  justify-self: start;
  min-height: 30px;
  margin-top: 8px;
  padding: 0 12px;
  border: 1px solid rgba(255, 111, 125, 0.55);
  border-radius: 7px;
  background: rgba(255, 111, 125, 0.14);
  color: var(--danger-text);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.pipeline-request-btn:hover:not(:disabled) {
  background: rgba(255, 111, 125, 0.24);
}

.pipeline-request-btn:disabled {
  cursor: wait;
  opacity: 0.65;
}

.gpu-image-dialog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.slot-card-gpu {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 3;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(96, 165, 250, 0.55);
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.82);
  color: #bfdbfe;
  cursor: pointer;
}

@media (max-width: 560px) {
  .gpu-image-dialog-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.runpod-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
}
.runpod-status-badge.badge-running {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.runpod-status-badge.badge-exited {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.runpod-status-badge.badge-starting {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
  animation: runpod-pulse-badge 1.4s infinite;
}
.runpod-status-badge.badge-neutral {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}
@keyframes runpod-pulse-badge {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.98); }
}
@keyframes runpod-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.spin-icon {
  display: inline-block;
  animation: runpod-spin 1s linear infinite;
}
.runpod-info-panel {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  padding: 12px 14px;
}

.pipeline-check-item input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.pipeline-check-content {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.pipeline-check-content strong {
  color: var(--text);
  font-size: 13px;
}

.pipeline-check-status {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.pipeline-check-item[data-state="done"] {
  border-color: rgba(54, 211, 153, 0.42);
  background: rgba(54, 211, 153, 0.08);
}

.pipeline-check-item[data-state="done"] .pipeline-check-status {
  color: var(--ok-text);
}

.pipeline-check-item[data-state="active"] {
  border-color: rgba(59, 130, 246, 0.62);
  background: rgba(59, 130, 246, 0.12);
}

.pipeline-check-item[data-state="active"] .pipeline-check-status {
  color: #60a5fa;
}

.pipeline-check-item[data-state="queued"] {
  border-color: rgba(234, 179, 8, 0.58);
  background: rgba(234, 179, 8, 0.1);
}

.pipeline-check-item[data-state="queued"] .pipeline-check-status {
  color: #facc15;
}

.pipeline-check-item[data-state="pending"] {
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.06);
}

.pipeline-check-item[data-state="error"] {
  border-color: rgba(255, 111, 125, 0.5);
  background: rgba(255, 111, 125, 0.08);
}

.pipeline-check-item[data-state="error"] .pipeline-check-status {
  color: var(--danger-text);
}

.pipeline-check-item[data-state="not-started"] {
  opacity: 0.7;
}

.embedded-tool-view {
  grid-row: 2 / span 2;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--bg-app, #090c14);
}

.embedded-tool-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(15, 23, 42, 0.4);
  border-bottom: 1px solid var(--line-soft, rgba(255, 255, 255, 0.08));
  backdrop-filter: blur(12px);
  min-height: 42px;
  box-sizing: border-box;
}

html[data-theme="light"] .embedded-tool-toolbar {
  background: rgba(243, 244, 246, 0.85);
  border-bottom-color: rgba(209, 213, 219, 0.8);
}

.embedded-tool-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #f1f5f9);
}

html[data-theme="light"] .embedded-tool-title {
  color: #1e293b;
}

.embedded-tool-title .tool-status-pill {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

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

.embedded-frame-shell {
  flex: 1;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.embedded-tool-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  display: block;
}

/* Prompts View Styles - Unified with App Design Tokens */
.prompts-view {
  grid-row: 2 / span 2;
  min-width: 0;
  min-height: 0;
  background: var(--bg-app);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 16px 20px 20px;
  box-sizing: border-box;
  color: var(--text);
}

.prompts-view[hidden] {
  display: none;
}

/* Header */
.prompts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 12px;
  flex-shrink: 0;
}

.prompts-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.prompts-header-icon {
  font-size: 24px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 10px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.prompts-header h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.prompts-header p {
  font-size: 13px;
  margin: 3px 0 0;
  color: var(--muted);
}

.prompts-header-actions {
  display: flex;
  gap: 8px;
}

.prompts-header-actions .dashboard-action-btn {
  background: var(--bg-panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.prompts-header-actions .dashboard-action-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

/* Toolbar & Filters */
.prompts-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.prompts-search-box {
  position: relative;
  width: 100%;
}

.prompts-search-box .search-input {
  width: 100%;
  height: 38px;
  padding: 0 36px 0 14px;
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.prompts-search-box .search-input::placeholder {
  color: var(--muted-2);
}

.prompts-search-box .search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.prompts-clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
}

.prompts-clear-btn:hover {
  color: var(--text);
}

.prompts-filters-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

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

.prompt-pill {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.prompt-pill:hover {
  background: var(--bg-panel-2);
  color: var(--text);
  border-color: var(--accent-soft);
}

.prompt-pill.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 2px 10px var(--accent-soft);
}

.prompt-pill-fav.active {
  background: var(--warn);
  border-color: var(--warn);
  color: #171326;
  font-weight: 700;
  box-shadow: 0 2px 10px var(--warn-soft);
}

.prompts-type-filter select {
  height: 32px;
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 0 10px;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}

.prompts-type-filter select:focus {
  border-color: var(--accent);
}

/* Workbench Layout */
.prompts-workbench {
  display: flex;
  flex: 1;
  min-height: 0;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

/* Left Sidebar Card List */
.prompts-sidebar {
  width: 340px;
  flex-shrink: 0;
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-panel-3);
}

.prompts-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}

.prompts-count-badge {
  background: var(--accent-soft);
  color: var(--accent-text);
  border: 1px solid rgba(155, 124, 245, 0.25);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 11px;
}

.prompts-card-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prompt-card {
  padding: 11px 12px;
  border-radius: 8px;
  background: var(--bg-panel);
  border: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.prompt-card:hover {
  background: var(--bg-panel-2);
  border-color: var(--line);
  transform: translateY(-1px);
}

.prompt-card.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.prompt-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.prompt-card-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  line-height: 1.35;
}

.prompt-card-fav-btn {
  background: none;
  border: none;
  color: var(--muted-2);
  font-size: 15px;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.15s ease, transform 0.15s ease;
}

.prompt-card-fav-btn.active,
.prompt-card-fav-btn:hover {
  color: var(--warn);
  transform: scale(1.15);
}

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

.prompt-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 2px;
}

.prompt-badge-cat {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(155, 124, 245, 0.12);
  border: 1px solid rgba(155, 124, 245, 0.22);
  color: var(--accent-text);
  font-weight: 600;
  white-space: nowrap;
}

.prompt-tags-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.prompt-tag-chip {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-soft);
  color: var(--muted);
}

.prompts-empty-state {
  padding: 36px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* Detail Pane - Unified with App Design Tokens */
.prompts-detail {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 22px;
  background: var(--bg-panel);
}

.prompts-detail-empty {
  margin: auto;
  text-align: center;
  max-width: 400px;
  color: var(--muted);
}

.prompts-detail-empty .prompts-empty-icon {
  font-size: 44px;
  margin-bottom: 12px;
}

.prompts-detail-empty h3 {
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.prompts-detail-hero {
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.prompts-detail-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.prompt-badge-file {
  font-size: 11px;
  color: var(--muted-2);
}

.prompt-detail-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 10px;
  line-height: 1.35;
}

.prompt-detail-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Action Bar */
.prompts-action-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.prompts-primary-action-btn {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #ffffff;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 10px var(--accent-soft);
  transition: all 0.15s ease;
}

.prompts-primary-action-btn:hover {
  background: linear-gradient(135deg, var(--accent-strong) 0%, #6336df 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(155, 124, 245, 0.4);
}

.prompts-secondary-action-btn {
  background: linear-gradient(135deg, var(--accent-2) 0%, var(--accent-2-strong) 100%);
  color: #161223;
  border: 1px solid var(--accent-2);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(47, 210, 191, 0.25);
  transition: all 0.15s ease;
}

.prompts-secondary-action-btn:hover {
  background: var(--accent-2-strong);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(47, 210, 191, 0.35);
}

.prompts-action-btn {
  background: var(--bg-panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 13px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

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

.prompts-icon-action-btn {
  background: var(--bg-panel-2);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.prompts-icon-action-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
}

.prompts-icon-action-btn.active {
  color: var(--warn);
  border-color: var(--warn);
  background: var(--warn-soft);
}

.prompts-delete-btn:hover {
  color: var(--danger-text);
  border-color: var(--danger);
  background: var(--danger-soft);
}

.prompts-feedback-toast {
  background: var(--ok-soft);
  border: 1px solid var(--ok);
  color: var(--ok-text);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  margin-bottom: 12px;
  animation: fadeIn 0.2s ease-in-out;
}

/* Content Sections */
.prompts-content-sections {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.prompt-section-card {
  background: var(--bg-panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.prompt-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-panel-3);
  border-bottom: 1px solid var(--line-soft);
}

.prompt-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.prompt-len-badge {
  font-size: 11px;
  color: var(--muted);
  background: var(--bg-input);
  border: 1px solid var(--line-soft);
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: normal;
}

.copy-section-btn {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent-text);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-section-btn:hover {
  background: var(--accent);
  color: #ffffff;
}

.prompt-pre-box {
  margin: 0;
  padding: 14px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 380px;
  overflow-y: auto;
  background: var(--bg-input);
}

/* Modal */
.prompt-modal {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-panel);
  color: var(--text);
  padding: 0;
  max-width: 600px;
  width: 90vw;
  box-shadow: 0 16px 48px var(--bg-overlay);
}

.prompt-modal::backdrop {
  background: var(--bg-overlay);
  backdrop-filter: blur(4px);
}

.prompt-modal-form {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.prompt-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 10px;
}

.prompt-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.prompt-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.prompt-modal-body label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.prompt-modal-body input,
.prompt-modal-body select,
.prompt-modal-body textarea {
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
}

.prompt-modal-body input:focus,
.prompt-modal-body select:focus,
.prompt-modal-body textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.prompt-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.prompt-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}

.prompt-modal-footer .auth-primary-btn {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #ffffff;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 10px var(--accent-soft);
}

.prompt-modal-footer .auth-primary-btn:hover {
  background: var(--accent-strong);
}

.prompt-modal-footer .secondary {
  background: var(--bg-panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
}

/* Light Theme Enhancements */
html[data-theme="light"] .prompts-view {
  background: var(--bg-app);
  color: var(--text);
}

html[data-theme="light"] .prompts-workbench {
  background: var(--bg-panel);
  border-color: var(--line-soft);
}

html[data-theme="light"] .prompts-sidebar {
  background: var(--bg-panel-3);
  border-right-color: var(--line-soft);
}

html[data-theme="light"] .prompt-card {
  background: var(--bg-panel);
  border-color: var(--line-soft);
}

html[data-theme="light"] .prompt-card:hover {
  background: var(--bg-panel-2);
  border-color: var(--line);
}

html[data-theme="light"] .prompt-section-card {
  background: var(--bg-panel-2);
  border-color: var(--line-soft);
}

html[data-theme="light"] .prompt-section-header {
  background: var(--bg-panel-3);
  border-bottom-color: var(--line-soft);
}

html[data-theme="light"] .prompt-pre-box {
  background: var(--bg-input);
  color: var(--text);
}

html[data-theme="light"] .prompt-tag-chip {
  background: rgba(0, 0, 0, 0.05);
  border-color: var(--line-soft);
  color: var(--muted);
}

/* ── Profile Scanner & Manager Modal ────────────────────────────── */
.scan-profile-card {
  max-width: 820px;
  width: 94vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 20px 50px var(--bg-overlay);
  padding: 0;
  overflow: hidden;
}

.scan-profile-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-soft);
  flex-shrink: 0;
}

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

.scan-profile-header-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.scan-profile-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.scan-profile-modal-header p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.scan-profile-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.scan-profile-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-panel-3);
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  flex-shrink: 0;
}

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

.scan-profile-actions-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.scan-profile-actions-right {
  flex: 1;
  max-width: 240px;
  min-width: 160px;
}

.scan-profile-search-wrap input {
  width: 100%;
  height: 32px;
  padding: 4px 10px;
  font-size: 12px;
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  outline: none;
}

.scan-profile-search-wrap input:focus {
  border-color: var(--accent);
}

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

.scan-profile-batch-actions {
  display: flex;
  gap: 6px;
}

.compact-action-btn {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.scan-profile-status-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-soft);
  color: var(--muted);
}

.scan-profile-status-badge[data-tone="ok"] {
  background: var(--ok-soft);
  border-color: var(--ok);
  color: var(--ok-text);
}

.scan-profile-status-badge[data-tone="warn"] {
  background: var(--warn-soft);
  border-color: var(--warn);
  color: var(--warn-text);
}

.scan-profile-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scan-profile-item {
  background: var(--bg-panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.15s ease;
}

.scan-profile-item:hover {
  border-color: var(--accent-soft);
}

.scan-profile-item.is-selected {
  border-color: var(--accent);
  background: rgba(155, 124, 245, 0.08);
}

.scan-profile-item.is-active {
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.scan-profile-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.scan-profile-checkbox-wrap {
  display: flex;
  align-items: center;
  padding-top: 2px;
  cursor: pointer;
}

.scan-profile-checkbox-wrap input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
}

.scan-profile-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.scan-profile-item-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.scan-profile-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.scan-profile-active-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
}

.scan-profile-item-id {
  font-size: 11px;
  color: var(--muted);
  font-family: monospace;
}

.scan-profile-item-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.scan-profile-chip {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg-input);
  border: 1px solid var(--line-soft);
  color: var(--muted);
}

.scan-profile-chip.chip-ext {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  font-weight: 600;
}

.scan-profile-chip.chip-pro {
  background: rgba(155, 124, 245, 0.14);
  border-color: rgba(155, 124, 245, 0.3);
  color: var(--accent-text);
  font-weight: 600;
}

.scan-profile-status-pill {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.scan-profile-status-pill.tone-success {
  background: var(--ok-soft);
  color: var(--ok-text);
  border: 1px solid var(--ok);
}

.scan-profile-status-pill.tone-info {
  background: var(--warn-soft);
  color: var(--warn-text);
  border: 1px solid var(--warn);
}

.scan-profile-status-pill.tone-danger {
  background: var(--danger-soft);
  color: var(--danger-text);
  border: 1px solid var(--danger);
}

.scan-profile-status-pill .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.scan-profile-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.compact-action-btn.icon-btn-round {
  padding: 3px 6px;
  font-size: 12px;
}

.scan-profile-empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--muted);
}

.scan-profile-empty-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.scan-profile-empty h4 {
  color: var(--text);
  margin: 0 0 4px;
  font-size: 14px;
}

.scan-profile-empty p {
  margin: 0;
  font-size: 12px;
}

.scan-profile-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--line-soft);
  background: var(--bg-panel-3);
  flex-shrink: 0;
}

.scan-profile-summary {
  font-size: 12px;
  color: var(--muted);
}

.scan-profile-summary strong {
  color: var(--text);
}

.scan-profile-footer-actions {
  display: flex;
  gap: 8px;
}

/* Chrome Profile Scanner & Modal Styles */

/* 1. Sidebar Compact Summary Card */
.chrome-profiles-sidebar-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  background: var(--bg-panel-2, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--line-soft, rgba(255, 255, 255, 0.08));
  transition: border-color 0.2s ease, background 0.2s ease;
}
.chrome-profiles-sidebar-card:hover {
  border-color: rgba(56, 189, 248, 0.3);
}

.cp-sidebar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.74rem;
}
.cp-sidebar-label {
  color: var(--text-muted, #94a3b8);
  font-weight: 500;
  white-space: nowrap;
}
.cp-sidebar-value {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cp-sidebar-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cp-sidebar-pill.none {
  background: rgba(255, 255, 255, 0.05);
  color: #64748b;
  border-color: rgba(255, 255, 255, 0.1);
  font-weight: normal;
}
.cp-sidebar-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.cp-sidebar-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.25rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--line-soft, rgba(255, 255, 255, 0.06));
}
.cp-sidebar-btn {
  flex: 1;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}
.cp-sidebar-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
.cp-sidebar-btn.primary {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(14, 165, 233, 0.3));
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
}
.cp-sidebar-btn.primary:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.35), rgba(14, 165, 233, 0.45));
  color: #ffffff;
  border-color: #38bdf8;
}
.cp-sidebar-btn-cdp {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(234, 88, 12, 0.25));
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}
.cp-sidebar-btn-cdp:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.35), rgba(234, 88, 12, 0.45));
  color: #ffffff;
  border-color: #fbbf24;
}

/* Sidebar Imported Profiles List */
.chrome-profiles-imported-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 250px;
  overflow-y: auto;
  margin-top: 0.35rem;
  padding-right: 2px;
}
.chrome-profiles-imported-list::-webkit-scrollbar { width: 4px; }
.chrome-profiles-imported-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

.cp-imported-empty {
  font-size: 0.72rem;
  color: var(--text-muted, #64748b);
  text-align: center;
  padding: 0.6rem 0.4rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  line-height: 1.4;
}

.cp-imported-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: all 0.15s ease;
  cursor: pointer;
}
.cp-imported-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(56, 189, 248, 0.3);
}
.cp-imported-item.is-active {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
}

.cp-imported-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.72rem;
  color: #ffffff;
  flex-shrink: 0;
}
.cp-imported-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}
.cp-imported-name-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  overflow: hidden;
}
.cp-imported-name {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--heading, #f1f5f9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cp-imported-badge-active {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  flex-shrink: 0;
}
.cp-imported-dir-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cp-imported-dir {
  overflow: hidden;
  text-overflow: ellipsis;
}
.cp-imported-badge-ext {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 0.04rem 0.25rem;
  border-radius: 3px;
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
  flex-shrink: 0;
}

.cp-imported-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}
.cp-imported-btn-live-jev {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0.2rem 0.45rem;
  border-radius: 5px;
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(250, 204, 21, 0.12);
  color: #facc15;
  border: 1px solid rgba(250, 204, 21, 0.35);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.cp-imported-btn-live-jev:hover {
  background: rgba(250, 204, 21, 0.28);
  border-color: #facc15;
  color: #fef08a;
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.35);
}
.cp-imported-btn-flow {
  padding: 0.2rem 0.4rem;
  border-radius: 5px;
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.cp-imported-btn-flow:hover {
  background: #38bdf8;
  color: #0f172a;
}
.cp-imported-btn-remove {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  background: transparent;
  color: #64748b;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cp-imported-btn-remove:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Light Theme Overrides for Chrome Profiles Sidebar */
html[data-theme="light"] .chrome-profiles-sidebar-card { background: rgba(255, 255, 255, 0.88); border-color: rgba(37, 99, 235, 0.18); box-shadow: 0 2px 10px rgba(38, 54, 89, 0.05); }
html[data-theme="light"] .chrome-profiles-sidebar-card:hover { border-color: rgba(37, 99, 235, 0.35); }
html[data-theme="light"] .cp-sidebar-label { color: #334155; font-weight: 600; }
html[data-theme="light"] .cp-sidebar-pill { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; font-weight: 600; }
html[data-theme="light"] .cp-sidebar-pill.none { background: #f1f5f9; color: #64748b; border-color: #cbd5e1; }
html[data-theme="light"] .cp-sidebar-badge { background: #dcfce7; color: #15803d; border-color: #86efac; font-weight: 600; }
html[data-theme="light"] .cp-sidebar-actions { border-top-color: rgba(37, 99, 235, 0.12); }
html[data-theme="light"] .cp-sidebar-btn { background: #f8fafc; color: #334155; border-color: #cbd5e1; }
html[data-theme="light"] .cp-sidebar-btn:hover { background: #e2e8f0; color: #0f172a; }
html[data-theme="light"] .cp-sidebar-btn.primary { background: linear-gradient(135deg, #0284c7, #0369a1); color: #ffffff; border-color: #0284c7; box-shadow: 0 2px 8px rgba(2, 132, 199, 0.28); font-weight: 600; }
html[data-theme="light"] .cp-sidebar-btn.primary:hover { background: linear-gradient(135deg, #0369a1, #075985); color: #ffffff; border-color: #0369a1; box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35); }
html[data-theme="light"] .cp-sidebar-btn-cdp { background: linear-gradient(135deg, #f59e0b, #d97706); color: #ffffff; border-color: #d97706; box-shadow: 0 2px 8px rgba(217, 119, 6, 0.28); font-weight: 600; }
html[data-theme="light"] .cp-sidebar-btn-cdp:hover { background: linear-gradient(135deg, #d97706, #b45309); color: #ffffff; border-color: #b45309; box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35); }
html[data-theme="light"] .cp-imported-empty { background: rgba(255, 255, 255, 0.65); border-color: #cbd5e1; color: #64748b; }
html[data-theme="light"] .cp-imported-item { background: #ffffff; border-color: #e2e8f0; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04); }
html[data-theme="light"] .cp-imported-item:hover { background: #f8fafc; border-color: #38bdf8; }
html[data-theme="light"] .cp-imported-item.is-active { background: #f0f9ff; border-color: #0284c7; box-shadow: 0 0 0 1px rgba(2, 132, 199, 0.25), 0 2px 8px rgba(2, 132, 199, 0.1); }
html[data-theme="light"] .cp-imported-name { color: #0f172a; font-weight: 700; }
html[data-theme="light"] .cp-imported-badge-active { background: #e0f2fe; color: #0284c7; border-color: #7dd3fc; font-weight: 700; }
html[data-theme="light"] .cp-imported-dir-row { color: #64748b; font-weight: 500; }
html[data-theme="light"] .cp-imported-badge-ext { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; font-weight: 600; }
html[data-theme="light"] .cp-imported-btn-live-jev { background: #fef9c3; color: #854d0e; border-color: #fde047; font-weight: 700; }
html[data-theme="light"] .cp-imported-btn-live-jev:hover { background: #fef08a; color: #713f12; border-color: #eab308; box-shadow: 0 2px 6px rgba(234, 179, 8, 0.25); }
html[data-theme="light"] .cp-imported-btn-flow { background: #e0f2fe; color: #0284c7; border-color: #bae6fd; font-weight: 600; }
html[data-theme="light"] .cp-imported-btn-flow:hover { background: #0284c7; color: #ffffff; }
html[data-theme="light"] .cp-imported-btn-remove { color: #64748b; }
html[data-theme="light"] .cp-imported-btn-remove:hover { background: #fee2e2; color: #dc2626; }



/* 2. Chrome Profiles Modal Card */
.chrome-profiles-modal-card {
  width: min(980px, 95vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1.1rem 1.3rem;
  overflow: hidden;
  background: #111420;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 35px rgba(56, 189, 248, 0.1);
}

/* Modal Header */
.chrome-profiles-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.75rem;
  flex-shrink: 0;
}

.chrome-profiles-modal-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.chrome-profiles-modal-title-group h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chrome-profiles-modal-stats-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.cp-stat-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.cp-stat-badge.ext {
  background: rgba(234, 179, 8, 0.12);
  color: #facc15;
  border-color: rgba(234, 179, 8, 0.25);
}

.cp-stat-badge.socket {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.25);
}

.cp-stat-badge.email {
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  border-color: rgba(99, 102, 241, 0.25);
}

.cp-stat-badge.sel {
  background: rgba(56, 189, 248, 0.14);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}

/* Modal Toolbar */
.chrome-profiles-modal-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 0.75rem;
  flex-shrink: 0;
}

/* Row 1: Search & Rescan */
.chrome-profiles-modal-search-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.chrome-profiles-search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  position: relative;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  transition: all 0.2s ease;
}

.chrome-profiles-search-wrap:focus-within {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.chrome-profiles-search-wrap .search-icon {
  font-size: 0.85rem;
  margin-right: 0.45rem;
  opacity: 0.7;
}

.chrome-profiles-search-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #f8fafc;
  font-size: 0.82rem;
  padding: 0.15rem 0;
}


.chrome-profiles-search-wrap input::placeholder {
  color: #64748b;
}

.clear-search-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 0.3rem;
  line-height: 1;
  border-radius: 4px;
}

.clear-search-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.chrome-profile-count-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  white-space: nowrap;
  margin-left: 0.4rem;
}

.chrome-profiles-toolbar-actions {
  display: flex;
  gap: 0.4rem;
}

/* Row 2: Filter Chips */
.chrome-profiles-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.chrome-profiles-filter-chips .filter-chip {
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  font-size: 0.74rem;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.chrome-profiles-filter-chips .filter-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.18);
}

.chrome-profiles-filter-chips .filter-chip.active {
  background: #38bdf8;
  color: #0f172a;
  border-color: #38bdf8;
  font-weight: 700;
}

/* Row 3: Quick Select & Settings */
.chrome-profiles-modal-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.74rem;
  padding-top: 0.3rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
}

.chrome-profiles-bulk-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: #94a3b8;
}

.bulk-label {
  color: #64748b;
}

.cp-action-link {
  background: none;
  border: none;
  color: #38bdf8;
  font-size: 0.73rem;
  cursor: pointer;
  padding: 0.1rem 0.25rem;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.cp-action-link:hover {
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.1);
  text-decoration: underline;
}

.sep {
  color: rgba(255, 255, 255, 0.2);
  user-select: none;
}

.chrome-profiles-toggles-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chrome-profiles-incognito-label,
.chrome-profiles-headless-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.73rem;
  color: #94a3b8;
  cursor: pointer;
  user-select: none;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.15s ease;
}

.chrome-profiles-incognito-label:hover,
.chrome-profiles-headless-label:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
}

.chrome-profiles-incognito-label input[type="checkbox"],
.chrome-profiles-headless-label input[type="checkbox"] {
  cursor: pointer;
  accent-color: #06b6d4;
  width: 13px;
  height: 13px;
}

.chrome-profiles-incognito-label.is-active,
.chrome-profiles-headless-label.is-active {
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.4);
  color: #67e8f9;
}

/* 3. Profile Cards Container & Grid */
.chrome-profiles-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 0.65rem;
  flex: 1 1 auto;
  min-height: 160px;
  max-height: 52vh;
  overflow-y: auto;
  padding: 0.3rem 0.3rem 0.3rem 0;
  contain: paint;
}

/* Scrollbar styling */
.chrome-profiles-cards::-webkit-scrollbar {
  width: 6px;
}

.chrome-profiles-cards::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.chrome-profiles-cards::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Profile Card */
.chrome-profile-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: all 0.15s ease;
  position: relative;
  user-select: none;
}

.chrome-profile-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.chrome-profile-card.is-active {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.12);
}

.chrome-profile-card.is-selected {
  border-left: 3px solid #22c55e;
}

.chrome-profile-check {
  cursor: pointer;
  width: 15px;
  height: 15px;
  accent-color: #38bdf8;
  flex-shrink: 0;
}

.chrome-profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.chrome-profile-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.chrome-profile-header-line {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.chrome-profile-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.chrome-profile-dir-pill {
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  font-family: monospace;
}

.badge-active {
  font-size: 0.62rem;
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  font-weight: 700;
}

.badge-ext {
  font-size: 0.62rem;
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.3);
  font-weight: 600;
}

.badge-socket {
  font-size: 0.62rem;
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
  font-weight: 600;
}

.badge-size {
  font-size: 0.62rem;
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.chrome-profile-email-line {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.chrome-profile-email {
  font-size: 0.72rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chrome-profile-email.has-email {
  color: #94a3b8;
}

.chrome-profile-badges {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  margin-top: 0.1rem;
}

.chrome-profile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex-shrink: 0;
}

.btn-profile-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.22rem 0.5rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-align: center;
}

.btn-profile-open:hover:not(:disabled) {
  background: #22c55e;
  color: #052e16;
  border-color: #4ade80;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
}

.btn-profile-open:disabled {
  opacity: 0.65;
  cursor: wait;
}

.btn-profile-select {
  padding: 0.22rem 0.5rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-align: center;
}


.btn-profile-select:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.btn-profile-select.is-active {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
  font-weight: 600;
}

.chrome-profiles-empty {
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: #64748b;
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-height: 160px;
}

.chrome-profiles-empty[hidden] {
  display: none !important;
}

.cp-btn-reset-filters {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: auto;
  white-space: nowrap;
  margin-top: 10px;
  padding: 0.45rem 1.1rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  cursor: pointer;
  transition: all 0.15s ease;
}

.cp-btn-reset-filters:hover {
  background: #38bdf8;
  color: #0f172a;
}

/* 4. Modal Footer */
.chrome-profiles-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.75rem;
  flex-shrink: 0;
}

.chrome-profiles-footer-summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  color: #94a3b8;
}

.chrome-profiles-footer-summary strong {
  color: #f1f5f9;
}

.chrome-profiles-footer-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   5. Live JEV Pipeline Inspector Modal & Pipeline Trace
   ========================================================================== */

.live-jev-modal-card {
  width: 95vw;
  max-width: 1080px;
  height: 85vh;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: #141724;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  padding: 1.15rem 1.25rem;
  gap: 0.75rem;
  animation: cpModalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.live-jev-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.live-jev-modal-title-group h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.live-jev-modal-profile-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.3rem;
}

.live-jev-email {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* Toolbar */
.live-jev-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.live-jev-toolbar-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.76rem;
  color: #94a3b8;
  flex-wrap: wrap;
}

.live-jev-tag {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.live-jev-tag strong {
  color: #e2e8f0;
  font-family: var(--font-mono, monospace);
}

.live-jev-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 600;
}

.live-jev-status-badge.pending {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
}

.live-jev-status-badge.running {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.live-jev-status-badge.done {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.live-jev-status-badge.failed {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.live-jev-status-badge.warning {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.4);
}

.live-jev-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Modal Body: Split into Pipeline & Details */
.live-jev-modal-body {
  display: grid;
  grid-template-columns: 360px 1fr;
  grid-template-rows: minmax(0, 1fr);
  gap: 0.85rem;
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

@media (max-width: 820px) {
  .live-jev-modal-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    overflow-y: auto;
  }
}

/* ── Pipeline Panel & Steps (Matching veo3_playwright spec) ──────────── */
.live-jev-pipeline-container {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pipeline-panel {
  padding: 12px 14px;
  background: rgba(94, 106, 210, 0.04);
  border: 1px solid rgba(94, 106, 210, 0.15);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.pipeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.pipeline-panel strong {
  color: #818cf8;
  font-size: 0.82rem;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
}

.pipeline-elapsed {
  font-size: 0.72rem;
  color: #94a3b8;
  font-family: var(--font-mono, monospace);
}

.pipeline-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.pipeline-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.pipeline-step:hover {
  background: rgba(255, 255, 255, 0.03);
}

.pipeline-icon {
  width: 18px;
  min-width: 18px;
  text-align: center;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  font-size: 0.88rem;
  line-height: 1.2;
}

.pipeline-step-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  flex: 1 1 auto;
}

.pipeline-step-label b {
  font-weight: 600;
  color: #f1f5f9;
  font-size: 0.8rem;
}

.pipeline-step small {
  display: block;
  color: #94a3b8;
  font-size: 0.71rem;
  word-break: break-word;
  line-height: 1.35;
}

.pipeline-done .pipeline-icon {
  color: #22c55e;
}

.pipeline-running .pipeline-icon {
  color: #eab308;
  animation: pulse-pipeline 1.2s infinite ease-in-out;
}

.pipeline-pending .pipeline-icon {
  color: #64748b;
}

.pipeline-stalled .pipeline-icon,
.pipeline-stalled .pipeline-step-label,
.pipeline-stalled .pipeline-step-label small {
  color: #eab308;
}

.pipeline-failed .pipeline-icon,
.pipeline-failed .pipeline-step-label,
.pipeline-failed .pipeline-step-label small {
  color: #ef4444;
}

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

@keyframes pulse-pipeline {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(1.2); }
}

/* ── Details Panel & Tabs ─────────────────────────────────────────── */
.live-jev-details-container {
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.live-jev-tabs {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0 0.5rem;
  gap: 0.25rem;
  flex-shrink: 0;
}

.live-jev-tab-btn {
  padding: 0.55rem 0.85rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: #94a3b8;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.live-jev-tab-btn:hover {
  color: #f1f5f9;
}

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

.live-jev-tab-content {
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0.6rem;
}

.live-jev-tab-content[hidden] {
  display: none !important;
}

/* ── Tab 0: Live Viewport Preview Stage ───────────────────────────── */
.live-jev-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  padding: 0.25rem 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  flex-shrink: 0;
}


.live-jev-preview-meta {
  font-size: 0.74rem;
  color: #94a3b8;
  font-family: var(--font-mono, monospace);
}

.live-jev-preview-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.live-jev-preview-btn {
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.15s ease;
}

.live-jev-preview-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
}

.live-jev-preview-btn.active {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
}

.live-jev-preview-stage {
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  position: relative;
  overflow: auto;
  overscroll-behavior: contain;
  background: radial-gradient(circle at 50% 50%, rgba(20, 24, 38, 0.9) 0%, rgba(10, 12, 18, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.live-jev-preview-stage.is-zoomed {
  display: block;
  text-align: center;
}

.live-jev-preview-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  max-height: 100%;
  margin: auto;
  line-height: 0;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.live-jev-preview-stage.is-zoomed .live-jev-preview-wrap {
  max-width: none;
  max-height: none;
}

.live-jev-preview-img {
  max-width: 100%;
  max-height: 48vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  user-select: none;
  pointer-events: auto;
}

.live-jev-preview-stage.is-zoomed .live-jev-preview-img {
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
}

.live-jev-preview-overlays {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.live-jev-preview-overlays.hidden {
  display: none !important;
}

.live-jev-overlay-box {
  position: absolute;
  border: 1.5px solid rgba(56, 189, 248, 0.7);
  background: rgba(56, 189, 248, 0.12);
  border-radius: 3px;
  pointer-events: auto;
  cursor: pointer;
  transition: all 0.12s ease;
  z-index: 2;
}

.live-jev-overlay-box:hover {
  border-color: #facc15;
  background: rgba(250, 204, 21, 0.25);
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.5);
  z-index: 10;
}

.live-jev-overlay-box.composer {
  border-color: #a855f7;
  background: rgba(168, 85, 247, 0.18);
}

.live-jev-overlay-box.submit {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.2);
}

.live-jev-preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: #94a3b8;
  gap: 0.5rem;
}

.live-jev-placeholder-icon {
  font-size: 2.8rem;
  margin-bottom: 0.25rem;
  opacity: 0.8;
}

.live-jev-preview-placeholder strong {
  font-size: 0.95rem;
  color: #f1f5f9;
}

.live-jev-preview-placeholder p {
  font-size: 0.78rem;
  max-width: 380px;
  margin: 0;
  line-height: 1.5;
}

.live-jev-filter-bar {
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

.live-jev-filter-bar input {
  width: 100%;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
}

.live-jev-table-wrap {
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
}

.live-jev-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.74rem;
}

.live-jev-table th {
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  font-weight: 600;
  text-align: left;
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  z-index: 1;
}

.live-jev-table td {
  padding: 0.35rem 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: #cbd5e1;
  vertical-align: top;
}

.live-jev-table tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}

.live-jev-table td code {
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
  color: #c7ccf4;
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 4px;
  border-radius: 4px;
}

.live-jev-table-empty {
  text-align: center;
  padding: 2rem !important;
  color: #64748b;
}

/* Tab 2: Tiles */
.live-jev-tiles-summary {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
  flex-shrink: 0;
}

.live-jev-tile-stat {
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.74rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.live-jev-tile-stat.ready b { color: #4ade80; }
.live-jev-tile-stat.gen b { color: #facc15; }
.live-jev-tile-stat.err b { color: #f87171; }
.live-jev-tile-stat.total b { color: #38bdf8; }

.live-jev-tiles-list {
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-right: 4px;
}

.live-jev-tile-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  font-size: 0.75rem;
  gap: 0.6rem;
}

.live-jev-tile-status {
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.live-jev-tile-status.ready { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.live-jev-tile-status.generating { background: rgba(234, 179, 8, 0.15); color: #facc15; }
.live-jev-tile-status.error { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.live-jev-tile-prompt {
  flex: 1 1 auto;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-jev-tiles-empty {
  text-align: center;
  color: #64748b;
  padding: 2rem;
  font-size: 0.8rem;
}

/* Tab 3: Log Console */
.live-jev-log-box {
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  background: #0a0c13;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.6rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.73rem;
  color: #a5b4fc;
  overflow-y: auto;
  overscroll-behavior: contain;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.5;
}

.live-jev-log-line {
  margin-bottom: 2px;
}

.live-jev-log-line.error { color: #f87171; }
.live-jev-log-line.success { color: #4ade80; }
.live-jev-log-line.warn { color: #facc15; }

/* ── Live JEV Scrollbars ─────────────────────────────────────────── */
.pipeline-list,
.live-jev-table-wrap,
.live-jev-tiles-list,
.live-jev-log-box,
.live-jev-preview-stage {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.pipeline-list::-webkit-scrollbar,
.live-jev-table-wrap::-webkit-scrollbar,
.live-jev-tiles-list::-webkit-scrollbar,
.live-jev-log-box::-webkit-scrollbar,
.live-jev-preview-stage::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.pipeline-list::-webkit-scrollbar-track,
.live-jev-table-wrap::-webkit-scrollbar-track,
.live-jev-tiles-list::-webkit-scrollbar-track,
.live-jev-log-box::-webkit-scrollbar-track,
.live-jev-preview-stage::-webkit-scrollbar-track {
  background: transparent;
}

.pipeline-list::-webkit-scrollbar-thumb,
.live-jev-table-wrap::-webkit-scrollbar-thumb,
.live-jev-tiles-list::-webkit-scrollbar-thumb,
.live-jev-log-box::-webkit-scrollbar-thumb,
.live-jev-preview-stage::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 4px;
}

.pipeline-list::-webkit-scrollbar-thumb:hover,
.live-jev-table-wrap::-webkit-scrollbar-thumb:hover,
.live-jev-tiles-list::-webkit-scrollbar-thumb:hover,
.live-jev-log-box::-webkit-scrollbar-thumb:hover,
.live-jev-preview-stage::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* Modal Footer */
.live-jev-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.live-jev-footer-info {
  font-size: 0.78rem;
  color: #94a3b8;
}

.live-jev-footer-info strong {
  color: #f1f5f9;
}


