:root {
  --bg: #0b0c0e;
  --surface: rgba(17, 18, 20, 0.96);
  --surface-2: rgba(24, 25, 28, 0.96);
  --surface-3: rgba(31, 33, 37, 0.94);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f3f4f6;
  --muted: #9aa0a9;
  --soft: #c9cdd3;
  --success: #8fd0b7;
  --warning: #e8c781;
  --danger: #e28f8f;
  --focus: #d7dde7;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.36);
  --app-shell-gap: 6px;
  --app-topbar-height: 70px;
  --app-viewport-height: 100vh;
  --workspace-head-height: 54px;
  --scrollbar-track: rgba(5, 6, 7, 0.72);
  --scrollbar-thumb: rgba(82, 86, 94, 0.92);
  --scrollbar-thumb-hover: rgba(116, 122, 132, 0.96);
}

.presentation-template-select-field {
  flex: 1 1 240px;
  margin: 0;
}

.presentation-template-select-field select {
  width: 100%;
}

.admin-presentation-template-uploader {
  align-items: end;
  grid-template-columns: minmax(180px, 0.8fr) minmax(240px, 1fr) auto;
}

.admin-presentation-template-file-field input[type="file"] {
  min-height: 40px;
  padding: 8px;
}

.admin-presentation-template-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
}

.admin-presentation-template-card.is-disabled {
  opacity: 0.68;
}

.admin-presentation-template-card .management-card-main {
  display: grid;
  gap: 8px;
}

.admin-presentation-template-card .management-card-meta,
.admin-presentation-template-card .management-card-badges,
.admin-presentation-template-card .management-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

@media (max-width: 900px) {
  .admin-presentation-template-uploader,
  .admin-presentation-template-card {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Reference-style light workspace theme for the main Forge app. */
body:has(#appScreen:not(.hidden)) {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --surface-3: #f8fafc;
  --line: #e5eaf1;
  --line-strong: #d8e0ea;
  --text: #111827;
  --muted: #6b7280;
  --soft: #475569;
  --focus: #111827;
  --shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
  --scrollbar-track: #eef2f6;
  --scrollbar-thumb: #cbd5e1;
  --scrollbar-thumb-hover: #94a3b8;
  color: var(--text);
  background:
    linear-gradient(rgba(148,163,184,0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,0.10) 1px, transparent 1px),
    #f4f6f8;
  background-size: 28px 28px;
}

body:has(#appScreen:not(.hidden)) .grid-noise {
  opacity: 0;
}

body:has(#appScreen:not(.hidden)) .app-shell {
  width: min(1640px, calc(100% - 24px));
  gap: 10px;
}

body:has(#appScreen:not(.hidden)) .topbar,
body:has(#appScreen:not(.hidden)) .sidebar,
body:has(#appScreen:not(.hidden)) .workspace-head,
body:has(#appScreen:not(.hidden)) .panel,
body:has(#appScreen:not(.hidden)) .profile-card,
body:has(#appScreen:not(.hidden)) .trace-card,
body:has(#appScreen:not(.hidden)) .result-card,
body:has(#appScreen:not(.hidden)) .table-row,
body:has(#appScreen:not(.hidden)) .model-card,
body:has(#appScreen:not(.hidden)) .stat-card {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  box-shadow: var(--shadow);
}

body:has(#appScreen:not(.hidden)) .topbar {
  min-height: 64px;
  padding: 8px 12px;
  border-radius: 18px;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(18px);
}

body:has(#appScreen:not(.hidden)) .topbar-main {
  grid-template-columns: minmax(180px, 1fr) auto minmax(120px, 1fr);
}

body:has(#appScreen:not(.hidden)) .brand-lockup,
body:has(#appScreen:not(.hidden)) #profileName,
body:has(#appScreen:not(.hidden)) #profileEmail {
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .topbar-brand .brand-title::after,
body:has(#appScreen:not(.hidden)) .login-brand .brand-title::after {
  border-color: rgba(17,24,39,0.14);
  box-shadow: 0 8px 18px rgba(47,207,115,0.18);
}

body:has(#appScreen:not(.hidden)) .topbar-tabs {
  gap: 4px;
  padding: 4px;
  border: 1px solid #e8edf3;
  border-radius: 999px;
  background: #f8fafc;
}

body:has(#appScreen:not(.hidden)) .topbar-tab {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

body:has(#appScreen:not(.hidden)) .topbar-tab:hover,
body:has(#appScreen:not(.hidden)) .topbar-tab.active {
  color: #111827;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(15,23,42,0.08);
}

body:has(#appScreen:not(.hidden)) .app-layout {
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 12px;
}

body:has(#appScreen:not(.hidden)) .sidebar {
  top: calc(var(--app-topbar-height) + 10px);
  padding: 10px;
  border-radius: 18px;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(18px);
}

body:has(#appScreen:not(.hidden)) .sidebar-menu-panel,
body:has(#appScreen:not(.hidden)) .sidebar-profile-button {
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: none;
}

body:has(#appScreen:not(.hidden)) .sidebar-profile-button {
  border-radius: 14px;
}

body:has(#appScreen:not(.hidden)) .sidebar-profile-button small {
  color: var(--muted);
}

body:has(#appScreen:not(.hidden)) .profile-avatar,
body:has(#appScreen:not(.hidden)) .sidebar-profile-button .profile-avatar {
  border-color: #d7f3e7;
  background: #ecfdf5;
  color: #047857;
  box-shadow: none;
}

body:has(#appScreen:not(.hidden)) .sidebar-menu-panel {
  border-radius: 14px;
  padding: 8px;
}

body:has(#appScreen:not(.hidden)) .app-sidebar .nav-item,
body:has(#appScreen:not(.hidden)) .nav-item {
  border: 1px solid transparent;
  background: transparent;
  color: #475569;
  box-shadow: none;
}

body:has(#appScreen:not(.hidden)) .app-sidebar .nav-item:hover {
  border-color: #e5eaf1;
  background: #f8fafc;
  color: #111827;
}

body:has(#appScreen:not(.hidden)) .app-sidebar .nav-item.active {
  border-color: #e5eaf1;
  background: #111827;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(15,23,42,0.14);
}

body:has(#appScreen:not(.hidden)) .app-sidebar .nav-item span:last-child,
body:has(#appScreen:not(.hidden)) .app-sidebar .nav-item.active span:last-child {
  color: currentColor;
  opacity: 0.72;
}

body:has(#appScreen:not(.hidden)) .sidebar-logout-button,
body:has(#appScreen:not(.hidden)) .ghost-button {
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: #334155;
  box-shadow: none;
}

body:has(#appScreen:not(.hidden)) .ghost-button:hover,
body:has(#appScreen:not(.hidden)) .sidebar-logout-button:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #111827;
}

body:has(#appScreen:not(.hidden)) .primary-button {
  border: 1px solid #111827;
  background: #111827;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(15,23,42,0.16);
}

body:has(#appScreen:not(.hidden)) .primary-button:hover {
  background: #020617;
}

body:has(#appScreen:not(.hidden)) .workspace-head {
  min-height: 58px;
  padding: 10px 14px;
  border-radius: 16px;
  margin-bottom: 10px;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(18px);
}

body:has(#appScreen:not(.hidden)) .workspace-head .eyebrow {
  display: block;
  margin-bottom: 3px;
  color: #94a3b8;
  letter-spacing: .12em;
}

body:has(#appScreen:not(.hidden)) .workspace-head h1 {
  color: #111827;
  font-size: clamp(20px, 2vw, 26px);
}

body:has(#appScreen:not(.hidden)) .head-chip,
body:has(#appScreen:not(.hidden)) .status-chip,
body:has(#appScreen:not(.hidden)) .pill,
body:has(#appScreen:not(.hidden)) .role-badge {
  border: 1px solid #e8edf3;
  background: #f8fafc;
  color: #475569;
}

body:has(#appScreen:not(.hidden)) .workbench-stage,
body:has(#appScreen:not(.hidden)) .forge-tool-shell {
  gap: 12px;
}

body:has(#appScreen:not(.hidden)) .panel {
  border-radius: 16px;
}

body:has(#appScreen:not(.hidden)) .panel-head {
  border-bottom-color: #eef2f6;
}

body:has(#appScreen:not(.hidden)) .eyebrow,
body:has(#appScreen:not(.hidden)) .field span,
body:has(#appScreen:not(.hidden)) .form-note,
body:has(#appScreen:not(.hidden)) .trace-card p,
body:has(#appScreen:not(.hidden)) .table-row p,
body:has(#appScreen:not(.hidden)) .result-card p,
body:has(#appScreen:not(.hidden)) .job-card p,
body:has(#appScreen:not(.hidden)) .model-card p,
body:has(#appScreen:not(.hidden)) .empty-state {
  color: var(--muted);
}

body:has(#appScreen:not(.hidden)) input,
body:has(#appScreen:not(.hidden)) textarea,
body:has(#appScreen:not(.hidden)) select,
body:has(#appScreen:not(.hidden)) .composer-control-card select,
body:has(#appScreen:not(.hidden)) .composer-control-card input,
body:has(#appScreen:not(.hidden)) .jobs-panel input,
body:has(#appScreen:not(.hidden)) .jobs-panel select {
  border-color: #dfe6ef;
  background-color: #ffffff;
  color: #111827;
  box-shadow: none;
}

body:has(#appScreen:not(.hidden)) input::placeholder,
body:has(#appScreen:not(.hidden)) textarea::placeholder {
  color: #9aa4b2;
}

body:has(#appScreen:not(.hidden)) input:focus,
body:has(#appScreen:not(.hidden)) textarea:focus,
body:has(#appScreen:not(.hidden)) select:focus {
  border-color: #111827;
  box-shadow: 0 0 0 3px rgba(17,24,39,0.08);
}

body:has(#appScreen:not(.hidden)) .composer-panel,
body:has(#appScreen:not(.hidden)) .jobs-panel,
body:has(#appScreen:not(.hidden)) .results-panel {
  background: #ffffff;
}

body:has(#appScreen:not(.hidden)) .composer-brief-shell,
body:has(#appScreen:not(.hidden)) .composer-ai-shortcut,
body:has(#appScreen:not(.hidden)) .composer-control-card,
body:has(#appScreen:not(.hidden)) .creation-stat-card,
body:has(#appScreen:not(.hidden)) .toolbar-status,
body:has(#appScreen:not(.hidden)) .job-queue-summary,
body:has(#appScreen:not(.hidden)) .compact-grid,
body:has(#appScreen:not(.hidden)) .reference-preview,
body:has(#appScreen:not(.hidden)) .forge-tool-dropzone,
body:has(#appScreen:not(.hidden)) .forge-tool-preview,
body:has(#appScreen:not(.hidden)) .forge-tool-result-frame {
  border: 1px solid #e8edf3;
  background: #f8fafc;
  color: #111827;
  box-shadow: none;
}

body:has(#appScreen:not(.hidden)) .creation-stat-card strong,
body:has(#appScreen:not(.hidden)) .panel h2,
body:has(#appScreen:not(.hidden)) .panel h3,
body:has(#appScreen:not(.hidden)) .composer-control-card-head span {
  color: #111827;
}

body:has(#appScreen:not(.hidden)) .segmented,
body:has(#appScreen:not(.hidden)) .compact-segmented {
  border: 1px solid #e5eaf1;
  background: #eef2f6;
}

body:has(#appScreen:not(.hidden)) .segmented-item {
  color: #64748b;
}

body:has(#appScreen:not(.hidden)) .segmented-item.active {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 6px 16px rgba(15,23,42,0.08);
}

body:has(#appScreen:not(.hidden)) .result-card {
  overflow: hidden;
}

body:has(#appScreen:not(.hidden)) .result-card:hover,
body:has(#appScreen:not(.hidden)) .trace-card:hover,
body:has(#appScreen:not(.hidden)) .table-row:hover {
  border-color: #cbd5e1;
  box-shadow: 0 16px 34px rgba(15,23,42,0.12);
}

body:has(#appScreen:not(.hidden)) .danger-button {
  border-color: #fecaca;
  color: #dc2626;
}

body:has(#appScreen:not(.hidden)) .danger-button:hover {
  background: #fff5f5;
}

body:has(#appScreen:not(.hidden)) .canvas-browser {
  background:
    linear-gradient(rgba(148,163,184,0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,0.10) 1px, transparent 1px),
    #f4f6f8;
  background-size: 28px 28px;
}

body:has(#appScreen:not(.hidden)) .canvas-browser-card {
  border-color: var(--line);
  background: rgba(255,255,255,0.94);
}

body:has(#appScreen:not(.hidden)) .canvas-browser-title-row h2 {
  color: #111827;
}

/* EOF override: dark Forge colors + reference-like capsule menus/buttons. */
body:has(#appScreen:not(.hidden)) {
  --bg: #0b0c0e;
  --surface: rgba(17,18,20,0.96);
  --surface-2: rgba(24,25,28,0.96);
  --surface-3: rgba(31,33,37,0.94);
  --line: rgba(255,255,255,0.08);
  --line-strong: rgba(255,255,255,0.16);
  --text: #f3f4f6;
  --muted: #9aa0a9;
  --soft: #c9cdd3;
  --focus: #d7dde7;
  --shadow: 0 22px 70px rgba(0,0,0,0.30);
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(255,255,255,0.04), transparent 30%),
    radial-gradient(circle at 88% 12%, rgba(143,208,183,0.05), transparent 26%),
    linear-gradient(180deg, #050607, #111316 58%, #121417);
}

body:has(#appScreen:not(.hidden)) .topbar,
body:has(#appScreen:not(.hidden)) .sidebar,
body:has(#appScreen:not(.hidden)) .workspace-head,
body:has(#appScreen:not(.hidden)) .panel,
body:has(#appScreen:not(.hidden)) .profile-card,
body:has(#appScreen:not(.hidden)) .trace-card,
body:has(#appScreen:not(.hidden)) .result-card,
body:has(#appScreen:not(.hidden)) .table-row,
body:has(#appScreen:not(.hidden)) .model-card,
body:has(#appScreen:not(.hidden)) .stat-card {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

body:has(#appScreen:not(.hidden)) .topbar,
body:has(#appScreen:not(.hidden)) .sidebar,
body:has(#appScreen:not(.hidden)) .workspace-head {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.018)),
    rgba(17,19,21,0.96);
  backdrop-filter: blur(18px);
}

body:has(#appScreen:not(.hidden)) .topbar-main {
  grid-template-columns: minmax(180px, 1fr) auto minmax(120px, 1fr);
}

body:has(#appScreen:not(.hidden)) .topbar-tabs {
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  background: rgba(5,6,7,0.36);
}

body:has(#appScreen:not(.hidden)) .topbar-tab,
body:has(#appScreen:not(.hidden)) .app-sidebar .nav-item {
  border-radius: 999px;
  color: var(--muted);
}

body:has(#appScreen:not(.hidden)) .topbar-tab {
  min-height: 34px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 800;
}

body:has(#appScreen:not(.hidden)) .topbar-tab:hover,
body:has(#appScreen:not(.hidden)) .topbar-tab.active,
body:has(#appScreen:not(.hidden)) .app-sidebar .nav-item:hover,
body:has(#appScreen:not(.hidden)) .app-sidebar .nav-item.active {
  border-color: rgba(143,208,183,0.30);
  background:
    linear-gradient(135deg, rgba(143,208,183,0.18), rgba(255,255,255,0.07)),
    rgba(31,33,37,0.94);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

body:has(#appScreen:not(.hidden)) .sidebar-menu-panel,
body:has(#appScreen:not(.hidden)) .sidebar-profile-button,
body:has(#appScreen:not(.hidden)) .composer-brief-shell,
body:has(#appScreen:not(.hidden)) .composer-ai-shortcut,
body:has(#appScreen:not(.hidden)) .composer-control-card,
body:has(#appScreen:not(.hidden)) .creation-stat-card,
body:has(#appScreen:not(.hidden)) .toolbar-status,
body:has(#appScreen:not(.hidden)) .job-queue-summary,
body:has(#appScreen:not(.hidden)) .compact-grid,
body:has(#appScreen:not(.hidden)) .reference-preview,
body:has(#appScreen:not(.hidden)) .forge-tool-dropzone,
body:has(#appScreen:not(.hidden)) .forge-tool-preview,
body:has(#appScreen:not(.hidden)) .forge-tool-result-frame {
  border-color: rgba(255,255,255,0.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012)),
    rgba(24,25,28,0.96);
  color: var(--text);
  box-shadow: none;
}

body:has(#appScreen:not(.hidden)) .ghost-button,
body:has(#appScreen:not(.hidden)) .sidebar-logout-button,
body:has(#appScreen:not(.hidden)) .canvas-icon-button,
body:has(#appScreen:not(.hidden)) .icon-button,
body:has(#appScreen:not(.hidden)) .toolbar-jump-button,
body:has(#appScreen:not(.hidden)) .result-card-more-button,
body:has(#appScreen:not(.hidden)) .preview-head-action,
body:has(#appScreen:not(.hidden)) .preview-text-button,
body:has(#appScreen:not(.hidden)) .preview-nav-float {
  min-height: 32px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background: rgba(255,255,255,0.045);
  color: var(--soft);
  box-shadow: none;
}

body:has(#appScreen:not(.hidden)) .canvas-icon-button,
body:has(#appScreen:not(.hidden)) .icon-button,
body:has(#appScreen:not(.hidden)) .result-card-more-button,
body:has(#appScreen:not(.hidden)) .preview-head-action {
  width: auto;
  min-width: 34px;
  height: 34px;
  padding: 0 11px;
}

body:has(#appScreen:not(.hidden)) .ghost-button:hover,
body:has(#appScreen:not(.hidden)) .sidebar-logout-button:hover,
body:has(#appScreen:not(.hidden)) .canvas-icon-button:hover,
body:has(#appScreen:not(.hidden)) .icon-button:hover,
body:has(#appScreen:not(.hidden)) .toolbar-jump-button:hover,
body:has(#appScreen:not(.hidden)) .result-card-more-button:hover,
body:has(#appScreen:not(.hidden)) .preview-head-action:hover,
body:has(#appScreen:not(.hidden)) .preview-text-button:hover,
body:has(#appScreen:not(.hidden)) .preview-nav-float:hover {
  border-color: rgba(255,255,255,0.20);
  background: rgba(255,255,255,0.08);
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) input,
body:has(#appScreen:not(.hidden)) textarea,
body:has(#appScreen:not(.hidden)) select {
  border-color: rgba(255,255,255,0.10);
  background-color: #101113;
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .primary-button {
  border: 1px solid rgba(243,244,246,0.36);
  border-radius: 999px;
  background: linear-gradient(180deg, #f3f4f6, #aeb5bd);
  color: #0b0c0e;
}

body:has(#appScreen:not(.hidden)) .canvas-browser {
  background: #0b111d;
}

body:has(#appScreen:not(.hidden)) .canvas-browser-card {
  border-color: rgba(148,163,184,0.22);
  background: #151c2a;
}

body:has(#appScreen:not(.hidden)) .canvas-browser-title-row h2,
body:has(#appScreen:not(.hidden)) .workspace-head h1,
body:has(#appScreen:not(.hidden)) .panel h2,
body:has(#appScreen:not(.hidden)) .panel h3,
body:has(#appScreen:not(.hidden)) .composer-control-card-head span {
  color: var(--text);
}

/* Final requested polish: dashboard chips, selects, buttons, and unified tool backgrounds. */
body:has(#appScreen:not(.hidden)) .head-chip,
body:has(#appScreen:not(.hidden)) .status-chip,
body:has(#appScreen:not(.hidden)) #quickStatsChip,
body:has(#appScreen:not(.hidden)) #quickStatsChipMirror,
body:has(#appScreen:not(.hidden)) #runStatus,
body:has(#appScreen:not(.hidden)) .toolbar-status,
body:has(#appScreen:not(.hidden)) .toolbar-status .toolbar-jump-button {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.065), rgba(255,255,255,0.026)),
    rgba(19,21,23,0.88);
  color: var(--soft);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

body:has(#appScreen:not(.hidden)) .toolbar-status {
  min-height: 44px;
  padding: 5px;
  gap: 6px;
  display: inline-flex;
}

body:has(#appScreen:not(.hidden)) .toolbar-status .toolbar-jump-button,
body:has(#appScreen:not(.hidden)) #runStatus,
body:has(#appScreen:not(.hidden)) #quickStatsChipMirror,
body:has(#appScreen:not(.hidden)) #quickStatsChip {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
}

body:has(#appScreen:not(.hidden)) #runStatus {
  color: var(--success);
  border-color: rgba(143,208,183,0.26);
  background: rgba(143,208,183,0.10);
}

body:has(#appScreen:not(.hidden)) select,
body:has(#appScreen:not(.hidden)) .template-select,
body:has(#appScreen:not(.hidden)) .composer-control-card select,
body:has(#appScreen:not(.hidden)) .jobs-panel select,
body:has(#appScreen:not(.hidden)) .pager-control select,
body:has(#appScreen:not(.hidden)) .community-head-filter select,
body:has(#appScreen:not(.hidden)) .preview-local-edit-mode-select {
  min-height: 38px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background-color: rgba(16,17,19,0.96);
  background-image:
    linear-gradient(45deg, transparent 50%, #9aa0a9 50%),
    linear-gradient(135deg, #9aa0a9 50%, transparent 50%);
  color: var(--text);
  padding: 8px 36px 8px 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

body:has(#appScreen:not(.hidden)) select:hover {
  border-color: rgba(255,255,255,0.20);
  background-color: rgba(24,25,28,0.98);
}

body:has(#appScreen:not(.hidden)) select:focus {
  border-color: rgba(143,208,183,0.52);
  box-shadow: 0 0 0 3px rgba(143,208,183,0.12);
}

body:has(#appScreen:not(.hidden)) button,
body:has(#appScreen:not(.hidden)) .ghost-button,
body:has(#appScreen:not(.hidden)) .primary-button {
  border-radius: 999px;
}

body:has(#appScreen:not(.hidden)) .ghost-button,
body:has(#appScreen:not(.hidden)) .canvas-icon-button,
body:has(#appScreen:not(.hidden)) .canvas-new-button,
body:has(#appScreen:not(.hidden)) .forge-tool-preset,
body:has(#appScreen:not(.hidden)) .tool-chip,
body:has(#appScreen:not(.hidden)) .result-actions-menu-button {
  min-height: 36px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.045);
  color: var(--soft);
  padding-inline: 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

body:has(#appScreen:not(.hidden)) .ghost-button:hover,
body:has(#appScreen:not(.hidden)) .canvas-icon-button:hover,
body:has(#appScreen:not(.hidden)) .canvas-new-button:hover,
body:has(#appScreen:not(.hidden)) .forge-tool-preset:hover,
body:has(#appScreen:not(.hidden)) .tool-chip:hover,
body:has(#appScreen:not(.hidden)) .result-actions-menu-button:hover {
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.085);
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .primary-button,
body:has(#appScreen:not(.hidden)) .forge-tool-run {
  min-height: 42px;
  border: 1px solid rgba(243,244,246,0.34);
  background: linear-gradient(180deg, #f3f4f6, #aeb5bd);
  color: #0b0c0e;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(0,0,0,0.18);
}

body:has(#appScreen:not(.hidden)) .forge-tool-run:hover:not(:disabled) {
  border-color: rgba(243,244,246,0.54);
  background: linear-gradient(180deg, #ffffff, #b9c0c8);
  color: #0b0c0e;
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(0,0,0,0.22);
}

body:has(#appScreen:not(.hidden)) #angleView,
body:has(#appScreen:not(.hidden)) #enhanceView,
body:has(#appScreen:not(.hidden)) #canvasView,
body:has(#appScreen:not(.hidden)) .angle-lab-shell,
body:has(#appScreen:not(.hidden)) .forge-tool-shell,
body:has(#appScreen:not(.hidden)) .infinite-canvas-shell,
body:has(#appScreen:not(.hidden)) .canvas-browser {
  background:
    radial-gradient(circle at 12% 0%, rgba(255,255,255,0.035), transparent 28%),
    radial-gradient(circle at 84% 8%, rgba(143,208,183,0.045), transparent 26%),
    linear-gradient(180deg, #050607, #111316 58%, #121417);
}

body:has(#appScreen:not(.hidden)) .angle-lab-shell,
body:has(#appScreen:not(.hidden)) .forge-tool-shell,
body:has(#appScreen:not(.hidden)) .infinite-canvas-shell {
  border-radius: 12px;
}

/* Final micro-polish at EOF: make workbench counters, status tags, selects, and tool pages feel like one system. */
body:has(#appScreen:not(.hidden)) .creation-task-status,
body:has(#appScreen:not(.hidden)) .job-queue-summary span,
body:has(#appScreen:not(.hidden)) .panel-head small,
body:has(#appScreen:not(.hidden)) .result-mode-meta,
body:has(#appScreen:not(.hidden)) .canvas-browser-count {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  width: fit-content;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

body:has(#appScreen:not(.hidden)) .creation-task-status.is-active,
body:has(#appScreen:not(.hidden)) .status-chip:not(:empty) {
  border-color: rgba(143,208,183,0.24);
  background: rgba(143,208,183,0.09);
  color: var(--success);
}

body:has(#appScreen:not(.hidden)) .status-chip.is-warning {
  border-color: rgba(232,199,129,0.34);
  background: rgba(232,199,129,0.10);
  color: #ffe1a0;
}

body:has(#appScreen:not(.hidden)) .panel-head h2,
body:has(#appScreen:not(.hidden)) .panel-head h3 {
  letter-spacing: 0;
}

body:has(#appScreen:not(.hidden)) .jobs-panel .panel-head,
body:has(#appScreen:not(.hidden)) .results-panel .panel-head,
body:has(#appScreen:not(.hidden)) .angle-tool-topbar,
body:has(#appScreen:not(.hidden)) .forge-tool-topbar,
body:has(#appScreen:not(.hidden)) .canvas-browser-topbar,
body:has(#appScreen:not(.hidden)) .canvas-toolbar-panel {
  border-color: rgba(255,255,255,0.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.018)),
    rgba(19,21,23,0.92);
}

body:has(#appScreen:not(.hidden)) select,
body:has(#appScreen:not(.hidden)) .template-select,
body:has(#appScreen:not(.hidden)) .composer-control-card select,
body:has(#appScreen:not(.hidden)) .jobs-panel select,
body:has(#appScreen:not(.hidden)) .pager-control select,
body:has(#appScreen:not(.hidden)) .community-head-filter select,
body:has(#appScreen:not(.hidden)) .preview-local-edit-mode-select {
  appearance: none;
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 13px) calc(50% - 3px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

body:has(#appScreen:not(.hidden)) .toolbar-status .toolbar-jump-button {
  min-width: 64px;
  justify-content: center;
}

body:has(#appScreen:not(.hidden)) .toolbar-status .toolbar-jump-button:hover,
body:has(#appScreen:not(.hidden)) .toolbar-status .toolbar-jump-button:focus-visible {
  border-color: rgba(143,208,183,0.30);
  background: rgba(143,208,183,0.12);
  color: #f5f7f8;
}

body:has(#appScreen:not(.hidden)) .angle-lab-shell,
body:has(#appScreen:not(.hidden)) .forge-tool-shell,
body:has(#appScreen:not(.hidden)) .infinite-canvas-shell,
body:has(#appScreen:not(.hidden)) .canvas-editor {
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .angle-control-card,
body:has(#appScreen:not(.hidden)) .angle-render-card,
body:has(#appScreen:not(.hidden)) .forge-tool-card,
body:has(#appScreen:not(.hidden)) .canvas-browser-card,
body:has(#appScreen:not(.hidden)) .canvas-editor-shell,
body:has(#appScreen:not(.hidden)) .canvas-toolbar-panel {
  border-color: rgba(255,255,255,0.09);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.014)),
    rgba(18,20,22,0.94);
  box-shadow: 0 18px 50px rgba(0,0,0,0.22);
}

/* Physical EOF polish pass: workspace status, task/result panels, ready states, controls, and tool surfaces. */
body:has(#appScreen:not(.hidden)) .workbench-stage,
body:has(#appScreen:not(.hidden)) .workbench-prompt,
body:has(#appScreen:not(.hidden)) .workbench-jobs,
body:has(#appScreen:not(.hidden)) .results-panel,
body:has(#appScreen:not(.hidden)) .forge-tool-hero,
body:has(#appScreen:not(.hidden)) .forge-tool-uploader,
body:has(#appScreen:not(.hidden)) .forge-tool-controls,
body:has(#appScreen:not(.hidden)) .forge-tool-result,
body:has(#appScreen:not(.hidden)) .angle-result-frame,
body:has(#appScreen:not(.hidden)) .forge-tool-dropzone,
body:has(#appScreen:not(.hidden)) .forge-tool-preview,
body:has(#appScreen:not(.hidden)) .forge-tool-result-frame,
body:has(#appScreen:not(.hidden)) .canvas-browser-card {
  border-color: rgba(255,255,255,0.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.014)),
    rgba(17,19,22,0.94);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

body:has(#appScreen:not(.hidden)) .head-chip,
body:has(#appScreen:not(.hidden)) .status-chip,
body:has(#appScreen:not(.hidden)) #quickStatsChip,
body:has(#appScreen:not(.hidden)) #quickStatsChipMirror,
body:has(#appScreen:not(.hidden)) #runStatus,
body:has(#appScreen:not(.hidden)) .toolbar-status,
body:has(#appScreen:not(.hidden)) .creation-task-status,
body:has(#appScreen:not(.hidden)) .pill.ready,
body:has(#appScreen:not(.hidden)) .job-feed-status,
body:has(#appScreen:not(.hidden)) .result-group-chip {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.025)),
    rgba(19,21,23,0.90);
  color: var(--soft);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

body:has(#appScreen:not(.hidden)) .toolbar-status {
  min-height: 44px;
  padding: 5px;
  gap: 6px;
  display: inline-flex;
  align-items: center;
}

body:has(#appScreen:not(.hidden)) .toolbar-status .toolbar-jump-button,
body:has(#appScreen:not(.hidden)) #runStatus,
body:has(#appScreen:not(.hidden)) #quickStatsChip,
body:has(#appScreen:not(.hidden)) #quickStatsChipMirror,
body:has(#appScreen:not(.hidden)) .creation-task-status {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
  line-height: 32px;
}

body:has(#appScreen:not(.hidden)) #runStatus,
body:has(#appScreen:not(.hidden)) .pill.ready,
body:has(#appScreen:not(.hidden)) .job-status-dot.ready,
body:has(#appScreen:not(.hidden)) .job-feed-item.ready .job-feed-status,
body:has(#appScreen:not(.hidden)) .model-usage-chip.ready,
body:has(#appScreen:not(.hidden)) .record-gallery-card.ready,
body:has(#appScreen:not(.hidden)) .management-card.ready {
  border-color: rgba(143,208,183,0.32);
  background: rgba(143,208,183,0.12);
  color: var(--success);
}

body:has(#appScreen:not(.hidden)) select,
body:has(#appScreen:not(.hidden)) .template-select,
body:has(#appScreen:not(.hidden)) .composer-control-card select,
body:has(#appScreen:not(.hidden)) .jobs-panel select,
body:has(#appScreen:not(.hidden)) .pager-control select,
body:has(#appScreen:not(.hidden)) .community-head-filter select,
body:has(#appScreen:not(.hidden)) .preview-local-edit-mode-select,
body:has(#appScreen:not(.hidden)) .forge-node-mini-row select {
  min-height: 38px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  appearance: none;
  background-color: rgba(16,17,19,0.96);
  background-image:
    linear-gradient(45deg, transparent 50%, #aeb4bd 50%),
    linear-gradient(135deg, #aeb4bd 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 50%,
    calc(100% - 11px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  color: var(--text);
  padding: 8px 36px 8px 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

body:has(#appScreen:not(.hidden)) select:hover {
  border-color: rgba(255,255,255,0.22);
  background-color: rgba(24,25,28,0.98);
}

body:has(#appScreen:not(.hidden)) select:focus,
body:has(#appScreen:not(.hidden)) select:focus-visible {
  border-color: rgba(143,208,183,0.54);
  outline: none;
  box-shadow: 0 0 0 3px rgba(143,208,183,0.13);
}

body:has(#appScreen:not(.hidden)) button,
body:has(#appScreen:not(.hidden)) .ghost-button,
body:has(#appScreen:not(.hidden)) .primary-button,
body:has(#appScreen:not(.hidden)) .toolbar-jump-button,
body:has(#appScreen:not(.hidden)) .result-card-more-button,
body:has(#appScreen:not(.hidden)) .result-actions-menu-button,
body:has(#appScreen:not(.hidden)) .preview-head-action,
body:has(#appScreen:not(.hidden)) .preview-tool-button,
body:has(#appScreen:not(.hidden)) .forge-tool-preset,
body:has(#appScreen:not(.hidden)) .tool-chip {
  border-radius: 999px;
}

body:has(#appScreen:not(.hidden)) .ghost-button,
body:has(#appScreen:not(.hidden)) .sidebar-logout-button,
body:has(#appScreen:not(.hidden)) .canvas-icon-button,
body:has(#appScreen:not(.hidden)) .canvas-new-button,
body:has(#appScreen:not(.hidden)) .icon-button,
body:has(#appScreen:not(.hidden)) .toolbar-jump-button,
body:has(#appScreen:not(.hidden)) .result-card-more-button,
body:has(#appScreen:not(.hidden)) .result-actions-menu-button,
body:has(#appScreen:not(.hidden)) .preview-head-action,
body:has(#appScreen:not(.hidden)) .preview-text-button,
body:has(#appScreen:not(.hidden)) .preview-nav-float,
body:has(#appScreen:not(.hidden)) .preview-tool-button,
body:has(#appScreen:not(.hidden)) .forge-tool-preset,
body:has(#appScreen:not(.hidden)) .tool-chip {
  min-height: 36px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.045);
  color: var(--soft);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

body:has(#appScreen:not(.hidden)) .ghost-button:hover,
body:has(#appScreen:not(.hidden)) .sidebar-logout-button:hover,
body:has(#appScreen:not(.hidden)) .canvas-icon-button:hover,
body:has(#appScreen:not(.hidden)) .canvas-new-button:hover,
body:has(#appScreen:not(.hidden)) .icon-button:hover,
body:has(#appScreen:not(.hidden)) .toolbar-jump-button:hover,
body:has(#appScreen:not(.hidden)) .result-card-more-button:hover,
body:has(#appScreen:not(.hidden)) .result-actions-menu-button:hover,
body:has(#appScreen:not(.hidden)) .preview-head-action:hover,
body:has(#appScreen:not(.hidden)) .preview-text-button:hover,
body:has(#appScreen:not(.hidden)) .preview-nav-float:hover,
body:has(#appScreen:not(.hidden)) .preview-tool-button:hover,
body:has(#appScreen:not(.hidden)) .forge-tool-preset:hover,
body:has(#appScreen:not(.hidden)) .tool-chip:hover {
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.085);
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .primary-button,
body:has(#appScreen:not(.hidden)) .forge-tool-run {
  min-height: 42px;
  border: 1px solid rgba(243,244,246,0.34);
  background: linear-gradient(180deg, #f3f4f6, #aeb5bd);
  color: #0b0c0e;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(0,0,0,0.18);
}

body:has(#appScreen:not(.hidden)) .forge-tool-run:hover:not(:disabled) {
  border-color: rgba(243,244,246,0.54);
  background: linear-gradient(180deg, #ffffff, #b9c0c8);
  color: #0b0c0e;
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(0,0,0,0.22);
}

body:has(#appScreen:not(.hidden)) #angleView,
body:has(#appScreen:not(.hidden)) #enhanceView,
body:has(#appScreen:not(.hidden)) #canvasView,
body:has(#appScreen:not(.hidden)) .angle-lab-shell,
body:has(#appScreen:not(.hidden)) .forge-tool-shell,
body:has(#appScreen:not(.hidden)) .infinite-canvas-shell,
body:has(#appScreen:not(.hidden)) .canvas-browser {
  background:
    radial-gradient(circle at 12% 0%, rgba(255,255,255,0.035), transparent 28%),
    radial-gradient(circle at 84% 8%, rgba(143,208,183,0.045), transparent 26%),
    linear-gradient(180deg, #050607, #111316 58%, #121417);
}

body:has(#appScreen:not(.hidden)) .angle-lab-shell,
body:has(#appScreen:not(.hidden)) .forge-tool-shell,
body:has(#appScreen:not(.hidden)) .infinite-canvas-shell {
  border-radius: 12px;
}

/* Physical EOF polish pass: workspace status, task/result panels, ready states, controls, and tool surfaces. */
body:has(#appScreen:not(.hidden)) .workbench-stage,
body:has(#appScreen:not(.hidden)) .workbench-prompt,
body:has(#appScreen:not(.hidden)) .workbench-jobs,
body:has(#appScreen:not(.hidden)) .results-panel,
body:has(#appScreen:not(.hidden)) .forge-tool-hero,
body:has(#appScreen:not(.hidden)) .forge-tool-uploader,
body:has(#appScreen:not(.hidden)) .forge-tool-controls,
body:has(#appScreen:not(.hidden)) .forge-tool-result,
body:has(#appScreen:not(.hidden)) .angle-result-frame,
body:has(#appScreen:not(.hidden)) .forge-tool-dropzone,
body:has(#appScreen:not(.hidden)) .forge-tool-preview,
body:has(#appScreen:not(.hidden)) .forge-tool-result-frame,
body:has(#appScreen:not(.hidden)) .canvas-browser-card {
  border-color: rgba(255,255,255,0.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.014)),
    rgba(17,19,22,0.94);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

body:has(#appScreen:not(.hidden)) .head-chip,
body:has(#appScreen:not(.hidden)) .status-chip,
body:has(#appScreen:not(.hidden)) #quickStatsChip,
body:has(#appScreen:not(.hidden)) #quickStatsChipMirror,
body:has(#appScreen:not(.hidden)) #runStatus,
body:has(#appScreen:not(.hidden)) .toolbar-status,
body:has(#appScreen:not(.hidden)) .creation-task-status,
body:has(#appScreen:not(.hidden)) .pill.ready,
body:has(#appScreen:not(.hidden)) .job-feed-status,
body:has(#appScreen:not(.hidden)) .result-group-chip {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.025)),
    rgba(19,21,23,0.90);
  color: var(--soft);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

body:has(#appScreen:not(.hidden)) .toolbar-status {
  min-height: 44px;
  padding: 5px;
  gap: 6px;
  display: inline-flex;
  align-items: center;
}

body:has(#appScreen:not(.hidden)) .toolbar-status .toolbar-jump-button,
body:has(#appScreen:not(.hidden)) #runStatus,
body:has(#appScreen:not(.hidden)) #quickStatsChip,
body:has(#appScreen:not(.hidden)) #quickStatsChipMirror,
body:has(#appScreen:not(.hidden)) .creation-task-status {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
  line-height: 32px;
}

body:has(#appScreen:not(.hidden)) #runStatus,
body:has(#appScreen:not(.hidden)) .pill.ready,
body:has(#appScreen:not(.hidden)) .job-status-dot.ready,
body:has(#appScreen:not(.hidden)) .job-feed-item.ready .job-feed-status,
body:has(#appScreen:not(.hidden)) .model-usage-chip.ready,
body:has(#appScreen:not(.hidden)) .record-gallery-card.ready,
body:has(#appScreen:not(.hidden)) .management-card.ready {
  border-color: rgba(143,208,183,0.32);
  background: rgba(143,208,183,0.12);
  color: var(--success);
}

body:has(#appScreen:not(.hidden)) select,
body:has(#appScreen:not(.hidden)) .template-select,
body:has(#appScreen:not(.hidden)) .composer-control-card select,
body:has(#appScreen:not(.hidden)) .jobs-panel select,
body:has(#appScreen:not(.hidden)) .pager-control select,
body:has(#appScreen:not(.hidden)) .community-head-filter select,
body:has(#appScreen:not(.hidden)) .preview-local-edit-mode-select,
body:has(#appScreen:not(.hidden)) .forge-node-mini-row select {
  min-height: 38px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  appearance: none;
  background-color: rgba(16,17,19,0.96);
  background-image:
    linear-gradient(45deg, transparent 50%, #aeb4bd 50%),
    linear-gradient(135deg, #aeb4bd 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 50%,
    calc(100% - 11px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  color: var(--text);
  padding: 8px 36px 8px 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

body:has(#appScreen:not(.hidden)) select:hover {
  border-color: rgba(255,255,255,0.22);
  background-color: rgba(24,25,28,0.98);
}

body:has(#appScreen:not(.hidden)) select:focus,
body:has(#appScreen:not(.hidden)) select:focus-visible {
  border-color: rgba(143,208,183,0.54);
  outline: none;
  box-shadow: 0 0 0 3px rgba(143,208,183,0.13);
}

body:has(#appScreen:not(.hidden)) button,
body:has(#appScreen:not(.hidden)) .ghost-button,
body:has(#appScreen:not(.hidden)) .primary-button,
body:has(#appScreen:not(.hidden)) .toolbar-jump-button,
body:has(#appScreen:not(.hidden)) .result-card-more-button,
body:has(#appScreen:not(.hidden)) .result-actions-menu-button,
body:has(#appScreen:not(.hidden)) .preview-head-action,
body:has(#appScreen:not(.hidden)) .preview-tool-button,
body:has(#appScreen:not(.hidden)) .forge-tool-preset,
body:has(#appScreen:not(.hidden)) .tool-chip {
  border-radius: 999px;
}

body:has(#appScreen:not(.hidden)) .ghost-button,
body:has(#appScreen:not(.hidden)) .sidebar-logout-button,
body:has(#appScreen:not(.hidden)) .canvas-icon-button,
body:has(#appScreen:not(.hidden)) .canvas-new-button,
body:has(#appScreen:not(.hidden)) .icon-button,
body:has(#appScreen:not(.hidden)) .toolbar-jump-button,
body:has(#appScreen:not(.hidden)) .result-card-more-button,
body:has(#appScreen:not(.hidden)) .result-actions-menu-button,
body:has(#appScreen:not(.hidden)) .preview-head-action,
body:has(#appScreen:not(.hidden)) .preview-text-button,
body:has(#appScreen:not(.hidden)) .preview-nav-float,
body:has(#appScreen:not(.hidden)) .preview-tool-button,
body:has(#appScreen:not(.hidden)) .forge-tool-preset,
body:has(#appScreen:not(.hidden)) .tool-chip {
  min-height: 36px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.045);
  color: var(--soft);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

body:has(#appScreen:not(.hidden)) .ghost-button:hover,
body:has(#appScreen:not(.hidden)) .sidebar-logout-button:hover,
body:has(#appScreen:not(.hidden)) .canvas-icon-button:hover,
body:has(#appScreen:not(.hidden)) .canvas-new-button:hover,
body:has(#appScreen:not(.hidden)) .icon-button:hover,
body:has(#appScreen:not(.hidden)) .toolbar-jump-button:hover,
body:has(#appScreen:not(.hidden)) .result-card-more-button:hover,
body:has(#appScreen:not(.hidden)) .result-actions-menu-button:hover,
body:has(#appScreen:not(.hidden)) .preview-head-action:hover,
body:has(#appScreen:not(.hidden)) .preview-text-button:hover,
body:has(#appScreen:not(.hidden)) .preview-nav-float:hover,
body:has(#appScreen:not(.hidden)) .preview-tool-button:hover,
body:has(#appScreen:not(.hidden)) .forge-tool-preset:hover,
body:has(#appScreen:not(.hidden)) .tool-chip:hover {
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.085);
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .primary-button,
body:has(#appScreen:not(.hidden)) .forge-tool-run {
  min-height: 42px;
  border: 1px solid rgba(243,244,246,0.34);
  background: linear-gradient(180deg, #f3f4f6, #aeb5bd);
  color: #0b0c0e;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(0,0,0,0.18);
}

body:has(#appScreen:not(.hidden)) .forge-tool-run:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .forge-tool-run:focus-visible {
  border-color: rgba(243,244,246,0.58);
  background: linear-gradient(180deg, #ffffff, #c4cbd2);
  color: #0b0c0e;
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(0,0,0,0.22);
}

body:has(#appScreen:not(.hidden)) .forge-tool-run:hover:not(:disabled) .forge-tool-run-copy small,
body:has(#appScreen:not(.hidden)) .forge-tool-run:focus-visible .forge-tool-run-copy small {
  color: rgba(9,14,18,0.68);
}

body:has(#appScreen:not(.hidden)) #angleView,
body:has(#appScreen:not(.hidden)) #enhanceView,
body:has(#appScreen:not(.hidden)) #canvasView,
body:has(#appScreen:not(.hidden)) .angle-lab-shell,
body:has(#appScreen:not(.hidden)) .forge-tool-shell,
body:has(#appScreen:not(.hidden)) .infinite-canvas-shell,
body:has(#appScreen:not(.hidden)) .canvas-browser {
  background:
    radial-gradient(circle at 12% 0%, rgba(255,255,255,0.035), transparent 28%),
    radial-gradient(circle at 84% 8%, rgba(143,208,183,0.045), transparent 26%),
    linear-gradient(180deg, #050607, #111316 58%, #121417);
}

body:has(#appScreen:not(.hidden)) .angle-lab-shell,
body:has(#appScreen:not(.hidden)) .forge-tool-shell,
body:has(#appScreen:not(.hidden)) .infinite-canvas-shell {
  border-radius: 12px;
}

/* Absolute EOF polish pass: workspace status, task/result panels, ready states, controls, and tool surfaces. */
body:has(#appScreen:not(.hidden)) .workbench-stage,
body:has(#appScreen:not(.hidden)) .workbench-prompt,
body:has(#appScreen:not(.hidden)) .workbench-jobs,
body:has(#appScreen:not(.hidden)) .results-panel,
body:has(#appScreen:not(.hidden)) .forge-tool-hero,
body:has(#appScreen:not(.hidden)) .forge-tool-uploader,
body:has(#appScreen:not(.hidden)) .forge-tool-controls,
body:has(#appScreen:not(.hidden)) .forge-tool-result,
body:has(#appScreen:not(.hidden)) .angle-result-frame,
body:has(#appScreen:not(.hidden)) .forge-tool-dropzone,
body:has(#appScreen:not(.hidden)) .forge-tool-preview,
body:has(#appScreen:not(.hidden)) .forge-tool-result-frame,
body:has(#appScreen:not(.hidden)) .canvas-browser-card {
  border-color: rgba(255,255,255,0.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.014)),
    rgba(17,19,22,0.94);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

body:has(#appScreen:not(.hidden)) .head-chip,
body:has(#appScreen:not(.hidden)) .status-chip,
body:has(#appScreen:not(.hidden)) #quickStatsChip,
body:has(#appScreen:not(.hidden)) #quickStatsChipMirror,
body:has(#appScreen:not(.hidden)) #runStatus,
body:has(#appScreen:not(.hidden)) .toolbar-status,
body:has(#appScreen:not(.hidden)) .creation-task-status,
body:has(#appScreen:not(.hidden)) .pill.ready,
body:has(#appScreen:not(.hidden)) .job-feed-status,
body:has(#appScreen:not(.hidden)) .result-group-chip {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.025)),
    rgba(19,21,23,0.90);
  color: var(--soft);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

body:has(#appScreen:not(.hidden)) .toolbar-status {
  min-height: 44px;
  padding: 5px;
  gap: 6px;
  display: inline-flex;
  align-items: center;
}

body:has(#appScreen:not(.hidden)) .toolbar-status .toolbar-jump-button,
body:has(#appScreen:not(.hidden)) #runStatus,
body:has(#appScreen:not(.hidden)) #quickStatsChip,
body:has(#appScreen:not(.hidden)) #quickStatsChipMirror,
body:has(#appScreen:not(.hidden)) .creation-task-status {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
  line-height: 32px;
}

body:has(#appScreen:not(.hidden)) #runStatus,
body:has(#appScreen:not(.hidden)) .pill.ready,
body:has(#appScreen:not(.hidden)) .job-status-dot.ready,
body:has(#appScreen:not(.hidden)) .job-feed-item.ready .job-feed-status,
body:has(#appScreen:not(.hidden)) .model-usage-chip.ready,
body:has(#appScreen:not(.hidden)) .record-gallery-card.ready,
body:has(#appScreen:not(.hidden)) .management-card.ready {
  border-color: rgba(143,208,183,0.32);
  background: rgba(143,208,183,0.12);
  color: var(--success);
}

body:has(#appScreen:not(.hidden)) select,
body:has(#appScreen:not(.hidden)) .template-select,
body:has(#appScreen:not(.hidden)) .composer-control-card select,
body:has(#appScreen:not(.hidden)) .jobs-panel select,
body:has(#appScreen:not(.hidden)) .pager-control select,
body:has(#appScreen:not(.hidden)) .community-head-filter select,
body:has(#appScreen:not(.hidden)) .preview-local-edit-mode-select,
body:has(#appScreen:not(.hidden)) .forge-node-mini-row select {
  min-height: 38px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  appearance: none;
  background-color: rgba(16,17,19,0.96);
  background-image:
    linear-gradient(45deg, transparent 50%, #aeb4bd 50%),
    linear-gradient(135deg, #aeb4bd 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 50%,
    calc(100% - 11px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  color: var(--text);
  padding: 8px 36px 8px 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

body:has(#appScreen:not(.hidden)) select:hover {
  border-color: rgba(255,255,255,0.22);
  background-color: rgba(24,25,28,0.98);
}

body:has(#appScreen:not(.hidden)) select:focus,
body:has(#appScreen:not(.hidden)) select:focus-visible {
  border-color: rgba(143,208,183,0.54);
  outline: none;
  box-shadow: 0 0 0 3px rgba(143,208,183,0.13);
}

body:has(#appScreen:not(.hidden)) button,
body:has(#appScreen:not(.hidden)) .ghost-button,
body:has(#appScreen:not(.hidden)) .primary-button,
body:has(#appScreen:not(.hidden)) .toolbar-jump-button,
body:has(#appScreen:not(.hidden)) .result-card-more-button,
body:has(#appScreen:not(.hidden)) .result-actions-menu-button,
body:has(#appScreen:not(.hidden)) .preview-head-action,
body:has(#appScreen:not(.hidden)) .preview-tool-button,
body:has(#appScreen:not(.hidden)) .forge-tool-preset,
body:has(#appScreen:not(.hidden)) .tool-chip {
  border-radius: 999px;
}

body:has(#appScreen:not(.hidden)) .ghost-button,
body:has(#appScreen:not(.hidden)) .sidebar-logout-button,
body:has(#appScreen:not(.hidden)) .canvas-icon-button,
body:has(#appScreen:not(.hidden)) .canvas-new-button,
body:has(#appScreen:not(.hidden)) .icon-button,
body:has(#appScreen:not(.hidden)) .toolbar-jump-button,
body:has(#appScreen:not(.hidden)) .result-card-more-button,
body:has(#appScreen:not(.hidden)) .result-actions-menu-button,
body:has(#appScreen:not(.hidden)) .preview-head-action,
body:has(#appScreen:not(.hidden)) .preview-text-button,
body:has(#appScreen:not(.hidden)) .preview-nav-float,
body:has(#appScreen:not(.hidden)) .preview-tool-button,
body:has(#appScreen:not(.hidden)) .forge-tool-preset,
body:has(#appScreen:not(.hidden)) .tool-chip {
  min-height: 36px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.045);
  color: var(--soft);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

body:has(#appScreen:not(.hidden)) .ghost-button:hover,
body:has(#appScreen:not(.hidden)) .sidebar-logout-button:hover,
body:has(#appScreen:not(.hidden)) .canvas-icon-button:hover,
body:has(#appScreen:not(.hidden)) .canvas-new-button:hover,
body:has(#appScreen:not(.hidden)) .icon-button:hover,
body:has(#appScreen:not(.hidden)) .toolbar-jump-button:hover,
body:has(#appScreen:not(.hidden)) .result-card-more-button:hover,
body:has(#appScreen:not(.hidden)) .result-actions-menu-button:hover,
body:has(#appScreen:not(.hidden)) .preview-head-action:hover,
body:has(#appScreen:not(.hidden)) .preview-text-button:hover,
body:has(#appScreen:not(.hidden)) .preview-nav-float:hover,
body:has(#appScreen:not(.hidden)) .preview-tool-button:hover,
body:has(#appScreen:not(.hidden)) .forge-tool-preset:hover,
body:has(#appScreen:not(.hidden)) .tool-chip:hover {
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.085);
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .primary-button,
body:has(#appScreen:not(.hidden)) .forge-tool-run {
  min-height: 42px;
  border: 1px solid rgba(243,244,246,0.34);
  background: linear-gradient(180deg, #f3f4f6, #aeb5bd);
  color: #0b0c0e;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(0,0,0,0.18);
}

body:has(#appScreen:not(.hidden)) #angleView,
body:has(#appScreen:not(.hidden)) #enhanceView,
body:has(#appScreen:not(.hidden)) #canvasView,
body:has(#appScreen:not(.hidden)) .angle-lab-shell,
body:has(#appScreen:not(.hidden)) .forge-tool-shell,
body:has(#appScreen:not(.hidden)) .infinite-canvas-shell,
body:has(#appScreen:not(.hidden)) .canvas-browser {
  background:
    radial-gradient(circle at 12% 0%, rgba(255,255,255,0.035), transparent 28%),
    radial-gradient(circle at 84% 8%, rgba(143,208,183,0.045), transparent 26%),
    linear-gradient(180deg, #050607, #111316 58%, #121417);
}

body:has(#appScreen:not(.hidden)) .angle-lab-shell,
body:has(#appScreen:not(.hidden)) .forge-tool-shell,
body:has(#appScreen:not(.hidden)) .infinite-canvas-shell {
  border-radius: 12px;
}

/* Final micro-polish: make workbench counters, status tags, selects, and tool pages feel like one system. */
body:has(#appScreen:not(.hidden)) .creation-task-status,
body:has(#appScreen:not(.hidden)) .job-queue-summary span,
body:has(#appScreen:not(.hidden)) .panel-head small,
body:has(#appScreen:not(.hidden)) .result-mode-meta,
body:has(#appScreen:not(.hidden)) .canvas-browser-count {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  width: fit-content;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

body:has(#appScreen:not(.hidden)) .creation-task-status.is-active,
body:has(#appScreen:not(.hidden)) .status-chip:not(:empty) {
  border-color: rgba(143,208,183,0.24);
  background: rgba(143,208,183,0.09);
  color: var(--success);
}

body:has(#appScreen:not(.hidden)) .panel-head h2,
body:has(#appScreen:not(.hidden)) .panel-head h3 {
  letter-spacing: 0;
}

body:has(#appScreen:not(.hidden)) .jobs-panel .panel-head,
body:has(#appScreen:not(.hidden)) .results-panel .panel-head,
body:has(#appScreen:not(.hidden)) .angle-tool-topbar,
body:has(#appScreen:not(.hidden)) .forge-tool-topbar,
body:has(#appScreen:not(.hidden)) .canvas-browser-topbar,
body:has(#appScreen:not(.hidden)) .canvas-toolbar-panel {
  border-color: rgba(255,255,255,0.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.018)),
    rgba(19,21,23,0.92);
}

body:has(#appScreen:not(.hidden)) select,
body:has(#appScreen:not(.hidden)) .template-select,
body:has(#appScreen:not(.hidden)) .composer-control-card select,
body:has(#appScreen:not(.hidden)) .jobs-panel select,
body:has(#appScreen:not(.hidden)) .pager-control select,
body:has(#appScreen:not(.hidden)) .community-head-filter select,
body:has(#appScreen:not(.hidden)) .preview-local-edit-mode-select {
  appearance: none;
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 13px) calc(50% - 3px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

body:has(#appScreen:not(.hidden)) .toolbar-status .toolbar-jump-button {
  min-width: 64px;
  justify-content: center;
}

body:has(#appScreen:not(.hidden)) .toolbar-status .toolbar-jump-button:hover,
body:has(#appScreen:not(.hidden)) .toolbar-status .toolbar-jump-button:focus-visible {
  border-color: rgba(143,208,183,0.30);
  background: rgba(143,208,183,0.12);
  color: #f5f7f8;
}

body:has(#appScreen:not(.hidden)) .angle-lab-shell,
body:has(#appScreen:not(.hidden)) .forge-tool-shell,
body:has(#appScreen:not(.hidden)) .infinite-canvas-shell,
body:has(#appScreen:not(.hidden)) .canvas-editor {
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .angle-control-card,
body:has(#appScreen:not(.hidden)) .angle-render-card,
body:has(#appScreen:not(.hidden)) .forge-tool-card,
body:has(#appScreen:not(.hidden)) .canvas-browser-card,
body:has(#appScreen:not(.hidden)) .canvas-editor-shell,
body:has(#appScreen:not(.hidden)) .canvas-toolbar-panel {
  border-color: rgba(255,255,255,0.09);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.014)),
    rgba(18,20,22,0.94);
  box-shadow: 0 18px 50px rgba(0,0,0,0.22);
}

/* Requested polish: dashboard chips, selects, buttons, and tool-page background consistency. */
body:has(#appScreen:not(.hidden)) .head-chip,
body:has(#appScreen:not(.hidden)) .status-chip,
body:has(#appScreen:not(.hidden)) #quickStatsChip,
body:has(#appScreen:not(.hidden)) #quickStatsChipMirror,
body:has(#appScreen:not(.hidden)) #runStatus,
body:has(#appScreen:not(.hidden)) .toolbar-status,
body:has(#appScreen:not(.hidden)) .toolbar-status .toolbar-jump-button {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.065), rgba(255,255,255,0.026)),
    rgba(19,21,23,0.88);
  color: var(--soft);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

body:has(#appScreen:not(.hidden)) .toolbar-status {
  min-height: 44px;
  padding: 5px;
  gap: 6px;
  display: inline-flex;
}

body:has(#appScreen:not(.hidden)) .toolbar-status .toolbar-jump-button,
body:has(#appScreen:not(.hidden)) #runStatus,
body:has(#appScreen:not(.hidden)) #quickStatsChipMirror,
body:has(#appScreen:not(.hidden)) #quickStatsChip {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
}

body:has(#appScreen:not(.hidden)) .toolbar-status .toolbar-jump-button:hover,
body:has(#appScreen:not(.hidden)) .toolbar-status .toolbar-jump-button:focus-visible {
  border-color: rgba(143,208,183,0.34);
  background: rgba(143,208,183,0.12);
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) #runStatus {
  color: var(--success);
  border-color: rgba(143,208,183,0.26);
  background: rgba(143,208,183,0.10);
}

body:has(#appScreen:not(.hidden)) select,
body:has(#appScreen:not(.hidden)) .template-select,
body:has(#appScreen:not(.hidden)) .composer-control-card select,
body:has(#appScreen:not(.hidden)) .jobs-panel select,
body:has(#appScreen:not(.hidden)) .pager-control select,
body:has(#appScreen:not(.hidden)) .community-head-filter select,
body:has(#appScreen:not(.hidden)) .preview-local-edit-mode-select {
  min-height: 38px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background-color: rgba(16,17,19,0.96);
  background-image:
    linear-gradient(45deg, transparent 50%, #9aa0a9 50%),
    linear-gradient(135deg, #9aa0a9 50%, transparent 50%);
  color: var(--text);
  padding: 8px 36px 8px 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

body:has(#appScreen:not(.hidden)) select:hover {
  border-color: rgba(255,255,255,0.20);
  background-color: rgba(24,25,28,0.98);
}

body:has(#appScreen:not(.hidden)) select:focus {
  border-color: rgba(143,208,183,0.52);
  box-shadow: 0 0 0 3px rgba(143,208,183,0.12);
}

body:has(#appScreen:not(.hidden)) button,
body:has(#appScreen:not(.hidden)) .ghost-button,
body:has(#appScreen:not(.hidden)) .primary-button {
  border-radius: 999px;
}

body:has(#appScreen:not(.hidden)) .ghost-button,
body:has(#appScreen:not(.hidden)) .canvas-icon-button,
body:has(#appScreen:not(.hidden)) .canvas-new-button,
body:has(#appScreen:not(.hidden)) .forge-tool-preset,
body:has(#appScreen:not(.hidden)) .tool-chip,
body:has(#appScreen:not(.hidden)) .result-actions-menu-button {
  min-height: 36px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.045);
  color: var(--soft);
  padding-inline: 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

body:has(#appScreen:not(.hidden)) .ghost-button:hover,
body:has(#appScreen:not(.hidden)) .canvas-icon-button:hover,
body:has(#appScreen:not(.hidden)) .canvas-new-button:hover,
body:has(#appScreen:not(.hidden)) .forge-tool-preset:hover,
body:has(#appScreen:not(.hidden)) .tool-chip:hover,
body:has(#appScreen:not(.hidden)) .result-actions-menu-button:hover {
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.085);
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .primary-button,
body:has(#appScreen:not(.hidden)) .forge-tool-run {
  min-height: 42px;
  border: 1px solid rgba(243,244,246,0.34);
  background: linear-gradient(180deg, #f3f4f6, #aeb5bd);
  color: #0b0c0e;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(0,0,0,0.18);
}

body:has(#appScreen:not(.hidden)) #angleView,
body:has(#appScreen:not(.hidden)) #enhanceView,
body:has(#appScreen:not(.hidden)) #canvasView,
body:has(#appScreen:not(.hidden)) .angle-lab-shell,
body:has(#appScreen:not(.hidden)) .forge-tool-shell,
body:has(#appScreen:not(.hidden)) .infinite-canvas-shell,
body:has(#appScreen:not(.hidden)) .canvas-browser {
  background:
    radial-gradient(circle at 12% 0%, rgba(255,255,255,0.035), transparent 28%),
    radial-gradient(circle at 84% 8%, rgba(143,208,183,0.045), transparent 26%),
    linear-gradient(180deg, #050607, #111316 58%, #121417);
}

body:has(#appScreen:not(.hidden)) .angle-lab-shell,
body:has(#appScreen:not(.hidden)) .forge-tool-shell,
body:has(#appScreen:not(.hidden)) .infinite-canvas-shell {
  border-radius: 12px;
}

/* Detail polish EOF pass: dark consistency, quieter surfaces, tighter tool ergonomics. */
body:has(#appScreen:not(.hidden)) .app-shell {
  width: min(1600px, calc(100% - 20px));
}

body:has(#appScreen:not(.hidden)) .panel,
body:has(#appScreen:not(.hidden)) .workspace-head,
body:has(#appScreen:not(.hidden)) .topbar,
body:has(#appScreen:not(.hidden)) .sidebar {
  box-shadow:
    0 18px 46px rgba(0,0,0,0.24),
    inset 0 1px 0 rgba(255,255,255,0.04);
}

body:has(#appScreen:not(.hidden)) .panel-head {
  padding-bottom: 12px;
}

body:has(#appScreen:not(.hidden)) .panel-head h3,
body:has(#appScreen:not(.hidden)) .forge-tool-hero h2 {
  letter-spacing: 0;
}

body:has(#appScreen:not(.hidden)) .eyebrow.small,
body:has(#appScreen:not(.hidden)) .angle-lab-step {
  color: #7f8895;
  letter-spacing: .16em;
}

body:has(#appScreen:not(.hidden)) .topbar-tabs,
body:has(#appScreen:not(.hidden)) .sidebar-menu-panel,
body:has(#appScreen:not(.hidden)) .canvas-toolbar-panel {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

body:has(#appScreen:not(.hidden)) .topbar-tab,
body:has(#appScreen:not(.hidden)) .app-sidebar .nav-item,
body:has(#appScreen:not(.hidden)) .ghost-button,
body:has(#appScreen:not(.hidden)) .primary-button,
body:has(#appScreen:not(.hidden)) .forge-tool-preset,
body:has(#appScreen:not(.hidden)) .tool-chip,
body:has(#appScreen:not(.hidden)) .canvas-card-edit,
body:has(#appScreen:not(.hidden)) .canvas-delete,
body:has(#appScreen:not(.hidden)) .canvas-new-button,
body:has(#appScreen:not(.hidden)) .canvas-icon-button {
  min-height: 34px;
  border-radius: 999px;
  font-weight: 800;
}

body:has(#appScreen:not(.hidden)) .primary-button,
body:has(#appScreen:not(.hidden)) .forge-tool-run {
  min-height: 42px;
}

body:has(#appScreen:not(.hidden)) .forge-tool-preset,
body:has(#appScreen:not(.hidden)) .tool-chip,
body:has(#appScreen:not(.hidden)) .canvas-create-menu button {
  min-height: 34px;
  padding: 0 12px;
}

body:has(#appScreen:not(.hidden)) .topbar-tab:focus-visible,
body:has(#appScreen:not(.hidden)) .nav-item:focus-visible,
body:has(#appScreen:not(.hidden)) button:focus-visible,
body:has(#appScreen:not(.hidden)) input:focus,
body:has(#appScreen:not(.hidden)) textarea:focus,
body:has(#appScreen:not(.hidden)) select:focus {
  outline: none;
  border-color: rgba(143,208,183,0.52);
  box-shadow: 0 0 0 3px rgba(143,208,183,0.12);
}

body:has(#appScreen:not(.hidden)) #angleView,
body:has(#appScreen:not(.hidden)) #enhanceView,
body:has(#appScreen:not(.hidden)) #canvasView {
  --tool-panel: rgba(21,28,42,0.94);
  --tool-panel-2: rgba(15,23,42,0.78);
  --tool-line: rgba(183,196,215,0.14);
}

body:has(#appScreen:not(.hidden)) .angle-lab-shell,
body:has(#appScreen:not(.hidden)) .forge-tool-shell,
body:has(#appScreen:not(.hidden)) .infinite-canvas-shell {
  border-radius: 12px;
  background:
    radial-gradient(circle at 16% 8%, rgba(143,208,183,0.08), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.006)),
    #0b111d;
}

body:has(#appScreen:not(.hidden)) .angle-dropzone,
body:has(#appScreen:not(.hidden)) .angle-camera-card,
body:has(#appScreen:not(.hidden)) .angle-result-frame,
body:has(#appScreen:not(.hidden)) .forge-tool-hero,
body:has(#appScreen:not(.hidden)) .forge-tool-uploader,
body:has(#appScreen:not(.hidden)) .forge-tool-controls,
body:has(#appScreen:not(.hidden)) .forge-tool-result,
body:has(#appScreen:not(.hidden)) .forge-tool-dropzone,
body:has(#appScreen:not(.hidden)) .forge-tool-preview,
body:has(#appScreen:not(.hidden)) .forge-tool-result-frame,
body:has(#appScreen:not(.hidden)) .canvas-browser-card,
body:has(#appScreen:not(.hidden)) .canvas-browser-list-shell,
body:has(#appScreen:not(.hidden)) .canvas-create-menu {
  border-color: var(--tool-line);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.014)),
    var(--tool-panel);
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .angle-camera-panel,
body:has(#appScreen:not(.hidden)) .angle-source-preview,
body:has(#appScreen:not(.hidden)) .angle-three-stage,
body:has(#appScreen:not(.hidden)) .infinite-board {
  background:
    linear-gradient(rgba(148,163,184,0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,0.09) 1px, transparent 1px),
    #0b111d;
  background-size: 32px 32px;
}

body:has(#appScreen:not(.hidden)) .angle-plane-fallback,
body:has(#appScreen:not(.hidden)) .angle-upload-icon,
body:has(#appScreen:not(.hidden)) .canvas-browser-item-icon {
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.055);
  color: var(--soft);
}

body:has(#appScreen:not(.hidden)) .angle-camera-slider strong,
body:has(#appScreen:not(.hidden)) .forge-tool-slider strong {
  min-width: 48px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) input[type="range"] {
  accent-color: var(--success);
}

body:has(#appScreen:not(.hidden)) .forge-tool-slider,
body:has(#appScreen:not(.hidden)) .forge-tool-checkline {
  border-color: rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.035);
}

body:has(#appScreen:not(.hidden)) .canvas-browser {
  background:
    radial-gradient(circle at 24% 16%, rgba(143,208,183,0.12), transparent 26%),
    #0b111d;
}

body:has(#appScreen:not(.hidden)) .canvas-browser-list {
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
}

body:has(#appScreen:not(.hidden)) .canvas-browser-item {
  border-color: rgba(255,255,255,0.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.016)),
    #151c2a;
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .canvas-browser-item:hover,
body:has(#appScreen:not(.hidden)) .canvas-browser-item.active {
  border-color: rgba(143,208,183,0.34);
  background:
    linear-gradient(135deg, rgba(143,208,183,0.13), rgba(255,255,255,0.035)),
    #151c2a;
}

body:has(#appScreen:not(.hidden)) .canvas-card-title,
body:has(#appScreen:not(.hidden)) .canvas-browser-item.active .canvas-card-title,
body:has(#appScreen:not(.hidden)) .canvas-browser-title-row h2 {
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .canvas-card-meta,
body:has(#appScreen:not(.hidden)) .canvas-browser-item small,
body:has(#appScreen:not(.hidden)) .canvas-browser-head p {
  color: var(--muted);
}

body:has(#appScreen:not(.hidden)) .forge-canvas-node {
  border-color: rgba(255,255,255,0.12);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.018)),
    #151c2a;
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .forge-canvas-node.selected {
  border-color: rgba(143,208,183,0.66);
  box-shadow: 0 0 0 2px rgba(143,208,183,0.16), 0 20px 48px rgba(0,0,0,0.32);
}

body:has(#appScreen:not(.hidden)) .forge-canvas-node header {
  border-bottom-color: rgba(255,255,255,0.08);
}

body:has(#appScreen:not(.hidden)) .forge-canvas-node header strong,
body:has(#appScreen:not(.hidden)) .forge-node-mini-row strong,
body:has(#appScreen:not(.hidden)) .forge-group-slot strong {
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .forge-canvas-node-kind,
body:has(#appScreen:not(.hidden)) .forge-canvas-run-status,
body:has(#appScreen:not(.hidden)) .forge-node-mini-row,
body:has(#appScreen:not(.hidden)) .forge-node-output-text,
body:has(#appScreen:not(.hidden)) .forge-output-slot,
body:has(#appScreen:not(.hidden)) .forge-group-slot,
body:has(#appScreen:not(.hidden)) .forge-canvas-image-slot,
body:has(#appScreen:not(.hidden)) .forge-output-pending {
  border-color: rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.045);
  color: var(--muted);
}

body:has(#appScreen:not(.hidden)) .forge-canvas-port {
  border-color: #151c2a;
  background: #a7b0be;
}

body:has(#appScreen:not(.hidden)) .forge-canvas-port-out {
  background: var(--success);
}

body:has(#appScreen:not(.hidden)) .canvas-create-menu {
  width: 210px;
  border-radius: 16px;
  padding: 8px;
}

body:has(#appScreen:not(.hidden)) .canvas-create-menu button {
  justify-content: flex-start;
}

body:has(#appScreen:not(.hidden)) .canvas-create-menu button span {
  color: var(--soft);
}

body:has(#appScreen:not(.hidden)) .canvas-delete-confirm {
  background: rgba(5,8,12,0.72);
}

body:has(#appScreen:not(.hidden)) .canvas-delete-box {
  border: 1px solid rgba(255,255,255,0.12);
  background: #111827;
}

body:has(#appScreen:not(.hidden)) .danger-button,
body:has(#appScreen:not(.hidden)) .canvas-delete:hover {
  border-color: rgba(226,143,143,0.34);
  color: #ffd5d5;
}

/* Tool pages color unification: angle, enhance, and infinite canvas. */
body:has(#appScreen:not(.hidden)) #angleView,
body:has(#appScreen:not(.hidden)) #enhanceView,
body:has(#appScreen:not(.hidden)) #canvasView {
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .angle-lab-shell,
body:has(#appScreen:not(.hidden)) .forge-tool-shell,
body:has(#appScreen:not(.hidden)) .infinite-canvas-shell {
  background:
    radial-gradient(circle at 18% 8%, rgba(143,208,183,0.08), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.006)),
    #0b111d;
}

body:has(#appScreen:not(.hidden)) .forge-tool-hero,
body:has(#appScreen:not(.hidden)) .forge-tool-uploader,
body:has(#appScreen:not(.hidden)) .forge-tool-controls,
body:has(#appScreen:not(.hidden)) .forge-tool-result,
body:has(#appScreen:not(.hidden)) .angle-camera-card,
body:has(#appScreen:not(.hidden)) .angle-dropzone,
body:has(#appScreen:not(.hidden)) .angle-result-frame,
body:has(#appScreen:not(.hidden)) .forge-tool-dropzone,
body:has(#appScreen:not(.hidden)) .forge-tool-preview,
body:has(#appScreen:not(.hidden)) .forge-tool-result-frame,
body:has(#appScreen:not(.hidden)) .forge-tool-slider,
body:has(#appScreen:not(.hidden)) .canvas-browser-card,
body:has(#appScreen:not(.hidden)) .canvas-browser-list-shell,
body:has(#appScreen:not(.hidden)) .canvas-editor-back-panel,
body:has(#appScreen:not(.hidden)) .canvas-toolbar-panel,
body:has(#appScreen:not(.hidden)) .canvas-create-menu {
  border-color: rgba(255,255,255,0.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.014)),
    rgba(21,28,42,0.94);
  color: var(--text);
  box-shadow: 0 18px 46px rgba(0,0,0,0.22);
}

body:has(#appScreen:not(.hidden)) .angle-three-stage,
body:has(#appScreen:not(.hidden)) .angle-camera-panel,
body:has(#appScreen:not(.hidden)) .angle-source-preview,
body:has(#appScreen:not(.hidden)) .infinite-board {
  background-color: #0b111d;
}

body:has(#appScreen:not(.hidden)) .angle-lab-step,
body:has(#appScreen:not(.hidden)) .forge-tool-hero p,
body:has(#appScreen:not(.hidden)) .forge-tool-dropzone small,
body:has(#appScreen:not(.hidden)) .angle-dropzone small,
body:has(#appScreen:not(.hidden)) .angle-camera-slider span,
body:has(#appScreen:not(.hidden)) .forge-tool-slider span,
body:has(#appScreen:not(.hidden)) .forge-tool-checkline,
body:has(#appScreen:not(.hidden)) .canvas-browser-head p,
body:has(#appScreen:not(.hidden)) .canvas-card-meta,
body:has(#appScreen:not(.hidden)) .canvas-browser-item small,
body:has(#appScreen:not(.hidden)) .forge-canvas-empty {
  color: var(--muted);
}

body:has(#appScreen:not(.hidden)) .forge-tool-hero h2,
body:has(#appScreen:not(.hidden)) .forge-tool-hero h3,
body:has(#appScreen:not(.hidden)) .angle-dropzone strong,
body:has(#appScreen:not(.hidden)) .angle-result-frame strong,
body:has(#appScreen:not(.hidden)) .canvas-browser-title-row h2,
body:has(#appScreen:not(.hidden)) .canvas-editor-back-panel strong,
body:has(#appScreen:not(.hidden)) .forge-canvas-empty strong {
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .forge-tool-preset,
body:has(#appScreen:not(.hidden)) .tool-chip,
body:has(#appScreen:not(.hidden)) .canvas-new-button,
body:has(#appScreen:not(.hidden)) .canvas-card-edit,
body:has(#appScreen:not(.hidden)) .canvas-delete,
body:has(#appScreen:not(.hidden)) .canvas-create-menu button,
body:has(#appScreen:not(.hidden)) .angle-camera-slider button {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background: rgba(255,255,255,0.045);
  color: var(--soft);
  box-shadow: none;
}

body:has(#appScreen:not(.hidden)) .forge-tool-preset:hover,
body:has(#appScreen:not(.hidden)) .tool-chip:hover,
body:has(#appScreen:not(.hidden)) .canvas-card-edit:hover,
body:has(#appScreen:not(.hidden)) .canvas-delete:hover,
body:has(#appScreen:not(.hidden)) .canvas-create-menu button:hover {
  border-color: rgba(255,255,255,0.20);
  background: rgba(255,255,255,0.08);
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .forge-tool-preset.active,
body:has(#appScreen:not(.hidden)) .tool-chip.primary {
  border-color: rgba(143,208,183,0.42);
  background: rgba(143,208,183,0.14);
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .angle-camera-slider strong,
body:has(#appScreen:not(.hidden)) .forge-tool-slider strong,
body:has(#appScreen:not(.hidden)) .canvas-browser-title-row span,
body:has(#appScreen:not(.hidden)) .canvas-card-meta {
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.055);
  color: var(--soft);
}

body:has(#appScreen:not(.hidden)) .canvas-browser {
  background:
    radial-gradient(circle at 22% 18%, rgba(143,208,183,0.12), transparent 28%),
    #0b111d;
}

body:has(#appScreen:not(.hidden)) .canvas-browser-item {
  border-color: rgba(255,255,255,0.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.014)),
    #151c2a;
  color: var(--text);
  box-shadow: 0 16px 34px rgba(0,0,0,0.20);
}

body:has(#appScreen:not(.hidden)) .canvas-browser-item.active,
body:has(#appScreen:not(.hidden)) .canvas-browser-item:hover {
  border-color: rgba(143,208,183,0.34);
  background:
    linear-gradient(135deg, rgba(143,208,183,0.14), rgba(255,255,255,0.035)),
    #151c2a;
}

body:has(#appScreen:not(.hidden)) .canvas-browser-item-icon,
body:has(#appScreen:not(.hidden)) .angle-upload-icon {
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.055);
  color: var(--soft);
}

body:has(#appScreen:not(.hidden)) .canvas-card-title,
body:has(#appScreen:not(.hidden)) .canvas-browser-item.active .canvas-card-title {
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .canvas-card-title-input,
body:has(#appScreen:not(.hidden)) .forge-canvas-node textarea,
body:has(#appScreen:not(.hidden)) .forge-node-mini-row input,
body:has(#appScreen:not(.hidden)) .forge-node-mini-row select {
  border-color: rgba(255,255,255,0.10);
  background: #101113;
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .forge-canvas-node {
  border-color: rgba(255,255,255,0.12);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.018)),
    #151c2a;
  color: var(--text);
  box-shadow: 0 16px 36px rgba(0,0,0,0.26);
}

body:has(#appScreen:not(.hidden)) .forge-canvas-node.selected {
  border-color: rgba(143,208,183,0.64);
  box-shadow: 0 0 0 2px rgba(143,208,183,0.16), 0 20px 48px rgba(0,0,0,0.32);
}

body:has(#appScreen:not(.hidden)) .forge-canvas-node header {
  border-bottom-color: rgba(255,255,255,0.08);
}

body:has(#appScreen:not(.hidden)) .forge-canvas-node header strong,
body:has(#appScreen:not(.hidden)) .forge-node-mini-row strong,
body:has(#appScreen:not(.hidden)) .forge-group-slot strong {
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .forge-canvas-node-kind,
body:has(#appScreen:not(.hidden)) .forge-canvas-run-status,
body:has(#appScreen:not(.hidden)) .forge-node-mini-row,
body:has(#appScreen:not(.hidden)) .forge-node-output-text,
body:has(#appScreen:not(.hidden)) .forge-output-slot,
body:has(#appScreen:not(.hidden)) .forge-group-slot,
body:has(#appScreen:not(.hidden)) .forge-canvas-image-slot,
body:has(#appScreen:not(.hidden)) .forge-output-pending {
  border-color: rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.045);
  color: var(--muted);
}

/* Dark reference menu pass: preserve Forge black/gray colors while using lighter capsule controls. */
body:has(#appScreen:not(.hidden)) {
  --bg: #0b0c0e;
  --surface: rgba(17, 18, 20, 0.96);
  --surface-2: rgba(24, 25, 28, 0.96);
  --surface-3: rgba(31, 33, 37, 0.94);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f3f4f6;
  --muted: #9aa0a9;
  --soft: #c9cdd3;
  --focus: #d7dde7;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.30);
  --scrollbar-track: rgba(5, 6, 7, 0.72);
  --scrollbar-thumb: rgba(82, 86, 94, 0.92);
  --scrollbar-thumb-hover: rgba(116, 122, 132, 0.96);
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(255,255,255,0.04), transparent 30%),
    radial-gradient(circle at 88% 12%, rgba(143,208,183,0.05), transparent 26%),
    linear-gradient(180deg, #050607, #111316 58%, #121417);
}

body:has(#appScreen:not(.hidden)) .grid-noise {
  opacity: 0.045;
}

body:has(#appScreen:not(.hidden)) .topbar,
body:has(#appScreen:not(.hidden)) .sidebar,
body:has(#appScreen:not(.hidden)) .workspace-head,
body:has(#appScreen:not(.hidden)) .panel,
body:has(#appScreen:not(.hidden)) .profile-card,
body:has(#appScreen:not(.hidden)) .trace-card,
body:has(#appScreen:not(.hidden)) .result-card,
body:has(#appScreen:not(.hidden)) .table-row,
body:has(#appScreen:not(.hidden)) .model-card,
body:has(#appScreen:not(.hidden)) .stat-card {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

body:has(#appScreen:not(.hidden)) .topbar {
  min-height: 64px;
  padding: 8px 12px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.018)),
    rgba(17, 19, 21, 0.96);
  backdrop-filter: blur(18px);
}

body:has(#appScreen:not(.hidden)) .topbar-main {
  grid-template-columns: minmax(180px, 1fr) auto minmax(120px, 1fr);
}

body:has(#appScreen:not(.hidden)) .brand-lockup,
body:has(#appScreen:not(.hidden)) #profileName,
body:has(#appScreen:not(.hidden)) #profileEmail {
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .topbar-tabs {
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  background: rgba(5, 6, 7, 0.36);
}

body:has(#appScreen:not(.hidden)) .topbar-tab {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

body:has(#appScreen:not(.hidden)) .topbar-tab:hover,
body:has(#appScreen:not(.hidden)) .topbar-tab.active {
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04)),
    rgba(31, 33, 37, 0.94);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

body:has(#appScreen:not(.hidden)) .app-layout {
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 12px;
}

body:has(#appScreen:not(.hidden)) .sidebar {
  top: calc(var(--app-topbar-height) + 10px);
  padding: 10px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 18% 0%, rgba(143,208,183,0.13), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.018)),
    rgba(17, 19, 21, 0.96);
  backdrop-filter: blur(18px);
}

body:has(#appScreen:not(.hidden)) .sidebar-menu-panel,
body:has(#appScreen:not(.hidden)) .sidebar-profile-button {
  border: 1px solid rgba(255,255,255,0.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.014)),
    rgba(19, 21, 23, 0.98);
  box-shadow: none;
}

body:has(#appScreen:not(.hidden)) .sidebar-profile-button {
  border-radius: 14px;
}

body:has(#appScreen:not(.hidden)) .sidebar-profile-button small {
  color: #b7bdc6;
}

body:has(#appScreen:not(.hidden)) .profile-avatar,
body:has(#appScreen:not(.hidden)) .sidebar-profile-button .profile-avatar {
  border-color: rgba(143,208,183,0.28);
  background: rgba(143,208,183,0.14);
  color: var(--success);
  box-shadow: none;
}

body:has(#appScreen:not(.hidden)) .sidebar-menu-panel {
  border-radius: 14px;
  padding: 8px;
}

body:has(#appScreen:not(.hidden)) .app-sidebar .nav-item,
body:has(#appScreen:not(.hidden)) .nav-item {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #c7ccd4;
  box-shadow: none;
}

body:has(#appScreen:not(.hidden)) .app-sidebar .nav-item:hover {
  border-color: rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.055);
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .app-sidebar .nav-item.active {
  border-color: rgba(143,208,183,0.30);
  background:
    linear-gradient(135deg, rgba(143,208,183,0.20), rgba(255,255,255,0.07)),
    rgba(31, 33, 37, 0.94);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

body:has(#appScreen:not(.hidden)) .app-sidebar .nav-item span:last-child,
body:has(#appScreen:not(.hidden)) .app-sidebar .nav-item.active span:last-child {
  color: currentColor;
  opacity: 0.72;
}

body:has(#appScreen:not(.hidden)) .ghost-button,
body:has(#appScreen:not(.hidden)) .sidebar-logout-button,
body:has(#appScreen:not(.hidden)) .canvas-icon-button,
body:has(#appScreen:not(.hidden)) .icon-button,
body:has(#appScreen:not(.hidden)) .toolbar-jump-button,
body:has(#appScreen:not(.hidden)) .result-card-more-button,
body:has(#appScreen:not(.hidden)) .preview-head-action,
body:has(#appScreen:not(.hidden)) .preview-text-button,
body:has(#appScreen:not(.hidden)) .preview-nav-float {
  min-height: 32px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background: rgba(255,255,255,0.045);
  color: var(--soft);
  box-shadow: none;
}

body:has(#appScreen:not(.hidden)) .canvas-icon-button,
body:has(#appScreen:not(.hidden)) .icon-button,
body:has(#appScreen:not(.hidden)) .result-card-more-button,
body:has(#appScreen:not(.hidden)) .preview-head-action {
  width: auto;
  min-width: 34px;
  height: 34px;
  padding: 0 11px;
}

body:has(#appScreen:not(.hidden)) .ghost-button:hover,
body:has(#appScreen:not(.hidden)) .sidebar-logout-button:hover,
body:has(#appScreen:not(.hidden)) .canvas-icon-button:hover,
body:has(#appScreen:not(.hidden)) .icon-button:hover,
body:has(#appScreen:not(.hidden)) .toolbar-jump-button:hover,
body:has(#appScreen:not(.hidden)) .result-card-more-button:hover,
body:has(#appScreen:not(.hidden)) .preview-head-action:hover,
body:has(#appScreen:not(.hidden)) .preview-text-button:hover,
body:has(#appScreen:not(.hidden)) .preview-nav-float:hover {
  border-color: rgba(255,255,255,0.20);
  background: rgba(255,255,255,0.08);
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .primary-button {
  border: 1px solid rgba(243,244,246,0.36);
  border-radius: 999px;
  background: linear-gradient(180deg, #f3f4f6, #aeb5bd);
  color: #0b0c0e;
  box-shadow: 0 12px 26px rgba(0,0,0,0.18);
}

body:has(#appScreen:not(.hidden)) .primary-button:hover {
  background: linear-gradient(180deg, #ffffff, #c7cdd4);
}

body:has(#appScreen:not(.hidden)) .workspace-head {
  min-height: 58px;
  padding: 10px 14px;
  border-radius: 16px;
  margin-bottom: 10px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.016)),
    rgba(17, 18, 20, 0.92);
  backdrop-filter: blur(18px);
}

body:has(#appScreen:not(.hidden)) .workspace-head .eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  letter-spacing: .12em;
}

body:has(#appScreen:not(.hidden)) .workspace-head h1 {
  color: var(--text);
  font-size: clamp(20px, 2vw, 26px);
}

body:has(#appScreen:not(.hidden)) .head-chip,
body:has(#appScreen:not(.hidden)) .status-chip,
body:has(#appScreen:not(.hidden)) .pill,
body:has(#appScreen:not(.hidden)) .role-badge {
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color: var(--soft);
}

body:has(#appScreen:not(.hidden)) .panel {
  border-radius: 16px;
  background: var(--surface);
}

body:has(#appScreen:not(.hidden)) .panel-head {
  border-bottom-color: rgba(255,255,255,0.08);
}

body:has(#appScreen:not(.hidden)) input,
body:has(#appScreen:not(.hidden)) textarea,
body:has(#appScreen:not(.hidden)) select,
body:has(#appScreen:not(.hidden)) .composer-control-card select,
body:has(#appScreen:not(.hidden)) .composer-control-card input,
body:has(#appScreen:not(.hidden)) .jobs-panel input,
body:has(#appScreen:not(.hidden)) .jobs-panel select {
  border-color: rgba(255,255,255,0.10);
  background-color: #101113;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}

body:has(#appScreen:not(.hidden)) input::placeholder,
body:has(#appScreen:not(.hidden)) textarea::placeholder {
  color: var(--muted);
}

body:has(#appScreen:not(.hidden)) input:focus,
body:has(#appScreen:not(.hidden)) textarea:focus,
body:has(#appScreen:not(.hidden)) select:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(215,221,231,0.08);
}

body:has(#appScreen:not(.hidden)) .composer-panel,
body:has(#appScreen:not(.hidden)) .jobs-panel,
body:has(#appScreen:not(.hidden)) .results-panel,
body:has(#appScreen:not(.hidden)) .composer-brief-shell,
body:has(#appScreen:not(.hidden)) .composer-ai-shortcut,
body:has(#appScreen:not(.hidden)) .composer-control-card,
body:has(#appScreen:not(.hidden)) .creation-stat-card,
body:has(#appScreen:not(.hidden)) .toolbar-status,
body:has(#appScreen:not(.hidden)) .job-queue-summary,
body:has(#appScreen:not(.hidden)) .compact-grid,
body:has(#appScreen:not(.hidden)) .reference-preview,
body:has(#appScreen:not(.hidden)) .forge-tool-dropzone,
body:has(#appScreen:not(.hidden)) .forge-tool-preview,
body:has(#appScreen:not(.hidden)) .forge-tool-result-frame {
  border-color: rgba(255,255,255,0.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012)),
    rgba(24, 25, 28, 0.96);
  color: var(--text);
  box-shadow: none;
}

body:has(#appScreen:not(.hidden)) .creation-stat-card strong,
body:has(#appScreen:not(.hidden)) .panel h2,
body:has(#appScreen:not(.hidden)) .panel h3,
body:has(#appScreen:not(.hidden)) .composer-control-card-head span {
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .segmented,
body:has(#appScreen:not(.hidden)) .compact-segmented {
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(5,6,7,0.36);
}

body:has(#appScreen:not(.hidden)) .segmented-item {
  border-radius: 999px;
  color: var(--muted);
}

body:has(#appScreen:not(.hidden)) .segmented-item.active {
  background: rgba(255,255,255,0.10);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

body:has(#appScreen:not(.hidden)) .result-card:hover,
body:has(#appScreen:not(.hidden)) .trace-card:hover,
body:has(#appScreen:not(.hidden)) .table-row:hover {
  border-color: rgba(255,255,255,0.16);
  box-shadow: 0 18px 42px rgba(0,0,0,0.22);
}

body:has(#appScreen:not(.hidden)) .danger-button {
  border-color: rgba(226,143,143,0.35);
  color: #ffd5d5;
}

body:has(#appScreen:not(.hidden)) .danger-button:hover {
  background: rgba(226,143,143,0.10);
}

body:has(#appScreen:not(.hidden)) .canvas-browser {
  background: #0b111d;
}

body:has(#appScreen:not(.hidden)) .canvas-browser-card {
  border-color: rgba(148,163,184,0.22);
  background: #151c2a;
}

body:has(#appScreen:not(.hidden)) .canvas-browser-title-row h2 {
  color: var(--text);
}

* { box-sizing: border-box; }

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

html {
  min-width: 320px;
  overflow-x: hidden;
  overflow-x: clip;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

button,
select {
  -webkit-appearance: none;
  appearance: none;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.018), rgba(255,255,255,0.006)),
    var(--scrollbar-track);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb {
  border: 2px 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);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: var(--app-viewport-height);
  overflow-x: hidden;
  overflow-x: clip;
  color: var(--text);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 16% 14%, rgba(143,208,183,0.16), transparent 24%),
    radial-gradient(circle at 84% 12%, rgba(129,153,255,0.12), transparent 22%),
    radial-gradient(circle at 50% 78%, rgba(255,255,255,0.06), transparent 38%),
    linear-gradient(140deg, #020304 0%, #061015 34%, #0d1318 62%, #151b21 100%);
}

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

.grid-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.055;
  background-image:
    linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px),
    radial-gradient(circle at center, rgba(255,255,255,0.04), transparent 62%);
  background-size: 26px 26px, 26px 26px, 100% 100%;
  -webkit-mask-image: radial-gradient(circle at center, rgba(0,0,0,0.86), transparent 88%);
  mask-image: radial-gradient(circle at center, rgba(0,0,0,0.86), transparent 88%);
}

.hidden { display: none !important; }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .result-thumb-play-badge,
  .result-more-button,
  .overview-pulse-chart-card,
  .preview-modal-close,
  .preview-edit-placeholder,
  .preview-nav-float:hover,
  .preview-nav-float:focus-visible {
    background-color: rgba(18, 20, 24, 0.92);
  }

  .result-card-media-badge,
  .preview-edit-background-note {
    background-color: rgba(8, 10, 12, 0.9);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }

  button:hover,
  .result-card:hover,
  .result-card:focus-visible,
  .overview-kpi-chart-card:hover,
  .community-category-card:hover {
    transform: none !important;
  }
}

.mobile-menu-button,
.mobile-menu-overlay {
  display: none;
}

.mobile-menu-button {
  top: 10px;
  left: 12px;
  top: max(10px, constant(safe-area-inset-top));
  left: max(12px, constant(safe-area-inset-left));
  top: max(10px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
}

.login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  min-height: var(--app-viewport-height);
  display: grid;
  place-items: center;
  padding: 20px;
  padding:
    max(20px, constant(safe-area-inset-top))
    max(20px, constant(safe-area-inset-right))
    max(20px, constant(safe-area-inset-bottom))
    max(20px, constant(safe-area-inset-left));
  padding:
    max(20px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.login-screen::before,
.login-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.login-screen::before {
  inset: -18% -8%;
  background:
    radial-gradient(circle at 18% 22%, rgba(143,208,183,0.20), transparent 22%),
    radial-gradient(circle at 78% 16%, rgba(126,145,255,0.16), transparent 24%),
    radial-gradient(circle at 52% 52%, rgba(255,255,255,0.08), transparent 28%);
  filter: blur(16px);
  opacity: 0.95;
}

.login-screen::after {
  background:
    radial-gradient(circle at center, transparent 0 34%, rgba(3,5,7,0.24) 70%, rgba(3,5,7,0.56) 100%),
    linear-gradient(180deg, rgba(1,2,3,0.08), rgba(1,2,3,0.34));
}

.account-apply-button {
  position: absolute;
  top: 22px;
  right: 24px;
  z-index: 2;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid rgba(143,208,183,0.34);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(143,208,183,0.18), rgba(255,255,255,0.045)),
    rgba(13,15,16,0.72);
  color: var(--text);
  box-shadow: 0 14px 34px rgba(0,0,0,0.18);
}

.account-apply-button:hover {
  border-color: rgba(143,208,183,0.62);
  background:
    linear-gradient(135deg, rgba(143,208,183,0.25), rgba(255,255,255,0.07)),
    rgba(13,15,16,0.82);
}

.login-card,
.panel,
.sidebar,
.workspace-head,
.modal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.login-card {
  width: min(940px, 100%);
  display: grid;
  grid-template-columns: 420px 360px;
  gap: 52px;
  align-items: stretch;
  border-radius: 24px;
  padding: 28px 24px;
  position: relative;
  z-index: 1;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.login-showcase {
  width: 420px;
  min-width: 420px;
  display: grid;
  align-content: stretch;
  justify-items: center;
  justify-self: start;
  margin-left: 0;
  position: relative;
  z-index: 1;
}

.login-copy {
  min-width: 0;
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 6px;
  padding: 0 0 10px;
}

.login-community-hero {
  width: 420px;
  height: 520px;
  min-height: 520px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 16px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.045);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.018), rgba(255,255,255,0.004)),
    rgba(255,255,255,0.008);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.014),
    0 8px 20px rgba(0,0,0,0.05);
}

.login-community-hero-media {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: transparent;
}

.login-community-hero-media-backdrop,
.login-community-hero-media-image,
.login-community-hero-media img {
  display: block;
}

.login-community-hero-media-backdrop {
  display: none;
}

.login-community-hero-media-image {
  position: relative;
  z-index: 1;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
  box-shadow:
    0 8px 18px rgba(0,0,0,0.10),
    0 0 0 1px rgba(255,255,255,0.03);
}

.login-community-hero.is-landscape .login-community-hero-media-image {
  max-width: 100%;
  max-height: 100%;
}

.login-community-hero.is-portrait .login-community-hero-media-image {
  max-width: 100%;
  max-height: 100%;
}

.login-community-hero.is-square .login-community-hero-media-image {
  max-width: 100%;
  max-height: 100%;
}

.login-community-hero-empty {
  width: 100%;
  height: 100%;
  min-height: 100%;
  border-radius: 18px;
  background:
    radial-gradient(circle at center, rgba(255,255,255,0.022), rgba(255,255,255,0.008) 58%, transparent 100%);
}

.login-panel {
  min-width: 0;
  width: 100%;
  max-width: 360px;
  display: grid;
  align-content: start;
  align-self: stretch;
  gap: 20px;
  justify-self: end;
  min-height: 520px;
  padding: 28px 26px 30px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.014)),
    rgba(11,13,16,0.44);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 18px 46px rgba(0,0,0,0.16);
  position: relative;
  z-index: 1;
}

.skeleton-block {
  position: relative;
  overflow: hidden;
}

.skeleton-block::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  transform: translateX(-100%);
  animation: skeletonSweep 1.8s ease-in-out infinite;
}

@keyframes skeletonSweep {
  100% {
    transform: translateX(100%);
  }
}

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

@keyframes loginButtonSweep {
  to {
    transform: translateX(100%);
  }
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
}

.small { font-size: 10px; }

.login-copy h1,
.workspace-head h1,
.sidebar h2,
.panel h3 {
  margin: 0;
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  letter-spacing: 0;
}

.brand-lockup {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px 12px;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 0;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0;
  text-align: left;
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  flex: 0 0 auto;
}

.brand-mark img {
  display: block;
  width: 235px;
  max-width: none;
  height: auto;
  object-fit: contain;
  border-radius: 0;
}

.brand-title {
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-size: 31px;
  line-height: 1.02;
}

.brand-title-accent {
  color: #2fcf73;
}

.sidebar-brand {
  width: 100%;
  justify-content: center;
  margin: 0 auto 2px;
  padding: 2px 0 6px;
}

.sidebar-brand .brand-mark {
  width: 42px;
  height: 42px;
}

.sidebar-brand .brand-mark img {
  width: 159px;
}

.sidebar-brand .brand-title {
  font-size: 24px;
  line-height: 1.05;
}

.login-brand .brand-mark {
  width: min(188px, 34vw);
  height: auto;
  overflow: visible;
}

.login-brand .brand-mark img {
  width: 100%;
}

.login-brand .brand-title {
  position: relative;
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.02;
}

.login-brand .brand-title::after {
  content: "AI";
  position: absolute;
  top: -13px;
  right: -30px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(8,18,12,0.72);
  border-radius: 999px;
  background: linear-gradient(135deg, #90f2b9, #2fcf73);
  color: #082012;
  box-shadow: 0 10px 22px rgba(47,207,115,0.28);
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: -0.02em;
  animation: aiBadgeFloat 4.8s ease-in-out infinite;
}

.login-copy h1 {
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.04;
  font-weight: 800;
}

.login-mode-hint {
  margin: 0;
  min-height: 18px;
  color: rgba(201,205,211,0.72);
  font-size: 12px;
  line-height: 1.45;
}

.login-copy p,
.sidebar-copy,
.form-note,
.trace-card p,
.table-row p,
.result-card p,
.job-card p,
.model-card p,
.empty-state {
  color: var(--muted);
  line-height: 1.6;
}

.form-note {
  margin: 4px 0 0;
  font-size: 12px;
}

.form-note-success {
  color: var(--success);
}

.form-note-warn {
  color: var(--warning);
}

.form-note-error {
  color: var(--danger);
}

.login-message {
  min-height: 22px;
  margin-top: 4px;
  padding: 0;
  border-radius: 0;
  border-left: 0;
  background: transparent;
}

.login-message.info {
  color: #2fbf73;
}

.login-message.warn {
  color: #f6c86b;
}

.login-message.error {
  color: #ff8e8e;
}

.login-session-note {
  margin-top: 2px;
  color: rgba(159, 169, 184, 0.76);
  font-size: 12px;
  line-height: 1.5;
}

.login-form,
.settings-stack,
.model-settings-stack,
.stack-list,
.table-list,
.model-list,
.system-settings-panel {
  display: grid;
  gap: 11px;
}

.login-form {
  align-content: start;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.login-form select,
.login-form input {
  min-height: 48px;
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(9,10,12,0.82);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.login-form input::placeholder {
  color: rgba(154, 160, 169, 0.84);
  opacity: 1;
}

.login-form input:focus,
.login-form select:focus {
  outline: none;
  border-color: rgba(143,208,183,0.42);
  background: rgba(11,13,15,0.92);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.02),
    0 0 0 3px rgba(143,208,183,0.10);
}

.login-form input:-webkit-autofill,
.login-form input:-webkit-autofill:hover,
.login-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  box-shadow: 0 0 0 1000px rgba(9,10,12,0.82) inset;
  caret-color: var(--text);
  transition: background-color 9999s ease-out 0s;
}

.login-remember-option {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 28px;
  color: rgba(201, 205, 211, 0.88);
  font-size: 13px;
  line-height: 1.4;
  user-select: none;
}

.login-remember-option input {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border-radius: 4px;
  accent-color: #20c463;
}

.login-form.is-loading {
  pointer-events: none;
}

.login-submit-button {
  border-color: rgba(47,207,115,0.62);
  background: linear-gradient(135deg, #7ff0aa, #20c463);
  color: #082012;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 14px 30px rgba(32,196,99,0.22);
}

.login-submit-button:hover {
  border-color: rgba(144,242,185,0.82);
  background: linear-gradient(135deg, #98f6bd, #27d36f);
}

.login-submit-button:disabled {
  cursor: not-allowed;
  opacity: 0.82;
  border-color: rgba(157, 169, 180, 0.42);
  background: linear-gradient(135deg, rgba(160,172,184,0.72), rgba(110,122,134,0.78));
  color: rgba(8, 18, 12, 0.88);
  box-shadow: none;
}

.login-copyright {
  grid-column: 1 / -1;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.field {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.field span {
  font-size: 13px;
  color: var(--muted);
}

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

.field-title-row > span {
  color: var(--muted);
}

.template-flash {
  animation: templateFlash 1.45s ease;
}

.template-select {
  width: min(190px, 48%);
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 12px;
}

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

input,
textarea,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: #101113;
  color: var(--text);
  border-radius: 10px;
  padding: 11px 12px;
  outline: none;
}

select {
  padding-right: 34px;
  background-color: #101113;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(215, 221, 231, 0.08);
}

textarea {
  resize: vertical;
  min-height: 150px;
}

button {
  border: 0;
  cursor: pointer;
  border-radius: 10px;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease, border-color 160ms ease;
}

button:hover { transform: translateY(-1px); }

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.primary-button {
  background: linear-gradient(180deg, #f3f4f6, #aeb5bd);
  color: #0b0c0e;
  font-weight: 700;
  padding: 12px 16px;
}

.primary-button:disabled {
  background: linear-gradient(180deg, #d5dae0, #8d949d);
  color: rgba(11, 12, 14, 0.72);
}

.ghost-button {
  background: #17191c;
  color: var(--text);
  border: 1px solid var(--line-strong);
  padding: 11px 14px;
}

.ghost-button.active-filter {
  border-color: rgba(143, 208, 183, 0.55);
  color: var(--success);
  background: rgba(143, 208, 183, 0.08);
}

.danger-button {
  border-color: rgba(226, 143, 143, 0.35);
  color: #ffd5d5;
}

.wide-button { width: 100%; }

.app-shell {
  width: min(1560px, calc(100% - 20px));
  margin: 0 auto 10px;
  margin:
    constant(safe-area-inset-top)
    auto
    max(10px, constant(safe-area-inset-bottom));
  margin:
    env(safe-area-inset-top)
    auto
    max(10px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: var(--app-shell-gap);
  position: relative;
  z-index: 1;
}

.app-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: 182px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.sidebar {
  display: grid;
  gap: 8px;
  align-content: start;
  position: sticky;
  top: calc(var(--app-topbar-height) + var(--app-shell-gap));
  padding: 10px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 18% 0%, rgba(143,208,183,0.16), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.018)),
    rgba(17, 19, 21, 0.96);
  border-color: rgba(255,255,255,0.12);
  box-shadow:
    0 18px 42px rgba(0,0,0,0.22),
    inset 0 1px 0 rgba(255,255,255,0.05);
}

.app-sidebar {
  padding: 0;
  gap: 10px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: var(--app-topbar-height);
  gap: 14px;
  padding: 8px 12px;
  background:
    linear-gradient(180deg, #1e2322, #171b1a),
    #151817;
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 14px 32px rgba(0,0,0,0.18);
  position: sticky;
  top: 0;
  z-index: 12;
  border-radius: 12px;
}

.topbar-main {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  width: 100%;
}

.topbar-brand {
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  gap: 12px;
}

.topbar-brand .brand-mark {
  width: min(156px, 24vw);
  height: auto;
  overflow: visible;
}

.topbar-brand .brand-mark img {
  width: 100%;
  max-width: 100%;
}

.topbar-brand .brand-title {
  display: inline-block;
  position: relative;
  font-size: clamp(24px, 2.8vw, 32px);
  line-height: 1;
}

.topbar-brand .brand-title::after {
  content: "AI";
  position: absolute;
  top: -11px;
  right: -27px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(8,18,12,0.72);
  border-radius: 999px;
  background: linear-gradient(135deg, #90f2b9, #2fcf73);
  color: #082012;
  box-shadow: 0 10px 22px rgba(47,207,115,0.28);
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: -0.02em;
  animation: aiBadgeFloat 4.8s ease-in-out infinite;
}

.login-brand:hover .brand-title::after,
.topbar-brand:hover .brand-title::after {
  animation-duration: 3.2s;
  filter: brightness(1.04);
}

.profile-card,
.trace-card,
.result-card,
.table-row,
.model-card,
.stat-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.profile-card {
  padding: 11px;
  display: grid;
  gap: 2px;
}

.profile-button {
  width: 100%;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  text-align: left;
}

.profile-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.profile-card strong,
.profile-card small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.profile-credit {
  color: var(--success);
  font-weight: 800;
}

.profile-credit.is-low {
  color: var(--warning);
}

#profileName,
#profileEmail {
  color: var(--text);
}

.profile-avatar {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(143,208,183,0.14);
  border: 1px solid rgba(143,208,183,0.28);
  color: var(--success);
  font-weight: 700;
}

.profile-avatar.large {
  width: 56px;
  height: 56px;
  font-size: 20px;
}

.profile-credit-panel {
  display: grid;
  gap: 6px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(143,208,183,0.28);
  border-radius: 12px;
  background: rgba(143,208,183,0.10);
}

.profile-credit-panel span,
.profile-credit-panel small {
  color: var(--muted);
  font-size: 12px;
}

.profile-credit-panel strong {
  color: var(--success);
  font-size: 28px;
  line-height: 1;
}

.profile-credit-panel.is-low {
  border-color: rgba(232,199,129,0.32);
  background: rgba(232,199,129,0.08);
}

.profile-credit-panel.is-low strong {
  color: var(--warning);
}

.profile-modal-card {
  width: min(660px, 100%);
}

#profileModal .user-edit-modal-info {
  gap: 9px;
  padding-top: 14px;
}

#profileModal .profile-modal-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 2px;
}

#profileModal .profile-avatar.large {
  width: 44px;
  height: 44px;
  font-size: 17px;
}

#profileModal .profile-modal-head h3 {
  padding-right: 30px;
  font-size: 18px;
  line-height: 1.18;
}

#profileModal .profile-modal-head .form-note {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.35;
}

#profileModal .profile-credit-panel {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "label value"
    "detail value";
  align-items: center;
  gap: 2px 12px;
  margin: 0;
  padding: 8px 11px;
  border-radius: 10px;
}

#profileModal .profile-credit-panel span {
  grid-area: label;
}

#profileModal .profile-credit-panel strong {
  grid-area: value;
  font-size: 22px;
}

#profileModal .profile-credit-panel small {
  grid-area: detail;
}

#profileModal .profile-info-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
}

#profileModal .profile-info-form .field:nth-of-type(5) {
  grid-column: 1 / -1;
}

#profileModal .field {
  gap: 4px;
}

#profileModal .field span {
  font-size: 12px;
}

#profileModal input {
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 13px;
}

#profileModal .action-row {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

#profileModal .action-row .primary-button,
#profileModal .action-row .ghost-button {
  min-height: 36px;
  border-radius: 9px;
  padding: 8px 12px;
  white-space: nowrap !important;
  word-break: keep-all !important;
}

#profileModal .profile-password-form {
  grid-template-columns: minmax(0, 1fr) minmax(210px, 230px);
  gap: 8px 10px;
  align-items: end;
  padding-top: 9px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

#profileModal .profile-password-form .action-row {
  grid-column: auto;
  grid-template-columns: 72px minmax(112px, 1fr);
  gap: 8px;
}

@media (max-width: 560px) {
  #profileModal .profile-info-form,
  #profileModal .profile-password-form,
  #profileModal .profile-password-form .action-row {
    grid-template-columns: 1fr;
  }

  #profileModal .profile-password-form .action-row {
    grid-column: 1 / -1;
  }
}

.role-badge,
.status-chip,
.head-chip,
.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.role-badge,
.head-chip,
.status-chip,
.pill {
  background: rgba(255,255,255,0.08);
  color: var(--soft);
}

.status-chip,
.pill.success { color: var(--success); }
.pill.warning { color: var(--warning); }
.pill.danger { color: var(--danger); }
.pill.model-usage-pill {
  color: var(--soft);
  border-color: rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
}

.pill.model-credit-pill {
  color: var(--warning);
  border-color: rgba(232,199,129,0.24);
  background: rgba(232,199,129,0.08);
}

.nav-list {
  display: grid;
  gap: 5px;
}

.sidebar-nav {
  align-content: start;
}

.sidebar-menu-panel {
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 14px 32px rgba(0,0,0,0.16);
}

.sidebar-menu-panel {
  display: grid;
  gap: 8px;
  padding: 10px 10px 11px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 0%, rgba(143,208,183,0.12), transparent 32%),
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.016)),
    rgba(19, 21, 23, 0.98);
  border-color: rgba(255,255,255,0.11);
  box-shadow:
    0 16px 34px rgba(0,0,0,0.18),
    inset 0 1px 0 rgba(255,255,255,0.04);
}

.sidebar-profile-button {
  width: 100%;
  min-height: 64px;
  padding: 12px 12px 11px;
  border-radius: 12px;
  grid-template-columns: 38px minmax(0, 1fr);
  justify-items: stretch;
  align-items: center;
  gap: 10px;
  background:
    linear-gradient(135deg, rgba(143,208,183,0.18), rgba(255,255,255,0.08)),
    rgba(26, 29, 32, 0.98);
  border-color: rgba(143,208,183,0.22);
  box-shadow:
    0 12px 28px rgba(0,0,0,0.18),
    inset 0 1px 0 rgba(255,255,255,0.05);
}

.sidebar-profile-button .profile-avatar {
  width: 38px;
  height: 38px;
  font-size: 14px;
  background: linear-gradient(180deg, rgba(169,235,201,0.24), rgba(143,208,183,0.12));
  border-color: rgba(169,235,201,0.34);
  box-shadow: 0 8px 18px rgba(47,207,115,0.16);
}

body:has(#appScreen:not(.hidden)) .sidebar-profile-button:hover,
body:has(#appScreen:not(.hidden)) .sidebar-profile-button:focus-visible {
  transform: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.014)),
    rgba(19, 21, 23, 0.98);
  border-color: rgba(255,255,255,0.10);
  box-shadow: none;
}

body:has(#appScreen:not(.hidden)) .sidebar-profile-button:hover #profileName,
body:has(#appScreen:not(.hidden)) .sidebar-profile-button:focus-visible #profileName {
  color: #f7fafc;
}

body:has(#appScreen:not(.hidden)) .sidebar-profile-button:hover #profileEmail,
body:has(#appScreen:not(.hidden)) .sidebar-profile-button:focus-visible #profileEmail {
  color: #d7dee7;
}

.sidebar-profile-button .profile-copy {
  width: 100%;
  gap: 4px;
}

.sidebar-profile-button strong {
  display: block;
  font-size: 14px;
  line-height: 1.3;
}

.sidebar-profile-button small {
  display: block;
  color: #b7bdc6;
  font-size: 10px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: normal;
}

.sidebar-logout-button {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.02)),
    rgba(24, 26, 29, 0.98);
  border-color: rgba(255,255,255,0.16);
}

.sidebar-logout-button:hover {
  background:
    linear-gradient(180deg, rgba(143,208,183,0.12), rgba(255,255,255,0.04)),
    rgba(26, 29, 31, 0.98);
  border-color: rgba(143,208,183,0.24);
}

.topbar-tabs {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-self: center;
  justify-content: center;
  gap: 14px;
}

.topbar-spacer {
  width: 1px;
  height: 1px;
  justify-self: end;
}

.topbar-tab {
  position: relative;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}

.topbar-tab:hover {
  color: var(--text);
  transform: none;
}

.topbar-tab.active {
  color: var(--text);
}

.topbar-tab-label {
  position: relative;
  display: inline-block;
}

.topbar-tab-with-dot .topbar-tab-label::before,
.topbar-tab-with-dot .topbar-tab-label::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.topbar-tab-with-dot .topbar-tab-label::before {
  top: -5px;
  right: -9px;
  width: 7px;
  height: 7px;
  background: #ff4d5f;
  box-shadow: 0 0 0 1px rgba(11, 12, 14, 0.72);
  z-index: 2;
}

.topbar-tab-with-dot .topbar-tab-label::after {
  top: -8px;
  right: -12px;
  width: 13px;
  height: 13px;
  background: rgba(255, 77, 95, 0.22);
  animation: topbar-community-dot-breathe 1.9s ease-in-out infinite;
}

@keyframes topbar-community-dot-breathe {
  0%, 100% {
    transform: scale(0.85);
    opacity: 0.4;
  }
  50% {
    transform: scale(1.22);
    opacity: 0.95;
  }
}

.topbar-nav {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
}

.nav-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.016)),
    #191c20;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: left;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.035),
    0 8px 18px rgba(0,0,0,0.12);
}

.topbar .nav-item {
  width: auto;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(7,20,14,0.28);
  border-color: rgba(143,208,183,0.12);
  white-space: nowrap;
  flex: 0 0 auto;
}

.topbar .nav-item span:last-child {
  display: none;
}

.topbar .nav-item.active {
  background:
    linear-gradient(135deg, rgba(143,208,183,0.22), rgba(255,255,255,0.08)),
    rgba(7,20,14,0.42);
  border-color: rgba(143,208,183,0.36);
}

.nav-item.active {
  background:
    linear-gradient(135deg, rgba(143,208,183,0.24), rgba(255,255,255,0.1)),
    linear-gradient(180deg, #2a2f34, #1a1d21);
  border-color: rgba(143,208,183,0.34);
  box-shadow:
    0 14px 28px rgba(0,0,0,0.18),
    0 0 0 1px rgba(143,208,183,0.08),
    inset 0 1px 0 rgba(255,255,255,0.06);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.topbar-profile-button {
  width: clamp(168px, 20vw, 216px);
  min-width: 0;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 12px;
  background: transparent;
  border-color: rgba(255,255,255,0.06);
  box-shadow: none;
}

.topbar-profile-button .profile-avatar {
  width: 36px;
  height: 36px;
}

.topbar-profile-button small {
  display: none;
}

.topbar-logout-button {
  width: auto;
  min-height: 40px;
  padding: 9px 13px;
  border-radius: 12px;
  background: transparent;
  border-color: rgba(255,255,255,0.12);
}

.app-sidebar .nav-item {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 11px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.018)),
    #1a1d21;
  font-size: 14px;
  line-height: 1.35;
  border-color: rgba(255,255,255,0.11);
  color: #eef1f4;
}

.app-sidebar .nav-item:hover {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.026)),
    #1e2327;
  border-color: rgba(143,208,183,0.2);
}

.app-sidebar .nav-item.active {
  background:
    radial-gradient(circle at 0% 50%, rgba(169,235,201,0.18), transparent 42%),
    linear-gradient(135deg, rgba(143,208,183,0.26), rgba(255,255,255,0.09)),
    #1f2428;
  border-color: rgba(143,208,183,0.36);
  color: #ffffff;
}

.app-sidebar .nav-item span:last-child {
  color: rgba(223,230,237,0.72);
}

.app-sidebar .nav-item.active span:last-child {
  color: #d9ffe9;
}

.workspace {
  min-width: 0;
}

.workspace-head {
  min-height: var(--workspace-head-height);
  border-radius: 16px;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015)),
    rgba(17, 18, 20, 0.92);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 14px 36px rgba(0,0,0,0.18);
}

.head-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.regression-trigger {
  cursor: pointer;
  user-select: none;
}

.workspace-head .eyebrow {
  display: none;
}

.workspace-head h1 {
  font-size: clamp(20px, 2.1vw, 28px);
  line-height: 1.05;
}

.muted-chip { color: var(--muted); }

.view { display: none; }
.view.active { display: block; }

.forge-tool-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.forge-tool-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.forge-tool-hero h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 42px);
  line-height: 1;
}

.forge-tool-hero p {
  max-width: 780px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.forge-tool-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(320px, 1fr) minmax(320px, 1.15fr);
  gap: 10px;
  align-items: stretch;
}

.forge-tool-hero-compact {
  min-height: 0;
}

.angle-lab-shell {
  min-height: calc(100vh - 126px);
  padding: 28px 36px 0;
  border-radius: 8px;
  background: #0d131d;
}

.angle-lab-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(520px, 1.35fr);
  gap: 34px 40px;
  align-items: stretch;
}

.angle-lab-block {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.angle-lab-step {
  min-height: 28px;
  margin: 0 0 16px;
  color: #8e9aad;
  font-size: 10px;
  line-height: 1.35;
  font-weight: 900;
  letter-spacing: 0.42em;
}

.angle-dropzone {
  position: relative;
  flex: 1;
  min-height: 436px;
  border: 1px dashed rgba(183, 196, 215, 0.42);
  border-radius: 16px;
  background: #151c27;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #e8edf5;
  cursor: pointer;
  overflow: hidden;
}

.angle-dropzone.drag-over {
  border-color: #dce6f4;
  background: #192232;
}

.angle-dropzone input {
  display: none;
}

.angle-upload-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid rgba(183, 196, 215, 0.18);
  display: grid;
  place-items: center;
  color: #dce6f4;
  font-size: 28px;
  line-height: 1;
}

.angle-dropzone strong {
  font-size: 12px;
  font-weight: 900;
}

.angle-dropzone small {
  color: #6f7b8d;
  font-size: 12px;
}

.angle-source-preview {
  position: absolute;
  inset: 0;
  display: none;
  background: #101722;
  pointer-events: none;
}

.angle-source-preview:not(.empty) {
  display: block;
}

.angle-source-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.angle-ai-parameter-button {
  align-self: flex-start;
  margin-top: -4px;
}

.angle-camera-card {
  flex: 1;
  min-height: 520px;
  border: 1px solid rgba(183, 196, 215, 0.16);
  border-radius: 14px;
  background: #151c27;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 244px;
}

.angle-three-stage {
  position: relative;
  overflow: hidden;
  background: #22211f;
  perspective: 900px;
}

.angle-three-fallback {
  position: absolute;
  inset: 0;
}

.angle-plane-fallback {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 320px;
  height: 320px;
  transform: translate(-50%, -50%) perspective(780px);
  transform-style: preserve-3d;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.035);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 30px 80px rgba(0,0,0,0.28);
  transition: transform 150ms ease;
}

.angle-plane-fallback.has-image {
  background-color: rgba(255,255,255,0.08);
}

.angle-plane-fallback img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.angle-stage-cross {
  position: absolute;
  background: rgba(218, 225, 236, 0.08);
  pointer-events: none;
}

.angle-stage-cross.horizontal {
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
}

.angle-stage-cross.vertical {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
}

.angle-camera-panel {
  padding: 128px 22px 22px;
  background: #151c27;
  border-left: 1px solid rgba(183,196,215,0.10);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.angle-camera-slider {
  display: grid;
  gap: 10px;
}

.angle-camera-slider span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px 48px;
  align-items: center;
  gap: 8px;
  color: #9aa6b8;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.angle-camera-slider button {
  color: #9aa6b8;
}

.angle-camera-slider strong {
  padding: 6px 8px;
  border-radius: 2px;
  background: #111824;
  color: #e9eef6;
  text-align: center;
}

.angle-camera-slider input {
  width: 100%;
  accent-color: #0b0c0f;
}

.angle-preset-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: auto;
}

.angle-params-block textarea {
  flex: 1;
  min-height: 260px;
}

.angle-params-block .field {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.angle-params-block .field textarea {
  width: 100%;
}

.angle-model-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.forge-tool-provider-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.angle-params-block .status-chip {
  margin-top: 10px;
}

.angle-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 28px;
  margin-bottom: 16px;
}

.angle-result-head .angle-lab-step {
  min-height: 0;
  margin: 0;
}

.angle-result-frame {
  flex: 1;
  min-height: 288px;
  border: 1px solid rgba(183,196,215,0.16);
  border-radius: 28px;
  background: #151c27;
  color: #596579;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  overflow: hidden;
}

.angle-result-frame img {
  width: 100%;
  height: 100%;
  max-height: 360px;
  object-fit: contain;
}

.angle-result-icon {
  font-size: 36px;
}

.angle-result-frame strong {
  color: #606b7d;
  font-size: 11px;
  letter-spacing: 0.52em;
}



.forge-tool-uploader,
.forge-tool-controls,
.forge-tool-result {
  min-height: 540px;
}

.forge-tool-dropzone {
  min-height: 178px;
  border: 1px dashed rgba(255,255,255,0.18);
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text);
  text-align: center;
}

.forge-tool-dropzone input {
  display: none;
}

.forge-tool-dropzone small {
  color: var(--muted);
}

.forge-tool-preview,
.forge-tool-result-frame {
  margin-top: 10px;
  min-height: 300px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  overflow: hidden;
  text-align: center;
}

.forge-tool-result-frame {
  min-height: 430px;
  flex-direction: column;
  gap: 10px;
}

.forge-tool-preview img,
.forge-tool-result-frame img {
  width: 100%;
  height: 100%;
  max-height: 430px;
  object-fit: contain;
}

.forge-tool-angle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.forge-tool-preset {
  min-height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-weight: 800;
}

.forge-tool-preset.active {
  background: rgba(127,255,184,0.14);
  color: var(--text);
  border-color: rgba(127,255,184,0.44);
}

.forge-tool-controls textarea {
  min-height: 128px;
}

.forge-tool-run {
  width: 100%;
  min-height: 58px;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 16px;
  box-shadow: 0 16px 34px rgba(127,255,184,0.18), inset 0 1px 0 rgba(255,255,255,0.18);
}

.forge-tool-run .forge-tool-run-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(0,0,0,0.16);
  font-size: 18px;
  flex: 0 0 auto;
}

.forge-tool-run .forge-tool-run-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  min-width: 0;
}

.forge-tool-run .forge-tool-run-copy strong {
  font-size: 14px;
}

.forge-tool-run .forge-tool-run-copy small {
  margin-top: 3px;
  font-size: 11px;
  font-weight: 800;
  color: rgba(9, 14, 18, 0.64);
}

.forge-tool-run.is-loading .forge-tool-run-icon {
  animation: forgeToolRunSpin 0.8s linear infinite;
}

.forge-tool-run:disabled .forge-tool-run-copy small {
  color: rgba(255,255,255,0.48);
}

.forge-tool-slider {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  margin-bottom: 12px;
}

.forge-tool-slider span {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-weight: 800;
}

.forge-tool-toggle-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.forge-tool-checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.forge-tool-checkline input {
  width: 16px;
  height: 16px;
  accent-color: #7fffb8;
}

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

  .angle-lab-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    min-height: 0;
  }

  .angle-camera-card {
    grid-template-columns: 1fr;
  }

  .forge-tool-uploader,
  .forge-tool-controls,
  .forge-tool-result {
    min-height: 0;
  }
}

.forge-canvas-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 10px;
  min-height: calc(100vh - 128px);
}

.forge-canvas-sidebar,
.forge-canvas-workspace {
  min-height: 0;
}

.forge-canvas-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.forge-canvas-actions,
.forge-canvas-tool-buttons,
.forge-canvas-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.forge-canvas-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  max-height: calc(100vh - 280px);
}

.forge-canvas-list-item {
  width: 100%;
  min-height: 68px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.forge-canvas-list-item.active {
  border-color: rgba(127,255,184,0.42);
  background: rgba(127,255,184,0.10);
}

.forge-canvas-list-item span {
  color: var(--muted);
  font-size: 12px;
}

.forge-canvas-workspace {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), transparent),
    rgba(12, 14, 18, 0.96);
}

.forge-canvas-toolbar {
  justify-content: space-between;
}

.forge-canvas-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 260px;
}

.forge-canvas-title-group input {
  width: min(360px, 38vw);
  height: 38px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  background: rgba(0,0,0,0.18);
  color: var(--text);
  padding: 0 12px;
  font-weight: 800;
  outline: none;
}

.infinite-canvas-shell {
  position: relative;
  height: calc(100vh - 76px);
  min-height: 720px;
  margin: calc(-1 * var(--workspace-head-height) - 8px) -6px 0;
  overflow: hidden;
  border-radius: 0;
  background: #0b111d;
}

.canvas-browser {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 24px;
  background:
    radial-gradient(circle at 22% 18%, rgba(143,208,183,0.16), transparent 28%),
    radial-gradient(circle at 78% 10%, rgba(226,232,240,0.10), transparent 24%),
    #0b111d;
  overflow: auto;
}

.canvas-browser-card {
  width: min(920px, 100%);
  min-height: 420px;
  padding: 28px;
  border: 1px solid rgba(226,232,240,0.14);
  border-radius: 24px;
  background: rgba(21,28,42,0.92);
  box-shadow: 0 28px 80px rgba(0,0,0,0.32);
  backdrop-filter: blur(18px);
}

.canvas-browser-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}

.canvas-browser-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.canvas-browser-title-row h2 {
  margin: 0;
  color: #f8fafc;
  font-size: 24px;
  line-height: 1.05;
}

.canvas-browser-title-row span {
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(148,163,184,0.10);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.canvas-browser-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.canvas-icon-button,
.canvas-new-button,
.canvas-back-button {
  border: 1px solid rgba(148,163,184,0.20);
  background: #101827;
  color: var(--text);
  font-weight: 900;
}

.canvas-icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 12px;
  color: var(--muted);
}

.canvas-new-button {
  min-height: 38px;
  padding: 0 18px;
  border-radius: 12px;
  background: #e7edf8;
  color: #111827;
}

.canvas-browser-list-shell {
  min-height: 260px;
  padding: 14px;
  border: 1px solid rgba(148,163,184,0.14);
  border-radius: 18px;
  background: rgba(15,23,42,0.70);
}

.canvas-browser-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
  gap: 10px;
  max-height: min(58vh, 520px);
  overflow: auto;
  padding: 2px;
}

.canvas-browser-item {
  min-height: 142px;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 1px solid #e5eaf1;
  border-radius: 14px;
  background: #fff;
  color: #111827;
  overflow: hidden;
  position: relative;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}

.canvas-browser-item.active,
.canvas-browser-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 1px 3px rgba(15,23,42,.08);
}

.canvas-browser-item.active {
  border-color: #0f172a;
  background: #0f172a;
  box-shadow: 0 1px 3px rgba(15,23,42,.15);
}

.canvas-browser-open {
  width: 100%;
  height: 100%;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: inherit;
  text-align: left;
  background: transparent;
}

.canvas-browser-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
}

.canvas-browser-item-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #edf2f7;
  border-radius: 10px;
  color: #475569;
  background: #f8fafc;
}

.canvas-browser-item.active .canvas-browser-item-icon {
  color: #fff;
  border-color: rgba(255,255,255,.12);
  background: rgba(255,255,255,.08);
}

.canvas-card-title {
  flex: 1;
  min-height: 0;
  color: #111827;
  font-size: 13.5px;
  line-height: 1.25;
  font-weight: 750;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.canvas-browser-item.active .canvas-card-title {
  color: #fff;
}

.canvas-card-title-input {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #111827;
  font-size: 13.5px;
  line-height: 1.3;
  font-weight: 750;
  outline: none;
}

.canvas-card-meta {
  margin-top: auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border: 1px solid #edf2f7;
  border-radius: 999px;
  background: #f8fafc;
}

.canvas-browser-item.active .canvas-card-meta {
  border-color: rgba(255,255,255,.08);
  background: rgba(255,255,255,.06);
}

.canvas-card-meta-dot {
  width: 3px;
  height: 3px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #94a3b8;
}

.canvas-browser-item small {
  color: #64748b;
  font-size: 9px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.canvas-browser-item.active small {
  color: rgba(255,255,255,.62);
}

.canvas-card-edit,
.canvas-delete {
  position: absolute;
  top: 8px;
  z-index: 2;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e8edf3;
  border-radius: 10px;
  background: rgba(255,255,255,.92);
  color: #94a3b8;
  opacity: 0;
  transition: opacity .14s var(--ease), background .14s var(--ease), color .14s var(--ease), border-color .14s var(--ease);
}

.canvas-card-edit {
  right: 40px;
}

.canvas-delete {
  right: 8px;
}

.canvas-browser-item:hover .canvas-card-edit,
.canvas-browser-item:hover .canvas-delete,
.canvas-browser-item.active .canvas-card-edit,
.canvas-browser-item.active .canvas-delete {
  opacity: 1;
}

.canvas-card-edit:hover {
  color: #0f172a;
  border-color: #cbd5e1;
  background: #fff;
}

.canvas-delete:hover {
  color: #dc2626;
  border-color: #fecaca;
  background: #fee2e2;
}

.canvas-browser-item.active .canvas-card-edit,
.canvas-browser-item.active .canvas-delete {
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.14);
  color: #fff;
}

.canvas-delete-confirm {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(15,23,42,.18);
  backdrop-filter: blur(4px);
}

.canvas-delete-box {
  width: 100%;
  padding: 12px;
  border-radius: 16px;
  background: #111827;
  box-shadow: 0 16px 36px rgba(15,23,42,.22);
  text-align: center;
}

.canvas-delete-title {
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.canvas-delete-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.canvas-confirm-btn,
.canvas-cancel-btn {
  height: 28px;
  flex: 1;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

.canvas-confirm-btn {
  background: #fff;
  color: #111827;
}

.canvas-cancel-btn {
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.1);
  color: #fff;
}

.canvas-browser-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 800;
}

.canvas-editor {
  position: absolute;
  inset: 0;
}

.canvas-floating-top {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 12;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  align-items: flex-start;
  gap: 12px;
  pointer-events: none;
}

.canvas-editor-back-panel {
  pointer-events: auto;
  justify-self: start;
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 8px;
  border: 1px solid rgba(148,163,184,0.20);
  border-radius: 28px;
  background: rgba(15,23,42,0.84);
  backdrop-filter: blur(14px);
}

.canvas-back-button {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  color: var(--muted);
}

.canvas-editor-back-panel div {
  display: grid;
  gap: 3px;
}

.canvas-editor-back-panel strong {
  font-size: 13px;
}

.canvas-editor-back-panel span {
  color: var(--muted);
  font-size: 11px;
}

.canvas-library-panel,
.canvas-nav-panel,
.canvas-toolbar-panel {
  pointer-events: auto;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 20px;
  background: rgba(17, 24, 39, 0.88);
  box-shadow: 0 18px 46px rgba(0,0,0,0.24);
  backdrop-filter: blur(16px);
}

.canvas-library-panel {
  width: 300px;
  max-height: calc(100vh - 146px);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.canvas-library-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.canvas-library-head h3 {
  margin: 0;
}

.canvas-nav-panel {
  display: none;
  min-width: min(360px, 36vw);
  padding: 8px;
  align-items: center;
  gap: 8px;
}

.canvas-nav-panel input {
  min-width: 0;
  height: 36px;
  flex: 1;
  border: 0;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  padding: 0 12px;
  font-weight: 900;
  outline: none;
}

.canvas-toolbar-panel {
  grid-column: 2;
  justify-self: center;
  padding: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.tool-chip {
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(15,23,42,0.66);
  color: #b8c1d1;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.tool-chip-icon {
  min-width: 14px;
  display: inline-flex;
  justify-content: center;
  color: #dbe3ef;
  font-size: 12px;
  font-weight: 900;
}

.tool-chip:hover {
  color: var(--text);
  background: rgba(255,255,255,0.09);
}

.tool-chip.primary {
  color: #07100c;
  background: #8fd0b7;
  border-color: #8fd0b7;
}

.canvas-library-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  overflow: auto;
}

.canvas-library-grid .forge-canvas-list-item {
  aspect-ratio: 1 / 1;
  min-height: 0;
}

.canvas-world {
  position: absolute;
  left: 0;
  top: 0;
  width: 6000px;
  height: 4000px;
  transform-origin: 0 0;
  will-change: transform;
}

.canvas-zoom-hud {
  position: absolute;
  left: 22px;
  bottom: 22px;
  min-width: 64px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  background: rgba(17,24,39,0.82);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  backdrop-filter: blur(14px);
}

.canvas-empty-hint {
  z-index: 3;
}

.forge-canvas-board {
  position: relative;
  flex: 1;
  min-height: 620px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  cursor: grab;
  background:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px),
    radial-gradient(rgba(143,208,183,0.18) 1px, transparent 1px),
    rgba(5, 8, 12, 0.88);
  background-size: 96px 96px, 96px 96px, 24px 24px;
}

.infinite-board {
  position: absolute;
  inset: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background-color: #0b111d;
  background-image: radial-gradient(rgba(148,163,184,0.26) 1px, transparent 1px);
  background-size: 24px 24px;
}

.forge-canvas-board.is-panning {
  cursor: grabbing;
}

body.canvas-node-drag,
body.canvas-node-drag * {
  user-select: none !important;
}

body.canvas-node-drag .forge-canvas-node {
  cursor: grabbing;
}

body.canvas-node-drag .forge-canvas-node textarea,
body.canvas-node-drag .forge-canvas-node input,
body.canvas-node-drag .forge-canvas-node select,
body.canvas-node-drag .forge-canvas-node button,
body.canvas-node-drag .forge-canvas-node .forge-canvas-node-body {
  pointer-events: none !important;
}

body.canvas-node-resize,
body.canvas-node-resize * {
  cursor: nwse-resize !important;
  user-select: none !important;
}

body.canvas-node-resize .forge-canvas-node textarea,
body.canvas-node-resize .forge-canvas-node input,
body.canvas-node-resize .forge-canvas-node select,
body.canvas-node-resize .forge-canvas-node button:not(.forge-canvas-resize-handle),
body.canvas-node-resize .forge-canvas-node .forge-canvas-node-body {
  pointer-events: none !important;
}

body.canvas-pane-resize,
body.canvas-pane-resize * {
  cursor: row-resize !important;
  user-select: none !important;
}

body.canvas-pane-resize .forge-canvas-node textarea,
body.canvas-pane-resize .forge-canvas-node input,
body.canvas-pane-resize .forge-canvas-node select,
body.canvas-pane-resize .forge-canvas-node button,
body.canvas-pane-resize .forge-canvas-node .llm-output-wrap {
  pointer-events: none !important;
}

body.canvas-selecting,
body.canvas-selecting * {
  user-select: none !important;
}

.forge-canvas-selection-box {
  position: absolute;
  z-index: 22;
  display: none;
  border: 1px solid #e8edf3;
  background: rgba(232, 237, 243, 0.12);
  pointer-events: none;
}

.forge-canvas-viewport {
  position: absolute;
  left: 0;
  top: 0;
  width: 2400px;
  height: 1600px;
  transform-origin: 0 0;
  will-change: transform;
}

.forge-canvas-links {
  position: absolute;
  left: 0;
  top: 0;
  width: 6000px;
  height: 4000px;
  pointer-events: none;
}

.forge-canvas-links path.link {
  fill: none;
  stroke: rgba(148, 163, 184, 0.82);
  stroke-width: 2.5;
  opacity: .82;
  pointer-events: none;
}

.forge-canvas-links path.link-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 18;
  pointer-events: stroke;
}

.forge-canvas-links path.temp-link {
  stroke: #f8fafc;
  stroke-dasharray: 6 6;
}

.forge-canvas-link-controls {
  position: absolute;
  inset: 0;
  width: 6000px;
  height: 4000px;
  pointer-events: none;
  z-index: 3;
}

.forge-canvas-link-controls .link-delete {
  position: absolute;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  color: #64748b;
  background: rgba(255,255,255,.94);
  box-shadow: 0 8px 20px rgba(15,23,42,.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s var(--ease), color .14s var(--ease), border-color .14s var(--ease), background .14s var(--ease);
}

.forge-canvas-link-controls .link-delete.visible,
.forge-canvas-link-controls .link-delete.hover {
  opacity: 1;
  pointer-events: auto;
}

.forge-canvas-link-controls .link-delete.hover {
  color: #dc2626;
  border-color: #fecaca;
  background: #fff5f5;
}

.forge-canvas-nodes {
  position: relative;
  width: 6000px;
  height: 4000px;
}

.forge-canvas-node {
  position: absolute;
  width: 220px;
  min-height: 96px;
  border: 1px solid #e6ebf2;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 16px 42px rgba(15,23,42,0.12);
  overflow: visible;
  touch-action: none;
  user-select: none;
}

.forge-canvas-node.selected {
  outline: 2px solid #111827;
  outline-offset: 2px;
  border-color: #cbd5e1;
  box-shadow: 0 18px 44px rgba(15,23,42,0.18);
}

.forge-canvas-node.tone-copy,
.forge-canvas-node.tone-media,
.forge-canvas-node.tone-loop,
.forge-canvas-node.tone-llm,
.forge-canvas-node.tone-api,
.forge-canvas-node.tone-ms,
.forge-canvas-node.tone-video,
.forge-canvas-node.tone-comfy,
.forge-canvas-node.tone-output,
.forge-canvas-node.tone-group,
.forge-canvas-node.tone-angle,
.forge-canvas-node.tone-enhance {
  border-top: 0;
}

.forge-canvas-node.tone-copy { --node-accent: #e8c781; }
.forge-canvas-node.tone-media { --node-accent: #8fd0b7; }
.forge-canvas-node.tone-loop { --node-accent: #c4b5fd; }
.forge-canvas-node.tone-llm { --node-accent: #93c5fd; }
.forge-canvas-node.tone-api { --node-accent: #f0abfc; }
.forge-canvas-node.tone-ms { --node-accent: #67e8f9; }
.forge-canvas-node.tone-video { --node-accent: #fca5a5; }
.forge-canvas-node.tone-comfy { --node-accent: #a7f3d0; }
.forge-canvas-node.tone-output { --node-accent: #cbd5e1; }
.forge-canvas-node.tone-group { --node-accent: #94a3b8; }
.forge-canvas-node.tone-angle { --node-accent: #9fbdf2; }
.forge-canvas-node.tone-enhance { --node-accent: #e28f8f; }

.forge-canvas-port {
  position: absolute;
  top: 54px;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: #a7b0be;
  box-shadow: 0 2px 8px rgba(15,23,42,0.12);
  z-index: 3;
}

.forge-canvas-port-in {
  left: -6px;
}

.forge-canvas-port-out {
  right: -7px;
  background: var(--node-accent, #111827);
}

.forge-canvas-node header {
  height: 42px;
  padding: 0 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #eef2f6;
  border-radius: 21px 21px 0 0;
  cursor: move;
}

.forge-canvas-node header strong {
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forge-canvas-node-kind {
  min-width: 28px;
  padding: 3px 6px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--node-accent, #e2e8f0) 22%, #fff);
  color: #475569;
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}

.forge-canvas-run-status {
  min-width: 28px;
  padding: 3px 6px;
  border-radius: 6px;
  color: #64748b;
  background: #f3f6fa;
  font-size: 9px;
  font-weight: 900;
  text-align: center;
}

.forge-canvas-run-status.running,
.forge-canvas-run-status.queued {
  color: var(--warning);
  background: rgba(232,199,129,0.12);
}

.forge-canvas-run-status.done {
  color: var(--success);
  background: rgba(143,208,183,0.12);
}

.forge-canvas-run-status.dedicated {
  color: var(--success);
  background: rgba(143,208,183,0.14);
}

.forge-canvas-run-status.failed {
  color: var(--danger);
  background: rgba(226,143,143,0.12);
}

.forge-canvas-node header .ghost-button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid #e8edf3;
  border-radius: 10px;
  color: #94a3b8;
  background: #f8fafc;
}

.forge-canvas-node-body {
  padding: 12px;
}

.forge-canvas-node textarea {
  width: 100%;
  height: 100px;
  resize: vertical;
  border: 1px solid #e6ebf2;
  border-radius: 16px;
  background: #fbfdff;
  color: #111827;
  padding: 12px;
  outline: none;
  font-size: 13px;
  line-height: 1.6;
}

.forge-canvas-node footer {
  padding: 0 12px 12px;
}

.canvas-create-menu {
  position: fixed;
  z-index: 90;
  display: none;
  width: 190px;
  padding: 8px;
  border: 1px solid #e8edf3;
  border-radius: 18px;
  background: rgba(255,255,255,0.96);
  box-shadow: 0 20px 50px rgba(15,23,42,0.14);
  backdrop-filter: blur(16px);
}

.canvas-create-menu.open {
  display: block;
}

.canvas-create-menu button {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border-radius: 12px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.canvas-create-menu button:hover {
  color: #111827;
  background: #f8fafc;
}

.canvas-create-menu button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  pointer-events: none;
}

.canvas-create-menu button span {
  width: 18px;
  flex: 0 0 18px;
  text-align: center;
  color: #64748b;
}

.canvas-node-port-menu {
  width: auto;
  min-width: 136px;
}

.canvas-node-port-menu .node-port-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(58px, 1fr));
  gap: 6px;
}

.canvas-node-port-menu button {
  min-height: 54px;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 6px;
  font-size: 10px;
  line-height: 1.15;
  text-align: center;
}

.output-node-menu {
  width: 260px;
}

.menu-section-title {
  padding: 7px 10px 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.menu-divider {
  height: 1px;
  margin: 6px 0;
  background: #e8edf3;
}

.forge-canvas-run {
  width: 100%;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}

.forge-canvas-image-slot {
  min-height: 150px;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  cursor: pointer;
  overflow: hidden;
  background: #f8fafc;
}

.forge-canvas-image-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.forge-output-slot,
.forge-group-slot,
.forge-node-mini-row {
  border: 1px solid #e6ebf2;
  border-radius: 14px;
  background: #f8fafc;
}

.forge-node-mini-row {
  min-height: 28px;
  margin-bottom: 7px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: #64748b;
  font-size: 9px;
  font-weight: 900;
}

.forge-node-mini-row label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.forge-node-mini-row input,
.forge-node-mini-row select {
  min-width: 0;
  width: 54px;
  height: 22px;
  border: 1px solid #d9e0ea;
  border-radius: 6px;
  background: #ffffff;
  color: #111827;
  padding: 0 5px;
  font-size: 10px;
  outline: none;
}

.forge-node-mini-row input[data-role='aspect-ratio'] {
  width: 76px;
}

.forge-node-mini-row strong {
  color: #111827;
  font-size: 10px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forge-node-output-text {
  max-height: 56px;
  overflow: auto;
  border: 1px solid #e6ebf2;
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
  padding: 6px;
  font-size: 10px;
  line-height: 1.35;
  white-space: pre-wrap;
}

.forge-output-slot {
  min-height: 88px;
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  color: #64748b;
  font-size: 10px;
  text-align: center;
}

.forge-output-slot span,
.forge-group-slot span {
  align-self: center;
  justify-self: center;
}

.forge-output-slot img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
}

.forge-output-pending {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eef2f6;
}

.forge-output-pending span {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  border-top-color: #111827;
  animation: spin 0.8s linear infinite;
}

.forge-group-slot {
  min-height: 90px;
  padding: 10px;
  display: grid;
  place-items: center;
  gap: 6px;
  color: #64748b;
  font-size: 10px;
  text-align: center;
}

.forge-group-slot strong {
  color: #111827;
}

.forge-canvas-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  pointer-events: none;
}


.forge-canvas-empty strong {
  color: var(--text);
}

@media (max-width: 980px) {
  .canvas-browser {
    padding: 18px;
  }

  .canvas-browser-card {
    min-height: calc(100vh - 36px);
    padding: 18px;
    border-radius: 18px;
  }

  .canvas-browser-head {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .canvas-browser-actions {
    justify-content: space-between;
  }

  .canvas-browser-list {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .canvas-browser-item,
  .canvas-browser-open {
    min-height: 150px;
  }

  .canvas-floating-top {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    display: grid;
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .infinite-canvas-shell {
    display: flex;
    flex-direction: column;
    min-height: 760px;
  }

  .infinite-board {
    position: relative;
    flex: 1;
    min-height: 560px;
  }

  .forge-canvas-shell {
    grid-template-columns: 1fr;
  }

  .forge-canvas-list {
    max-height: 220px;
  }

  .forge-canvas-title-group input {
    width: min(100%, 360px);
  }

}

.panel {
  min-width: 0;
  border-radius: 16px;
  padding: 12px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}

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

.panel h4 {
  margin: 0 0 6px;
}

.dashboard-grid,
.workbench-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
}

.workbench-stage {
  display: grid;
  gap: 10px;
}

.workbench-support-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(520px, 1.18fr);
  gap: 10px;
  align-items: stretch;
}

.workbench-jobs-only {
  grid-template-columns: 1fr;
}

.workbench-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(17, 18, 20, 0.74);
}

.branch-status-panel {
  flex: 1 1 560px;
  min-width: 280px;
  max-width: 760px;
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(34,197,94,0.24);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(34,197,94,0.10), rgba(255,255,255,0.025)),
    rgba(11,14,16,0.78);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.branch-status-modal {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 18px;
}

.branch-status-modal.hidden {
  display: none;
}

.branch-status-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.56);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.branch-status-dialog {
  position: relative;
  z-index: 1;
  width: min(860px, calc(100vw - 36px));
  max-height: min(76vh, 620px);
  overflow: auto;
  flex: none;
  max-width: none;
  padding: 18px;
  border-color: rgba(255,255,255,0.12);
  background:
    radial-gradient(circle at 20% 0%, rgba(34,197,94,0.16), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02)),
    rgba(11,14,16,0.96);
  box-shadow: 0 24px 70px rgba(0,0,0,0.42);
}

.branch-status-close {
  top: 12px;
  right: 12px;
}

.branch-status-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.branch-status-head strong {
  color: #ffffff;
  font-size: 13px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.branch-status-head small {
  margin-left: auto;
  padding: 3px 7px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  color: #e5e7eb;
  font-size: 10px;
  line-height: 1;
}

.branch-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34,197,94,0.12);
}

.branch-status-dot.busy {
  background: #facc15;
  box-shadow: 0 0 0 4px rgba(250,204,21,0.14);
}

.branch-status-dot.full {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239,68,68,0.14);
}

.branch-status-panel[data-status="busy"] {
  border-color: rgba(250,204,21,0.34);
  background:
    linear-gradient(180deg, rgba(250,204,21,0.12), rgba(255,255,255,0.025)),
    rgba(18,16,9,0.78);
}

.branch-status-panel[data-status="full"] {
  border-color: rgba(239,68,68,0.36);
  background:
    linear-gradient(180deg, rgba(239,68,68,0.13), rgba(255,255,255,0.025)),
    rgba(20,10,12,0.78);
}

.branch-status-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.branch-status-metrics span {
  min-width: 0;
  padding: 5px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.055);
  color: #f8fafc;
  font-size: 11px;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.branch-status-models {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  overflow: visible;
  padding-bottom: 2px;
  overscroll-behavior-x: contain;
}

.branch-model-card {
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(34,197,94,0.22);
  border-radius: 10px;
  background: rgba(255,255,255,0.045);
}

.branch-model-card.busy {
  border-color: rgba(250,204,21,0.34);
}

.branch-model-card.full,
.branch-model-card.cooling {
  border-color: rgba(239,68,68,0.36);
}

.branch-model-card.selected {
  box-shadow: 0 0 0 2px rgba(34,197,94,0.18);
}

.branch-model-card-head {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.branch-model-card-head strong {
  min-width: 0;
  flex: 1;
  color: #ffffff;
  font-size: 11px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.branch-model-card-head small {
  color: #e5e7eb;
  font-size: 10px;
  white-space: nowrap;
}

.branch-model-card-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.branch-model-card-meta span,
.branch-model-empty {
  min-width: 0;
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.055);
  color: #f8fafc;
  font-size: 10px;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.toolbar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#quickStatsChipMirror {
  display: none;
}

.toolbar-jump-button {
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.run-stage-notice {
  min-height: 38px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.run-stage-notice.hidden {
  display: none;
}

.run-stage-notice.is-pending {
  color: var(--warning);
  border-color: rgba(232,199,129,0.3);
  background: rgba(232,199,129,0.08);
}

.run-stage-notice.is-active {
  color: var(--soft);
  border-color: rgba(143,208,183,0.24);
  background: rgba(143,208,183,0.08);
}

.run-stage-notice.is-success {
  color: var(--success);
  border-color: rgba(143,208,183,0.34);
  background: rgba(143,208,183,0.10);
}

.run-stage-notice.is-error {
  color: var(--danger);
  border-color: rgba(226,143,143,0.34);
  background: rgba(226,143,143,0.10);
}

.queue-hint-badge {
  min-height: 32px;
  display: flex;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid rgba(232,199,129,0.28);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(232,199,129,0.12), rgba(232,199,129,0.06)),
    rgba(31,24,11,0.72);
  color: var(--warning);
  font-size: 12px;
  line-height: 1.4;
}

.creation-stat-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(108px, 1fr));
  gap: 8px;
}

.creation-stat-card {
  min-height: 60px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 9, 11, 0.64);
}

.branch-status-open-button {
  position: relative;
  overflow: hidden;
  width: fit-content;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid rgba(34,197,94,0.34);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(34,197,94,0.20), rgba(34,197,94,0.10)),
    rgba(34,197,94,0.12);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 5px 12px rgba(34,197,94,0.08);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.branch-status-open-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,0.28) 50%, transparent 78%);
  transform: translateX(-130%);
  opacity: 0;
  pointer-events: none;
}

.branch-status-open-button:hover,
.branch-status-open-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(34,197,94,0.62);
  background:
    linear-gradient(180deg, rgba(34,197,94,0.28), rgba(34,197,94,0.14)),
    rgba(34,197,94,0.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 8px 18px rgba(34,197,94,0.16);
}

.branch-status-open-button:hover::after,
.branch-status-open-button:focus-visible::after {
  opacity: 1;
  animation: buttonSweep 900ms ease;
}

.creation-stat-card span {
  color: #ffffff;
  font-size: 12px;
}

.creation-stat-card strong {
  color: #ffffff;
  font-size: 18px;
  line-height: 1;
}

.creation-stat-card.image-stat strong,
.creation-stat-card.video-stat strong { color: #ffffff; }

.creation-task-status {
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.035);
  color: #ffffff;
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}

.creation-task-status.is-active {
  color: #ffffff;
  border-color: rgba(143,208,183,0.26);
  background: rgba(143,208,183,0.08);
}

.idea-composer {
  padding: 12px;
  gap: 10px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.018)),
    rgba(17, 18, 20, 0.98);
  border-color: rgba(255,255,255,0.13);
}

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

.composer-title-row h2 {
  margin: 0;
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-size: 20px;
  line-height: 1.05;
}

.idea-composer textarea {
  min-height: 196px;
  font-size: 17px;
  line-height: 1.58;
  border-radius: 14px;
  background: #0c0d0f;
  border-color: rgba(255,255,255,0.12);
  padding: 13px;
}

.composer-brief-field {
  gap: 8px;
}

.composer-brief-shell {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.02);
}

.composer-brief-shell textarea {
  border: 0;
  background: #0c0d0f;
}

.current-skill-template-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(143,208,183,0.2);
  border-radius: 12px;
  background: rgba(143,208,183,0.055);
}

.current-skill-template-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.current-skill-template-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.current-skill-template-copy strong {
  color: var(--text);
  font-size: 13px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-skill-template-copy p {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.55;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-skill-template-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.current-skill-template-actions .ghost-button,
.inline-skill-template-button {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
}

.current-skill-prompt-modal-card {
  width: min(780px, calc(100vw - 28px));
}

.modal-card.current-skill-prompt-modal-card {
  width: min(780px, calc(100vw - 28px));
}

.current-skill-prompt-modal-info textarea {
  min-height: 330px;
  resize: vertical;
}

@media (max-width: 760px) {
  .current-skill-template-bar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .current-skill-template-copy {
    display: flex;
    gap: 8px;
  }

  .current-skill-template-copy strong {
    max-width: 100%;
  }

  .current-skill-template-actions {
    justify-content: flex-start;
  }
}

.composer-ai-shortcut {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, max-content);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(143,208,183,0.16);
  border-radius: 14px;
  background:
    radial-gradient(circle at left center, rgba(143,208,183,0.12), transparent 30%),
    rgba(10, 13, 12, 0.54);
}

.composer-ai-shortcut-meta {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.composer-ai-shortcut-label {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.composer-optimize-button {
  width: 100%;
}

.composer-ai-shortcut-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.composer-ai-shortcut-copy {
  color: var(--soft);
  font-size: 12px;
  line-height: 1.55;
}

.composer-ai-shortcut-copy.is-error {
  color: var(--danger);
}

.inline-reference-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.inline-reference-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px dashed rgba(143,208,183,0.28);
  border-radius: 999px;
  background: rgba(143,208,183,0.06);
  color: var(--soft);
  cursor: pointer;
}

.inline-reference-trigger input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.inline-reference-icon {
  font-size: 14px;
  line-height: 1;
}

.inline-reference-label {
  font-size: 12px;
  font-weight: 700;
}

.inline-reference-clear {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
}

.inline-reference-toggle {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
}

.composer-inline-template-select {
  margin-left: auto;
  width: auto;
  min-width: 118px;
  max-width: 180px;
  min-height: 34px;
  padding: 7px 28px 7px 10px;
  border-radius: 999px;
}

.inline-reference-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(78px, max-content));
  gap: 8px;
  align-items: start;
}

.composer-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -2px;
}

.check-chip {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.035);
  color: var(--muted);
  font-size: 12px;
}

.check-chip.ok {
  color: var(--success);
  border-color: rgba(143,208,183,0.28);
  background: rgba(143,208,183,0.08);
}

.check-chip.warn {
  color: var(--danger);
  border-color: rgba(226,143,143,0.34);
  background: rgba(226,143,143,0.09);
}

.check-chip.todo {
  color: var(--warning);
  border-color: rgba(232,199,129,0.26);
  background: rgba(232,199,129,0.07);
}

.composer-control-groups,
.composer-control-strip,
.composer-bottom {
  display: grid;
  gap: 8px;
}

.composer-control-groups {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.28fr) minmax(0, 0.72fr);
  grid-template-areas:
    "basic detail actions";
  align-items: stretch;
  gap: 14px;
}

.composer-control-card {
  display: grid;
  min-width: 0;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.016)),
    rgba(21,23,25,0.92);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.035),
    0 12px 28px rgba(0,0,0,0.14);
}

.composer-control-card-head {
  color: #c7ccd4;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.composer-control-card-basic {
  grid-area: basic;
}

.composer-control-card-detail {
  grid-area: detail;
}

.composer-control-strip {
  min-width: 0;
  align-items: end;
}

.composer-control-strip-primary {
  grid-template-columns: minmax(126px, 0.42fr) minmax(0, 1fr);
}

.composer-control-strip-secondary {
  grid-template-columns: minmax(88px, 0.52fr) minmax(142px, 1fr) minmax(82px, 0.48fr) minmax(82px, 0.48fr);
}

.composer-action-card {
  grid-area: actions;
  align-content: start;
  align-self: stretch;
  grid-template-rows: auto 1fr;
}

.composer-action-card .composer-control-card-head {
  display: block;
}

.mode-field {
  max-width: 142px;
}

.compact-segmented {
  width: 100%;
  gap: 3px;
  padding: 3px;
  border-radius: 10px;
}

.compact-segmented .segmented-item {
  min-height: 34px;
  padding: 7px 6px;
  border-radius: 7px;
  font-size: 12px;
}

.aspect-field {
  max-width: none;
}

.quality-field {
  min-width: 0;
}

.composer-control-card select,
.composer-control-card input {
  max-width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  font-size: 14px;
  text-overflow: ellipsis;
}

.control-action-field {
  min-width: 0;
  gap: 6px;
  height: 100%;
  align-content: end;
}

.control-action-field span {
  font-size: 12px;
}

.control-action-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.control-action-buttons .ghost-button,
.control-action-buttons .primary-button {
  width: 100%;
  min-height: 54px;
  padding: 10px 12px;
  justify-content: center;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
}

.control-action-buttons .ghost-button {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.018)),
    rgba(28,31,34,0.98);
  border-color: rgba(255,255,255,0.16);
}

.control-action-buttons .primary-button {
  border-color: rgba(34,197,94,0.72);
  border-radius: 12px;
  font-size: 15px;
  background: linear-gradient(180deg, #86efac, #22c55e);
  color: #052e16;
  box-shadow: 0 10px 24px rgba(34,197,94,0.24);
  position: relative;
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.control-action-buttons .primary-button#runButton {
  isolation: isolate;
}

.control-action-buttons .primary-button#runButton.is-capacity-full,
.control-action-buttons .primary-button#runButton[aria-disabled="true"].is-capacity-full {
  border-color: rgba(148,163,184,0.38) !important;
  background: linear-gradient(180deg, #cbd5e1, #94a3b8) !important;
  color: #475569 !important;
  box-shadow: none !important;
  cursor: not-allowed;
  filter: grayscale(0.18);
}

.control-action-buttons .primary-button#runButton::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  background:
    conic-gradient(
      from 0deg,
      rgba(255,255,255,0) 0deg,
      rgba(212,255,229,0.22) 48deg,
      rgba(145,255,196,0.92) 110deg,
      rgba(255,255,255,0.12) 164deg,
      rgba(255,255,255,0) 230deg,
      rgba(145,255,196,0.88) 312deg,
      rgba(255,255,255,0) 360deg
    );
  z-index: -1;
  opacity: 0.95;
  filter: blur(0.2px);
  animation: runBorderSpin 2.8s linear infinite;
}

.control-action-buttons .primary-button:not(:disabled):hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 14px 30px rgba(79,177,125,0.24);
}

.control-action-buttons .primary-button:not(:disabled):active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 8px 18px rgba(79,177,125,0.16);
}

.control-action-buttons .primary-button.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,0.62) 46%, transparent 62%);
  transform: translateX(-120%);
  animation: buttonSweep 1.1s ease-in-out infinite;
}

.control-action-buttons .primary-button.is-generating {
  opacity: 1;
  color: #07140e;
  background: linear-gradient(180deg, #bcf4d6, #62c991);
  box-shadow: 0 14px 32px rgba(143,208,183,0.24);
}

.composer-bottom {
  grid-template-columns: 1fr;
  align-items: stretch;
  padding: 0;
  border: 0;
  background: transparent;
}

.compact-composer-bottom {
  grid-template-columns: 1fr;
  align-items: start;
  gap: 6px;
  padding: 0;
}

.composer-action-bar {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 6px;
}

.composer-hint {
  color: #c4cad2;
  font-size: 13px;
  text-align: left;
  min-width: 0;
}

.idea-composer input[type="file"] {
  min-height: 40px;
  padding: 7px;
  border-style: dashed;
  background: rgba(255,255,255,0.035);
}

.idea-composer input[type="file"]::file-selector-button {
  margin-right: 10px;
  border: 0;
  border-radius: 10px;
  padding: 7px 11px;
  background: #f3f4f6;
  color: #0b0c0e;
  font-weight: 700;
  cursor: pointer;
}

.workbench-results {
  border-radius: 20px;
}

.workbench-prompt {
  border-color: rgba(255,255,255,0.1);
  background:
    radial-gradient(circle at 100% 0%, rgba(143,208,183,0.045), transparent 28%),
    var(--surface);
}

.workbench-jobs {
  border-radius: 18px;
}

.workbench-results .panel-head {
  align-items: center;
}

.composer-panel,
.prompt-panel,
.jobs-panel,
.results-panel {
  display: grid;
  gap: 10px;
}

.workbench-prompt,
.workbench-jobs {
  height: 100%;
  align-content: start;
}

.prompt-panel,
.jobs-panel {
  gap: 8px;
}

.prompt-panel {
  position: static;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
}

.prompt-panel .trace-card {
  min-height: 0;
  height: 100%;
}

.prompt-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}

.prompt-panel-title {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.prompt-config-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.38fr);
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.032), rgba(255,255,255,0.01)),
    rgba(255,255,255,0.02);
}

.prompt-config-field {
  gap: 6px;
}

.prompt-config-field span {
  font-size: 12px;
}

.prompt-style-field .chip-row {
  gap: 6px;
  grid-auto-columns: max-content;
}

.prompt-helper-copy {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.prompt-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012)),
    rgba(255,255,255,0.025);
}

.prompt-actions .ghost-button {
  min-width: 0;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border-radius: 9px;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
}

.prompt-ai-button {
  position: relative;
  overflow: hidden;
  gap: 8px;
  border-color: rgba(143,208,183,0.58) !important;
  color: #eaf8f0 !important;
  background:
    linear-gradient(135deg, rgba(143,208,183,0.34), rgba(255,255,255,0.09)),
    rgba(13,18,15,0.96) !important;
  box-shadow: 0 14px 32px rgba(47,207,115,0.16);
  font-weight: 800;
  letter-spacing: 0.01em;
}

.prompt-ai-button::before {
  content: "AI";
  min-width: 24px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(7,20,14,0.78);
  border: 1px solid rgba(143,208,183,0.24);
  color: #a9ebc9;
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  transform-origin: center;
}

.prompt-ai-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,0.24) 50%, transparent 80%);
  transform: translateX(-130%);
  opacity: 0;
}

.prompt-ai-button:hover:not(:disabled)::after {
  opacity: 1;
  animation: buttonSweep 1.1s ease;
}

.prompt-ai-button:hover:not(:disabled) {
  border-color: rgba(143,208,183,0.82) !important;
  background:
    linear-gradient(135deg, rgba(143,208,183,0.42), rgba(255,255,255,0.12)),
    rgba(13,18,15,0.98) !important;
  box-shadow: 0 18px 38px rgba(47,207,115,0.22);
}

.prompt-ai-button.is-attention {
  animation: promptCtaPulse 1.8s ease-in-out infinite;
}

.prompt-image-to-prompt-button {
  width: 100%;
  border-color: rgba(232,199,129,0.58) !important;
  color: #fff4d8 !important;
  background:
    linear-gradient(135deg, rgba(232,199,129,0.34), rgba(255,255,255,0.08)),
    rgba(24,18,10,0.96) !important;
  box-shadow: 0 14px 32px rgba(232,199,129,0.16);
}

.prompt-image-to-prompt-button::before {
  background: rgba(24,18,10,0.82);
  border: 1px solid rgba(232,199,129,0.26);
  color: #ffd778;
  animation: aiBadgeFloat 2.6s ease-in-out infinite;
}

.prompt-image-to-prompt-button:hover:not(:disabled) {
  border-color: rgba(232,199,129,0.82) !important;
  background:
    linear-gradient(135deg, rgba(232,199,129,0.42), rgba(255,255,255,0.12)),
    rgba(24,18,10,0.98) !important;
  box-shadow: 0 18px 38px rgba(232,199,129,0.22);
}

.prompt-ai-button.is-loading {
  cursor: progress;
}

.prompt-ai-button.is-loading::before {
  animation: aiBadgeSpin 1.1s linear infinite;
}

.optimized-card-actions {
  display: grid;
  grid-template-columns: minmax(138px, 164px) minmax(0, 1fr);
  align-items: stretch;
  gap: 8px;
  margin-top: 2px;
}

.prompt-apply-action {
  min-height: 42px;
  padding-inline: 18px;
  white-space: nowrap;
}

.prompt-primary-action {
  width: auto;
  min-height: 42px;
  justify-content: center;
  border-radius: 12px;
}

.prompt-secondary-actions {
  width: 100%;
  padding: 6px;
  border-color: rgba(255,255,255,0.09);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.028), rgba(255,255,255,0.01)),
    rgba(6,7,8,0.18);
}

.optimized-card {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-content: start;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 0% 0%, rgba(143,208,183,0.12), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.018)),
    var(--surface-2);
  border-color: rgba(255,255,255,0.12);
}

.optimized-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--success), rgba(143,208,183,0));
  opacity: 0.9;
}

.optimized-card p {
  min-height: 120px;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  background: rgba(5, 6, 7, 0.32);
  color: var(--soft);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: auto;
}

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

.optimized-insight-block {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 10px 11px;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  background: rgba(5, 6, 7, 0.22);
}

.optimized-insight-label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.optimized-insight-copy {
  margin: 0;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.55;
}

.optimized-insight-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.optimized-insight-item {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(143,208,183,0.18);
  background: rgba(143,208,183,0.08);
  color: var(--soft);
  font-size: 11px;
  line-height: 1.45;
}

.optimized-insight-placeholder {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.optimized-insights-empty .optimized-insight-item {
  border-color: rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
}

.optimized-workflow-hint {
  padding: 8px 10px;
  border: 1px solid rgba(143,208,183,0.16);
  border-radius: 10px;
  background: rgba(143,208,183,0.08);
  color: var(--soft);
  font-size: 12px;
  line-height: 1.55;
}

.optimized-meta {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.optimized-meta span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.optimized-meta .pill {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  font-size: 11px;
  font-weight: 700;
}

.pill.queued,
.pill.optimizing,
.pill.submitted,
.pill.polling,
.pill.rendering,
.pill.pending {
  color: var(--warning);
}

.pill.ready {
  color: var(--success);
}

.pill.failed {
  color: var(--danger);
}

.jobs-panel .stack-list {
  min-height: clamp(210px, 27vh, 320px);
  max-height: min(34vh, 380px);
  overflow: auto;
  padding-right: 2px;
}

.active-job-spotlight {
  display: grid;
  gap: 6px;
  padding: 10px 11px;
  border: 1px solid rgba(143,208,183,0.2);
  border-radius: 14px;
  background:
    radial-gradient(circle at left center, rgba(143,208,183,0.12), transparent 28%),
    rgba(14, 18, 16, 0.72);
}

.active-job-spotlight-label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.active-job-spotlight-body {
  color: var(--soft);
  font-size: 13px;
  line-height: 1.5;
}

.jobs-panel .panel-head {
  align-items: center;
  margin-bottom: 2px;
}

.workbench-jobs {
  grid-template-rows: auto auto auto 1fr auto;
}

.jobs-panel .table-actions {
  gap: 6px;
}

.jobs-panel .table-actions .ghost-button {
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 12px;
}

.jobs-panel .compact-grid {
  grid-template-columns: minmax(0, 1fr) 148px;
  gap: 8px;
}

.jobs-panel .field {
  gap: 5px;
}

.jobs-panel .field span {
  font-size: 12px;
}

.jobs-panel input,
.jobs-panel select {
  min-height: 34px;
  padding: 7px 9px;
  border-radius: 9px;
  font-size: 12px;
}

.jobs-panel .pager-row {
  grid-template-columns: 88px minmax(0, 1fr) 88px;
  gap: 6px;
}

.jobs-panel .pager-row .ghost-button {
  min-height: 30px;
  padding: 6px 8px;
  border-radius: 9px;
  font-size: 12px;
}

.jobs-panel .page-info {
  font-size: 12px;
}

.compact-grid,
.grid-five,
.stats-grid,
.action-row,
.inline-form,
.reference-row,
.chip-row,
.results-grid,
.admin-page,
.admin-log-grid,
.model-edit-grid,
.model-meta-grid,
.row-meta,
.row-actions {
  display: grid;
  gap: 8px;
}

.compact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.action-row { grid-template-columns: 160px minmax(0, 1fr); align-items: end; }
.pager-row { grid-template-columns: 120px minmax(0, 1fr) minmax(96px, 120px) minmax(170px, 220px) 120px; align-items: center; }
.pager-control,
.pager-jump-form label {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.pager-control select,
.pager-jump-form input {
  min-width: 0;
  height: 34px;
  border-radius: 999px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(8,10,12,0.42);
  color: var(--soft);
}

.pager-control select {
  width: 72px;
}

.pager-jump-form {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.pager-jump-form input {
  width: 72px;
}

.pager-jump-form .ghost-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
}
.inline-form { grid-template-columns: minmax(220px, 1.4fr) minmax(180px, 1fr) 150px 150px; align-items: end; }
.user-create-form {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.user-create-form .primary-button {
  min-height: 42px;
}

.reference-row { grid-template-columns: 230px minmax(0, 1fr); align-items: end; }
.reference-preview-wrap { display: grid; gap: 8px; }
.compact-reference-wrap { gap: 6px; }
.chip-row { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }

.reference-upload-progress {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(143,208,183,0.18);
  background:
    linear-gradient(145deg, rgba(143,208,183,0.08), transparent 46%),
    rgba(255,255,255,0.02);
}

.reference-upload-progress-bar {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
}

.reference-upload-progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--success), #dfe7c6);
  transition: width 140ms ease;
}

.reference-upload-progress-list {
  display: grid;
  gap: 6px;
}

.reference-upload-progress-item {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
}

.reference-upload-progress-item strong {
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.reference-upload-progress-item span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.reference-upload-progress-item.is-active {
  border-color: rgba(232,199,129,0.2);
  background: rgba(232,199,129,0.06);
}

.reference-upload-progress-item.is-success {
  border-color: rgba(143,208,183,0.2);
  background: rgba(143,208,183,0.06);
}

.reference-upload-progress-item.is-error {
  border-color: rgba(226,143,143,0.24);
  background: rgba(226,143,143,0.08);
}

.chip-row::-webkit-scrollbar {
  height: 7px;
}
.results-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.model-settings-stack {
  gap: 12px;
}

.model-section {
  display: grid;
  gap: 8px;
}

.model-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.model-card {
  padding: 11px;
  display: grid;
  gap: 9px;
}

.model-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.model-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.model-title h4,
.model-card p {
  margin: 0;
}

.model-meta-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.model-edit-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.model-edit-grid .wide-field {
  grid-column: 1 / -1;
}

.model-test-status {
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 13px;
}

.model-test-status.testing {
  color: var(--warning);
  border-color: rgba(232,199,129,0.28);
  background: rgba(232,199,129,0.08);
}

.model-test-status.ok {
  color: var(--success);
  border-color: rgba(143,208,183,0.32);
  background: rgba(143,208,183,0.08);
}

.model-test-status.error {
  color: var(--danger);
  border-color: rgba(226,143,143,0.32);
  background: rgba(226,143,143,0.08);
}

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

.secret-field input {
  min-width: 0;
}

.secret-toggle-button {
  min-width: 0;
  min-height: 44px;
  padding: 0 10px;
  font-size: 12px;
}

.icon-button {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--line-strong);
  background: #17191c;
  color: var(--text);
  border-radius: 10px;
}

.inline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.inline-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--soft);
}

.table-actions,
.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.result-actions-menu {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
}

.result-actions-menu-button {
  min-width: 132px;
}

.result-actions-menu-button::after {
  content: "▾";
  margin-left: 8px;
  color: var(--muted);
  font-size: 11px;
}

.result-actions-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: grid;
  gap: 6px;
  width: 176px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(17, 18, 20, 0.98);
  box-shadow: var(--shadow);
}

.result-actions-dropdown .ghost-button {
  width: 100%;
  min-height: 38px;
  padding: 9px 11px;
  text-align: left;
}

.segmented {
  display: inline-flex;
  width: fit-content;
  gap: 4px;
  padding: 4px;
  background: #131518;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.segmented-item,
.filter-chip {
  background: transparent;
  color: var(--muted);
  padding: 9px 12px;
  border-radius: 8px;
}

.segmented-item.active,
.filter-chip.active {
  background: #2a2d32;
  color: var(--text);
}

.trace-card,
.result-card,
.table-row,
.stat-card {
  padding: 11px 12px;
}

.prompt-panel .trace-card,
.jobs-panel .trace-card {
  padding: 9px 10px;
}

.trace-card p,
.result-card p,
.table-row p {
  margin: 4px 0 0;
}

.job-feed-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 7px 6px 7px 0;
  border-bottom: 1px solid var(--line);
}

.job-feed-item:last-child {
  border-bottom: 0;
}

.job-feed-item.active-job {
  border-color: rgba(143, 208, 183, 0.56);
  background: rgba(143,208,183,0.055);
  box-shadow: inset 0 0 0 1px rgba(143,208,183,0.18);
}

.job-feed-item.is-highlighted {
  animation: jobHighlightPulse 1.1s ease-in-out 4;
}

.job-feed-item.optimizing,
.job-feed-item.submitted,
.job-feed-item.polling,
.job-feed-item.rendering {
  background: rgba(143,208,183,0.04);
}

.stack-list.has-running-jobs {
  position: relative;
  border-color: rgba(34,197,94,0.22);
  box-shadow: inset 0 1px 0 rgba(34,197,94,0.08);
}

.stack-list.has-running-jobs::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 10px;
  z-index: 3;
  display: block;
  height: 2px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, transparent, rgba(34,197,94,0.95), rgba(190,242,100,0.9), transparent);
  background-size: 220% 100%;
  animation: jobsPanelScan 1.6s linear infinite;
  box-shadow: 0 0 18px rgba(34,197,94,0.28);
}

.job-feed-item.is-generating {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  border-bottom-color: rgba(34,197,94,0.18);
  background:
    linear-gradient(180deg, rgba(34,197,94,0.07), rgba(34,197,94,0.025)),
    rgba(255,255,255,0.012);
  box-shadow:
    inset 0 0 0 1px rgba(34,197,94,0.1),
    0 8px 22px rgba(34,197,94,0.055);
  animation: jobGeneratingBreath 2.4s ease-in-out infinite;
}

.job-feed-item.is-generating::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,0.075) 45%, transparent 68%);
  transform: translateX(-120%);
  animation: jobCardSweep 2.8s ease-in-out infinite;
}

.job-feed-item.is-generating > * {
  position: relative;
  z-index: 1;
}

.job-feed-item.is-generating .job-feed-content {
  isolation: isolate;
}

.job-feed-item.is-generating .job-status-dot {
  background: #22c55e;
  box-shadow:
    0 0 0 3px rgba(34,197,94,0.16),
    0 0 16px rgba(34,197,94,0.58);
}

.job-feed-item.is-generating .job-feed-status::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 5px;
  border-radius: 999px;
  background: #22c55e;
  vertical-align: 1px;
  box-shadow: 0 0 10px rgba(34,197,94,0.72);
  animation: dotPulse 1.1s ease-in-out infinite;
}

.job-status-dot {
  width: 7px;
  height: 7px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.035);
}

.job-status-dot.queued,
.job-status-dot.optimizing,
.job-status-dot.submitted,
.job-status-dot.polling,
.job-status-dot.rendering {
  background: var(--warning);
  animation: dotPulse 1.25s ease-in-out infinite;
}

.job-status-dot.ready {
  background: var(--success);
}

.job-status-dot.failed {
  background: var(--danger);
}

.job-feed-content {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.job-feed-line {
  min-width: 0;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  color: var(--text);
  font-size: 13px;
  overflow: visible;
  white-space: normal;
}

.job-feed-status {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.job-feed-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-feed-item.queued .job-feed-status,
.job-feed-item.optimizing .job-feed-status,
.job-feed-item.submitted .job-feed-status,
.job-feed-item.polling .job-feed-status,
.job-feed-item.rendering .job-feed-status {
  color: var(--warning);
}

.job-feed-item.ready .job-feed-status {
  color: var(--success);
}

.job-feed-item.failed .job-feed-status {
  color: var(--danger);
}

.job-feed-content small {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.job-feed-error {
  color: var(--danger) !important;
  max-height: 38px;
  overflow: auto;
}

.job-progress {
  height: 5px;
  margin-top: 2px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
}

.job-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--warning), var(--success));
  transition: width 280ms ease;
}

.job-progress.is-animated span {
  background-size: 34px 34px, 100% 100%;
  background-image:
    linear-gradient(45deg, rgba(255,255,255,0.28) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.28) 50%, rgba(255,255,255,0.28) 75%, transparent 75%, transparent),
    linear-gradient(90deg, var(--warning), var(--success));
  animation: progressFlow 900ms linear infinite;
}

.job-feed-item.is-generating .job-progress {
  height: 6px;
  background: rgba(34,197,94,0.1);
  box-shadow: inset 0 0 0 1px rgba(34,197,94,0.08);
}

.job-feed-item.is-generating .job-progress span {
  background-size: 36px 36px, 100% 100%;
  background-image:
    linear-gradient(45deg, rgba(255,255,255,0.24) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.24) 50%, rgba(255,255,255,0.24) 75%, transparent 75%, transparent),
    linear-gradient(90deg, #22c55e, #bef264, #4ade80);
  box-shadow: 0 0 14px rgba(34,197,94,0.35);
}

.job-feed-item.failed .job-progress {
  background: rgba(226,143,143,0.16);
}

.job-feed-item.failed .job-progress span {
  width: 100% !important;
  background: linear-gradient(90deg, rgba(226,143,143,0.58), var(--danger));
}

.job-feed-item.ready .job-progress span {
  background: linear-gradient(90deg, var(--success), #d8f5e8);
}

.job-progress-text {
  font-size: 10.5px !important;
  line-height: 1.35;
}

.job-insight-text {
  color: rgba(240, 195, 106, 0.9) !important;
}

.job-queue-summary {
  min-height: 30px;
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  color: var(--soft);
  font-size: 12px;
}

.job-queue-summary.is-warning {
  border-color: rgba(240, 195, 106, 0.26);
  background: rgba(240, 195, 106, 0.075);
  color: #ffe1a0;
}

.job-done-toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(143,208,183,0.34);
  border-radius: 12px;
  background: rgba(17,18,20,0.94);
  color: var(--success);
  box-shadow: var(--shadow);
}

.toast-action-button {
  min-height: 32px;
  padding: 7px 10px;
  border-color: rgba(143,208,183,0.38);
  color: var(--success);
  background: rgba(143,208,183,0.08);
}

.job-feed-actions {
  margin-top: 5px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.job-feed-actions .ghost-button {
  min-height: 26px;
  padding: 5px 7px;
  border-radius: 7px;
  font-size: 11px;
}

.job-feed-actions .job-start-button {
  border-color: rgba(143, 208, 183, 0.55);
  background: rgba(143, 208, 183, 0.12);
  color: var(--success);
  font-weight: 700;
}

.jobs-panel-body {
  display: grid;
  gap: 10px;
}

.job-fixed-status-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 4px;
}

.queue-wait-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 9px 10px;
  border: 1px solid rgba(232,199,129,0.22);
  border-radius: 12px;
  background: rgba(232,199,129,0.06);
}

.queue-wait-card .job-feed-error {
  flex: 1 1 260px;
}

@media (max-width: 760px) {
  .job-feed-line {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .job-feed-status {
    justify-self: start;
  }

  .queue-wait-card .job-feed-error {
    flex-basis: 100%;
  }
}

.queue-wait-card.is-failure {
  border-color: rgba(226,143,143,0.26);
  background: rgba(226,143,143,0.07);
}

.job-failure-title {
  color: #ffe0e0;
  font-size: 12px;
  line-height: 1.3;
}

.job-failure-suggestion {
  color: var(--soft) !important;
}

.job-failure-attempts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.job-failure-attempts span {
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid rgba(226,143,143,0.22);
  border-radius: 999px;
  background: rgba(226,143,143,0.08);
  color: #ffd2d2;
  font-size: 10.5px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.result-card h4,
.table-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.result-card {
  display: grid;
  gap: 0;
  padding: 0;
  cursor: pointer;
  position: relative;
  overflow: visible;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0) 28%),
    linear-gradient(180deg, rgba(22, 24, 27, 0.98), rgba(12, 13, 15, 0.98));
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.result-card:hover,
.result-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(215, 221, 231, 0.24);
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255,255,255,0.05);
}

.result-card:focus-visible {
  outline: none;
}

.result-card.is-menu-open {
  z-index: 18;
}

.results-grid-fixed {
  align-content: start;
}

.result-group {
  display: grid;
  gap: 12px;
}

.result-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0)),
    rgba(15, 16, 19, 0.74);
  color: var(--soft);
  font-size: 13px;
}

.result-group-title {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.result-group-title strong {
  min-width: 0;
  font-size: 15px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.result-group-title span {
  color: var(--muted);
  font-size: 12px;
}

.result-group-summary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.result-group-chip {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: var(--soft);
  font-size: 12px;
}

.result-meta-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.result-meta-line span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03);
  color: var(--soft);
  font-size: 12px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-tag {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
}

.media-tag.image {
  color: #8fd0b7;
  background: rgba(143,208,183,0.14);
  border: 1px solid rgba(143,208,183,0.34);
}

.media-tag.video {
  color: #e8c781;
  background: rgba(232,199,129,0.14);
  border: 1px solid rgba(232,199,129,0.36);
}

.result-card.is-favorite {
  border-color: rgba(232, 199, 129, 0.5);
  box-shadow: inset 0 0 0 1px rgba(232, 199, 129, 0.16);
}

.result-card.is-selected {
  border-color: rgba(143, 208, 183, 0.55);
  box-shadow: inset 0 0 0 2px rgba(143, 208, 183, 0.22);
}

.result-card.is-favorite::after {
  content: none;
}

.result-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 18px 18px 0 0;
  overflow: hidden;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: linear-gradient(135deg, #202226, #373a40, #7c8187);
}

.result-skeleton-card {
  pointer-events: none;
}

.result-skeleton-card .result-thumb,
.result-skeleton-card .result-card-body span {
  position: relative;
  overflow: hidden;
}

.result-skeleton-card .result-thumb::before,
.result-skeleton-card .result-card-body span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.08), transparent);
  transform: translateX(-100%);
  animation: resultSkeletonSweep 1.15s ease-in-out infinite;
}

.result-skeleton-card .result-card-body span {
  display: block;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
}

.result-skeleton-card .result-card-body span:first-child {
  width: 64%;
  height: 16px;
}

.result-skeleton-card .result-card-body span:last-child {
  width: 82%;
}

@keyframes resultSkeletonSweep {
  100% { transform: translateX(100%); }
}

.result-thumb::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 48%;
  background: linear-gradient(180deg, transparent, rgba(6, 7, 8, 0.76));
  pointer-events: none;
  z-index: 2;
}

.result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #090909;
  transition: transform 0.35s ease;
}

.result-thumb video {
  position: relative;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.2s ease;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #090909;
  transition: opacity 0.2s ease, transform 0.35s ease;
}

.result-thumb video.is-ready {
  opacity: 1;
}

.video-cover-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 13px;
  background:
    linear-gradient(135deg, rgba(143,208,183,0.16), rgba(232,199,129,0.1)),
    #151719;
}

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

.result-thumb-play-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(8, 11, 14, 0.42);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow:
    0 10px 24px rgba(0,0,0,0.28),
    inset 0 1px 0 rgba(255,255,255,0.08);
  pointer-events: none;
  z-index: 4;
}

.result-thumb-play-triangle {
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 16px solid rgba(255,255,255,0.92);
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.28));
}

.result-thumb video.is-ready + .video-cover-fallback {
  display: none;
}

.result-card:hover .result-thumb img,
.result-card:hover .result-thumb video,
.result-card:hover .video-cover-fallback img {
  transform: scale(1.04);
}

.video-pending-thumb {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.04), rgba(143,208,183,0.08)),
    #101113;
  background-size: auto, 200% 200%;
  animation: resultPendingGlow 3s ease infinite;
}

.result-thumb-overlay {
  display: none;
}

.result-card-body {
  display: grid;
  gap: 8px;
  padding: 12px 12px 13px;
}

.result-card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.result-card-title-row h4 {
  margin: 0;
  min-width: 0;
  flex: 1 1 auto;
  display: -webkit-box;
  min-height: 38px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 15px;
  line-height: 1.34;
  letter-spacing: 0;
}

.result-select-toggle {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
}

.result-select-toggle.is-active {
  border-color: rgba(143, 208, 183, 0.45);
  background: rgba(143, 208, 183, 0.14);
  color: var(--success);
}

.result-card-more-menu {
  position: relative;
  flex: 0 0 auto;
  pointer-events: auto;
}

.result-card-more-menu-card {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 20;
}

.result-card-more-button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 999px;
  justify-content: center;
  background: rgba(12, 14, 16, 0.42);
  border-color: rgba(255,255,255,0.06);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.result-card-more-dropdown {
  position: fixed;
  top: auto;
  right: auto;
  min-width: 118px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(18, 20, 24, 0.96);
  box-shadow: 0 12px 30px rgba(0,0,0,0.24);
  z-index: 2600;
}

.result-card-more-dropdown .ghost-button {
  justify-content: flex-start;
}

.result-card-meta-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: -3px;
}

.result-card-id {
  min-width: 0;
  color: rgba(185, 191, 199, 0.56);
  font-family: "Space Mono", "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-time {
  color: rgba(185, 191, 199, 0.56);
  font-size: 11px;
  white-space: nowrap;
  padding-top: 1px;
  text-align: right;
}

.result-card-hint {
  margin: -1px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-card-storage-hint {
  margin: -2px 0 0;
  max-width: 100%;
  color: rgba(185, 191, 199, 0.72);
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-card-storage-hint.pending,
.result-card-storage-hint.syncing {
  color: rgba(251, 191, 36, 0.86);
}

.result-card-storage-hint.synced {
  color: rgba(52, 211, 153, 0.88);
}

.result-card-storage-hint.failed {
  color: rgba(248, 113, 113, 0.9);
}

.result-card-storage-hint.local {
  color: rgba(125, 211, 252, 0.86);
}

.result-id-tag {
  font-family: "Space Mono", "IBM Plex Mono", monospace;
  letter-spacing: 0.02em;
}

.preview-download-button {
  border-color: rgba(143, 208, 183, 0.5) !important;
  color: var(--success) !important;
  background: rgba(143, 208, 183, 0.12) !important;
  font-weight: 700;
}

.preview-download-button.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.primary-reuse-button {
  border-color: rgba(143, 208, 183, 0.36);
  color: var(--success);
  background: rgba(143, 208, 183, 0.08);
}

@keyframes resultPendingGlow {
  0%, 100% { background-position: 0 0, 0 0; }
  50% { background-position: 0 0, 100% 100%; }
}

@keyframes uploadSweep {
  0% { background-position: 0 0; }
  100% { background-position: 220% 0; }
}

@keyframes progressFlow {
  from { background-position: 0 0, 0 0; }
  to { background-position: 34px 0, 0 0; }
}

@keyframes buttonSweep {
  to { transform: translateX(120%); }
}

@keyframes aiBadgeFloat {
  0%, 100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 10px 22px rgba(47,207,115,0.24);
  }
  50% {
    transform: translateY(-1.5px) scale(1.045);
    box-shadow:
      0 14px 28px rgba(47,207,115,0.34),
      0 0 0 5px rgba(47,207,115,0.08);
  }
}

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

@keyframes promptCtaPulse {
  0%, 100% {
    box-shadow: 0 14px 32px rgba(47,207,115,0.16);
    filter: saturate(1);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(143,208,183,0.22), 0 20px 44px rgba(47,207,115,0.24);
    filter: saturate(1.08);
  }
}

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

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

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(232,199,129,0.12); }
  50% { box-shadow: 0 0 0 8px rgba(232,199,129,0.02); }
}

@keyframes jobHighlightPulse {
  0%, 100% {
    box-shadow: inset 0 0 0 1px rgba(143,208,183,0.18);
  }
  50% {
    box-shadow:
      inset 0 0 0 1px rgba(240,195,106,0.45),
      0 0 0 3px rgba(240,195,106,0.12);
  }
}

@keyframes jobsPanelScan {
  from { background-position: 180% 0; }
  to { background-position: -40% 0; }
}

@keyframes jobGeneratingBreath {
  0%, 100% {
    border-bottom-color: rgba(34,197,94,0.16);
    box-shadow:
      inset 0 0 0 1px rgba(34,197,94,0.1),
      0 8px 22px rgba(34,197,94,0.055);
  }
  50% {
    border-bottom-color: rgba(34,197,94,0.34);
    box-shadow:
      inset 0 0 0 1px rgba(34,197,94,0.2),
      0 12px 28px rgba(34,197,94,0.12);
  }
}

@keyframes jobCardSweep {
  0% { transform: translateX(-120%); opacity: 0; }
  24% { opacity: 1; }
  55% { transform: translateX(120%); opacity: 0; }
  100% { transform: translateX(120%); opacity: 0; }
}

@keyframes templateFlash {
  0% { outline: 0 solid rgba(143,208,183,0); background-color: transparent; }
  24% { outline: 2px solid rgba(143,208,183,0.6); background-color: rgba(143,208,183,0.08); }
  100% { outline: 0 solid rgba(143,208,183,0); background-color: transparent; }
}

.reference-preview {
  min-height: 58px;
  position: relative;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #101113;
  color: var(--muted);
  overflow-x: auto;
  overflow-y: hidden;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.reference-preview img,
.reference-preview video {
  width: 70px;
  height: 70px;
  max-height: 76px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: #050607;
  flex: 0 0 auto;
}

.reference-preview video {
  width: 108px;
}

.reference-media-item {
  position: relative;
  flex: 0 0 auto;
}

.reference-media-item img,
.reference-media-item video {
  display: block;
}

.reference-remove-button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background: rgba(8,10,12,0.78);
  color: #f3f4f6;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,0.24);
}

.reference-remove-button:hover {
  border-color: rgba(226,143,143,0.42);
  background: rgba(98,18,18,0.84);
  color: #ffd5d5;
}

.reference-preview-empty {
  display: grid;
  place-items: center;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.reference-preview.is-uploading {
  display: grid;
  place-items: center;
  color: var(--warning);
  border-color: rgba(232,199,129,0.32);
  background:
    linear-gradient(110deg, rgba(232,199,129,0.08), rgba(255,255,255,0.02), rgba(232,199,129,0.08)),
    #101113;
  background-size: 220% 100%;
  animation: uploadSweep 1.2s ease-in-out infinite;
}

.reference-preview.is-dragover {
  border-color: rgba(143,208,183,0.56);
  background:
    linear-gradient(135deg, rgba(143,208,183,0.14), rgba(255,255,255,0.03)),
    #101113;
  box-shadow: inset 0 0 0 1px rgba(143,208,183,0.16);
  transform: translateY(-1px);
}

.reference-count-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(11,12,14,0.72);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--soft);
  font-size: 11px;
}

.summary-card-block {
  display: grid;
  gap: 3px;
  padding: 2px 0;
}

.summary-card-block + .summary-card-block {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.summary-card-block h4 {
  margin: 0;
  font-size: 12px;
  color: var(--soft);
}

.summary-card-block p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
}

.preview-video-pending-state {
  display: grid;
  gap: 12px;
  max-width: 560px;
  margin: auto;
}

.preview-video-pending-state strong {
  color: var(--text);
  font-size: 16px;
}

.preview-video-pending-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.preview-video-pending-actions small {
  color: var(--muted);
}

.results-grid .empty-state,
.stats-grid .empty-state {
  grid-column: 1 / -1;
}

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

.stat-card {
  display: grid;
  gap: 8px;
  min-height: 92px;
  align-content: center;
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
}

.stat-card strong {
  margin: 0;
  font-size: 28px;
  line-height: 1;
}

.stat-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.overview-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(300px, 0.82fr);
  align-items: stretch;
  gap: 12px;
  padding: 15px 16px;
  border: 1px solid rgba(143,208,183,0.16);
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 10%, rgba(143,208,183,0.24), transparent 32%),
    radial-gradient(circle at 92% 0%, rgba(232,199,129,0.13), transparent 30%),
    linear-gradient(135deg, rgba(20,35,30,0.92), rgba(13,14,17,0.96) 56%, rgba(10,11,13,0.98));
  box-shadow: 0 16px 40px rgba(0,0,0,0.18);
}

.overview-hero::after {
  content: "";
  position: absolute;
  inset: auto -32px -72px auto;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  border: 1px solid rgba(143,208,183,0.18);
  background: rgba(143,208,183,0.06);
}

.overview-hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  gap: 8px;
  max-width: 680px;
}

.overview-hero h2 {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 34px);
  letter-spacing: -0.04em;
  line-height: 1.04;
}

.overview-lead {
  max-width: 620px;
  margin: 0;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.55;
}

.overview-pulse-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-content: start;
}

.overview-pulse-chart-card {
  min-width: 0;
  min-height: 116px;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  background:
    linear-gradient(150deg, rgba(255,255,255,0.08), rgba(255,255,255,0.018)),
    rgba(255,255,255,0.035);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.pyecharts-pulse-box {
  width: 100%;
  min-height: 116px;
}

.overview-main-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.overview-main-grid-balanced {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}

.overview-stats-panel,
.overview-model-panel,
.overview-focus-panel,
.overview-chart-panel {
  min-width: 0;
  height: 100%;
}

.overview-stats-panel {
  grid-column: 1 / -1;
}

.overview-stats-panel .stats-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.overview-chart-source {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(143,208,183,0.18);
  background: rgba(143,208,183,0.07);
  color: var(--success);
  font-size: 11px;
  font-weight: 800;
}

.overview-kpi-chart-card {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  padding: 0;
  border-radius: 13px;
  border: 1px solid rgba(255,255,255,0.09);
  background:
    radial-gradient(circle at 100% 0%, rgba(255,255,255,0.08), transparent 34%),
    linear-gradient(145deg, rgba(255,255,255,0.055), transparent 46%),
    rgba(255,255,255,0.026);
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.overview-kpi-chart-card:hover {
  transform: translateY(-1px);
  border-color: rgba(143,208,183,0.2);
  background:
    radial-gradient(circle at 100% 0%, rgba(143,208,183,0.11), transparent 34%),
    linear-gradient(145deg, rgba(255,255,255,0.065), transparent 46%),
    rgba(255,255,255,0.03);
}

.overview-kpi-chart-card::after {
  content: "";
  position: absolute;
  inset: auto 10px 10px auto;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: rgba(255,255,255,0.035);
  transform: rotate(10deg);
}

.pyecharts-kpi-box {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 132px;
}

.overview-job-chart-panel {
  grid-column: span 6;
}

.overview-job-status-chart-panel {
  grid-column: span 6;
}

.overview-department-chart-panel {
  grid-column: span 6;
}

.overview-user-top-chart-panel {
  grid-column: span 6;
}

.overview-retry-chart-panel {
  grid-column: span 6;
}

.overview-health-chart-panel {
  grid-column: span 6;
}

.overview-focus-list {
  display: grid;
  gap: 6px;
}

.overview-focus-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,0.075);
  border-radius: 12px;
  background: rgba(255,255,255,0.028);
}

.overview-focus-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 0 0 5px rgba(255,255,255,0.035);
}

.overview-focus-item strong {
  color: var(--text);
  font-size: 13px;
}

.overview-focus-item p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.42;
}

.overview-focus-item.ok .overview-focus-dot { background: var(--success); }
.overview-focus-item.active .overview-focus-dot,
.overview-focus-item.warn .overview-focus-dot { background: var(--warning); }
.overview-focus-item.danger .overview-focus-dot { background: var(--danger); }

.overview-model-panel {
  grid-column: 1 / -1;
}

.overview-focus-panel {
  grid-column: 1 / -1;
}

.overview-chart-stack {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr);
  gap: 10px;
  align-items: stretch;
}

.pyecharts-box {
  display: grid;
  place-items: stretch;
  min-width: 0;
  min-height: 286px;
  width: 100%;
  border: 1px solid rgba(255,255,255,0.075);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.045), transparent 48%),
    rgba(255,255,255,0.022);
}

.pyecharts-box .empty-state {
  align-self: center;
  justify-self: stretch;
  margin: 12px;
}

.pyecharts-box.is-fallback,
.pyecharts-kpi-box.is-fallback,
.pyecharts-pulse-box.is-fallback {
  display: grid;
  place-items: stretch;
}

.chart-fallback-card {
  min-height: inherit;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 14px;
  border-radius: inherit;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.035), transparent 52%),
    rgba(255,255,255,0.018);
}

.chart-fallback-note {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.chart-fallback-value {
  color: var(--success);
  font-size: 24px;
  line-height: 1.05;
}

.pyecharts-kpi-box .chart-fallback-value,
.pyecharts-pulse-box .chart-fallback-value {
  font-size: 22px;
}

.chart-fallback-title,
.chart-fallback-detail {
  margin: 0;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.4;
}

.chart-fallback-card small {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.3;
}

.pyecharts-box.large {
  min-height: 340px;
}

.pyecharts-box.compact {
  min-height: 340px;
}

.model-usage-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.compact-model-usage-list {
  margin-top: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.model-usage-group {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
}

.model-usage-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
}

.model-usage-group-head strong {
  color: var(--text);
  font-size: 13px;
}

.model-usage-counts {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.model-usage-counts.card-counts {
  flex: 0 0 auto;
  max-width: 46%;
}

.model-usage-card {
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.075);
  border-radius: 12px;
  background:
    linear-gradient(140deg, rgba(255,255,255,0.045), transparent 48%),
    rgba(255,255,255,0.026);
}

.model-usage-card.image {
  border-color: rgba(143,208,183,0.16);
}

.model-usage-card.video {
  border-color: rgba(232,199,129,0.16);
}

.model-usage-card.text {
  border-color: rgba(160,169,185,0.2);
}

.model-usage-title {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.model-usage-title div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.model-usage-title strong {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.model-usage-title .model-usage-subtitle {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.model-usage-meter {
  height: 8px;
  overflow: hidden;
  display: flex;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
}

.model-usage-meter span {
  min-width: 3px;
  height: 100%;
}

.model-usage-meter .ready { background: var(--success); }
.model-usage-meter .failed { background: var(--danger); }
.model-usage-meter .running { background: var(--warning); }
.model-usage-meter .queued { background: #9aa0a9; }
.model-usage-meter .paused { background: #667085; }

.model-usage-detail {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.model-usage-chip {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.model-usage-chip span {
  color: inherit;
  font-size: 10px;
  font-weight: 700;
  opacity: 0.76;
}

.model-usage-chip strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}

.model-usage-chip.total {
  border-color: rgba(215,221,231,0.14);
  background: rgba(255,255,255,0.055);
}

.model-usage-chip.active,
.model-usage-chip.ok {
  color: #9fd9ff;
  border-color: rgba(122,190,238,0.22);
  background: rgba(122,190,238,0.08);
}

.model-usage-chip.ready {
  color: var(--success);
  border-color: rgba(143,208,183,0.22);
  background: rgba(143,208,183,0.075);
}

.model-usage-chip.failed,
.model-usage-chip.danger {
  color: var(--danger);
  border-color: rgba(226,143,143,0.24);
  background: rgba(226,143,143,0.08);
}

.model-usage-chip.running,
.model-usage-chip.warning {
  color: var(--warning);
  border-color: rgba(232,199,129,0.24);
  background: rgba(232,199,129,0.08);
}

.model-usage-chip.queued,
.model-usage-chip.paused,
.model-usage-chip.neutral {
  color: var(--muted);
}

.model-edit-grid-spacer {
  display: none;
}

.admin-page {
  gap: 10px;
}

.admin-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012)),
    rgba(8, 9, 11, 0.62);
}

.admin-control-bar h3 {
  margin: 0;
}

.admin-control-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-unsaved-badge {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(232,199,129,0.34);
  background: rgba(232,199,129,0.09);
  color: var(--warning);
  font-size: 12px;
  font-weight: 700;
}

.admin-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(8, 9, 11, 0.64);
}

.admin-tab {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
}

.admin-tab.active {
  color: #0b0c0e;
  background: #f3f4f6;
}

.admin-tab-panel {
  display: none;
}

.admin-tab-panel.active {
  display: grid;
  gap: 12px;
}

#adminModelsPanel .settings-layout,
#adminSystemPanel .settings-layout {
  grid-template-columns: minmax(0, 1fr);
}

.admin-log-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.overview-log-grid .panel {
  min-width: 0;
  border-radius: 14px;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.collapsible-log-panel {
  transition: border-color 180ms ease, background 180ms ease;
}

.collapsible-log-panel.is-collapsed {
  background:
    linear-gradient(135deg, rgba(143,208,183,0.055), transparent 48%),
    rgba(17,18,20,0.7);
}

.overview-log-summary {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.overview-log-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.collapsible-log-panel.is-collapsed .refresh-log-button,
.collapsible-log-panel.is-collapsed .overview-log-body {
  display: none;
}

.overview-log-body {
  animation: fadeIn 160ms ease;
  display: grid;
  gap: 8px;
  align-content: start;
}

.overview-log-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid rgba(255,255,255,0.075);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.042), transparent 46%),
    rgba(255,255,255,0.024);
}

.overview-log-row.success {
  border-color: rgba(143,208,183,0.18);
}

.overview-log-row.danger {
  border-color: rgba(226,143,143,0.22);
}

.overview-log-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.04);
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
}

.overview-log-row.success .overview-log-icon {
  color: var(--success);
  border-color: rgba(143,208,183,0.24);
  background: rgba(143,208,183,0.08);
}

.overview-log-row.danger .overview-log-icon {
  color: var(--danger);
  border-color: rgba(226,143,143,0.24);
  background: rgba(226,143,143,0.08);
}

.overview-log-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.overview-log-title {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.overview-log-title strong {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.overview-log-main p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.overview-log-row .row-meta {
  gap: 6px;
}

.overview-log-row .row-meta span {
  font-size: 11px;
}

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

.admin-community-design-head {
  align-items: end;
}

.admin-community-design-copy {
  display: grid;
  gap: 6px;
}

.admin-community-design-copy p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  max-width: 760px;
}

.admin-community-design-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 12px;
  align-items: start;
}

.admin-community-category-form {
  grid-template-columns: minmax(120px, 0.45fr) minmax(0, 1fr) 132px;
  margin-bottom: 0;
}

.admin-community-design-note {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(143,208,183,0.16);
  background:
    linear-gradient(145deg, rgba(143,208,183,0.08), transparent 45%),
    rgba(255,255,255,0.02);
}

.admin-community-design-note strong {
  font-size: 13px;
}

.admin-community-design-note span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.admin-community-design-panel .management-summary-grid {
  margin-bottom: 0;
}

.admin-community-category-list {
  display: grid;
  gap: 12px;
}

.admin-community-category-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(140deg, rgba(255,255,255,0.045), transparent 46%),
    rgba(255,255,255,0.022);
}

.admin-community-category-main {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.admin-community-category-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-community-category-title {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.admin-community-category-title strong {
  font-size: 15px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.admin-community-category-title span {
  color: var(--muted);
  font-size: 12px;
}

.admin-community-category-actions {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.admin-risk-note {
  padding: 10px 12px;
  border: 1px solid rgba(232,199,129,0.24);
  border-radius: 12px;
  background: rgba(232,199,129,0.07);
  color: var(--warning);
  font-size: 13px;
  line-height: 1.5;
}

.admin-user-filters {
  grid-template-columns: minmax(220px, 1.4fr) minmax(130px, 0.7fr) minmax(130px, 0.7fr) 96px 112px;
  align-items: end;
  margin-bottom: 10px;
}

.user-management-table {
  min-width: 1160px;
  display: grid;
  gap: 6px;
}

.user-table-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(210px, 1.3fr) minmax(110px, 0.8fr) minmax(82px, 0.55fr) minmax(112px, 0.75fr) minmax(92px, 0.62fr) minmax(110px, 0.8fr) minmax(92px, 0.65fr) minmax(82px, 0.55fr) minmax(132px, 0.75fr);
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: 10px;
  background: rgba(255,255,255,0.025);
}

.user-table-head {
  position: sticky;
  top: 0;
  z-index: 3;
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.user-table-row > span,
.user-email-cell {
  min-width: 0;
  color: var(--soft);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.user-name-cell {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-name-cell div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.user-name-cell strong {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.user-name-cell small {
  color: var(--muted);
  font-size: 11px;
}

.user-status-cell {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.user-credit-cell {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  color: var(--success);
  font-weight: 800;
}

.user-credit-cell small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.user-row-actions {
  position: relative;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.user-more-menu {
  position: relative;
}

.user-more-dropdown {
  position: fixed;
  right: auto;
  top: auto;
  z-index: 2600;
  display: none;
  min-width: 132px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.user-more-menu.open .user-more-dropdown {
  display: grid;
  gap: 4px;
}

.user-more-dropdown button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 8px 9px;
  background: transparent;
  color: var(--soft);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.user-more-dropdown button:hover:not(:disabled) {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.user-more-dropdown button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.user-more-dropdown .danger-menu-item {
  color: var(--danger);
}

.management-toolbar {
  display: grid;
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.025);
}

.records-panel {
  display: grid;
  gap: 12px;
}

.records-panel-head {
  margin-bottom: 0;
}

.records-panel-copy {
  display: grid;
  gap: 6px;
  max-width: 760px;
}

.records-panel-copy h3 {
  margin: 0;
}

.records-panel-copy p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.skill-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(143,208,183,0.18);
  border-radius: 16px;
  background:
    radial-gradient(circle at left top, rgba(143,208,183,0.08), transparent 30%),
    rgba(17, 20, 19, 0.72);
}

.skill-summary-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  color: var(--soft);
  font-size: 13px;
  line-height: 1.6;
}

.skill-visualization {
  display: grid;
  grid-template-columns: minmax(280px, 1.35fr) minmax(220px, 0.95fr) minmax(220px, 0.95fr);
  gap: 8px;
}

.skill-visual-card {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.024);
}

.skill-visual-card h4 {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.skill-visual-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.skill-bar-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(82px, 1fr) minmax(92px, 1.1fr);
  align-items: center;
  gap: 8px;
}

.skill-bar-row span {
  color: var(--muted);
  font-size: 12px;
}

.skill-bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
}

.skill-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6ee7a8, #8fd0ff);
}

.skill-bar-row strong {
  min-width: 0;
  color: var(--soft);
  font-size: 12px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.skill-profile-chips h4,
.skill-evidence-preview h4 {
  grid-column: 1 / -1;
}

.skill-profile-chip,
.skill-evidence-item {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 9px;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  background: rgba(0,0,0,0.12);
}

.skill-profile-chip span,
.skill-evidence-item span {
  color: var(--muted);
  font-size: 11px;
}

.skill-profile-chip strong,
.skill-evidence-item strong {
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

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

.skill-trait-card {
  display: grid;
  gap: 6px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.025);
}

.skill-trait-card span {
  color: var(--muted);
  font-size: 11px;
}

.skill-trait-card strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.skill-memories-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.skill-memory-card {
  display: grid;
  gap: 6px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.022);
}

.skill-memory-card span {
  color: var(--muted);
  font-size: 11px;
}

.skill-memory-card strong {
  color: var(--soft);
  font-size: 12px;
  line-height: 1.55;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.skill-memory-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-skill-card .skill-summary-card {
  margin: 0;
}

.admin-skill-memory-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.community-panel {
  display: grid;
  gap: 12px;
}

.presentation-panel {
  display: grid;
  gap: 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98));
}

.presentation-layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.presentation-form-panel,
.presentation-slides-panel {
  display: grid;
  gap: 16px;
}

.presentation-create-entry {
  display: grid;
  gap: 12px;
}

.presentation-create-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 270px) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.presentation-create-controls {
  display: grid;
  gap: 12px;
}

.presentation-mode-section {
  display: grid;
  gap: 12px;
}

.presentation-hidden-upload {
  display: none;
}

.presentation-topic-field {
  gap: 10px;
}

.presentation-create-primary-actions {
  justify-content: flex-end;
}

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

.presentation-create-hero {
  display: grid;
  place-items: center;
  padding: 10px 0 2px;
}

.presentation-create-brand {
  font-size: clamp(52px, 8vw, 88px);
  font-weight: 900;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.9);
}

.presentation-topic-shell {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.presentation-topic-cover {
  min-height: 120px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.14);
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 217, 188, 0.9), transparent 42%),
    radial-gradient(circle at 80% 80%, rgba(198, 227, 255, 0.8), transparent 48%),
    linear-gradient(145deg, rgba(255,255,255,0.94), rgba(223,232,247,0.9));
  box-shadow: 0 18px 34px rgba(8, 10, 16, 0.18);
  display: grid;
  place-items: center;
  transform: rotate(-3deg);
}

.presentation-topic-cover span {
  font-size: 18px;
  font-weight: 700;
  color: rgba(30,34,40,0.78);
}

.presentation-brief-helper {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(226, 232, 240, 0.84);
  border-radius: 12px;
  background: rgba(248,250,252,0.66);
}

.presentation-brief-helper-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.presentation-brief-helper-head div {
  display: grid;
  gap: 2px;
}

.presentation-brief-helper-head strong {
  font-size: 13px;
  color: #0f172a;
}

.presentation-brief-helper-head span {
  font-size: 12px;
  color: #64748b;
}

.presentation-helper-tag {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.1);
  color: #0369a1 !important;
  font-weight: 700;
}

.presentation-style-browser {
  display: grid;
  gap: 8px;
}

.presentation-style-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
}

.presentation-style-tab {
  position: relative;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(203, 213, 225, 0.82);
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.presentation-style-tab::after {
  display: none;
}

.presentation-style-tab.active {
  border-color: rgba(14, 165, 233, 0.42);
  background: rgba(14, 165, 233, 0.1);
  color: #0369a1;
}

.presentation-style-tab.active::after {
  width: 56px;
}

.presentation-style-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.presentation-style-card {
  position: relative;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 70px;
  padding: 9px;
  border: 1px solid rgba(203, 213, 225, 0.76);
  border-radius: 12px;
  text-align: left;
  overflow: hidden;
  cursor: pointer;
  background: rgba(255,255,255,0.74);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.presentation-style-card:hover {
  transform: translateY(-2px);
  border-color: rgba(14, 165, 233, 0.28);
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.08);
}

.presentation-style-card.active {
  transform: translateY(-1px);
  border-color: rgba(14, 165, 233, 0.44);
  background: rgba(224, 242, 254, 0.66);
}

.presentation-style-card-kicker,
.presentation-style-card-title,
.presentation-style-card-label {
  display: block;
}

.presentation-style-card-mark {
  width: 8px;
  height: 42px;
  border-radius: 999px;
  background: #38bdf8;
}

.presentation-style-card-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.presentation-style-card-kicker {
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
}

.presentation-style-card-title {
  font-size: 13px;
  line-height: 1.25;
  font-weight: 800;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.presentation-style-card-label {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
}

.presentation-style-card-state {
  min-width: 34px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(248, 250, 252, 0.86);
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.presentation-style-card-structure {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.presentation-style-card-structure em {
  min-height: 18px;
  display: inline-flex;
  align-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(241, 245, 249, 0.9);
  color: #64748b;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.presentation-style-card.active .presentation-style-card-state {
  border-color: rgba(14, 165, 233, 0.28);
  background: rgba(14, 165, 233, 0.12);
  color: #0369a1;
}

.presentation-template-panel {
  gap: 10px;
}

.presentation-template-layouts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.presentation-template-layouts span {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(241, 245, 249, 0.9);
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}

.presentation-light-options,
.presentation-generation-modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.presentation-generation-mode {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(203, 213, 225, 0.86);
  border-radius: 12px;
  background: rgba(255,255,255,0.74);
  color: #334155;
  text-align: left;
  cursor: pointer;
}

.presentation-generation-mode strong {
  font-size: 13px;
  color: #0f172a;
}

.presentation-generation-mode span {
  font-size: 12px;
  color: #64748b;
}

.presentation-generation-mode.active {
  border-color: rgba(14, 165, 233, 0.46);
  background: rgba(14, 165, 233, 0.1);
}

.presentation-image-toggle {
  align-self: end;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid rgba(226, 232, 240, 0.86);
  border-radius: 10px;
  background: rgba(255,255,255,0.68);
}

.presentation-style-card-mist {
  --presentation-template-accent: #8b5cf6;
}

.presentation-style-card-electric {
  --presentation-template-accent: #2563eb;
}

.presentation-style-card-graphite {
  --presentation-template-accent: #475569;
}

.presentation-style-card-breeze {
  --presentation-template-accent: #0891b2;
}

.presentation-style-card-mist .presentation-style-card-mark,
.presentation-style-card-electric .presentation-style-card-mark,
.presentation-style-card-graphite .presentation-style-card-mark,
.presentation-style-card-breeze .presentation-style-card-mark {
  background: var(--presentation-template-accent);
}

.presentation-hero-copy {
  display: grid;
  gap: 6px;
}

.presentation-hero-copy p {
  max-width: 720px;
}

.presentation-hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: min(360px, 100%);
}

.presentation-metric-card {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.96);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98));
  box-shadow: none;
}

.presentation-metric-card strong {
  font-size: 24px;
  line-height: 1;
  color: #0f172a;
}

.presentation-metric-card span {
  font-size: 12px;
  color: #64748b;
}

.panel-shell {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.96);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.96));
  box-shadow:
    0 14px 34px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255,255,255,0.6);
}

.presentation-panel-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.86);
  background: rgba(255,255,255,0.94);
}

.presentation-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.presentation-section-head h4,
.presentation-editor-head h4 {
  margin: 0;
  font-size: 16px;
  color: #0f172a;
}

.presentation-section-head .eyebrow,
.presentation-editor-head .eyebrow {
  margin-bottom: 4px;
}

.presentation-section-head.presentation-section-head-simple {
  gap: 10px;
}

.presentation-section-head.presentation-section-head-simple p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.presentation-section-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(203, 213, 225, 0.96);
  background: rgba(248,250,252,0.96);
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.presentation-control-stack,
.presentation-reference-panel,
.presentation-history-panel {
  display: grid;
  gap: 12px;
}

.presentation-inline-reference-row {
  gap: 8px;
}

.presentation-inline-reference-trigger {
  min-height: 36px;
}

.presentation-inline-reference-trigger.is-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.presentation-inline-reference-trigger.is-disabled input[type="file"] {
  pointer-events: none;
}

.presentation-inline-reference-summary {
  margin-top: -2px;
}

.presentation-inline-reference-list.hidden {
  display: none;
}

.presentation-inline-reference-list.empty-state {
  min-height: 64px;
  display: grid;
  place-items: center;
}

.presentation-topic-checklist {
  display: grid;
  gap: 8px;
}

.presentation-topic-checklist-inline,
.presentation-topic-checklist-empty,
.presentation-topic-check {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  background: rgba(248,250,252,0.86);
}

.presentation-topic-checklist-inline {
  font-size: 12px;
  line-height: 1.5;
  color: #64748b;
}

.presentation-topic-checklist-inline strong {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.presentation-topic-checklist-inline span {
  font-size: 12px;
  line-height: 1.55;
}

.presentation-topic-check strong {
  font-size: 12px;
  color: #0f172a;
}

.presentation-topic-check span,
.presentation-topic-checklist-empty {
  font-size: 12px;
  line-height: 1.5;
  color: #64748b;
}

.presentation-topic-check.is-pass {
  border-color: rgba(34, 197, 94, 0.22);
  background: rgba(220, 252, 231, 0.72);
}

.presentation-topic-checklist-inline.is-pass,
.presentation-topic-check.is-pass strong {
  color: #166534;
}

.presentation-topic-check.is-warn {
  border-color: rgba(245, 158, 11, 0.25);
  background: rgba(254, 243, 199, 0.68);
}

.presentation-topic-checklist-inline.is-warn,
.presentation-topic-check.is-warn strong {
  color: #92400e;
}

.presentation-advanced-config {
  display: grid;
  gap: 12px;
  padding: 12px 14px;
  border: 1px dashed rgba(226, 232, 240, 0.92);
  border-radius: 16px;
  background: rgba(248,250,252,0.72);
}

.presentation-advanced-config summary {
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.presentation-advanced-config summary::-webkit-details-marker {
  display: none;
}

.presentation-advanced-config summary::before {
  content: "+";
  display: inline-flex;
  width: 18px;
  justify-content: center;
  margin-right: 6px;
  color: #64748b;
}

.presentation-advanced-config summary span {
  display: inline-flex;
  align-items: center;
}

.presentation-advanced-config summary small {
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.presentation-advanced-config[open] summary::before {
  content: "-";
}

.presentation-advanced-config-body {
  display: grid;
  gap: 12px;
}

.presentation-advanced-subsection {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.presentation-advanced-subsection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.presentation-advanced-subsection-head strong {
  font-size: 13px;
  color: #0f172a;
}

.presentation-advanced-subsection-head span {
  font-size: 12px;
  color: #64748b;
}

.presentation-brief-section textarea {
  min-height: 128px;
}

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

.presentation-form-grid-wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.presentation-create-controls .presentation-form-grid-wide {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.presentation-subtitle {
  margin: 0;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.presentation-inline-toggle-card {
  min-height: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(226, 232, 240, 0.82);
  border-radius: 12px;
  background: rgba(248,250,252,0.78);
}

.presentation-create-toolbar {
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 14px;
}

.presentation-mode-section,
.presentation-create-controls {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(226, 232, 240, 0.78);
  border-radius: 12px;
  background: rgba(248,250,252,0.7);
}

.presentation-reference-actions,
.presentation-primary-actions,
.presentation-secondary-actions,
.presentation-workspace-actions,
.presentation-slide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.presentation-action-section {
  gap: 12px;
}

.presentation-flow-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.presentation-flow-card {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 14px 14px 12px;
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96));
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.presentation-flow-card::after {
  content: "";
  position: absolute;
  inset: auto 14px 0;
  height: 3px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
}

.presentation-flow-index {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(241, 245, 249, 0.92);
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.presentation-flow-card strong {
  color: #0f172a;
  font-size: 15px;
  line-height: 1.25;
}

.presentation-flow-card p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.55;
}

.presentation-flow-state {
  display: inline-flex;
  width: fit-content;
  min-height: 26px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(248, 250, 252, 0.94);
  color: #475569;
  font-size: 11px;
  font-weight: 800;
}

.presentation-flow-card.is-current {
  border-color: rgba(14, 165, 233, 0.24);
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(255,255,255,1), rgba(240,249,255,0.96));
  box-shadow: 0 18px 30px rgba(14, 165, 233, 0.08);
}

.presentation-flow-card.is-current::after {
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.9), rgba(56, 189, 248, 0.55));
}

.presentation-flow-card.is-current .presentation-flow-index,
.presentation-flow-card.is-current .presentation-flow-state {
  border-color: rgba(14, 165, 233, 0.24);
  background: rgba(224, 242, 254, 0.92);
  color: #0369a1;
}

.presentation-flow-card.is-complete {
  border-color: rgba(34, 197, 94, 0.22);
  background:
    radial-gradient(circle at top left, rgba(34, 197, 94, 0.1), transparent 36%),
    linear-gradient(180deg, rgba(255,255,255,1), rgba(240,253,244,0.96));
}

.presentation-flow-card.is-complete::after {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.78), rgba(110, 231, 183, 0.54));
}

.presentation-flow-card.is-complete .presentation-flow-index,
.presentation-flow-card.is-complete .presentation-flow-state {
  border-color: rgba(34, 197, 94, 0.2);
  background: rgba(220, 252, 231, 0.9);
  color: #166534;
}

.presentation-flow-card.is-failed {
  border-color: rgba(239, 68, 68, 0.22);
  background:
    radial-gradient(circle at top left, rgba(239, 68, 68, 0.1), transparent 36%),
    linear-gradient(180deg, rgba(255,255,255,1), rgba(254,242,242,0.96));
}

.presentation-flow-card.is-failed::after {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.8), rgba(248, 113, 113, 0.5));
}

.presentation-flow-card.is-failed .presentation-flow-index,
.presentation-flow-card.is-failed .presentation-flow-state {
  border-color: rgba(239, 68, 68, 0.2);
  background: rgba(254, 226, 226, 0.9);
  color: #b91c1c;
}

.presentation-primary-actions .primary-button {
  min-width: 148px;
}

.presentation-primary-actions {
  align-items: center;
}

.presentation-primary-actions .ghost-button,
.presentation-workspace-actions .ghost-button,
.presentation-reference-actions .ghost-button {
  min-height: 36px;
}

.presentation-draft-status {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.86);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.presentation-draft-status.is-dirty {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.1);
  color: #b45309;
}

.presentation-draft-status.is-working {
  border-color: rgba(14, 165, 233, 0.32);
  background: rgba(14, 165, 233, 0.1);
  color: #0369a1;
}

#presentationView .ghost-button.is-stale {
  border-color: rgba(245, 158, 11, 0.38);
  background: rgba(245, 158, 11, 0.1);
  color: #92400e;
}

.presentation-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.presentation-summary-item {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.78);
  background: rgba(248,250,252,0.78);
}

.presentation-summary-item span {
  font-size: 11px;
  color: #64748b;
}

.presentation-summary-item strong {
  color: #0f172a;
  font-size: 13px;
  line-height: 1.35;
}

.presentation-message-card {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.84);
  background: rgba(248,250,252,0.84);
}

.presentation-generate-hint {
  margin: 2px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.84);
  background: rgba(248,250,252,0.84);
  color: #64748b;
  font-size: 12px;
  line-height: 1.55;
}

.presentation-generate-hint.is-pass {
  border-color: rgba(34, 197, 94, 0.24);
  background: rgba(220, 252, 231, 0.72);
  color: #166534;
}

.presentation-generate-hint.is-warn {
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(254, 243, 199, 0.78);
  color: #92400e;
}

.presentation-generate-hint.is-info {
  border-color: rgba(14, 165, 233, 0.24);
  background: rgba(224, 242, 254, 0.78);
  color: #0369a1;
}

.presentation-delete-button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  background:
    linear-gradient(180deg, rgba(255,255,255,1), rgba(254,242,242,0.98));
  color: #b91c1c;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 18px rgba(239, 68, 68, 0.08);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, background 140ms ease, color 140ms ease;
}

.presentation-delete-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(220, 38, 38, 0.28);
  background:
    linear-gradient(180deg, rgba(254,242,242,1), rgba(254,226,226,0.98));
  color: #991b1b;
  box-shadow: 0 14px 24px rgba(220, 38, 38, 0.12);
}

.presentation-delete-button:disabled {
  opacity: 0.56;
  box-shadow: none;
}

.presentation-history-panel {
  gap: 12px;
}

.presentation-history-filters {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(140px, 0.7fr);
  gap: 12px;
}

.presentation-reference-panel {
  gap: 12px;
}

.presentation-reference-summary {
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px dashed rgba(226, 232, 240, 0.92);
  background: rgba(248,250,252,0.72);
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.presentation-reference-summary.is-ready {
  border-style: solid;
  border-color: rgba(34, 197, 94, 0.24);
  background: rgba(220, 252, 231, 0.7);
  color: #166534;
}

.presentation-history-list {
  display: grid;
  gap: 10px;
}

.presentation-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.presentation-history-delete {
  min-width: 92px;
}

.presentation-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.presentation-editor-head p:last-child {
  margin-top: 6px;
  max-width: 620px;
}

.presentation-preview-board-panel {
  gap: 14px;
}

.presentation-preview-board-stage {
  min-height: 180px;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  background: linear-gradient(180deg, rgba(248,250,252,0.98), rgba(241,245,249,0.96));
  overflow: hidden;
}

.presentation-preview-board-stage.empty-state {
  display: grid;
  place-items: center;
  padding: 18px;
  color: #64748b;
  font-size: 13px;
  text-align: center;
}

.presentation-preview-board-image {
  display: block;
  width: 100%;
  height: auto;
}

.presentation-editor-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.presentation-slide-nav {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
}

.presentation-slide-nav-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.96);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98));
  text-align: left;
  color: #334155;
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.presentation-slide-nav-item strong {
  font-size: 18px;
  line-height: 1;
  color: #0f172a;
}

.presentation-slide-nav-item span,
.presentation-slide-nav-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.presentation-slide-nav-item small {
  color: #64748b;
}

.presentation-slide-nav-item:hover {
  transform: translateY(-1px);
  border-color: rgba(148, 163, 184, 0.45);
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.08);
}

.presentation-slide-nav-item.is-open {
  border-color: rgba(125, 211, 252, 0.7);
  background: linear-gradient(180deg, rgba(240,249,255,0.98), rgba(239,246,255,0.95));
}

.presentation-slide-nav-item.active {
  border-color: rgba(15, 23, 42, 0.18);
  background: linear-gradient(180deg, rgba(241,245,249,1), rgba(226,232,240,0.88));
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.1);
}

.presentation-history-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 15px;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.96);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98));
  color: #0f172a;
  text-align: left;
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.presentation-history-item:hover {
  border-color: rgba(148, 163, 184, 0.42);
  background: linear-gradient(180deg, rgba(255,255,255,1), rgba(248,250,252,0.98));
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
}

.presentation-history-item.active {
  border-color: rgba(15, 23, 42, 0.12);
  background:
    linear-gradient(180deg, rgba(241,245,249,1), rgba(226,232,240,0.76));
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.presentation-history-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.presentation-history-status {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(241, 245, 249, 0.9);
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.presentation-history-status.is-success {
  border-color: rgba(34, 197, 94, 0.28);
  background: rgba(220, 252, 231, 0.84);
  color: #166534;
}

.presentation-history-status.is-warning {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(254, 243, 199, 0.86);
  color: #92400e;
}

.presentation-history-status.is-danger {
  border-color: rgba(239, 68, 68, 0.32);
  background: rgba(254, 226, 226, 0.84);
  color: #991b1b;
}

.presentation-history-status.is-neutral {
  border-color: rgba(148, 163, 184, 0.32);
  background: rgba(241, 245, 249, 0.9);
  color: #475569;
}

.presentation-history-copy strong {
  color: #0f172a;
}

.presentation-history-copy small {
  color: #64748b;
}

.presentation-reference-list {
  display: grid;
  gap: 10px;
}

.presentation-reference-card {
  display: grid;
  gap: 8px;
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.84);
  background: rgba(248,250,252,0.84);
}

.presentation-reference-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #64748b;
  font-size: 12px;
}

.presentation-reference-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.presentation-reference-head strong {
  color: #0f172a;
}

.presentation-reference-delete {
  min-height: 32px;
  padding: 0 12px;
  flex: 0 0 auto;
}

.presentation-reference-preview {
  margin: 0;
  max-height: 116px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "SFMono-Regular", "Menlo", "Monaco", monospace;
  font-size: 12px;
  line-height: 1.55;
  color: #334155;
}

.presentation-pipeline-status {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.presentation-pipeline-step {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.96);
  background: linear-gradient(180deg, rgba(255,255,255,1), rgba(248,250,252,0.98));
  color: #64748b;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
}

.presentation-pipeline-step.is-active {
  border-color: rgba(15, 23, 42, 0.16);
  background: linear-gradient(180deg, rgba(241,245,249,1), rgba(226,232,240,0.9));
  color: #0f172a;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.presentation-pipeline-step.is-complete {
  border-color: rgba(203, 213, 225, 0.96);
  background: linear-gradient(180deg, rgba(248,250,252,1), rgba(241,245,249,0.96));
  color: #475569;
}

.presentation-workspace-actions {
  justify-content: flex-start;
}

.presentation-slides-list {
  display: grid;
  gap: 16px;
}

.presentation-slide-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(226, 232, 240, 0.96);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,1), rgba(248,250,252,0.98));
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

.presentation-slide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #64748b;
  font-size: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.presentation-slide-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.presentation-slide-toggle span:last-child {
  color: #475569;
  font-weight: 700;
}

.presentation-slide-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 12px;
  color: #64748b;
  font-size: 12px;
}

.presentation-slide-body {
  display: grid;
  gap: 14px;
}

.presentation-slide-design-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(248,250,252,0.9);
}

.presentation-slide-actions {
  justify-content: flex-start;
}

.presentation-slide-card.is-collapsed {
  gap: 10px;
}

.presentation-slide-card.is-expanded {
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.1);
}

.presentation-slide-card.is-collapsed .presentation-slide-body.hidden {
  display: none;
}

.presentation-slide-image {
  width: 100%;
  min-height: 220px;
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.96);
  background: linear-gradient(180deg, #eff6ff, #e2e8f0);
  display: block;
  object-fit: cover;
}

.presentation-slides-list .empty-state,
.presentation-reference-list.empty-state,
.presentation-history-list.empty-state {
  border-style: solid;
  border-color: rgba(226, 232, 240, 0.92);
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(248,250,252,0.95));
  color: #64748b;
}

@media (max-width: 1100px) {
  .presentation-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .presentation-hero-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .presentation-flow-board,
  .presentation-light-options,
  .presentation-generation-modes,
  .presentation-style-cards,
  .presentation-form-grid,
  .presentation-form-grid-wide,
  .presentation-history-filters {
    grid-template-columns: minmax(0, 1fr);
  }

  .presentation-create-controls .presentation-form-grid-wide {
    grid-template-columns: minmax(0, 1fr);
  }

  .presentation-pipeline-status,
  .presentation-slide-design-grid,
  .presentation-summary-grid,
  .presentation-slide-nav {
    grid-template-columns: minmax(0, 1fr);
  }

  .presentation-hero-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  .presentation-editor-controls {
    width: 100%;
  }

  .presentation-history-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.community-head-filter {
  width: 124px;
  flex: 0 0 auto;
}

.community-head-filter select {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.community-results-grid {
  display: block;
  column-count: 4;
  column-gap: 12px;
}

.community-results-grid.results-grid-fixed {
  align-content: normal;
}

.community-masonry-card {
  position: relative;
  display: block;
  width: 100%;
  min-height: 180px;
  margin: 0 0 12px;
  break-inside: avoid;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.05), transparent 56%),
    linear-gradient(180deg, rgba(15, 18, 22, 0.98), rgba(8, 10, 12, 0.98));
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  contain: layout paint;
}

.community-masonry-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, rgba(255,255,255,0.02), rgba(255,255,255,0.06), rgba(255,255,255,0.02)),
    rgba(255,255,255,0.015);
  background-size: 220% 100%;
  animation: communitySkeletonPulse 1.1s ease-in-out infinite;
  opacity: 0.92;
  transition: opacity 0.24s ease;
  pointer-events: none;
}

.community-masonry-card.is-media-ready::before,
.community-masonry-card:has(.community-media-fallback)::before {
  opacity: 0;
}

.community-masonry-card:hover,
.community-masonry-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,0.2);
  box-shadow: 0 18px 42px rgba(0,0,0,0.28);
  outline: none;
}

.community-masonry-card img,
.community-masonry-card video {
  width: 100%;
  height: auto;
  min-height: 180px;
  display: block;
  background: #090b0d;
  opacity: 0;
  transform: translateZ(0);
  transition: opacity 0.24s ease, transform 0.35s ease;
}

.community-masonry-card.is-media-ready img,
.community-masonry-card.is-media-ready video {
  opacity: 1;
}

.community-media-fallback {
  min-height: 220px;
  display: grid;
  place-items: center;
  padding: 18px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)),
    #0a0b0d;
}

.community-skeleton-card {
  pointer-events: none;
}

.community-skeleton-card span {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 16px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
}

.community-skeleton-card span:first-child {
  bottom: 36px;
  right: 36%;
}

@keyframes communitySkeletonPulse {
  0% { background-position: 160% 0; }
  100% { background-position: -60% 0; }
}

.community-masonry-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  background: rgba(8,10,12,0.68);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.community-masonry-badge.image {
  color: var(--success);
}

.community-masonry-badge.video {
  color: var(--warning);
}

.work-skill-library-panel {
  display: grid;
  gap: 14px;
}

.work-skill-library-head {
  align-items: end;
}

.work-skill-template-grid {
  display: block;
  column-count: 4;
  column-gap: 12px;
}

.work-skill-template-grid .empty-state {
  display: block;
  width: 100%;
  break-inside: avoid;
}

.work-skill-template-card {
  min-width: 0;
}

.public-skill-template-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto;
  width: 100%;
  margin: 0 0 12px;
  break-inside: avoid;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  background:
    radial-gradient(circle at 24% 0%, rgba(143,208,183,0.13), transparent 36%),
    linear-gradient(180deg, rgba(18, 20, 24, 0.98), rgba(9, 11, 13, 0.98));
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.public-skill-template-card:hover,
.public-skill-template-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(143,208,183,0.32);
  box-shadow: 0 18px 42px rgba(0,0,0,0.28);
  outline: none;
}

.work-skill-template-image {
  width: 100%;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.015)),
    #0a0b0d;
  overflow: hidden;
}

.public-skill-template-image {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  color: rgba(143,208,183,0.78);
  font-family: "Space Mono", "IBM Plex Mono", monospace;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.public-skill-template-image img,
.work-skill-template-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.public-skill-template-image img {
  height: 100%;
}

.public-skill-template-image.empty {
  min-height: 220px;
}

.public-skill-template-footer {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px 13px 13px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.014)),
    rgba(10, 11, 13, 0.96);
}

.public-skill-template-label {
  color: rgba(143,208,183,0.86);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
}

.public-skill-template-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.work-skill-template-body {
  display: grid;
  gap: 9px;
  padding: 14px;
}

.public-skill-template-body strong {
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.work-skill-template-badge {
  width: fit-content;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(143,208,183,0.22);
  background: rgba(143,208,183,0.1);
  color: var(--success);
  font-size: 11px;
  font-weight: 800;
}

.work-skill-template-copy,
.work-skill-template-prompt {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.58;
  overflow-wrap: anywhere;
}

.work-skill-template-prompt {
  display: block;
  color: rgba(159,169,184,0.82);
}

.admin-work-skill-panel {
  display: grid;
  gap: 14px;
}

.admin-work-skill-panel-head {
  align-items: end;
}

.admin-work-skill-list-shell {
  display: grid;
  gap: 12px;
}

.admin-work-skill-toolbar {
  grid-template-columns: minmax(260px, 1fr) auto auto;
}

.work-skill-template-admin-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.045), transparent 42%),
    var(--surface-2);
}

.work-skill-template-admin-card .work-skill-template-image {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--muted);
  font-family: "Space Mono", "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 800;
}

.work-skill-template-admin-card .work-skill-template-body {
  padding: 0;
  align-content: start;
}

.work-skill-template-admin-card .work-skill-template-body strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.work-skill-template-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-work-skill-modal-card {
  background:
    radial-gradient(circle at top left, rgba(143,208,183,0.12), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0)),
    var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 22px 64px rgba(0,0,0,0.42);
}

.admin-work-skill-modal-card {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 36px);
  grid-template-columns: minmax(0, 1fr);
  overflow: auto;
}

.admin-work-skill-modal-info {
  display: grid;
  gap: 14px;
}

.admin-work-skill-modal-head {
  align-items: center;
}

.work-skill-template-form {
  display: grid;
  gap: 12px;
}

.work-skill-template-form textarea {
  min-height: 128px;
  resize: vertical;
}

.work-skill-image-preview {
  min-height: 180px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed rgba(255,255,255,0.14);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.012)),
    rgba(255,255,255,0.02);
  color: var(--muted);
  font-size: 13px;
}

.work-skill-image-preview img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
}

.admin-work-skill-modal-actions {
  justify-content: end;
}

.work-skill-template-preview-modal {
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
  height: var(--app-viewport-height);
  padding: 0;
  place-items: stretch;
  overflow: hidden;
  background: rgba(0,0,0,0.86);
}

.work-skill-template-detail-card {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  grid-template-columns: minmax(0, 1fr);
  padding: clamp(10px, 1.2vw, 16px);
  padding:
    max(clamp(10px, 1.2vw, 16px), constant(safe-area-inset-top))
    max(clamp(10px, 1.2vw, 16px), constant(safe-area-inset-right))
    max(clamp(10px, 1.2vw, 16px), constant(safe-area-inset-bottom))
    max(clamp(10px, 1.2vw, 16px), constant(safe-area-inset-left));
  padding:
    max(clamp(10px, 1.2vw, 16px), env(safe-area-inset-top))
    max(clamp(10px, 1.2vw, 16px), env(safe-area-inset-right))
    max(clamp(10px, 1.2vw, 16px), env(safe-area-inset-bottom))
    max(clamp(10px, 1.2vw, 16px), env(safe-area-inset-left));
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.018), rgba(255,255,255,0)),
    #070809;
}

.work-skill-template-preview-layout {
  width: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(300px, 22vw, 360px);
  grid-template-rows: minmax(0, 1fr);
  gap: clamp(10px, 1.1vw, 16px);
  height: 100%;
}

.work-skill-template-preview-rail {
  position: absolute;
  left: clamp(10px, 1.2vw, 18px);
  top: 50%;
  z-index: 7;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 0;
  transform: translateY(-50%);
}

.work-skill-template-preview-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
  justify-items: stretch;
  align-items: stretch;
  overflow: hidden;
  padding: 0;
}

.work-skill-template-preview-rail .preview-rail-section {
  gap: 8px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(10, 11, 13, 0.70);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.work-skill-template-preview-rail .preview-nav-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 999px;
  font-size: 20px;
  line-height: 1;
}

.work-skill-template-detail-media {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 20%, rgba(143,208,183,0.16), transparent 40%),
    linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.012)),
    #090b0d;
  color: rgba(143,208,183,0.78);
  font-family: "Space Mono", "IBM Plex Mono", monospace;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
}

.work-skill-template-detail-media img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.work-skill-template-preview-stage .preview-nav-meta {
  justify-self: center;
  padding: 5px 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  background: rgba(10, 11, 13, 0.62);
}

.work-skill-template-detail-body {
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  display: grid;
  align-content: start;
  gap: 12px;
  overflow-y: auto;
  padding: 14px 4px 10px clamp(2px, 0.7vw, 8px);
}

.work-skill-template-detail-body h3 {
  margin: 0;
  padding-right: 36px;
  font-size: 24px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.work-skill-template-detail-block {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: rgba(255,255,255,0.035);
}

.work-skill-template-detail-block h4 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.work-skill-template-detail-block p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.records-toolbar,
.admin-job-filters {
  grid-template-columns: minmax(240px, 1.5fr) minmax(140px, 0.7fr) minmax(140px, 0.7fr) 104px;
}

.records-toolbar {
  margin-bottom: 0;
  padding: 12px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(143,208,183,0.08), transparent 50%),
    rgba(255,255,255,0.024);
}

.records-toolbar .field span {
  color: var(--muted);
  font-size: 12px;
}

.records-toolbar .ghost-button {
  align-self: stretch;
}

.admin-job-filters {
  grid-template-columns: minmax(260px, 1.5fr) repeat(4, minmax(140px, 0.72fr));
  margin-bottom: 0;
  padding: 14px;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(143,208,183,0.09), transparent 42%),
    rgba(255,255,255,0.026);
}

.admin-jobs-panel-head {
  align-items: end;
}

.admin-jobs-panel-copy {
  display: grid;
  gap: 6px;
}

.admin-jobs-panel-copy p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  max-width: 760px;
}

.admin-jobs-toolbar-shell {
  display: grid;
  gap: 12px;
}

.admin-job-search-field {
  grid-column: span 1;
}

.admin-jobs-filter-actions {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-jobs-filter-actions .ghost-button,
.admin-jobs-filter-actions .primary-button {
  min-height: 42px;
}

.admin-jobs-maintenance-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.06);
  background:
    linear-gradient(145deg, rgba(232,199,129,0.08), transparent 45%),
    rgba(255,255,255,0.02);
}

.admin-jobs-maintenance-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.admin-jobs-maintenance-copy strong {
  font-size: 13px;
}

.admin-jobs-maintenance-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.admin-jobs-maintenance-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-job-result-audit-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding: 12px;
  border: 1px solid rgba(232,199,129,0.22);
  border-radius: 14px;
  background: rgba(232,199,129,0.06);
}

.admin-job-result-audit-list strong {
  color: #f6e7b4;
  font-size: 13px;
}

.admin-job-result-audit-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.admin-job-result-audit-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-job-result-audit-button {
  justify-content: flex-start;
  text-align: left;
  min-height: 38px;
}

.admin-job-result-audit-view,
.admin-job-result-audit-copy {
  min-height: 38px;
}

.record-overview-grid,
.management-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.records-panel .record-overview-grid {
  margin-bottom: 0;
}

.management-summary-card {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(143,208,183,0.08), transparent 46%),
    rgba(255,255,255,0.026);
}

.management-summary-card span {
  color: var(--muted);
  font-size: 12px;
}

.management-summary-card strong {
  color: var(--text);
  font-size: 20px;
  line-height: 1;
}

.admin-users-pager {
  margin-top: 10px;
}

.admin-users-panel .table-list,
.admin-tasks-panel .table-list,
.admin-storage-sync-panel .table-list,
.admin-presentations-panel .table-list,
.admin-log-grid .table-list {
  max-height: 520px;
  overflow: auto;
  padding-right: 2px;
}

#recordsTable.table-list,
.admin-users-panel .table-list,
.admin-storage-sync-panel .table-list,
.admin-presentations-panel .table-list,
.admin-tasks-panel .table-list {
  gap: 12px;
}

.admin-storage-sync-panel-head {
  align-items: flex-start;
  gap: 12px;
}

.admin-storage-sync-panel-head p:last-child {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin-top: 4px;
  max-width: 680px;
}

.admin-storage-sync-filters {
  grid-template-columns: minmax(260px, 1.5fr) minmax(150px, 0.7fr) minmax(140px, 0.6fr) auto auto;
}

.admin-storage-sync-card {
  border-left: 3px solid rgba(154, 160, 169, 0.35);
}

.admin-storage-sync-card.pending,
.admin-storage-sync-card.syncing {
  border-left-color: rgba(238, 190, 111, 0.72);
}

.admin-storage-sync-card.synced {
  border-left-color: rgba(126, 207, 164, 0.76);
}

.admin-storage-sync-card.failed {
  border-left-color: rgba(214, 103, 95, 0.8);
}

.admin-storage-sync-head {
  align-items: flex-start;
}

.admin-storage-sync-info-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-storage-sync-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.admin-presentations-toolbar-shell {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-presentations-note {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(143, 208, 183, 0.16);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(143, 208, 183, 0.08), transparent 45%),
    rgba(255,255,255,0.02);
}

.admin-presentations-note strong {
  font-size: 13px;
}

.admin-presentations-note span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.admin-presentation-card.ready {
  border-color: rgba(143,208,183,0.28);
}

.admin-presentation-card.failed {
  border-color: rgba(226,143,143,0.28);
}

.admin-presentation-card.generating,
.admin-presentation-card.paused,
.admin-presentation-card.draft {
  border-color: rgba(232,199,129,0.22);
}

.admin-presentation-summary {
  margin: 0;
  color: var(--text);
  line-height: 1.6;
}

.admin-presentation-info-grid {
  margin-top: 2px;
}

.admin-presentation-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.record-gallery-card {
  min-width: 0;
  gap: 0;
  padding: 0;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0)),
    rgba(16, 17, 19, 0.98);
}

.record-gallery-card.ready {
  border-color: rgba(143,208,183,0.28);
}

.record-gallery-card.failed {
  border-color: rgba(226,143,143,0.28);
}

.record-gallery-card.paused,
.record-gallery-card.queued,
.record-gallery-card.optimizing,
.record-gallery-card.submitted,
.record-gallery-card.polling,
.record-gallery-card.rendering {
  border-color: rgba(232,199,129,0.22);
}

.record-card-thumb {
  aspect-ratio: 16 / 10;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background:
    linear-gradient(140deg, rgba(143,208,183,0.16), rgba(255,255,255,0.02)),
    #131518;
}

.record-skeleton-card {
  pointer-events: none;
}

.record-skeleton-card .record-card-thumb,
.record-skeleton-card .result-card-body span {
  position: relative;
  overflow: hidden;
}

.record-skeleton-card .record-card-thumb::after,
.record-skeleton-card .result-card-body span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.08), transparent);
  transform: translateX(-100%);
  animation: recordSkeletonSweep 1.15s ease-in-out infinite;
}

.record-skeleton-card .result-card-body span {
  display: block;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
}

.record-skeleton-card .result-card-body span:first-child {
  width: 64%;
  height: 16px;
}

.record-skeleton-card .result-card-body span:last-child {
  width: 82%;
}

@keyframes recordSkeletonSweep {
  100% { transform: translateX(100%); }
}

.record-gallery-card.video .record-card-thumb {
  background:
    linear-gradient(140deg, rgba(232,199,129,0.2), rgba(255,255,255,0.02)),
    #161515;
}

.record-gallery-card.failed .record-card-thumb {
  background:
    linear-gradient(140deg, rgba(226,143,143,0.18), rgba(255,255,255,0.02)),
    #171315;
}

.record-card-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.record-card-media img,
.record-card-media video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: saturate(1.03) contrast(1.04) brightness(0.97);
  transform: scale(1.01);
  transition: transform 0.45s ease, opacity 0.2s ease, filter 0.25s ease;
}

.record-card-media video {
  opacity: 0;
}

.record-card-media video.is-ready {
  opacity: 1;
}

.record-gallery-card:hover .record-card-media img,
.record-gallery-card:hover .record-card-media video {
  transform: scale(1.035);
  filter: saturate(1.08) contrast(1.05) brightness(1);
}

.record-card-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: end;
  gap: 8px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0) 35%),
    linear-gradient(180deg, rgba(8,10,12,0.18), rgba(8,10,12,0.84)),
    linear-gradient(140deg, rgba(143,208,183,0.18), transparent 58%);
}

.record-card-fallback strong {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
}

.record-card-fallback span {
  max-width: 228px;
  color: var(--soft);
  font-size: 11px;
  line-height: 1.4;
}

.management-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.045), transparent 42%),
    var(--surface-2);
}

.management-card.ready,
.management-card.active {
  border-color: rgba(143,208,183,0.26);
}

.management-card.failed,
.management-card.disabled {
  border-color: rgba(226,143,143,0.28);
}

.management-card-main {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.admin-skills-panel .table-list {
  display: grid;
  gap: 10px;
}

.admin-jobs-list {
  display: grid;
  gap: 12px;
}

.admin-job-top {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.admin-job-cover-thumb {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  border-bottom: 0;
}

.admin-job-cover-thumb .record-card-fallback {
  padding: 10px;
  gap: 6px;
}

.admin-job-cover-thumb .record-card-fallback strong {
  width: 34px;
  height: 34px;
  font-size: 15px;
}

.admin-job-cover-thumb .record-card-fallback span {
  max-width: none;
  font-size: 10px;
  line-height: 1.35;
}

.management-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.management-title-block {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.management-title-block strong {
  min-width: 0;
  color: var(--text);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.management-title-block span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.management-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-job-info-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-job-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: -2px 0 0;
}

.admin-job-meta-line span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03);
  color: var(--soft);
  font-size: 11px;
}

.admin-job-summary {
  margin: -1px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.admin-job-inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
}

.admin-job-inline-actions::-webkit-scrollbar {
  height: 6px;
}

.admin-job-detail-toggle {
  width: fit-content;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
}

.admin-job-detail-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.018);
}

.admin-job-detail-panel .management-info-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-job-prompt-block {
  display: grid;
  gap: 6px;
  padding: 10px 11px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(8,10,12,0.22);
}

.admin-job-prompt-block span {
  color: var(--muted);
  font-size: 11px;
}

.admin-job-prompt-block p {
  margin: 0;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

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

.management-info-item {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 8px 9px;
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: 11px;
  background: rgba(255,255,255,0.025);
}

.management-info-item span {
  color: var(--muted);
  font-size: 11px;
}

.management-info-item strong {
  min-width: 0;
  color: var(--soft);
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.admin-job-action-button {
  width: fit-content;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  flex: 0 0 auto;
}

.management-progress {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
}

.management-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--success), #dfe7c6);
  transition: width 240ms ease;
}

.management-progress.is-animated span {
  background-size: 180% 100%;
  animation: uploadSweep 1.3s ease-in-out infinite;
}

.management-error {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(226,143,143,0.22);
  border-radius: 11px;
  background: rgba(226,143,143,0.06);
  color: #ffd5d5;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.user-identity {
  min-width: 0;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.mini-avatar {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(143,208,183,0.12);
  border: 1px solid rgba(143,208,183,0.28);
  color: var(--success);
  font-size: 13px;
  font-weight: 800;
}

.user-create-form.is-collapsed {
  display: none;
}

.table-row {
  display: grid;
  gap: 8px;
}

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

.row-meta span {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.status-pill {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--soft);
  font-size: 12px;
  font-weight: 700;
}

.status-pill.success {
  color: var(--success);
  border-color: rgba(143,208,183,0.3);
  background: rgba(143,208,183,0.08);
}

.status-pill.warning {
  color: var(--warning);
  border-color: rgba(232,199,129,0.3);
  background: rgba(232,199,129,0.08);
}

.status-pill.danger {
  color: var(--danger);
  border-color: rgba(226,143,143,0.3);
  background: rgba(226,143,143,0.08);
}

.page-info {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.78);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 10;
}

#previewModal {
  place-items: start center;
  overflow-y: auto;
}

.modal-card {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
  border-radius: 18px;
  padding: 16px;
  position: relative;
}

#previewModal {
  padding: 0;
  place-items: stretch;
}

#previewModal .modal-card {
  display: block;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  height: var(--app-viewport-height);
  max-height: 100vh;
  max-height: 100dvh;
  max-height: var(--app-viewport-height);
  margin: 0;
  padding: 18px;
  padding:
    max(18px, constant(safe-area-inset-top))
    max(18px, constant(safe-area-inset-right))
    max(18px, constant(safe-area-inset-bottom))
    max(18px, constant(safe-area-inset-left));
  padding:
    max(18px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
  border-radius: 0;
  overflow: hidden;
}

.preview-modal-card {
  background:
    radial-gradient(circle at 20% 0%, rgba(143,208,183,0.12), transparent 32%),
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0)),
    var(--surface);
}

.preview-layout {
  position: relative;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 380px;
  gap: 18px;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.preview-left-rail,
.preview-right-panel,
.preview-center-stage {
  min-width: 0;
  min-height: 0;
}

.preview-left-rail {
  position: relative;
  z-index: 9;
  width: 92px;
  display: grid;
  align-content: start;
  gap: 14px;
  padding-top: 22px;
}

.preview-rail-section {
  display: grid;
  gap: 8px;
  padding: 10px 8px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(12, 13, 16, 0.94);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.preview-nav-stack {
  display: grid;
  gap: 8px;
}

.preview-nav-button {
  justify-content: center;
  min-height: 38px;
}

.preview-nav-meta {
  margin: 0;
  padding-left: 4px;
}

.preview-center-stage {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  padding-inline: clamp(8px, 2vw, 24px);
}

.preview-stage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 6px;
}

.preview-stage-header h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.preview-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  top: max(14px, constant(safe-area-inset-top));
  right: max(14px, constant(safe-area-inset-right));
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(18, 20, 24, 0.88);
  border: 1px solid rgba(255,255,255,0.08);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.22);
  z-index: 8;
}

.preview-right-panel {
  position: relative;
  width: 380px;
  display: grid;
  align-content: start;
  gap: 12px;
  overflow-y: auto;
  padding: 22px 6px 8px 0;
}

.preview-right-panel > * {
  min-width: 0;
}

.preview-right-panel h3 {
  margin: 0;
  padding-right: 36px;
  line-height: 1.3;
}

.preview-right-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.preview-meta-head {
  display: grid;
  gap: 12px;
  padding: 4px 0 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.preview-meta-owner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.preview-owner-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(143,208,183,0.12);
  border: 1px solid rgba(143,208,183,0.22);
  color: var(--success);
  font-weight: 800;
  font-size: 13px;
  flex: 0 0 auto;
}

.preview-meta-owner-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.preview-meta-owner-copy strong {
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.preview-meta-owner-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.preview-meta-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01)),
    rgba(14, 16, 18, 0.92);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.preview-head-action {
  width: 100%;
  min-height: 56px;
  padding: 10px 12px;
  border-radius: 16px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02)),
    rgba(20,22,26,0.94);
  border-color: rgba(255,255,255,0.1);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 12px 24px rgba(0,0,0,0.14);
  color: rgba(255,255,255,0.9);
}

.preview-head-action.is-active {
  color: #ff8da1;
  border-color: rgba(255,141,161,0.22);
  background:
    linear-gradient(180deg, rgba(255,141,161,0.18), rgba(255,141,161,0.04)),
    rgba(44,20,27,0.92);
}

.preview-download-icon-button {
  text-decoration: none;
  color: var(--success);
  border-color: rgba(143,208,183,0.24);
  background:
    linear-gradient(180deg, rgba(143,208,183,0.18), rgba(143,208,183,0.05)),
    rgba(15,35,29,0.92);
}

.preview-head-action-icon {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.preview-head-action.is-active .preview-head-action-icon {
  background: rgba(255,141,161,0.12);
  border-color: rgba(255,141,161,0.18);
}

.preview-download-icon-button .preview-head-action-icon {
  background: rgba(143,208,183,0.12);
  border-color: rgba(143,208,183,0.18);
}

.preview-head-action-icon svg {
  width: 16px;
  height: 16px;
}

.preview-head-action-label {
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.user-edit-modal-card {
  width: min(520px, 100%);
  grid-template-columns: 1fr;
  background: var(--surface);
}

.credit-history-modal-card {
  width: min(760px, 100%);
}

.credit-history-list {
  display: grid;
  gap: 8px;
  max-height: min(52vh, 520px);
  overflow: auto;
  padding-right: 2px;
}

.credit-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: rgba(255,255,255,0.035);
}

.credit-history-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.credit-history-main span,
.credit-history-main small,
.credit-history-balance {
  color: var(--muted);
  font-size: 12px;
}

.credit-history-title {
  color: var(--text);
}

.credit-history-amount {
  font-size: 16px;
  color: var(--text);
  white-space: nowrap;
}

.credit-history-row.is-recharge .credit-history-amount {
  color: var(--accent);
}

.credit-history-row.is-consume .credit-history-amount {
  color: #f2a6a6;
}

.credit-history-balance {
  white-space: nowrap;
}

.credit-history-pager {
  margin-top: 4px;
}

.account-apply-modal {
  z-index: 40;
}

.account-apply-card {
  width: min(420px, calc(100vw - 32px));
  grid-template-columns: 1fr;
  background:
    radial-gradient(circle at 16% 0%, rgba(143,208,183,0.18), transparent 34%),
    var(--surface);
}

.account-apply-form {
  display: grid;
  gap: 12px;
}

.account-apply-form .field {
  width: 100%;
}

.account-apply-form .field span {
  display: block;
  margin-bottom: 6px;
  color: rgba(226, 232, 240, 0.82);
  font-size: 12px;
}

.account-apply-form input {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  padding: 11px 13px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(10,12,14,0.82);
  color: var(--text);
}

.account-apply-form input::placeholder {
  color: rgba(154, 160, 169, 0.84);
}

.account-apply-form .primary-button {
  margin-top: 4px;
}

.user-edit-modal-info {
  min-width: 0;
  padding-top: 24px;
}

.profile-modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-stage-wrap {
  min-width: 0;
  min-height: 0;
  display: grid;
  gap: 8px;
  position: relative;
  justify-items: center;
  width: 100%;
  max-width: min(100%, 980px);
  margin: 0 auto;
}

.modal-stage-toolbar {
  display: grid;
  gap: 6px;
}

.preview-tool-button {
  width: 100%;
  min-width: 0;
  min-height: 84px;
  padding: 12px 8px;
  border-radius: 18px;
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 10px;
  background:
    radial-gradient(circle at 50% 0%, rgba(143,208,183,0.14), transparent 64%),
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.01)),
    rgba(10,12,14,0.82);
  border-color: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.92);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 14px 28px rgba(0,0,0,0.16);
}

.preview-tool-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(143,208,183,0.18), transparent 72%),
    linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.03)),
    rgba(18,20,24,0.94);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.96);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 10px 22px rgba(0,0,0,0.2);
}

.preview-tool-icon svg {
  width: 20px;
  height: 20px;
}

.preview-tool-text {
  display: block;
  min-width: 0;
  max-width: 100%;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.preview-tool-button-nowrap .preview-tool-text {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
}

.preview-tool-button.is-active {
  border-color: rgba(143, 208, 183, 0.22);
  background: rgba(143, 208, 183, 0.08);
  color: var(--success);
}

.preview-tool-button.is-active .preview-tool-icon {
  border-color: rgba(143, 208, 183, 0.28);
  background:
    linear-gradient(180deg, rgba(143,208,183,0.22), rgba(143,208,183,0.08)),
    rgba(15,35,29,0.92);
  color: var(--success);
}

.modal-stage {
  width: 100%;
  min-height: 100%;
  max-height: calc(100vh - 150px);
  max-height: calc(100dvh - 150px);
  max-height: calc(var(--app-viewport-height) - 150px);
  background: #111214;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  display: grid;
  place-items: center;
  touch-action: none;
  cursor: default;
}

.modal-stage.is-image-preview {
  align-content: start;
  justify-items: center;
  place-items: start center;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y pan-x pinch-zoom;
  padding: 18px;
  scroll-padding: 18px;
}

.modal-stage.is-video-preview {
  overflow: hidden;
  place-items: center;
  padding: 0;
}

.modal-stage.is-pannable {
  cursor: grab;
}

.modal-stage.is-loading::after {
  content: attr(data-loading-label);
  position: absolute;
  inset: auto 16px 16px 16px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(9, 12, 15, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  pointer-events: none;
  z-index: 6;
}

.preview-load-state {
  width: min(420px, calc(100% - 32px));
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 22px;
  border-radius: 16px;
  background: rgba(11, 13, 16, 0.86);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.9);
  text-align: center;
  box-shadow: 0 20px 44px rgba(0,0,0,0.22);
}

.preview-load-state strong {
  font-size: 15px;
  line-height: 1.35;
}

.preview-load-state span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.preview-load-state-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

#previewModal .modal-stage.is-image-preview img.is-loading {
  opacity: 0;
}

#previewModal .modal-stage.is-image-preview img {
  transition: opacity 160ms ease;
}

.preview-edit-placeholder {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  gap: 10px;
  background: rgba(8, 10, 12, 0.34);
  color: rgba(255, 255, 255, 0.94);
  pointer-events: auto;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.preview-edit-placeholder-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(360px, calc(100% - 32px));
  padding: 16px;
  border-radius: 8px;
  background: rgba(10, 14, 18, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.preview-edit-placeholder strong {
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
}

.preview-edit-task-id {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.preview-edit-stage-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}

.preview-edit-stage-list span {
  min-width: 0;
  padding: 6px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.preview-edit-stage-list span.is-done {
  background: rgba(143, 208, 183, 0.13);
  color: rgba(204, 245, 227, 0.86);
}

.preview-edit-stage-list span.is-active {
  background: rgba(240, 195, 106, 0.18);
  color: #ffe6a8;
  box-shadow: inset 0 0 0 1px rgba(240, 195, 106, 0.25);
}

.preview-edit-placeholder-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.22);
  border-top-color: rgba(143, 208, 183, 0.95);
  animation: preview-edit-spin 900ms linear infinite;
}

.preview-edit-progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.preview-edit-progress span {
  display: block;
  height: 100%;
  min-width: 8px;
  border-radius: inherit;
  background: linear-gradient(90deg, #8fd0b7, #f0c36a);
  transition: width 240ms ease;
}

.preview-edit-placeholder small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.preview-edit-background-note {
  color: #ffe1a0 !important;
  text-align: center;
}

.preview-edit-background-button {
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  pointer-events: auto;
}

.preview-edit-background-button.primary-button {
  border-color: rgba(143, 208, 183, 0.34);
  background: linear-gradient(180deg, #a9ebc9, #4fb17d);
  color: #07140e;
  font-weight: 800;
}

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

.preview-stage-nav {
  position: absolute;
  top: 50%;
  right: 12px;
  z-index: 7;
  display: grid;
  gap: 10px;
  transform: translateY(-50%);
}

.preview-nav-float {
  width: 40px;
  height: 72px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.preview-nav-float:hover,
.preview-nav-float:focus-visible {
  background: rgba(18, 20, 24, 0.48);
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.preview-nav-float:disabled {
  opacity: 0.38;
}

.preview-nav-float-up,
.preview-nav-float-down {
  font-size: 22px;
  line-height: 1;
}

.modal-stage img,
.modal-stage video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #090909;
  touch-action: none;
  user-select: none;
  will-change: transform;
}

.modal-stage.is-image-preview > img:not(.preview-comparison-image),
.modal-stage.is-image-preview > .preview-scroll-image:not(.preview-comparison-image) {
  display: block;
  width: min(100%, var(--preview-image-natural-width, 100%));
  max-width: 100%;
  max-height: none;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
}

.preview-comparison-stack {
  position: relative;
  display: block;
  width: min(100%, var(--preview-image-natural-width, 100%));
  max-width: 100%;
  min-height: 1px;
  margin: 0 auto;
}

.preview-comparison-stack > .preview-comparison-image {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: none;
  height: auto;
  object-fit: contain;
  margin: 0;
}

.modal-stage.is-video-preview video {
  max-width: 100%;
  max-height: 100%;
}

.preview-comparison-image {
  position: absolute;
  inset: 0 auto auto 0;
  margin: 0;
  opacity: 0;
  transition: opacity 140ms ease;
  z-index: 1;
}

.preview-comparison-image.is-edited {
  position: relative;
  opacity: 1;
  z-index: 1;
}

.preview-comparison-image.is-source {
  z-index: 2;
  pointer-events: none;
}

.preview-comparison-image.is-source.is-visible {
  opacity: 1;
}

.preview-comparison-image.is-edited.is-muted {
  opacity: 0.28;
}

.preview-mask-canvas {
  border: 1px dashed rgba(143, 208, 183, 0.45);
  background: transparent;
  cursor: crosshair;
  z-index: 3;
}

.preview-local-edit-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(143, 208, 183, 0.16);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(143, 208, 183, 0.08), rgba(255,255,255,0.03)),
    rgba(255,255,255,0.02);
}

.preview-local-edit-panel-head {
  display: grid;
  gap: 4px;
}

.preview-local-edit-panel-head strong {
  font-size: 13px;
}

.preview-local-edit-panel-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.preview-local-edit-tools {
  display: grid;
  gap: 10px;
}

.preview-local-edit-mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.preview-local-edit-brush-field {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.preview-local-edit-brush-field input[type="range"] {
  width: 100%;
}

.preview-local-edit-input-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: center;
}

.preview-local-edit-mode-select,
.preview-local-edit-panel input,
.preview-local-edit-panel textarea {
  border: 0;
  background: transparent;
  color: var(--text);
}

.preview-local-edit-mode-select {
  min-height: 42px;
  padding: 0 6px;
  font-size: 14px;
  font-weight: 600;
}

.preview-local-edit-panel input,
.preview-local-edit-panel textarea {
  min-width: 0;
  min-height: 42px;
  font-size: 14px;
  outline: none;
}

.preview-local-edit-panel textarea {
  min-height: 112px;
  padding: 12px;
  resize: vertical;
  line-height: 1.55;
  background: #050607;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #f5f7f8;
}

.preview-local-edit-panel input::placeholder,
.preview-local-edit-panel textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.preview-local-edit-panel input.hidden,
.preview-local-edit-panel textarea.hidden {
  display: none;
}

.preview-local-edit-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.preview-local-edit-message {
  margin: 8px 2px 0;
  min-height: 18px;
  color: rgba(32, 36, 43, 0.6);
  font-size: 12px;
  line-height: 1.45;
}

.preview-local-edit-message.is-error {
  color: #d95c5c;
}

.preview-local-edit-message.is-warn {
  color: #b88416;
}

.preview-local-edit-message.is-success {
  color: #248f5a;
}

.preview-local-edit-debug {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(143, 208, 183, 0.14);
  border-radius: 14px;
  background: rgba(12, 18, 17, 0.22);
}

.preview-local-edit-debug-head {
  display: grid;
  gap: 4px;
}

.preview-local-edit-debug-head strong {
  font-size: 12px;
}

.preview-local-edit-debug-head span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.preview-local-edit-debug-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.preview-local-edit-debug-card {
  display: grid;
  gap: 6px;
  text-decoration: none;
  color: var(--text);
}

.preview-local-edit-debug-card span {
  color: var(--muted);
  font-size: 11px;
}

.preview-local-edit-debug-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}

.preview-local-edit-submit {
  width: 100%;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  justify-content: center;
  background: rgba(143, 208, 183, 0.12);
  border-color: rgba(143, 208, 183, 0.22);
  color: var(--success);
}

.preview-edit-action {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
}

.preview-edit-action.is-active {
  border-color: rgba(143, 208, 183, 0.42);
  background: rgba(143, 208, 183, 0.12);
  color: var(--success);
}

@media (max-width: 720px) {
  .preview-local-edit-debug-grid {
    grid-template-columns: 1fr;
  }
}

.preview-image-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 10px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.preview-zoom-value {
  min-width: 58px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(8, 10, 12, 0.42);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.78);
  font-family: "Space Mono", "IBM Plex Mono", monospace;
  font-size: 11px;
  line-height: 1;
  user-select: none;
}

.preview-text-button {
  min-width: 0;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)),
    rgba(18, 20, 24, 0.9);
  border-color: rgba(255,255,255,0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.preview-text-button:hover,
.preview-text-button:focus-visible {
  border-color: rgba(143, 208, 183, 0.38);
  background:
    linear-gradient(180deg, rgba(143,208,183,0.12), rgba(255,255,255,0.03)),
    rgba(18, 20, 24, 0.96);
}

.modal-info {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
}

.modal-info h3 {
  margin: 0;
  padding-right: 36px;
  line-height: 1.3;
}

.compact-inline-button {
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
}

.modal-info p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

#previewMeta {
  max-height: 340px;
  overflow: auto;
}

.preview-meta-grid {
  display: grid;
  gap: 8px;
}

.preview-meta-more {
  display: grid;
  gap: 8px;
}

.preview-meta-more-toggle {
  justify-self: start;
  min-height: 32px;
  padding: 0 12px;
}

.preview-meta-more-body {
  display: grid;
  gap: 8px;
}

.preview-meta-item {
  display: grid;
  gap: 4px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012)),
    rgba(255,255,255,0.025);
}

.preview-meta-item span,
.preview-prompt-card span {
  color: var(--muted);
  font-size: 12px;
}

.preview-meta-item strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.48;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.preview-meta-item strong.is-block-value {
  font-weight: 500;
}

.preview-meta-expandable {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.preview-meta-expandable-summary {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.48;
  overflow-wrap: anywhere;
}

.preview-meta-expand-toggle {
  min-height: 30px;
  padding: 0 12px;
}

.preview-meta-json {
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.028), rgba(255,255,255,0.01)),
    rgba(10, 14, 18, 0.46);
  border: 1px solid rgba(255,255,255,0.08);
  color: #d9e2ec;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

.preview-prompt-card {
  display: grid;
  gap: 7px;
  padding: 11px;
  border: 1px solid rgba(143,208,183,0.22);
  border-radius: 12px;
  background: rgba(143,208,183,0.055);
}

#previewPrompt {
  max-height: 180px;
  overflow: auto;
  color: var(--soft);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  background: #18191c;
  color: var(--text);
}

.drawer-shell {
  position: fixed;
  inset: 0;
  z-index: 24;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 560px);
}

.drawer-backdrop {
  background: rgba(0,0,0,0.68);
}

.drawer-panel {
  position: relative;
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  height: var(--app-viewport-height);
  padding: 18px 18px 18px 0;
  padding:
    max(18px, constant(safe-area-inset-top))
    max(18px, constant(safe-area-inset-right))
    max(18px, constant(safe-area-inset-bottom))
    0;
  padding:
    max(18px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom))
    0;
}

.drawer-body {
  height: 100%;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 22px 18px 18px;
  border-left: 1px solid rgba(255,255,255,0.08);
  background:
    radial-gradient(circle at left top, rgba(143,208,183,0.12), transparent 24%),
    rgba(17, 20, 19, 0.98);
  box-shadow: -16px 0 42px rgba(0,0,0,0.26);
}

.drawer-section-head {
  margin-bottom: 8px;
}

.admin-skill-drawer-panel .modal-close {
  right: 28px;
  top: 18px;
}

.admin-skill-drawer-head {
  padding-right: 44px;
}

body.drawer-open {
  overflow: hidden;
}

.drawer-facet-group {
  display: grid;
  gap: 8px;
}

.drawer-facets-stack {
  display: grid;
  gap: 12px;
}

.drawer-evidence-stack {
  display: grid;
  gap: 12px;
}

.drawer-facet-group h4 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

.drawer-evidence-group {
  display: grid;
  gap: 8px;
}

.drawer-evidence-group h4 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

.drawer-evidence-card {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
}

.drawer-evidence-card strong {
  color: var(--soft);
  font-size: 13px;
  line-height: 1.5;
}

.drawer-evidence-chip {
  cursor: pointer;
}

.skill-import-warning {
  padding: 10px 11px;
  border: 1px solid rgba(232,199,129,0.28);
  border-radius: 12px;
  background: rgba(232,199,129,0.08);
  color: var(--warning);
  font-size: 12px;
  line-height: 1.55;
}

.admin-skill-memory-card {
  align-content: start;
}

.admin-skill-memory-card.is-expanded strong {
  display: block;
}

.admin-skill-memory-copy {
  white-space: pre-wrap;
}

.video-only.hidden-by-mode,
.image-only.hidden-by-mode { display: none; }

@media (max-width: 1500px) {
  .community-results-grid,
  .work-skill-template-grid {
    column-count: 3;
  }
}

@media (max-width: 1320px) {
  .community-results-grid,
  .work-skill-template-grid {
    column-count: 2;
  }

  .workbench-support-grid {
    grid-template-columns: 1fr;
  }

  .workbench-assist-stack {
    grid-template-rows: auto auto;
    height: auto;
  }

  .prompt-panel {
    grid-template-rows: auto auto auto;
  }

  .prompt-panel .trace-card,
  .optimized-card {
    height: auto;
  }

  .optimized-card p {
    min-height: 76px;
  }

  .optimized-insights {
    grid-template-columns: 1fr;
  }

  .composer-control-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .composer-control-groups {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.6fr);
    grid-template-areas:
      "basic actions"
      "detail actions";
  }

  .composer-control-strip-primary,
  .composer-control-strip-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .control-action-buttons {
    grid-template-columns: 1fr;
  }

  .composer-bottom {
    grid-template-columns: 1fr;
  }

  .composer-ai-shortcut {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .composer-ai-shortcut-actions {
    grid-template-columns: 1fr;
  }

  .prompt-config-strip {
    grid-template-columns: 1fr;
  }

  .composer-action-bar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .settings-layout,
  .admin-log-grid,
  .overview-hero,
  .overview-main-grid,
  .admin-control-bar {
    grid-template-columns: 1fr;
  }

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

  .overview-stats-panel,
  .overview-job-chart-panel,
  .overview-job-status-chart-panel,
  .overview-retry-chart-panel,
  .overview-health-chart-panel,
  .overview-focus-panel {
    grid-column: 1 / -1;
  }

  .overview-stats-panel .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .overview-chart-stack {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1080px) {
  .login-card {
    grid-template-columns: 340px 300px;
    gap: 22px;
    padding: 18px 14px;
  }

  .login-showcase {
    width: 340px;
    min-width: 340px;
    margin-left: 0;
  }

  .composer-control-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .composer-control-groups {
    grid-template-columns: 1fr;
    grid-template-areas:
      "basic"
      "detail"
      "actions";
  }

  .composer-control-strip-primary,
  .composer-control-strip-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .login-copyright {
    grid-column: 1 / -1;
  }

  .login-showcase {
    order: 1;
    justify-items: start;
  }

  .login-panel {
    order: 2;
    max-width: 300px;
    align-self: stretch;
    min-height: 430px;
    padding: 16px 16px 18px;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 20px;
  }

  .login-community-hero {
    width: 340px;
    max-width: 340px;
    height: 430px;
    min-height: 430px;
    padding: 10px;
    border-radius: 18px;
  }

  .login-community-hero-media {
    padding: 18px;
  }

  .login-copy {
    gap: 10px;
    padding-bottom: 8px;
  }

  .login-brand {
    gap: 8px;
  }

  .login-brand .brand-mark {
    width: min(164px, 30vw);
  }

  .login-brand .brand-title {
    font-size: clamp(22px, 2.8vw, 30px);
  }

  .login-copy h1 {
    font-size: clamp(20px, 2.6vw, 28px);
  }

  .login-mode-hint {
    min-height: 0;
  }
}

@media (max-width: 1080px) {
  .app-shell {
    padding-top: 48px;
  }

  .app-layout {
    grid-template-columns: 1fr;
  }

  .mobile-menu-button {
    position: fixed;
    top: 10px;
    left: 12px;
    top: max(10px, constant(safe-area-inset-top));
    left: max(12px, constant(safe-area-inset-left));
    top: max(10px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
    z-index: 31;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: rgba(17,18,20,0.96);
    color: var(--text);
    box-shadow: var(--shadow);
  }

  .mobile-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 28;
    display: block;
    background: rgba(0,0,0,0.58);
  }

  .sidebar {
    position: fixed;
    top: 66px;
    left: 12px;
    bottom: 12px;
    top: calc(max(10px, constant(safe-area-inset-top)) + 56px);
    left: max(12px, constant(safe-area-inset-left));
    bottom: max(12px, constant(safe-area-inset-bottom));
    top: calc(max(10px, env(safe-area-inset-top)) + 56px);
    left: max(12px, env(safe-area-inset-left));
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 30;
    width: min(284px, calc(100vw - 24px));
    overflow: auto;
    transform: translateX(calc(-100% - 18px));
    transition: transform 0.2s ease;
  }

  .app-shell.mobile-menu-open .sidebar {
    transform: translateX(0);
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px 12px 12px 58px;
  }

  .topbar-main,
  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .topbar-tabs {
    gap: 12px;
    justify-self: stretch;
    justify-content: flex-start;
  }

  .topbar-spacer {
    display: none;
  }

  .topbar-brand {
    justify-content: flex-start;
  }

  .topbar-brand .brand-mark {
    width: min(132px, 38vw);
    height: auto;
  }

  .topbar-brand .brand-mark img {
    width: 100%;
  }

  .topbar-brand .brand-title {
    font-size: 24px;
  }

  .workbench-toolbar,
  .composer-title-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .workbench-support-grid {
    grid-template-columns: 1fr;
  }

  .toolbar-status {
    justify-content: flex-start;
  }

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

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

  .model-usage-list {
    grid-template-columns: 1fr;
  }

  .compact-grid,
  .inline-form,
  .admin-user-filters,
  .management-toolbar,
  .records-toolbar,
  .community-toolbar,
  .admin-job-filters,
  .reference-row,
  .prompt-config-strip,
  .composer-control-strip,
  .model-meta-grid,
  .model-edit-grid,
  .row-meta,
  .management-card,
  .management-info-grid {
    grid-template-columns: 1fr;
  }

  .admin-jobs-maintenance-bar,
  .admin-jobs-filter-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .overview-main-grid-balanced,
  .admin-community-design-layout,
  .admin-community-category-form,
  .admin-community-category-card {
    grid-template-columns: 1fr;
  }

  .overview-stats-panel,
  .overview-job-chart-panel,
  .overview-job-status-chart-panel,
  .overview-retry-chart-panel,
  .overview-health-chart-panel,
  .overview-focus-panel,
  .overview-model-panel {
    grid-column: 1;
  }

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

  .admin-community-category-actions {
    justify-content: flex-start;
  }

  .admin-job-detail-panel .management-info-grid {
    grid-template-columns: 1fr;
  }

  .action-row {
    grid-template-columns: 1fr 1fr;
  }

  .control-action-buttons {
    grid-template-columns: 1fr;
  }

  .pager-row {
    grid-template-columns: 1fr;
  }

  .result-group-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .result-group-summary {
    justify-content: flex-start;
  }

  .composer-checklist {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .prompt-panel {
    position: static;
  }

  .jobs-panel .stack-list {
    min-height: 280px;
    max-height: 420px;
  }
}

@media (max-width: 720px) {
  .login-screen::before {
    inset: -10%;
    opacity: 0.72;
    filter: blur(20px);
  }

  .login-screen::after {
    background:
      radial-gradient(circle at center, transparent 0 26%, rgba(3,5,7,0.18) 68%, rgba(3,5,7,0.42) 100%),
      linear-gradient(180deg, rgba(1,2,3,0.04), rgba(1,2,3,0.24));
  }

  .drawer-shell {
    grid-template-columns: 1fr;
  }

  .drawer-backdrop {
    display: none;
  }

  .drawer-panel {
    padding: 0;
  }

  .drawer-body {
    border-left: 0;
    padding: 18px 14px 16px;
  }

  .community-results-grid,
  .work-skill-template-grid {
    column-count: 1;
  }

  .admin-work-skill-modal-card {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    grid-template-columns: minmax(0, 1fr);
    padding: 12px;
  }

  .work-skill-template-detail-card {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    height: var(--app-viewport-height);
    max-height: 100vh;
    max-height: 100dvh;
    max-height: var(--app-viewport-height);
    padding: 12px;
  }

  .work-skill-template-preview-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) minmax(160px, 34vh);
    gap: 12px;
  }

  .work-skill-template-preview-rail {
    padding-top: 0;
  }

  .work-skill-template-preview-rail .preview-rail-section {
    display: flex;
    justify-content: center;
  }

  .work-skill-template-preview-stage {
    padding-inline: 0;
  }

  .work-skill-template-detail-body {
    padding: 0;
  }

  .work-skill-template-detail-media,
  .work-skill-template-detail-media img {
    min-height: 0;
  }

  .admin-work-skill-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .work-skill-template-admin-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-shell {
    width: min(100%, calc(100% - 12px));
    margin: 6px auto;
    padding-top: 46px;
  }

  .panel,
  .workspace-head,
  .sidebar,
  .login-card {
    padding: 12px;
    border-radius: 14px;
  }

  .login-copy {
    text-align: center;
    justify-items: center;
    padding: 0;
  }

  .login-card {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .login-showcase {
    width: 100%;
    min-width: 0;
    order: 2;
    justify-items: center;
  }

  .login-panel {
    order: 1;
    max-width: none;
    align-self: stretch;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
  }

  .account-apply-button {
    top: 12px;
    right: 12px;
    min-height: 34px;
    padding: 7px 11px;
    font-size: 12px;
  }

  .login-brand {
    justify-content: center;
    gap: 8px 10px;
  }

  .login-brand .brand-mark {
    width: min(148px, 38vw);
    height: auto;
  }

  .login-brand .brand-mark img {
    width: 100%;
  }

  .login-brand .brand-title {
    font-size: clamp(20px, 7vw, 30px);
  }

  .login-community-hero {
    width: 100%;
    max-width: 100%;
    min-height: 0;
    height: auto;
  }

  .login-community-hero-media-image {
    max-width: 100%;
    max-height: min(48vh, 420px);
  }

  .login-community-hero-empty {
    width: 100%;
    min-height: 260px;
  }

  .sidebar-brand .brand-mark {
    width: 40px;
    height: 40px;
  }

  .sidebar-brand .brand-mark img {
    width: 152px;
  }

  .workspace-head,
  .model-summary {
    grid-template-columns: 1fr;
    display: grid;
  }

  .workbench-toolbar,
  .composer-title-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .toolbar-status {
    justify-content: flex-start;
  }

  .admin-control-bar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-control-actions {
    justify-content: flex-start;
  }

  .field-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .template-select {
    width: 100%;
  }

  .composer-brief-tools {
    justify-content: stretch;
  }

  .composer-brief-tool {
    width: 100%;
  }

  .creation-stat-cards {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .creation-stat-card {
    min-width: 0;
  }

  .grid-five,
  .stats-grid,
  .overview-pulse-grid,
  .overview-stats-panel .stats-grid,
  .compact-model-usage-list,
  .action-row,
  .record-overview-grid,
  .management-summary-grid,
  .management-info-grid {
    grid-template-columns: 1fr;
  }

  .skill-visualization {
    grid-template-columns: 1fr;
  }

  .skill-bar-row {
    grid-template-columns: 38px minmax(72px, 1fr);
  }

  .skill-bar-row strong {
    grid-column: 2;
    white-space: normal;
  }

  .skill-profile-chips,
  .skill-traits-grid,
  .skill-memories-list {
    grid-template-columns: 1fr;
  }

  #recordsTable .record-card .management-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-hero {
    padding: 14px;
    border-radius: 18px;
  }

  .overview-pulse-chart-card,
  .pyecharts-pulse-box {
    min-height: 96px;
  }

  .overview-log-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .model-usage-title {
    display: grid;
    grid-template-columns: 1fr;
  }

  .model-usage-counts.card-counts {
    max-width: 100%;
    justify-content: flex-start;
  }

  .management-card-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .management-badges {
    justify-content: flex-start;
  }

  .control-action-buttons {
    grid-template-columns: 1fr;
  }

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

  .optimized-card-actions {
    grid-template-columns: 1fr;
  }

  .prompt-primary-action {
    min-height: 40px;
    width: 100%;
  }

  .prompt-actions .ghost-button {
    white-space: normal;
  }

  .jobs-panel .compact-grid,
  .jobs-panel .pager-row {
    grid-template-columns: 1fr;
  }

  .reference-preview img,
  .reference-preview video {
    width: 62px;
    height: 62px;
    max-height: 68px;
  }

  .reference-preview video {
    width: 92px;
  }

  .jobs-panel .stack-list {
    min-height: 0;
    max-height: 360px;
  }

  .optimized-meta {
    grid-template-columns: 1fr;
  }

  .composer-hint {
    text-align: left;
  }

  .preview-layout {
    grid-template-columns: 1fr;
    gap: 14px;
    height: auto;
    position: static;
  }

  .preview-left-rail {
    position: static;
    width: auto;
    order: 2;
    padding-top: 0;
  }

  .preview-center-stage {
    position: static;
    inset: auto;
    order: 1;
    padding-inline: 0;
  }

  .preview-stage-header {
    flex-direction: column;
    align-items: stretch;
  }

  .preview-meta-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .preview-right-panel {
    position: static;
    width: auto;
    order: 3;
    overflow: visible;
    padding: 0;
  }

  .preview-stage-nav {
    display: none;
  }

  .preview-tool-button {
    min-height: 54px;
    padding: 10px 8px;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 12px;
  }

  .preview-tool-icon {
    width: 34px;
    height: 34px;
  }

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

  .modal-stage-wrap {
    max-width: none;
  }

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

  #previewModal {
    padding: 10px;
  }

  #previewModal .modal-card {
    max-height: none;
    overflow: visible;
  }

  .result-card-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .result-card-actions .ghost-button,
  .result-card-actions a.ghost-button {
    width: 100%;
    justify-content: center;
  }

  .chip-row {
    grid-auto-flow: row;
    grid-auto-columns: auto;
  }

  .segmented {
    width: 100%;
  }

  .segmented-item {
    flex: 1;
  }

  .job-feed-item {
    grid-template-columns: 12px minmax(0, 1fr);
  }

  .job-feed-line,
  .job-feed-content small {
    white-space: normal;
  }

  .modal-stage {
    min-height: 260px;
  }

#previewMeta,
  #previewPrompt {
    max-height: none;
    overflow: visible;
  }
}

/* Final reference-style override: keep the logged-in app close to the clean canvas reference. */
body:has(#appScreen:not(.hidden)) {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --surface-3: #f8fafc;
  --line: #e5eaf1;
  --line-strong: #d8e0ea;
  --text: #111827;
  --muted: #6b7280;
  --soft: #475569;
  --focus: #111827;
  --shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
  --scrollbar-track: #eef2f6;
  --scrollbar-thumb: #cbd5e1;
  --scrollbar-thumb-hover: #94a3b8;
  color: var(--text);
  background:
    linear-gradient(rgba(148,163,184,0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,0.10) 1px, transparent 1px),
    #f4f6f8;
  background-size: 28px 28px;
}

body:has(#appScreen:not(.hidden)) .grid-noise {
  opacity: 0;
}

body:has(#appScreen:not(.hidden)) .app-shell {
  width: min(1640px, calc(100% - 24px));
  gap: 10px;
}

body:has(#appScreen:not(.hidden)) .topbar,
body:has(#appScreen:not(.hidden)) .sidebar,
body:has(#appScreen:not(.hidden)) .workspace-head,
body:has(#appScreen:not(.hidden)) .panel,
body:has(#appScreen:not(.hidden)) .profile-card,
body:has(#appScreen:not(.hidden)) .trace-card,
body:has(#appScreen:not(.hidden)) .result-card,
body:has(#appScreen:not(.hidden)) .table-row,
body:has(#appScreen:not(.hidden)) .model-card,
body:has(#appScreen:not(.hidden)) .stat-card {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  box-shadow: var(--shadow);
}

body:has(#appScreen:not(.hidden)) .topbar {
  min-height: 64px;
  padding: 8px 12px;
  border-radius: 18px;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(18px);
}

body:has(#appScreen:not(.hidden)) .topbar-main {
  grid-template-columns: minmax(180px, 1fr) auto minmax(120px, 1fr);
}

body:has(#appScreen:not(.hidden)) .brand-lockup,
body:has(#appScreen:not(.hidden)) #profileName,
body:has(#appScreen:not(.hidden)) #profileEmail {
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .topbar-brand .brand-title::after {
  border-color: rgba(17,24,39,0.14);
  box-shadow: 0 8px 18px rgba(47,207,115,0.18);
}

body:has(#appScreen:not(.hidden)) .topbar-tabs {
  gap: 4px;
  padding: 4px;
  border: 1px solid #e8edf3;
  border-radius: 999px;
  background: #f8fafc;
}

body:has(#appScreen:not(.hidden)) .topbar-tab {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

body:has(#appScreen:not(.hidden)) .topbar-tab:hover,
body:has(#appScreen:not(.hidden)) .topbar-tab.active {
  color: #111827;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(15,23,42,0.08);
}

body:has(#appScreen:not(.hidden)) .app-layout {
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 12px;
}

body:has(#appScreen:not(.hidden)) .sidebar {
  top: calc(var(--app-topbar-height) + 10px);
  padding: 10px;
  border-radius: 18px;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(18px);
}

body:has(#appScreen:not(.hidden)) .sidebar-menu-panel,
body:has(#appScreen:not(.hidden)) .sidebar-profile-button {
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: none;
}

body:has(#appScreen:not(.hidden)) .sidebar-profile-button {
  border-radius: 14px;
}

body:has(#appScreen:not(.hidden)) .sidebar-profile-button small {
  color: var(--muted);
}

body:has(#appScreen:not(.hidden)) .profile-avatar,
body:has(#appScreen:not(.hidden)) .sidebar-profile-button .profile-avatar {
  border-color: #d7f3e7;
  background: #ecfdf5;
  color: #047857;
  box-shadow: none;
}

body:has(#appScreen:not(.hidden)) .sidebar-menu-panel {
  border-radius: 14px;
  padding: 8px;
}

body:has(#appScreen:not(.hidden)) .app-sidebar .nav-item,
body:has(#appScreen:not(.hidden)) .nav-item {
  border: 1px solid transparent;
  background: transparent;
  color: #475569;
  box-shadow: none;
}

body:has(#appScreen:not(.hidden)) .app-sidebar .nav-item:hover {
  border-color: #e5eaf1;
  background: #f8fafc;
  color: #111827;
}

body:has(#appScreen:not(.hidden)) .app-sidebar .nav-item.active {
  border-color: #e5eaf1;
  background: #111827;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(15,23,42,0.14);
}

body:has(#appScreen:not(.hidden)) .app-sidebar .nav-item span:last-child,
body:has(#appScreen:not(.hidden)) .app-sidebar .nav-item.active span:last-child {
  color: currentColor;
  opacity: 0.72;
}

body:has(#appScreen:not(.hidden)) .sidebar-logout-button,
body:has(#appScreen:not(.hidden)) .ghost-button {
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: #334155;
  box-shadow: none;
}

body:has(#appScreen:not(.hidden)) .ghost-button:hover,
body:has(#appScreen:not(.hidden)) .sidebar-logout-button:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #111827;
}

body:has(#appScreen:not(.hidden)) .primary-button {
  border: 1px solid #111827;
  background: #111827;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(15,23,42,0.16);
}

body:has(#appScreen:not(.hidden)) .primary-button:hover {
  background: #020617;
}

body:has(#appScreen:not(.hidden)) .workspace-head {
  min-height: 58px;
  padding: 10px 14px;
  border-radius: 16px;
  margin-bottom: 10px;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(18px);
}

body:has(#appScreen:not(.hidden)) .workspace-head .eyebrow {
  display: block;
  margin-bottom: 3px;
  color: #94a3b8;
  letter-spacing: .12em;
}

body:has(#appScreen:not(.hidden)) .workspace-head h1 {
  color: #111827;
  font-size: clamp(20px, 2vw, 26px);
}

body:has(#appScreen:not(.hidden)) .head-chip,
body:has(#appScreen:not(.hidden)) .status-chip,
body:has(#appScreen:not(.hidden)) .pill,
body:has(#appScreen:not(.hidden)) .role-badge {
  border: 1px solid #e8edf3;
  background: #f8fafc;
  color: #475569;
}

body:has(#appScreen:not(.hidden)) .workbench-stage,
body:has(#appScreen:not(.hidden)) .forge-tool-shell {
  gap: 12px;
}

body:has(#appScreen:not(.hidden)) .panel {
  border-radius: 16px;
}

body:has(#appScreen:not(.hidden)) .panel-head {
  border-bottom-color: #eef2f6;
}

body:has(#appScreen:not(.hidden)) .eyebrow,
body:has(#appScreen:not(.hidden)) .field span,
body:has(#appScreen:not(.hidden)) .form-note,
body:has(#appScreen:not(.hidden)) .trace-card p,
body:has(#appScreen:not(.hidden)) .table-row p,
body:has(#appScreen:not(.hidden)) .result-card p,
body:has(#appScreen:not(.hidden)) .job-card p,
body:has(#appScreen:not(.hidden)) .model-card p,
body:has(#appScreen:not(.hidden)) .empty-state {
  color: var(--muted);
}

body:has(#appScreen:not(.hidden)) input,
body:has(#appScreen:not(.hidden)) textarea,
body:has(#appScreen:not(.hidden)) select,
body:has(#appScreen:not(.hidden)) .composer-control-card select,
body:has(#appScreen:not(.hidden)) .composer-control-card input,
body:has(#appScreen:not(.hidden)) .jobs-panel input,
body:has(#appScreen:not(.hidden)) .jobs-panel select {
  border-color: #dfe6ef;
  background-color: #ffffff;
  color: #111827;
  box-shadow: none;
}

body:has(#appScreen:not(.hidden)) input::placeholder,
body:has(#appScreen:not(.hidden)) textarea::placeholder {
  color: #9aa4b2;
}

body:has(#appScreen:not(.hidden)) input:focus,
body:has(#appScreen:not(.hidden)) textarea:focus,
body:has(#appScreen:not(.hidden)) select:focus {
  border-color: #111827;
  box-shadow: 0 0 0 3px rgba(17,24,39,0.08);
}

body:has(#appScreen:not(.hidden)) .composer-panel,
body:has(#appScreen:not(.hidden)) .jobs-panel,
body:has(#appScreen:not(.hidden)) .results-panel {
  background: #ffffff;
}

body:has(#appScreen:not(.hidden)) .composer-brief-shell,
body:has(#appScreen:not(.hidden)) .composer-ai-shortcut,
body:has(#appScreen:not(.hidden)) .composer-control-card,
body:has(#appScreen:not(.hidden)) .creation-stat-card,
body:has(#appScreen:not(.hidden)) .toolbar-status,
body:has(#appScreen:not(.hidden)) .job-queue-summary,
body:has(#appScreen:not(.hidden)) .compact-grid,
body:has(#appScreen:not(.hidden)) .reference-preview,
body:has(#appScreen:not(.hidden)) .forge-tool-dropzone,
body:has(#appScreen:not(.hidden)) .forge-tool-preview,
body:has(#appScreen:not(.hidden)) .forge-tool-result-frame {
  border: 1px solid #e8edf3;
  background: #f8fafc;
  color: #111827;
  box-shadow: none;
}

body:has(#appScreen:not(.hidden)) .creation-stat-card strong,
body:has(#appScreen:not(.hidden)) .panel h2,
body:has(#appScreen:not(.hidden)) .panel h3,
body:has(#appScreen:not(.hidden)) .composer-control-card-head span {
  color: #111827;
}

body:has(#appScreen:not(.hidden)) .segmented,
body:has(#appScreen:not(.hidden)) .compact-segmented {
  border: 1px solid #e5eaf1;
  background: #eef2f6;
}

body:has(#appScreen:not(.hidden)) .segmented-item {
  color: #64748b;
}

body:has(#appScreen:not(.hidden)) .segmented-item.active {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 6px 16px rgba(15,23,42,0.08);
}

body:has(#appScreen:not(.hidden)) .result-card {
  overflow: hidden;
}

body:has(#appScreen:not(.hidden)) .result-card:hover,
body:has(#appScreen:not(.hidden)) .trace-card:hover,
body:has(#appScreen:not(.hidden)) .table-row:hover {
  border-color: #cbd5e1;
  box-shadow: 0 16px 34px rgba(15,23,42,0.12);
}

body:has(#appScreen:not(.hidden)) .danger-button {
  border-color: #fecaca;
  color: #dc2626;
}

body:has(#appScreen:not(.hidden)) .danger-button:hover {
  background: #fff5f5;
}

body:has(#appScreen:not(.hidden)) .canvas-browser {
  background:
    linear-gradient(rgba(148,163,184,0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,0.10) 1px, transparent 1px),
    #f4f6f8;
  background-size: 28px 28px;
}

body:has(#appScreen:not(.hidden)) .canvas-browser-card {
  border-color: var(--line);
  background: rgba(255,255,255,0.94);
}

body:has(#appScreen:not(.hidden)) .canvas-browser-title-row h2 {
  color: #111827;
}
/* True EOF override: dark Forge colors + reference-like capsule menus/buttons. */
body:has(#appScreen:not(.hidden)) {
  --bg: #0b0c0e;
  --surface: rgba(17,18,20,0.96);
  --surface-2: rgba(24,25,28,0.96);
  --surface-3: rgba(31,33,37,0.94);
  --line: rgba(255,255,255,0.08);
  --line-strong: rgba(255,255,255,0.16);
  --text: #f3f4f6;
  --muted: #9aa0a9;
  --soft: #c9cdd3;
  --focus: #d7dde7;
  --shadow: 0 22px 70px rgba(0,0,0,0.30);
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(255,255,255,0.04), transparent 30%),
    radial-gradient(circle at 88% 12%, rgba(143,208,183,0.05), transparent 26%),
    linear-gradient(180deg, #050607, #111316 58%, #121417);
}

body:has(#appScreen:not(.hidden)) .topbar,
body:has(#appScreen:not(.hidden)) .sidebar,
body:has(#appScreen:not(.hidden)) .workspace-head,
body:has(#appScreen:not(.hidden)) .panel,
body:has(#appScreen:not(.hidden)) .profile-card,
body:has(#appScreen:not(.hidden)) .trace-card,
body:has(#appScreen:not(.hidden)) .result-card,
body:has(#appScreen:not(.hidden)) .table-row,
body:has(#appScreen:not(.hidden)) .model-card,
body:has(#appScreen:not(.hidden)) .stat-card {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

body:has(#appScreen:not(.hidden)) .topbar,
body:has(#appScreen:not(.hidden)) .sidebar,
body:has(#appScreen:not(.hidden)) .workspace-head {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.018)),
    rgba(17,19,21,0.96);
  backdrop-filter: blur(18px);
}

body:has(#appScreen:not(.hidden)) .topbar-tabs {
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  background: rgba(5,6,7,0.36);
}

body:has(#appScreen:not(.hidden)) .topbar-tab,
body:has(#appScreen:not(.hidden)) .app-sidebar .nav-item {
  border-radius: 999px;
  color: var(--muted);
}

body:has(#appScreen:not(.hidden)) .topbar-tab:hover,
body:has(#appScreen:not(.hidden)) .topbar-tab.active,
body:has(#appScreen:not(.hidden)) .app-sidebar .nav-item:hover,
body:has(#appScreen:not(.hidden)) .app-sidebar .nav-item.active {
  border-color: rgba(143,208,183,0.30);
  background:
    linear-gradient(135deg, rgba(143,208,183,0.18), rgba(255,255,255,0.07)),
    rgba(31,33,37,0.94);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

body:has(#appScreen:not(.hidden)) .sidebar-menu-panel,
body:has(#appScreen:not(.hidden)) .sidebar-profile-button,
body:has(#appScreen:not(.hidden)) .composer-brief-shell,
body:has(#appScreen:not(.hidden)) .composer-ai-shortcut,
body:has(#appScreen:not(.hidden)) .composer-control-card,
body:has(#appScreen:not(.hidden)) .creation-stat-card,
body:has(#appScreen:not(.hidden)) .toolbar-status,
body:has(#appScreen:not(.hidden)) .job-queue-summary,
body:has(#appScreen:not(.hidden)) .compact-grid,
body:has(#appScreen:not(.hidden)) .reference-preview,
body:has(#appScreen:not(.hidden)) .forge-tool-dropzone,
body:has(#appScreen:not(.hidden)) .forge-tool-preview,
body:has(#appScreen:not(.hidden)) .forge-tool-result-frame {
  border-color: rgba(255,255,255,0.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012)),
    rgba(24,25,28,0.96);
  color: var(--text);
  box-shadow: none;
}

body:has(#appScreen:not(.hidden)) .ghost-button,
body:has(#appScreen:not(.hidden)) .sidebar-logout-button,
body:has(#appScreen:not(.hidden)) .canvas-icon-button,
body:has(#appScreen:not(.hidden)) .icon-button,
body:has(#appScreen:not(.hidden)) .toolbar-jump-button,
body:has(#appScreen:not(.hidden)) .result-card-more-button,
body:has(#appScreen:not(.hidden)) .preview-head-action,
body:has(#appScreen:not(.hidden)) .preview-text-button,
body:has(#appScreen:not(.hidden)) .preview-nav-float {
  min-height: 32px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background: rgba(255,255,255,0.045);
  color: var(--soft);
  box-shadow: none;
}

body:has(#appScreen:not(.hidden)) .canvas-icon-button,
body:has(#appScreen:not(.hidden)) .icon-button,
body:has(#appScreen:not(.hidden)) .result-card-more-button,
body:has(#appScreen:not(.hidden)) .preview-head-action {
  width: auto;
  min-width: 34px;
  height: 34px;
  padding: 0 11px;
}

body:has(#appScreen:not(.hidden)) .ghost-button:hover,
body:has(#appScreen:not(.hidden)) .sidebar-logout-button:hover,
body:has(#appScreen:not(.hidden)) .canvas-icon-button:hover,
body:has(#appScreen:not(.hidden)) .icon-button:hover,
body:has(#appScreen:not(.hidden)) .toolbar-jump-button:hover,
body:has(#appScreen:not(.hidden)) .result-card-more-button:hover,
body:has(#appScreen:not(.hidden)) .preview-head-action:hover,
body:has(#appScreen:not(.hidden)) .preview-text-button:hover,
body:has(#appScreen:not(.hidden)) .preview-nav-float:hover {
  border-color: rgba(255,255,255,0.20);
  background: rgba(255,255,255,0.08);
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) input,
body:has(#appScreen:not(.hidden)) textarea,
body:has(#appScreen:not(.hidden)) select {
  border-color: rgba(255,255,255,0.10);
  background-color: #101113;
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .primary-button {
  border: 1px solid rgba(243,244,246,0.36);
  border-radius: 999px;
  background: linear-gradient(180deg, #f3f4f6, #aeb5bd);
  color: #0b0c0e;
}

body:has(#appScreen:not(.hidden)) .canvas-browser {
  background: #0b111d;
}

body:has(#appScreen:not(.hidden)) .canvas-browser-card {
  border-color: rgba(148,163,184,0.22);
  background: #151c2a;
}

body:has(#appScreen:not(.hidden)) .canvas-browser-title-row h2,
body:has(#appScreen:not(.hidden)) .workspace-head h1,
body:has(#appScreen:not(.hidden)) .panel h2,
body:has(#appScreen:not(.hidden)) .panel h3,
body:has(#appScreen:not(.hidden)) .composer-control-card-head span {
  color: var(--text);
}

/* Final requested polish at true EOF: dashboard chips, selects, buttons, and unified tool backgrounds. */
body:has(#appScreen:not(.hidden)) .head-chip,
body:has(#appScreen:not(.hidden)) .status-chip,
body:has(#appScreen:not(.hidden)) #quickStatsChip,
body:has(#appScreen:not(.hidden)) #quickStatsChipMirror,
body:has(#appScreen:not(.hidden)) #runStatus,
body:has(#appScreen:not(.hidden)) .toolbar-status,
body:has(#appScreen:not(.hidden)) .toolbar-status .toolbar-jump-button {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.065), rgba(255,255,255,0.026)),
    rgba(19,21,23,0.88);
  color: var(--soft);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

body:has(#appScreen:not(.hidden)) .toolbar-status {
  min-height: 44px;
  padding: 5px;
  gap: 6px;
  display: inline-flex;
}

body:has(#appScreen:not(.hidden)) .toolbar-status .toolbar-jump-button,
body:has(#appScreen:not(.hidden)) #runStatus,
body:has(#appScreen:not(.hidden)) #quickStatsChipMirror,
body:has(#appScreen:not(.hidden)) #quickStatsChip {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
}

body:has(#appScreen:not(.hidden)) #runStatus {
  color: var(--success);
  border-color: rgba(143,208,183,0.26);
  background: rgba(143,208,183,0.10);
}

body:has(#appScreen:not(.hidden)) select,
body:has(#appScreen:not(.hidden)) .template-select,
body:has(#appScreen:not(.hidden)) .composer-control-card select,
body:has(#appScreen:not(.hidden)) .jobs-panel select,
body:has(#appScreen:not(.hidden)) .pager-control select,
body:has(#appScreen:not(.hidden)) .community-head-filter select,
body:has(#appScreen:not(.hidden)) .preview-local-edit-mode-select {
  min-height: 38px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background-color: rgba(16,17,19,0.96);
  background-image:
    linear-gradient(45deg, transparent 50%, #9aa0a9 50%),
    linear-gradient(135deg, #9aa0a9 50%, transparent 50%);
  color: var(--text);
  padding: 8px 36px 8px 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

body:has(#appScreen:not(.hidden)) select:hover {
  border-color: rgba(255,255,255,0.20);
  background-color: rgba(24,25,28,0.98);
}

body:has(#appScreen:not(.hidden)) select:focus {
  border-color: rgba(143,208,183,0.52);
  box-shadow: 0 0 0 3px rgba(143,208,183,0.12);
}

body:has(#appScreen:not(.hidden)) button,
body:has(#appScreen:not(.hidden)) .ghost-button,
body:has(#appScreen:not(.hidden)) .primary-button {
  border-radius: 999px;
}

body:has(#appScreen:not(.hidden)) .ghost-button,
body:has(#appScreen:not(.hidden)) .canvas-icon-button,
body:has(#appScreen:not(.hidden)) .canvas-new-button,
body:has(#appScreen:not(.hidden)) .forge-tool-preset,
body:has(#appScreen:not(.hidden)) .tool-chip,
body:has(#appScreen:not(.hidden)) .result-actions-menu-button {
  min-height: 36px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.045);
  color: var(--soft);
  padding-inline: 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

body:has(#appScreen:not(.hidden)) .ghost-button:hover,
body:has(#appScreen:not(.hidden)) .canvas-icon-button:hover,
body:has(#appScreen:not(.hidden)) .canvas-new-button:hover,
body:has(#appScreen:not(.hidden)) .forge-tool-preset:hover,
body:has(#appScreen:not(.hidden)) .tool-chip:hover,
body:has(#appScreen:not(.hidden)) .result-actions-menu-button:hover {
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.085);
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .primary-button,
body:has(#appScreen:not(.hidden)) .forge-tool-run {
  min-height: 42px;
  border: 1px solid rgba(243,244,246,0.34);
  background: linear-gradient(180deg, #f3f4f6, #aeb5bd);
  color: #0b0c0e;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(0,0,0,0.18);
}

body:has(#appScreen:not(.hidden)) #angleView,
body:has(#appScreen:not(.hidden)) #enhanceView,
body:has(#appScreen:not(.hidden)) #canvasView,
body:has(#appScreen:not(.hidden)) .angle-lab-shell,
body:has(#appScreen:not(.hidden)) .forge-tool-shell,
body:has(#appScreen:not(.hidden)) .infinite-canvas-shell,
body:has(#appScreen:not(.hidden)) .canvas-browser {
  background:
    radial-gradient(circle at 12% 0%, rgba(255,255,255,0.035), transparent 28%),
    radial-gradient(circle at 84% 8%, rgba(143,208,183,0.045), transparent 26%),
    linear-gradient(180deg, #050607, #111316 58%, #121417);
}

body:has(#appScreen:not(.hidden)) .angle-lab-shell,
body:has(#appScreen:not(.hidden)) .forge-tool-shell,
body:has(#appScreen:not(.hidden)) .infinite-canvas-shell {
  border-radius: 12px;
}

/* Final micro-polish at EOF: make workbench counters, status tags, selects, and tool pages feel like one system. */
body:has(#appScreen:not(.hidden)) .creation-task-status,
body:has(#appScreen:not(.hidden)) .job-queue-summary span,
body:has(#appScreen:not(.hidden)) .panel-head small,
body:has(#appScreen:not(.hidden)) .result-mode-meta,
body:has(#appScreen:not(.hidden)) .canvas-browser-count {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  width: fit-content;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

body:has(#appScreen:not(.hidden)) .creation-task-status.is-active,
body:has(#appScreen:not(.hidden)) .status-chip:not(:empty) {
  border-color: rgba(143,208,183,0.24);
  background: rgba(143,208,183,0.09);
  color: var(--success);
}

body:has(#appScreen:not(.hidden)) .panel-head h2,
body:has(#appScreen:not(.hidden)) .panel-head h3 {
  letter-spacing: 0;
}

body:has(#appScreen:not(.hidden)) .jobs-panel .panel-head,
body:has(#appScreen:not(.hidden)) .results-panel .panel-head,
body:has(#appScreen:not(.hidden)) .angle-tool-topbar,
body:has(#appScreen:not(.hidden)) .forge-tool-topbar,
body:has(#appScreen:not(.hidden)) .canvas-browser-topbar,
body:has(#appScreen:not(.hidden)) .canvas-toolbar-panel {
  border-color: rgba(255,255,255,0.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.018)),
    rgba(19,21,23,0.92);
}

body:has(#appScreen:not(.hidden)) select,
body:has(#appScreen:not(.hidden)) .template-select,
body:has(#appScreen:not(.hidden)) .composer-control-card select,
body:has(#appScreen:not(.hidden)) .jobs-panel select,
body:has(#appScreen:not(.hidden)) .pager-control select,
body:has(#appScreen:not(.hidden)) .community-head-filter select,
body:has(#appScreen:not(.hidden)) .preview-local-edit-mode-select {
  appearance: none;
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 13px) calc(50% - 3px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

body:has(#appScreen:not(.hidden)) .toolbar-status .toolbar-jump-button {
  min-width: 64px;
  justify-content: center;
}

body:has(#appScreen:not(.hidden)) .toolbar-status .toolbar-jump-button:hover,
body:has(#appScreen:not(.hidden)) .toolbar-status .toolbar-jump-button:focus-visible {
  border-color: rgba(143,208,183,0.30);
  background: rgba(143,208,183,0.12);
  color: #f5f7f8;
}

body:has(#appScreen:not(.hidden)) .angle-lab-shell,
body:has(#appScreen:not(.hidden)) .forge-tool-shell,
body:has(#appScreen:not(.hidden)) .infinite-canvas-shell,
body:has(#appScreen:not(.hidden)) .canvas-editor {
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .angle-control-card,
body:has(#appScreen:not(.hidden)) .angle-render-card,
body:has(#appScreen:not(.hidden)) .forge-tool-card,
body:has(#appScreen:not(.hidden)) .canvas-browser-card,
body:has(#appScreen:not(.hidden)) .canvas-editor-shell,
body:has(#appScreen:not(.hidden)) .canvas-toolbar-panel {
  border-color: rgba(255,255,255,0.09);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.014)),
    rgba(18,20,22,0.94);
  box-shadow: 0 18px 50px rgba(0,0,0,0.22);
}
/* Physical EOF polish pass: workspace status, task/result panels, ready states, controls, and tool surfaces. */
body:has(#appScreen:not(.hidden)) .workbench-stage,
body:has(#appScreen:not(.hidden)) .workbench-prompt,
body:has(#appScreen:not(.hidden)) .workbench-jobs,
body:has(#appScreen:not(.hidden)) .results-panel,
body:has(#appScreen:not(.hidden)) .forge-tool-hero,
body:has(#appScreen:not(.hidden)) .forge-tool-uploader,
body:has(#appScreen:not(.hidden)) .forge-tool-controls,
body:has(#appScreen:not(.hidden)) .forge-tool-result,
body:has(#appScreen:not(.hidden)) .angle-result-frame,
body:has(#appScreen:not(.hidden)) .forge-tool-dropzone,
body:has(#appScreen:not(.hidden)) .forge-tool-preview,
body:has(#appScreen:not(.hidden)) .forge-tool-result-frame,
body:has(#appScreen:not(.hidden)) .canvas-browser-card {
  border-color: rgba(255,255,255,0.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.014)),
    rgba(17,19,22,0.94);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

body:has(#appScreen:not(.hidden)) .head-chip,
body:has(#appScreen:not(.hidden)) .status-chip,
body:has(#appScreen:not(.hidden)) #quickStatsChip,
body:has(#appScreen:not(.hidden)) #quickStatsChipMirror,
body:has(#appScreen:not(.hidden)) #runStatus,
body:has(#appScreen:not(.hidden)) .toolbar-status,
body:has(#appScreen:not(.hidden)) .creation-task-status,
body:has(#appScreen:not(.hidden)) .pill.ready,
body:has(#appScreen:not(.hidden)) .job-feed-status,
body:has(#appScreen:not(.hidden)) .result-group-chip {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.025)),
    rgba(19,21,23,0.90);
  color: var(--soft);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

body:has(#appScreen:not(.hidden)) .toolbar-status {
  min-height: 44px;
  padding: 5px;
  gap: 6px;
  display: inline-flex;
  align-items: center;
}

body:has(#appScreen:not(.hidden)) .toolbar-status .toolbar-jump-button,
body:has(#appScreen:not(.hidden)) #runStatus,
body:has(#appScreen:not(.hidden)) #quickStatsChip,
body:has(#appScreen:not(.hidden)) #quickStatsChipMirror,
body:has(#appScreen:not(.hidden)) .creation-task-status {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
  line-height: 32px;
}

body:has(#appScreen:not(.hidden)) #runStatus,
body:has(#appScreen:not(.hidden)) .pill.ready,
body:has(#appScreen:not(.hidden)) .job-status-dot.ready,
body:has(#appScreen:not(.hidden)) .job-feed-item.ready .job-feed-status,
body:has(#appScreen:not(.hidden)) .model-usage-chip.ready,
body:has(#appScreen:not(.hidden)) .record-gallery-card.ready,
body:has(#appScreen:not(.hidden)) .management-card.ready {
  border-color: rgba(143,208,183,0.32);
  background: rgba(143,208,183,0.12);
  color: var(--success);
}

body:has(#appScreen:not(.hidden)) select,
body:has(#appScreen:not(.hidden)) .template-select,
body:has(#appScreen:not(.hidden)) .composer-control-card select,
body:has(#appScreen:not(.hidden)) .jobs-panel select,
body:has(#appScreen:not(.hidden)) .pager-control select,
body:has(#appScreen:not(.hidden)) .community-head-filter select,
body:has(#appScreen:not(.hidden)) .preview-local-edit-mode-select,
body:has(#appScreen:not(.hidden)) .forge-node-mini-row select {
  min-height: 38px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  appearance: none;
  background-color: rgba(16,17,19,0.96);
  background-image:
    linear-gradient(45deg, transparent 50%, #aeb4bd 50%),
    linear-gradient(135deg, #aeb4bd 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 50%,
    calc(100% - 11px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  color: var(--text);
  padding: 8px 36px 8px 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

body:has(#appScreen:not(.hidden)) select:hover {
  border-color: rgba(255,255,255,0.22);
  background-color: rgba(24,25,28,0.98);
}

body:has(#appScreen:not(.hidden)) select:focus,
body:has(#appScreen:not(.hidden)) select:focus-visible {
  border-color: rgba(143,208,183,0.54);
  outline: none;
  box-shadow: 0 0 0 3px rgba(143,208,183,0.13);
}

body:has(#appScreen:not(.hidden)) button,
body:has(#appScreen:not(.hidden)) .ghost-button,
body:has(#appScreen:not(.hidden)) .primary-button,
body:has(#appScreen:not(.hidden)) .toolbar-jump-button,
body:has(#appScreen:not(.hidden)) .result-card-more-button,
body:has(#appScreen:not(.hidden)) .result-actions-menu-button,
body:has(#appScreen:not(.hidden)) .preview-head-action,
body:has(#appScreen:not(.hidden)) .preview-tool-button,
body:has(#appScreen:not(.hidden)) .forge-tool-preset,
body:has(#appScreen:not(.hidden)) .tool-chip {
  border-radius: 999px;
}

body:has(#appScreen:not(.hidden)) .ghost-button,
body:has(#appScreen:not(.hidden)) .sidebar-logout-button,
body:has(#appScreen:not(.hidden)) .canvas-icon-button,
body:has(#appScreen:not(.hidden)) .canvas-new-button,
body:has(#appScreen:not(.hidden)) .icon-button,
body:has(#appScreen:not(.hidden)) .toolbar-jump-button,
body:has(#appScreen:not(.hidden)) .result-card-more-button,
body:has(#appScreen:not(.hidden)) .result-actions-menu-button,
body:has(#appScreen:not(.hidden)) .preview-head-action,
body:has(#appScreen:not(.hidden)) .preview-text-button,
body:has(#appScreen:not(.hidden)) .preview-nav-float,
body:has(#appScreen:not(.hidden)) .preview-tool-button,
body:has(#appScreen:not(.hidden)) .forge-tool-preset,
body:has(#appScreen:not(.hidden)) .tool-chip {
  min-height: 36px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.045);
  color: var(--soft);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

body:has(#appScreen:not(.hidden)) .ghost-button:hover,
body:has(#appScreen:not(.hidden)) .sidebar-logout-button:hover,
body:has(#appScreen:not(.hidden)) .canvas-icon-button:hover,
body:has(#appScreen:not(.hidden)) .canvas-new-button:hover,
body:has(#appScreen:not(.hidden)) .icon-button:hover,
body:has(#appScreen:not(.hidden)) .toolbar-jump-button:hover,
body:has(#appScreen:not(.hidden)) .result-card-more-button:hover,
body:has(#appScreen:not(.hidden)) .result-actions-menu-button:hover,
body:has(#appScreen:not(.hidden)) .preview-head-action:hover,
body:has(#appScreen:not(.hidden)) .preview-text-button:hover,
body:has(#appScreen:not(.hidden)) .preview-nav-float:hover,
body:has(#appScreen:not(.hidden)) .preview-tool-button:hover,
body:has(#appScreen:not(.hidden)) .forge-tool-preset:hover,
body:has(#appScreen:not(.hidden)) .tool-chip:hover {
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.085);
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .primary-button,
body:has(#appScreen:not(.hidden)) .forge-tool-run {
  min-height: 42px;
  border: 1px solid rgba(243,244,246,0.34);
  background: linear-gradient(180deg, #f3f4f6, #aeb5bd);
  color: #0b0c0e;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(0,0,0,0.18);
}

body:has(#appScreen:not(.hidden)) #angleView,
body:has(#appScreen:not(.hidden)) #enhanceView,
body:has(#appScreen:not(.hidden)) #canvasView,
body:has(#appScreen:not(.hidden)) .angle-lab-shell,
body:has(#appScreen:not(.hidden)) .forge-tool-shell,
body:has(#appScreen:not(.hidden)) .infinite-canvas-shell,
body:has(#appScreen:not(.hidden)) .canvas-browser {
  background:
    radial-gradient(circle at 12% 0%, rgba(255,255,255,0.035), transparent 28%),
    radial-gradient(circle at 84% 8%, rgba(143,208,183,0.045), transparent 26%),
    linear-gradient(180deg, #050607, #111316 58%, #121417);
}

body:has(#appScreen:not(.hidden)) .angle-lab-shell,
body:has(#appScreen:not(.hidden)) .forge-tool-shell,
body:has(#appScreen:not(.hidden)) .infinite-canvas-shell {
  border-radius: 12px;
}
/* 2026-05-19 final tool/workbench correction pass. */
body:has(#appScreen:not(.hidden)) .creation-stat-card,
body:has(#appScreen:not(.hidden)) .compact-grid,
body:has(#appScreen:not(.hidden)) .jobs-panel .field,
body:has(#appScreen:not(.hidden)) .results-panel .field,
body:has(#appScreen:not(.hidden)) .pager-row,
body:has(#appScreen:not(.hidden)) .pager-control {
  border-color: rgba(255,255,255,0.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.014)),
    rgba(17,19,22,0.90);
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .segmented,
body:has(#appScreen:not(.hidden)) .compact-segmented {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background: rgba(5,6,7,0.42);
  padding: 4px;
}

body:has(#appScreen:not(.hidden)) .segmented-item {
  min-height: 34px;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
}

body:has(#appScreen:not(.hidden)) .segmented-item:hover,
body:has(#appScreen:not(.hidden)) .segmented-item.active {
  color: #f5f7f8;
  background: rgba(143,208,183,0.14);
}

body:has(#appScreen:not(.hidden)) .jobs-panel input,
body:has(#appScreen:not(.hidden)) .results-panel input,
body:has(#appScreen:not(.hidden)) .canvas-nav-panel input,
body:has(#appScreen:not(.hidden)) .canvas-create-menu input,
body:has(#appScreen:not(.hidden)) .canvas-card-title-input {
  min-height: 38px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background: rgba(16,17,19,0.96);
  color: var(--text);
  padding: 8px 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

body:has(#appScreen:not(.hidden)) .jobs-panel .table-actions,
body:has(#appScreen:not(.hidden)) .results-panel .result-actions-menu,
body:has(#appScreen:not(.hidden)) .action-row {
  gap: 8px;
}

body:has(#appScreen:not(.hidden)) #angleView,
body:has(#appScreen:not(.hidden)) .angle-lab-shell {
  min-height: calc(100vh - 126px);
  background:
    radial-gradient(circle at 12% 0%, rgba(255,255,255,0.035), transparent 28%),
    radial-gradient(circle at 84% 8%, rgba(143,208,183,0.04), transparent 26%),
    linear-gradient(180deg, #050607, #111316 58%, #121417);
}

body:has(#appScreen:not(.hidden)) .angle-lab-block,
body:has(#appScreen:not(.hidden)) .angle-dropzone,
body:has(#appScreen:not(.hidden)) .angle-camera-card,
body:has(#appScreen:not(.hidden)) .angle-camera-panel,
body:has(#appScreen:not(.hidden)) .angle-source-preview,
body:has(#appScreen:not(.hidden)) .angle-three-stage,
body:has(#appScreen:not(.hidden)) .angle-result-frame,
body:has(#appScreen:not(.hidden)) .angle-params-block textarea {
  border-color: rgba(255,255,255,0.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.014)),
    rgba(17,19,22,0.94);
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .angle-source-block,
body:has(#appScreen:not(.hidden)) .angle-camera-block,
body:has(#appScreen:not(.hidden)) .angle-params-block,
body:has(#appScreen:not(.hidden)) .angle-result-block {
  padding: 18px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.012)),
    rgba(14,16,19,0.92);
}

body:has(#appScreen:not(.hidden)) .angle-camera-card {
  grid-template-columns: minmax(0, 1.55fr) 244px;
}

body:has(#appScreen:not(.hidden)) .angle-three-stage {
  min-height: 580px;
  background:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px),
    #0b0d10;
  background-size: 28px 28px;
}

body:has(#appScreen:not(.hidden)) .angle-plane-fallback {
  max-height: 86%;
}

body:has(#appScreen:not(.hidden)) .angle-camera-hud {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 4;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background: rgba(5,6,7,0.68);
  color: var(--soft);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  backdrop-filter: blur(10px);
}

body:has(#appScreen:not(.hidden)) .angle-source-preview img,
body:has(#appScreen:not(.hidden)) .angle-result-frame img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
}

body:has(#appScreen:not(.hidden)) #angleView .angle-lab-shell {
  width: 100%;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

body:has(#appScreen:not(.hidden)) #angleView .angle-lab-grid {
  width: 100%;
  gap: 12px;
}

body:has(#appScreen:not(.hidden)) #enhanceView .forge-tool-shell {
  padding-top: 0;
}

body:has(#appScreen:not(.hidden)) #enhanceView .forge-tool-grid {
  align-items: stretch;
}

body:has(#appScreen:not(.hidden)) #enhanceView .forge-tool-hero {
  display: none;
}

body:has(#appScreen:not(.hidden)) .forge-tool-result-summary {
  display: grid;
  gap: 6px;
  text-align: center;
}

body:has(#appScreen:not(.hidden)) #enhanceView .forge-tool-result-frame img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
}

body:has(#appScreen:not(.hidden)) .forge-tool-result-summary strong {
  color: var(--text);
  font-size: 16px;
}

body:has(#appScreen:not(.hidden)) .forge-tool-result-summary span {
  color: var(--muted);
  font-size: 12px;
}

body:has(#appScreen:not(.hidden)) #canvasView,
body:has(#appScreen:not(.hidden)) .infinite-canvas-shell,
body:has(#appScreen:not(.hidden)) .canvas-browser,
body:has(#appScreen:not(.hidden)) .canvas-editor,
body:has(#appScreen:not(.hidden)) .forge-canvas-board,
body:has(#appScreen:not(.hidden)) .infinite-board {
  background:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px),
    #090b0f;
  background-size: 32px 32px;
}

body:has(#appScreen:not(.hidden)) .infinite-canvas-shell {
  height: calc(100vh - 178px);
  min-height: 640px;
  margin: 0 -6px;
  position: relative;
  z-index: 0;
}

body:has(#appScreen:not(.hidden)) .canvas-browser {
  z-index: 8;
  padding-top: 24px;
}

body:has(#appScreen:not(.hidden)) .canvas-browser-card,
body:has(#appScreen:not(.hidden)) .canvas-browser-list-shell,
body:has(#appScreen:not(.hidden)) .canvas-browser-item,
body:has(#appScreen:not(.hidden)) .canvas-editor-back-panel,
body:has(#appScreen:not(.hidden)) .canvas-nav-panel,
body:has(#appScreen:not(.hidden)) .canvas-toolbar-panel,
body:has(#appScreen:not(.hidden)) .canvas-create-menu,
body:has(#appScreen:not(.hidden)) .canvas-delete-box,
body:has(#appScreen:not(.hidden)) .forge-canvas-node,
body:has(#appScreen:not(.hidden)) .forge-canvas-node-body,
body:has(#appScreen:not(.hidden)) .canvas-card-meta,
body:has(#appScreen:not(.hidden)) .canvas-browser-item-icon {
  border-color: rgba(255,255,255,0.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.014)),
    rgba(17,19,22,0.94);
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .canvas-browser-title-row h2,
body:has(#appScreen:not(.hidden)) .canvas-card-title,
body:has(#appScreen:not(.hidden)) .canvas-editor-back-panel strong,
body:has(#appScreen:not(.hidden)) .forge-canvas-node header strong {
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) .canvas-browser-head p,
body:has(#appScreen:not(.hidden)) .canvas-browser-item small,
body:has(#appScreen:not(.hidden)) .canvas-editor-back-panel span,
body:has(#appScreen:not(.hidden)) .forge-canvas-node-kind {
  color: var(--muted);
}

body:has(#appScreen:not(.hidden)) .canvas-floating-top {
  grid-template-columns: minmax(220px, auto) minmax(0, 1fr);
  align-items: start;
  z-index: 18;
}

body:has(#appScreen:not(.hidden)) .canvas-editor-back-panel {
  grid-column: 1;
}

body:has(#appScreen:not(.hidden)) .canvas-nav-panel {
  display: none;
  grid-column: 1;
  grid-row: 2;
  margin-top: 8px;
}

body:has(#appScreen:not(.hidden)) .canvas-toolbar-panel {
  grid-column: 2;
  grid-row: 1 / span 2;
  justify-self: end;
  max-width: calc(100vw - 420px);
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  overflow-x: auto;
  white-space: nowrap;
}

body:has(#appScreen:not(.hidden)) .canvas-toolbar-panel .tool-chip {
  flex: 0 0 auto;
}

body:has(#appScreen:not(.hidden)) .canvas-toolbar-status {
  flex: 0 0 auto;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-color: rgba(143,208,183,0.20);
  background: rgba(12,14,17,0.88);
  color: var(--muted);
}

body:has(#appScreen:not(.hidden)) .canvas-empty-hint {
  z-index: 1;
  color: var(--muted);
}

body:has(#appScreen:not(.hidden)) .canvas-create-menu button {
  border-color: rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.045);
  color: var(--soft);
}
/* Infinite canvas toolbox parity with the reference project. */
body:has(#appScreen:not(.hidden)) .canvas-toolbar-panel {
  padding: 10px;
  gap: 8px;
  border-radius: 24px;
}

body:has(#appScreen:not(.hidden)) .canvas-toolbar-panel .tool-chip {
  height: 38px;
  min-height: 38px;
  min-width: 38px;
  padding: 0 12px;
  gap: 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

body:has(#appScreen:not(.hidden)) .canvas-node-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

body:has(#appScreen:not(.hidden)) .canvas-node-section-title,
body:has(#appScreen:not(.hidden)) .setting-title,
body:has(#appScreen:not(.hidden)) .loop-count-label,
body:has(#appScreen:not(.hidden)) .llm-pane-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body:has(#appScreen:not(.hidden)) .canvas-node-empty {
  padding: 9px 10px;
  border: 1px dashed rgba(255,255,255,0.12);
  border-radius: 12px;
  background: rgba(255,255,255,0.035);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

body:has(#appScreen:not(.hidden)) .loop-preview {
  padding: 8px 10px;
  border: 1px dashed rgba(255,255,255,0.12);
  border-radius: 12px;
  background: rgba(255,255,255,0.035);
  color: var(--soft);
  font-size: 11px;
  line-height: 1.45;
}

body:has(#appScreen:not(.hidden)) .gen-settings,
body:has(#appScreen:not(.hidden)) .loop-count-row,
body:has(#appScreen:not(.hidden)) .loop-image-panel,
body:has(#appScreen:not(.hidden)) .llm-output-wrap,
body:has(#appScreen:not(.hidden)) .prompt-list,
body:has(#appScreen:not(.hidden)) .input-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.014)),
    rgba(12,14,17,0.82);
  padding: 10px;
}

body:has(#appScreen:not(.hidden)) .input-list {
  flex-direction: row;
  align-items: flex-start;
  min-height: 86px;
  overflow: auto;
}

body:has(#appScreen:not(.hidden)) .canvas-input-item {
  position: relative;
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  padding: 5px;
  overflow: hidden;
  cursor: grab;
}

body:has(#appScreen:not(.hidden)) .canvas-input-item:active {
  cursor: grabbing;
}

body:has(#appScreen:not(.hidden)) .canvas-input-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

body:has(#appScreen:not(.hidden)) .canvas-input-item .input-index {
  position: absolute;
  left: 6px;
  top: 6px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(5,6,7,0.82);
  color: var(--text);
  font-size: 10px;
  font-weight: 900;
}

body:has(#appScreen:not(.hidden)) .canvas-input-item .input-label {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  padding: 2px 5px;
  border-radius: 8px;
  background: rgba(5,6,7,0.76);
  color: var(--soft);
  font-size: 9px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body:has(#appScreen:not(.hidden)) .canvas-source-pill {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 12px;
  background: rgba(255,255,255,0.035);
}

body:has(#appScreen:not(.hidden)) .canvas-source-pill strong {
  color: var(--text);
  font-size: 10px;
  font-weight: 900;
}

body:has(#appScreen:not(.hidden)) .canvas-source-pill span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

body:has(#appScreen:not(.hidden)) .gen-settings-row,
body:has(#appScreen:not(.hidden)) .loop-run-row,
body:has(#appScreen:not(.hidden)) .loop-toggle-row,
body:has(#appScreen:not(.hidden)) .loop-image-row,
body:has(#appScreen:not(.hidden)) .llm-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

body:has(#appScreen:not(.hidden)) .toggle-wrap {
  flex-wrap: wrap;
}

body:has(#appScreen:not(.hidden)) .gen-settings-row .field {
  flex: 1;
  min-width: 0;
}

body:has(#appScreen:not(.hidden)) .select-lite,
body:has(#appScreen:not(.hidden)) .setting-input,
body:has(#appScreen:not(.hidden)) .loop-count-input,
body:has(#appScreen:not(.hidden)) .gen-count-input,
body:has(#appScreen:not(.hidden)) .forge-canvas-node textarea {
  min-height: 32px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  background: rgba(16,17,19,0.96);
  color: var(--text);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 750;
}

body:has(#appScreen:not(.hidden)) .forge-canvas-node textarea {
  width: 100%;
  min-height: 78px;
  resize: vertical;
  line-height: 1.45;
}

body:has(#appScreen:not(.hidden)) .seg,
body:has(#appScreen:not(.hidden)) .mode-tabs,
body:has(#appScreen:not(.hidden)) .ms-model-tabs,
body:has(#appScreen:not(.hidden)) .llm-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  background: rgba(255,255,255,0.035);
}

body:has(#appScreen:not(.hidden)) .mode-tabs,
body:has(#appScreen:not(.hidden)) .ms-model-tabs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body:has(#appScreen:not(.hidden)) .seg button,
body:has(#appScreen:not(.hidden)) .mode-tabs button,
body:has(#appScreen:not(.hidden)) .ms-model-tabs button,
body:has(#appScreen:not(.hidden)) .llm-mode button {
  min-height: 28px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

body:has(#appScreen:not(.hidden)) .seg button.active,
body:has(#appScreen:not(.hidden)) .mode-tabs button.active,
body:has(#appScreen:not(.hidden)) .ms-model-tabs button.active,
body:has(#appScreen:not(.hidden)) .llm-mode button.active {
  background: var(--text);
  color: #0b0c0e;
}

body:has(#appScreen:not(.hidden)) .loop-toggle,
body:has(#appScreen:not(.hidden)) .loop-token-btn,
body:has(#appScreen:not(.hidden)) .setting-check {
  min-height: 30px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background: rgba(255,255,255,0.045);
  color: var(--soft);
  padding: 0 10px;
  font-size: 10.5px;
  font-weight: 850;
  white-space: nowrap;
}

body:has(#appScreen:not(.hidden)) .loop-toggle.active,
body:has(#appScreen:not(.hidden)) .setting-check.active {
  border-color: rgba(143,208,183,0.32);
  background: rgba(143,208,183,0.14);
  color: var(--success);
}

body:has(#appScreen:not(.hidden)) .gen-stepper {
  height: 32px;
  min-width: 96px;
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  align-items: center;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(16,17,19,0.96);
}

body:has(#appScreen:not(.hidden)) .gen-step-btn {
  min-height: 30px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
}

body:has(#appScreen:not(.hidden)) .gen-count-input {
  min-height: 30px;
  border: 0;
  border-radius: 0;
  padding: 0;
  text-align: center;
  background: transparent;
}

body:has(#appScreen:not(.hidden)) .canvas-range {
  width: 100%;
  accent-color: var(--text);
}

body:has(#appScreen:not(.hidden)) .llm-body .llm-row {
  align-items: stretch;
}

body:has(#appScreen:not(.hidden)) .llm-provider-select,
body:has(#appScreen:not(.hidden)) .llm-row .select-lite {
  flex: 1;
}

body:has(#appScreen:not(.hidden)) .llm-output {
  min-height: 72px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

body:has(#appScreen:not(.hidden)) .llm-pane-label span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  opacity: .72;
}

body:has(#appScreen:not(.hidden)) .llm-image-badge {
  width: fit-content;
  max-width: 100%;
  padding: 6px 9px;
  border-radius: 10px;
  background: rgba(143,208,183,0.12);
  color: var(--success);
  font-size: 10.5px;
  font-weight: 850;
}

body:has(#appScreen:not(.hidden)) .llm-pane-resizer {
  height: 12px;
  flex: 0 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: row-resize;
  touch-action: none;
}

body:has(#appScreen:not(.hidden)) .llm-pane-resizer::before {
  content: "";
  width: 54px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
}

body:has(#appScreen:not(.hidden)) .llm-pane-resizer:hover::before {
  background: rgba(255,255,255,0.34);
}

body:has(#appScreen:not(.hidden)) .comfy-body,
body:has(#appScreen:not(.hidden)) .generator-body {
  min-height: 0;
}

body:has(#appScreen:not(.hidden)) .forge-canvas-node.type-api,
body:has(#appScreen:not(.hidden)) .forge-canvas-node.type-msgen,
body:has(#appScreen:not(.hidden)) .forge-canvas-node.type-video {
  width: 380px;
}

body:has(#appScreen:not(.hidden)) .forge-canvas-node.type-comfy {
  width: 420px;
}

body:has(#appScreen:not(.hidden)) .forge-canvas-node {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

body:has(#appScreen:not(.hidden)) .forge-canvas-node.is-resized {
  overflow: hidden;
}

body:has(#appScreen:not(.hidden)) .forge-canvas-node.is-resized .forge-canvas-node-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-bottom: 14px;
}

body:has(#appScreen:not(.hidden)) .forge-canvas-node.is-resized footer {
  flex: 0 0 auto;
}

body:has(#appScreen:not(.hidden)) .forge-canvas-node.is-resized .canvas-node-panel {
  min-height: 100%;
}

body:has(#appScreen:not(.hidden)) .forge-canvas-node.is-resized textarea[data-role="prompt"],
body:has(#appScreen:not(.hidden)) .forge-canvas-node.is-resized textarea[data-role="loop-variable-prompt"],
body:has(#appScreen:not(.hidden)) .forge-canvas-node.is-resized textarea[data-role="system-prompt"],
body:has(#appScreen:not(.hidden)) .forge-canvas-node.is-resized textarea[data-role="comfy-params"] {
  min-height: 120px;
  flex: 1 1 auto;
}

body:has(#appScreen:not(.hidden)) .forge-canvas-node.is-resized .forge-output-slot,
body:has(#appScreen:not(.hidden)) .forge-canvas-node.is-resized .forge-canvas-image-slot {
  min-height: 100%;
}

body:has(#appScreen:not(.hidden)) .forge-canvas-node.is-resized .forge-output-slot {
  align-content: start;
}

body:has(#appScreen:not(.hidden)) .forge-canvas-node footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}

body:has(#appScreen:not(.hidden)) .forge-canvas-cascade {
  min-height: 32px;
  padding: 0 12px;
  border-color: rgba(255,255,255,0.14);
  background: rgba(20,21,24,0.95);
  color: var(--muted);
  white-space: nowrap;
}

body:has(#appScreen:not(.hidden)) .forge-canvas-resize-handle {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 8px;
  background: rgba(245,247,248,0.88);
  color: #6b7280;
  cursor: nwse-resize;
  opacity: 0;
  z-index: 5;
  transition: opacity .16s ease, background .16s ease, color .16s ease, border-color .16s ease;
}

body:has(#appScreen:not(.hidden)) .forge-canvas-resize-handle:focus-visible {
  opacity: 1;
  outline: 2px solid rgba(143,208,183,0.55);
  outline-offset: 2px;
}

body:has(#appScreen:not(.hidden)) .forge-canvas-resize-handle::before {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

body:has(#appScreen:not(.hidden)) .forge-canvas-node:hover .forge-canvas-resize-handle,
body:has(#appScreen:not(.hidden)) .forge-canvas-node.selected .forge-canvas-resize-handle {
  opacity: 1;
}

body:has(#appScreen:not(.hidden)) .forge-canvas-resize-handle:hover {
  background: #fff;
  color: #111827;
  border-color: rgba(255,255,255,0.34);
}

/* Unified button hover pass: keep controls light instead of flipping to black. */
body:has(#appScreen:not(.hidden)) button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .ghost-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .compact-admin-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .topbar-tab:hover,
body:has(#appScreen:not(.hidden)) .admin-tab:hover,
body:has(#appScreen:not(.hidden)) .tool-chip:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .forge-tool-preset:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .canvas-icon-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .canvas-new-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .icon-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .toolbar-jump-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .result-card-more-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .result-actions-menu-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .preview-head-action:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .preview-text-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .preview-tool-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .preview-nav-float:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .sidebar-logout-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .canvas-create-menu button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .control-action-buttons .primary-button:not(:disabled):hover,
body:has(#appScreen:not(.hidden)) .prompt-actions .ghost-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .job-feed-actions .ghost-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .result-card-actions .ghost-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .result-card-actions a.ghost-button:hover {
  border-color: rgba(34,197,94,0.58) !important;
  background: #dcfce7 !important;
  color: #14532d !important;
  box-shadow: 0 10px 22px rgba(34,197,94,0.14) !important;
}

body:has(#appScreen:not(.hidden)) .primary-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .forge-tool-run:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .control-action-buttons .primary-button#runButton:not(:disabled):hover {
  border-color: rgba(34,197,94,0.72) !important;
  background: #dcfce7 !important;
  color: #14532d !important;
  box-shadow: 0 10px 22px rgba(34,197,94,0.16) !important;
}

body:has(#appScreen:not(.hidden)) .danger-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .canvas-delete:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .reference-remove-button:hover:not(:disabled) {
  border-color: #fecaca !important;
  background: #fff1f2 !important;
  color: #991b1b !important;
  box-shadow: 0 8px 18px rgba(220, 38, 38, 0.10) !important;
}

body:has(#appScreen:not(.hidden)) .admin-tab.active:hover,
body:has(#appScreen:not(.hidden)) .topbar-tab.active:hover {
  background: #ffffff !important;
  color: #111827 !important;
}

body:has(#appScreen:not(.hidden)) .creation-stat-card span,
body:has(#appScreen:not(.hidden)) .creation-stat-card strong,
body:has(#appScreen:not(.hidden)) .creation-stat-card small,
body:has(#appScreen:not(.hidden)) .creation-task-status,
body:has(#appScreen:not(.hidden)) .creation-task-status.is-active {
  color: #ffffff !important;
}

/* Final green hover policy. */
button:hover:not(:disabled),
a.primary-button:hover,
a.ghost-button:hover,
.login-submit-button:hover:not(:disabled),
.account-apply-button:hover:not(:disabled),
.user-more-dropdown button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .primary-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .ghost-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .compact-admin-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .topbar-tab:hover,
body:has(#appScreen:not(.hidden)) .admin-tab:hover,
body:has(#appScreen:not(.hidden)) .tool-chip:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .forge-tool-preset:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .canvas-icon-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .canvas-new-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .icon-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .toolbar-jump-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .result-card-more-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .result-actions-menu-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .preview-head-action:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .preview-text-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .preview-tool-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .preview-nav-float:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .sidebar-logout-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .canvas-create-menu button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .prompt-actions .ghost-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .prompt-ai-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .prompt-image-to-prompt-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .job-feed-actions .ghost-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .result-card-actions .ghost-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .result-card-actions a.ghost-button:hover {
  border-color: rgba(34,197,94,0.58) !important;
  background: #dcfce7 !important;
  color: #14532d !important;
  box-shadow: 0 10px 22px rgba(34,197,94,0.14) !important;
}

body:has(#appScreen:not(.hidden)) .control-action-buttons .primary-button#runButton,
body:has(#appScreen:not(.hidden)) .control-action-buttons .primary-button#runButton:not(:disabled):hover {
  border-color: rgba(34,197,94,0.72) !important;
  background: linear-gradient(180deg, #86efac, #22c55e) !important;
  color: #052e16 !important;
  box-shadow: 0 12px 26px rgba(34,197,94,0.24) !important;
}

/* EOF task panel overlay guard. */

/* Absolute final task panel layout guard. */
body:has(#appScreen:not(.hidden)) #jobsList.has-running-jobs::before {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 10px !important;
  z-index: 0 !important;
  pointer-events: none !important;
}

body:has(#appScreen:not(.hidden)) #jobsList .job-feed-item {
  position: relative !important;
}

body:has(#appScreen:not(.hidden)) #jobsList .job-feed-item.is-generating::after {
  z-index: 0 !important;
  pointer-events: none !important;
}

body:has(#appScreen:not(.hidden)) #jobsList .job-feed-item.is-generating > * {
  position: relative !important;
  z-index: 1 !important;
}

body:has(#appScreen:not(.hidden)) #jobsList .job-feed-line {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 6px !important;
  overflow: visible !important;
}

body:has(#appScreen:not(.hidden)) #jobsList .job-feed-title {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body:has(#appScreen:not(.hidden)) #jobsList .job-feed-status {
  white-space: nowrap !important;
}

@media (max-width: 760px) {
  body:has(#appScreen:not(.hidden)) #jobsList .job-feed-line {
    grid-template-columns: 1fr !important;
  }

  body:has(#appScreen:not(.hidden)) #jobsList .job-feed-status {
    justify-self: start !important;
  }
}


/* Final task panel layout guard: animated layers must never cover task content. */
body:has(#appScreen:not(.hidden)) #jobsList.has-running-jobs::before {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 10px !important;
  z-index: 0 !important;
  pointer-events: none !important;
}

body:has(#appScreen:not(.hidden)) #jobsList .job-feed-item {
  position: relative !important;
}

body:has(#appScreen:not(.hidden)) #jobsList .job-feed-item.is-generating::after {
  z-index: 0 !important;
  pointer-events: none !important;
}

body:has(#appScreen:not(.hidden)) #jobsList .job-feed-item.is-generating > * {
  position: relative !important;
  z-index: 1 !important;
}

body:has(#appScreen:not(.hidden)) #jobsList .job-feed-line {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 6px !important;
  overflow: visible !important;
}

body:has(#appScreen:not(.hidden)) #jobsList .job-feed-title {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body:has(#appScreen:not(.hidden)) #jobsList .job-feed-status {
  white-space: nowrap !important;
}

@media (max-width: 760px) {
  body:has(#appScreen:not(.hidden)) #jobsList .job-feed-line {
    grid-template-columns: 1fr !important;
  }

  body:has(#appScreen:not(.hidden)) #jobsList .job-feed-status {
    justify-self: start !important;
  }
}

/* Preview detail layout: keep the artwork central and put primary actions near it. */
#previewModal .preview-modal-card {
  width: min(1500px, calc(100vw - 28px)) !important;
  max-height: min(920px, calc(100dvh - 28px)) !important;
}

#previewModal .preview-layout {
  grid-template-columns: 84px minmax(560px, 1fr) minmax(280px, 340px) !important;
  gap: 14px !important;
}

#previewModal .preview-center-stage {
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  padding-inline: clamp(4px, 1vw, 14px) !important;
}

#previewModal .modal-stage-wrap {
  max-width: min(100%, 1120px) !important;
  align-self: stretch !important;
}

#previewModal .modal-stage {
  min-height: min(680px, calc(100dvh - 190px)) !important;
  max-height: calc(100dvh - 190px) !important;
  border-radius: 10px !important;
}

#previewModal .preview-stage-footer {
  display: flex !important;
  align-items: center !important;
  min-width: 0 !important;
  padding: 2px 0 0 !important;
}

#previewModal .preview-nav-meta {
  margin: 0 !important;
  white-space: nowrap !important;
}

#previewModal .preview-right-panel {
  width: auto !important;
  padding: 18px 4px 8px 0 !important;
  gap: 10px !important;
}

#previewModal .preview-meta-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

#previewModal .preview-meta-head {
  padding-bottom: 8px !important;
}

#previewModal #previewMeta {
  grid-template-columns: 1fr !important;
}

@media (max-width: 1100px) {
  #previewModal .preview-layout {
    grid-template-columns: 74px minmax(0, 1fr) !important;
  }

  #previewModal .preview-right-panel {
    grid-column: 1 / -1 !important;
    width: auto !important;
    max-height: 260px !important;
    padding: 0 4px 8px !important;
  }
}

@media (max-width: 760px) {
  #previewModal .preview-layout {
    grid-template-columns: 1fr !important;
  }

  #previewModal .preview-left-rail {
    width: auto !important;
    padding-top: 0 !important;
  }

  #previewModal .preview-rail-section {
    grid-auto-flow: column !important;
    grid-auto-columns: minmax(94px, 1fr) !important;
    overflow-x: auto !important;
  }

  #previewModal .preview-meta-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* Final workbench queue cue. */
body:has(#appScreen:not(.hidden)) #quickStatsChip,
body:has(#appScreen:not(.hidden)) #quickStatsChipMirror {
  border-color: rgba(239,68,68,0.32) !important;
  background: rgba(239,68,68,0.08) !important;
  color: #f87171 !important;
  box-shadow: 0 10px 24px rgba(239,68,68,0.1) !important;
}

/* Global dark graphite scrollbars. */
* {
  scrollbar-color: #4b5563 #111827;
  scrollbar-width: thin;
}

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

*::-webkit-scrollbar-track {
  background: #111827;
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: #4b5563;
  border: 2px solid #111827;
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

*::-webkit-scrollbar-corner {
  background: #111827;
}

/* Compact one-line workbench toolbar. */
body:has(#appScreen:not(.hidden)) .workbench-toolbar {
  min-height: 54px !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 6px 10px !important;
}

body:has(#appScreen:not(.hidden)) .creation-stat-cards {
  width: auto !important;
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

body:has(#appScreen:not(.hidden)) .creation-stat-card {
  width: auto !important;
  min-width: 132px !important;
  min-height: 38px !important;
  display: grid !important;
  grid-template-columns: auto auto auto !important;
  grid-template-rows: auto auto !important;
  align-items: center !important;
  align-content: center !important;
  column-gap: 8px !important;
  row-gap: 3px !important;
  padding: 6px 8px !important;
  border-radius: 10px !important;
}

body:has(#appScreen:not(.hidden)) .creation-stat-card span {
  grid-column: 1 !important;
  grid-row: 1 !important;
  font-size: 10px !important;
  line-height: 1 !important;
}

body:has(#appScreen:not(.hidden)) .creation-stat-card strong {
  grid-column: 2 !important;
  grid-row: 1 !important;
  font-size: 16px !important;
  line-height: 1 !important;
}

body:has(#appScreen:not(.hidden)) .creation-stat-card .creation-task-status {
  grid-column: 1 / 3 !important;
  grid-row: 2 !important;
  padding: 2px 6px !important;
  font-size: 10px !important;
}

body:has(#appScreen:not(.hidden)) .creation-stat-card .branch-status-open-button {
  grid-column: 3 !important;
  grid-row: 1 / 3 !important;
  align-self: center !important;
  min-height: 26px !important;
  padding: 4px 7px !important;
  font-size: 10px !important;
  white-space: nowrap !important;
}

body:has(#appScreen:not(.hidden)) .toolbar-status {
  flex: 0 0 auto !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
}

body:has(#appScreen:not(.hidden)) .toolbar-status .toolbar-jump-button,
body:has(#appScreen:not(.hidden)) .toolbar-status .status-chip,
body:has(#appScreen:not(.hidden)) .toolbar-status .head-chip {
  min-height: 30px !important;
  padding-block: 6px !important;
  white-space: nowrap !important;
}

body:has(#appScreen:not(.hidden)) .branch-status-open-button:hover,
body:has(#appScreen:not(.hidden)) .branch-status-open-button:focus-visible {
  transform: translateY(-1px) !important;
  border-color: rgba(34,197,94,0.62) !important;
  background:
    linear-gradient(180deg, rgba(34,197,94,0.28), rgba(34,197,94,0.14)),
    rgba(34,197,94,0.16) !important;
  color: #ffffff !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 8px 18px rgba(34,197,94,0.16) !important;
}

@media (max-width: 760px) {
  body:has(#appScreen:not(.hidden)) .workbench-toolbar {
    flex-wrap: wrap !important;
  }

  body:has(#appScreen:not(.hidden)) .toolbar-status {
    width: 100% !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
  }
}

.model-monitor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 16px;
  align-items: start;
}

.model-monitor-list,
.model-monitor-actions {
  display: grid;
  gap: 12px;
}

.model-monitor-auto-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin: 14px 0 18px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  background: rgba(255,255,255,0.035);
}

.model-monitor-auto-panel .inline-toggle {
  min-height: 44px;
  align-items: center;
}

.model-monitor-card {
  border-color: rgba(255,255,255,0.12);
}

.model-monitor-card.warn {
  border-color: rgba(232,199,129,0.38);
}

.model-monitor-card.danger {
  border-color: rgba(226,143,143,0.42);
}

.model-monitor-action {
  align-items: center;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.model-monitor-action small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

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

  .model-monitor-auto-panel {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .model-monitor-auto-panel {
    grid-template-columns: 1fr;
  }
}

/* Final button hover guard: no button should flip to black on hover. */
button:hover:not(:disabled),
a.primary-button:hover,
a.ghost-button:hover,
.login-submit-button:hover:not(:disabled),
.account-apply-button:hover:not(:disabled),
.user-more-dropdown button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .primary-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .ghost-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .compact-admin-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .topbar-tab:hover,
body:has(#appScreen:not(.hidden)) .admin-tab:hover,
body:has(#appScreen:not(.hidden)) .tool-chip:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .forge-tool-preset:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .canvas-icon-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .canvas-new-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .icon-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .toolbar-jump-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .result-card-more-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .result-actions-menu-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .preview-head-action:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .preview-text-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .preview-tool-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .preview-nav-float:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .sidebar-logout-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .canvas-create-menu button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .control-action-buttons .primary-button:not(:disabled):hover,
body:has(#appScreen:not(.hidden)) .prompt-actions .ghost-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .prompt-ai-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .prompt-image-to-prompt-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .job-feed-actions .ghost-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .result-card-actions .ghost-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .result-card-actions a.ghost-button:hover {
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
  color: #111827 !important;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08) !important;
}

.login-submit-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .primary-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .forge-tool-run:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .control-action-buttons .primary-button#runButton:not(:disabled):hover,
body:has(#appScreen:not(.hidden)) .prompt-ai-button:hover:not(:disabled) {
  border-color: rgba(34,197,94,0.72) !important;
  background: #dcfce7 !important;
  color: #14532d !important;
  box-shadow: 0 10px 22px rgba(34,197,94,0.16) !important;
}

body:has(#appScreen:not(.hidden)) .control-action-buttons .primary-button#runButton,
body:has(#appScreen:not(.hidden)) .control-action-buttons .primary-button#runButton:not(:disabled):hover {
  border-color: rgba(34,197,94,0.72) !important;
  background: linear-gradient(180deg, #86efac, #22c55e) !important;
  color: #052e16 !important;
  box-shadow: 0 12px 26px rgba(34,197,94,0.24) !important;
}

/* Absolute final scrollbar policy: black, never blue. */
:root,
html,
body,
body[data-theme="light"],
body[data-theme="dark"],
body:has(#appScreen:not(.hidden)) {
  --scrollbar-track: #050505 !important;
  --scrollbar-thumb: #1f1f1f !important;
  --scrollbar-thumb-hover: #353535 !important;
}

* {
  scrollbar-color: #1f1f1f #050505 !important;
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 10px !important;
  height: 10px !important;
}

*::-webkit-scrollbar-track {
  background: #050505 !important;
  border-radius: 999px !important;
}

*::-webkit-scrollbar-thumb {
  background: #1f1f1f !important;
  border: 2px solid #050505 !important;
  border-radius: 999px !important;
}

*::-webkit-scrollbar-thumb:hover {
  background: #353535 !important;
}

*::-webkit-scrollbar-corner {
  background: #050505 !important;
}

body:has(#appScreen:not(.hidden)) .prompt-image-to-prompt-button:hover:not(:disabled) {
  border-color: rgba(34,197,94,0.58) !important;
  background: #dcfce7 !important;
  color: #14532d !important;
  box-shadow: 0 10px 22px rgba(34,197,94,0.14) !important;
}

body:has(#appScreen:not(.hidden)) .danger-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .canvas-delete:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .reference-remove-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .user-more-dropdown .danger-menu-item:hover:not(:disabled) {
  border-color: rgba(34,197,94,0.58) !important;
  background: #dcfce7 !important;
  color: #14532d !important;
  box-shadow: 0 10px 22px rgba(34,197,94,0.14) !important;
}

body:has(#appScreen:not(.hidden)) .admin-tab.active:hover,
body:has(#appScreen:not(.hidden)) .topbar-tab.active:hover {
  border-color: rgba(34,197,94,0.58) !important;
  background: #dcfce7 !important;
  color: #14532d !important;
}

/* Absolute final button hover policy: green everywhere. */
button:hover:not(:disabled),
a.primary-button:hover,
a.ghost-button:hover,
.login-submit-button:hover:not(:disabled),
.account-apply-button:hover:not(:disabled),
.user-more-dropdown button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .primary-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .ghost-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .compact-admin-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .topbar-tab:hover,
body:has(#appScreen:not(.hidden)) .admin-tab:hover,
body:has(#appScreen:not(.hidden)) .tool-chip:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .forge-tool-preset:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .canvas-icon-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .canvas-new-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .icon-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .toolbar-jump-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .result-card-more-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .result-actions-menu-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .preview-head-action:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .preview-text-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .preview-tool-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .preview-nav-float:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .sidebar-logout-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .canvas-create-menu button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .control-action-buttons .primary-button:not(:disabled):hover,
body:has(#appScreen:not(.hidden)) .prompt-actions .ghost-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .prompt-ai-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .prompt-image-to-prompt-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .job-feed-actions .ghost-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .result-card-actions .ghost-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) .result-card-actions a.ghost-button:hover {
  border-color: rgba(34,197,94,0.58) !important;
  background: #dcfce7 !important;
  color: #14532d !important;
  box-shadow: 0 10px 22px rgba(34,197,94,0.14) !important;
}

body:has(#appScreen:not(.hidden)) .control-action-buttons .primary-button#runButton,
body:has(#appScreen:not(.hidden)) .control-action-buttons .primary-button#runButton:not(:disabled):hover {
  border-color: rgba(34,197,94,0.72) !important;
  background: linear-gradient(180deg, #86efac, #22c55e) !important;
  color: #052e16 !important;
  box-shadow: 0 12px 26px rgba(34,197,94,0.24) !important;
}

/* Task card layout fix: keep live generation cards readable under long status text. */
body:has(#appScreen:not(.hidden)) #jobsList .job-feed-item {
  overflow: visible !important;
  grid-template-columns: 12px minmax(0, 1fr) !important;
  padding-right: 8px !important;
}

body:has(#appScreen:not(.hidden)) #jobsList .job-feed-content {
  min-width: 0 !important;
  position: relative !important;
  z-index: 2 !important;
}

body:has(#appScreen:not(.hidden)) #jobsList .job-feed-line {
  grid-template-columns: minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 4px !important;
}

body:has(#appScreen:not(.hidden)) #jobsList .job-feed-title,
body:has(#appScreen:not(.hidden)) #jobsList .job-feed-status {
  max-width: 100% !important;
  justify-self: start !important;
}

body:has(#appScreen:not(.hidden)) #jobsList .job-feed-title {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  overflow-wrap: anywhere !important;
  line-height: 1.35 !important;
}

body:has(#appScreen:not(.hidden)) #jobsList .job-feed-status {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  line-height: 1.35 !important;
}

body:has(#appScreen:not(.hidden)) #jobsList .job-feed-actions {
  position: relative !important;
  z-index: 3 !important;
  max-width: 100% !important;
}

body:has(#appScreen:not(.hidden)) #jobsList .job-feed-actions .ghost-button {
  flex: 0 1 auto !important;
}

/* Preview detail actions: compact, stable toolbar layout. */
#previewModal .preview-meta-actions {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 6px !important;
  padding: 6px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  background: rgba(255,255,255,0.035) !important;
  box-shadow: none !important;
}

#previewModal .preview-head-action {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 38px !important;
  height: 38px !important;
  padding: 0 10px !important;
  border-radius: 9px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  color: rgba(255,255,255,0.88) !important;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  text-decoration: none !important;
}

#previewModal .preview-head-action:hover:not(:disabled) {
  border-color: rgba(143,208,183,0.28) !important;
  background: rgba(143,208,183,0.09) !important;
  color: #d8f5e8 !important;
  box-shadow: none !important;
}

#previewModal .preview-head-action-icon {
  width: 18px !important;
  height: 18px !important;
  flex: 0 0 18px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#previewModal .preview-head-action-icon svg {
  width: 18px !important;
  height: 18px !important;
  display: block !important;
}

#previewModal .preview-head-action-label {
  min-width: 0 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

#previewModal .preview-download-icon-button {
  color: rgba(216,245,232,0.94) !important;
}

#previewModal .preview-head-action.is-active {
  color: #ffb3c1 !important;
  border-color: rgba(255,141,161,0.24) !important;
  background: rgba(255,141,161,0.1) !important;
}

/* Preview stage: open images fitted and centered; zoomed images remain pannable. */
#previewModal .modal-stage.is-image-preview {
  display: grid !important;
  place-items: center !important;
  align-content: center !important;
  justify-items: center !important;
  overflow: hidden !important;
  padding: 18px !important;
  background:
    linear-gradient(45deg, rgba(255,255,255,0.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.035) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.035) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.035) 75%),
    #0b0c0e !important;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0 !important;
  background-size: 20px 20px !important;
}

#previewModal .modal-stage.is-image-preview.is-pannable {
  cursor: grab !important;
}

#previewModal .modal-stage.is-image-preview > img:not(.preview-comparison-image),
#previewModal .modal-stage.is-image-preview > .preview-scroll-image:not(.preview-comparison-image),
#previewModal .modal-stage.is-image-preview .preview-comparison-stack {
  width: var(--preview-image-natural-width, auto) !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
}

#previewModal .modal-stage.is-image-preview img {
  transform-origin: center center !important;
}

@media (max-width: 520px) {
  #previewModal .preview-meta-actions {
    grid-template-columns: 1fr !important;
  }

  #previewModal .preview-head-action {
    justify-content: flex-start !important;
  }
}

/* Preview detail viewport fit: the whole detail page adapts to the current screen. */
#previewModal {
  width: 100dvw !important;
  height: 100dvh !important;
  max-width: 100dvw !important;
  max-height: 100dvh !important;
  padding: 0 !important;
  place-items: stretch !important;
  overflow: hidden !important;
}

#previewModal .preview-modal-card {
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  max-height: none !important;
  margin: 0 !important;
  padding: clamp(10px, 1.6dvw, 18px) !important;
  border-radius: 0 !important;
  overflow: hidden !important;
}

#previewModal .preview-layout {
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  display: grid !important;
  grid-template-columns: clamp(72px, 7dvw, 96px) minmax(0, 1fr) minmax(280px, clamp(300px, 24dvw, 380px)) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  gap: clamp(8px, 1.2dvw, 16px) !important;
}

#previewModal .preview-left-rail,
#previewModal .preview-center-stage,
#previewModal .preview-right-panel {
  min-width: 0 !important;
  min-height: 0 !important;
}

#previewModal .preview-left-rail {
  width: auto !important;
  padding-top: clamp(8px, 1.4dvh, 18px) !important;
}

#previewModal .preview-center-stage {
  width: 100% !important;
  height: 100% !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  gap: 8px !important;
  padding-inline: 0 !important;
}

#previewModal .preview-stage-header {
  min-height: 34px !important;
  padding-top: 0 !important;
  flex-wrap: wrap !important;
}

#previewModal .preview-image-controls {
  max-width: 100% !important;
  overflow-x: auto !important;
  scrollbar-width: thin !important;
}

#previewModal .modal-stage-wrap {
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  min-height: 0 !important;
  align-self: stretch !important;
}

#previewModal .modal-stage {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
}

#previewModal .preview-stage-footer {
  min-height: 22px !important;
}

#previewModal .preview-right-panel {
  width: auto !important;
  max-height: none !important;
  height: 100% !important;
  overflow-y: auto !important;
  padding: clamp(8px, 1.4dvh, 18px) 4px 8px 0 !important;
}

@media (max-width: 1180px) {
  #previewModal .preview-layout {
    grid-template-columns: clamp(68px, 8dvw, 84px) minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) minmax(180px, 30dvh) !important;
  }

  #previewModal .preview-right-panel {
    grid-column: 1 / -1 !important;
    height: auto !important;
    max-height: none !important;
    padding: 0 4px 8px !important;
  }
}

@media (max-width: 760px) {
  #previewModal {
    overflow-y: auto !important;
  }

  #previewModal .preview-modal-card {
    min-height: 100dvh !important;
    height: auto !important;
    overflow: visible !important;
    padding: 10px !important;
  }

  #previewModal .preview-layout {
    height: auto !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto minmax(360px, calc(100dvh - 240px)) auto !important;
  }

  #previewModal .preview-left-rail {
    order: 1 !important;
    width: auto !important;
    padding-top: 0 !important;
  }

  #previewModal .preview-center-stage {
    order: 2 !important;
    min-height: 360px !important;
  }

  #previewModal .preview-right-panel {
    order: 3 !important;
    grid-column: auto !important;
    height: auto !important;
    overflow: visible !important;
    padding: 0 0 8px !important;
  }

  #previewModal .preview-rail-section {
    grid-auto-flow: column !important;
    grid-auto-columns: minmax(108px, 1fr) !important;
    overflow-x: auto !important;
  }

  #previewModal .preview-stage-header {
    align-items: stretch !important;
  }

  #previewModal .preview-modal-close {
    top: 10px !important;
    right: 10px !important;
  }
}

/* Preview image centering: anchor artwork to the exact center of the stage. */
#previewModal .modal-stage.is-image-preview > img:not(.preview-comparison-image),
#previewModal .modal-stage.is-image-preview > .preview-scroll-image:not(.preview-comparison-image),
#previewModal .modal-stage.is-image-preview .preview-comparison-stack {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  width: var(--preview-image-natural-width, auto) !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
}

#previewModal .modal-stage.is-image-preview .preview-comparison-stack {
  transform-origin: center center !important;
}

#previewModal .modal-stage.is-image-preview .preview-comparison-stack > .preview-comparison-image {
  width: 100% !important;
  max-width: none !important;
}

#previewModal .modal-stage.is-image-preview .preview-comparison-stack > .preview-comparison-image.is-edited {
  position: relative !important;
  left: auto !important;
  top: auto !important;
}

#previewModal .modal-stage.is-image-preview .preview-comparison-stack > .preview-comparison-image.is-source {
  position: absolute !important;
  inset: 0 auto auto 0 !important;
}

/* Keep the sidebar profile readable under the final app-theme overrides. */
body:has(#appScreen:not(.hidden)) button.sidebar-profile-button:hover:not(:disabled),
body:has(#appScreen:not(.hidden)) button.sidebar-profile-button:focus-visible:not(:disabled) {
  transform: none !important;
  border-color: rgba(255,255,255,0.10) !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.014)),
    rgba(19, 21, 23, 0.98) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

body:has(#appScreen:not(.hidden)) .sidebar-profile-button:hover #profileName,
body:has(#appScreen:not(.hidden)) .sidebar-profile-button:focus-visible #profileName {
  color: #ffffff !important;
}

body:has(#appScreen:not(.hidden)) .sidebar-profile-button:hover #profileEmail,
body:has(#appScreen:not(.hidden)) .sidebar-profile-button:focus-visible #profileEmail {
  color: #e6edf5 !important;
}

/* Final login layout override: isolate login page from global layout breakpoints. */
#loginScreen .login-shell {
  width: min(1072px, calc(100vw - 64px));
  display: grid;
  gap: 14px;
  margin: 0 auto;
}

#loginScreen .login-card {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 388px;
  gap: 56px;
  align-items: stretch;
  margin: 0;
  padding: 28px 30px;
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.014)),
    rgba(11,13,16,0.54);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 24px 60px rgba(0,0,0,0.20);
}

#loginScreen .login-showcase {
  width: 100%;
  min-width: 0;
  display: grid;
  align-content: stretch;
  justify-items: stretch;
  justify-self: start;
  align-self: stretch;
  margin: 0;
}

#loginScreen .login-community-hero {
  width: 100%;
  height: 100%;
  min-height: 548px;
  display: block;
  position: relative;
  overflow: hidden;
  padding: 0;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.045);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.018), rgba(255,255,255,0.004)),
    rgba(255,255,255,0.008);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.014),
    0 8px 20px rgba(0,0,0,0.05);
}

#loginScreen .login-community-hero-media {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  overflow: hidden;
  padding: 0;
  background: transparent;
}

#loginScreen .login-community-hero-media-backdrop {
  display: none;
}

#loginScreen .login-community-hero-media-image {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  object-position: center center;
  border-radius: 0;
  box-shadow:
    none;
}

#loginScreen .login-community-hero.is-landscape .login-community-hero-media-image,
#loginScreen .login-community-hero.is-square .login-community-hero-media-image {
  object-position: center 44%;
}

#loginScreen .login-community-hero.is-portrait .login-community-hero-media-image {
  object-position: center 38%;
}

#loginScreen .login-community-hero.is-portrait-safe-top .login-community-hero-media-image {
  object-position: center 28%;
}

#loginScreen .login-community-hero-empty {
  width: 100%;
  height: 100%;
  min-height: 100%;
  border-radius: 18px;
  background:
    radial-gradient(circle at center, rgba(255,255,255,0.022), rgba(255,255,255,0.008) 58%, transparent 100%);
}

#loginScreen .login-community-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(143,208,183,0.22);
  background: rgba(7, 10, 12, 0.66);
  color: #def7ea;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.16);
}

#loginScreen .login-panel {
  width: 100%;
  max-width: 388px;
  min-height: 548px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-self: stretch;
  justify-self: end;
  gap: 20px;
  padding: 22px 10px 18px 18px;
  margin: 16px -6px 0 0;
  border: 0;
  border-left: 1px solid rgba(255,255,255,0.04);
  border-radius: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.012), rgba(255,255,255,0.004));
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

#loginScreen .login-copy {
  width: min(100%, 320px);
  justify-items: center;
  text-align: center;
  gap: 6px;
  padding: 0 0 10px;
  margin: 0 auto;
}

#loginScreen .brand-lockup.login-brand {
  justify-content: center;
  gap: 8px 12px;
}

#loginScreen .login-copy h1 {
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.04;
  font-weight: 800;
}

#loginScreen .login-mode-hint {
  min-height: 18px;
  color: rgba(201,205,211,0.72);
  font-size: 12px;
  line-height: 1.45;
}

#loginScreen .login-form {
  width: min(100%, 320px);
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin: 0 auto;
}

#loginScreen .login-form .field,
#loginScreen .login-form label.field {
  width: 100%;
}

#loginScreen .login-form .field span {
  text-align: left;
  padding-left: 2px;
}

#loginScreen .login-form select,
#loginScreen .login-form input {
  min-height: 48px;
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(9,10,12,0.82);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

#loginScreen .login-form input::placeholder {
  color: rgba(154, 160, 169, 0.84);
}

#loginScreen .login-form input:focus,
#loginScreen .login-form select:focus {
  outline: none;
  border-color: rgba(255,255,255,0.08);
  background: rgba(9,10,12,0.82);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}

#loginScreen .login-form input:-webkit-autofill,
#loginScreen .login-form input:-webkit-autofill:hover,
#loginScreen .login-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  box-shadow: 0 0 0 1000px rgba(9,10,12,0.82) inset;
  caret-color: var(--text);
}

#loginScreen .login-submit-button {
  font-weight: 800;
  letter-spacing: 0.01em;
}

#loginScreen .login-remember-option {
  width: 100%;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  color: rgba(201,205,211,0.8);
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
  user-select: none;
}

#loginScreen .login-remember-option input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  border-radius: 5px;
  accent-color: #22c55e;
  cursor: pointer;
}

#loginScreen .login-session-note {
  width: min(100%, 320px);
  margin: -4px auto 0;
  color: rgba(159, 169, 184, 0.76);
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
}

#loginScreen .login-form.is-loading {
  pointer-events: none;
}

#loginScreen .login-form.is-loading input,
#loginScreen .login-form.is-loading select {
  opacity: 0.82;
}

#loginScreen .login-submit-button.is-loading {
  position: relative;
  overflow: hidden;
}

#loginScreen .login-submit-button.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.32), transparent);
  transform: translateX(-100%);
  animation: loginButtonSweep 1.1s ease-in-out infinite;
}

#loginScreen .login-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 6, 8, 0.48);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

#loginScreen .login-loading-overlay.hidden {
  display: none;
}

#loginScreen .login-loading-panel {
  width: min(280px, calc(100vw - 48px));
  min-height: 142px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 9px;
  padding: 22px;
  border: 1px solid rgba(143,208,183,0.24);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.026)),
    rgba(10, 12, 14, 0.88);
  color: var(--text);
  box-shadow: 0 24px 68px rgba(0,0,0,0.34);
}

#loginScreen .login-loading-panel strong {
  font-size: 15px;
  font-weight: 850;
}

#loginScreen .login-loading-panel span:last-child {
  color: rgba(201,205,211,0.76);
  font-size: 12px;
}

#loginScreen .login-loading-spinner {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 3px solid rgba(143,208,183,0.18);
  border-top-color: #7ff0aa;
  animation: loginSpin 0.82s linear infinite;
}

#loginScreen .login-message {
  margin-top: 4px;
  text-align: center;
}

#loginScreen .login-copyright {
  width: 100%;
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(159, 169, 184, 0.76);
  text-align: center;
  padding-top: 0;
}

@media (max-width: 1080px) {
  #loginScreen .login-card {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) 328px;
    gap: 42px;
    padding: 22px 20px;
    border-radius: 24px;
  }

  #loginScreen .login-shell {
    width: min(872px, calc(100vw - 36px));
  }

  #loginScreen .login-showcase {
    width: 100%;
    min-width: 0;
    justify-items: stretch;
  }

  #loginScreen .login-community-hero {
    width: 100%;
    height: 100%;
    min-height: 458px;
    padding: 0;
    border-radius: 14px;
  }

  #loginScreen .login-community-badge {
    top: 12px;
    left: 12px;
  }

  #loginScreen .login-community-hero-media {
    padding: 0;
  }

  #loginScreen .login-panel {
    max-width: 328px;
    min-height: 458px;
    justify-self: end;
    padding: 18px 4px 14px 18px;
    margin: 12px -4px 0 0;
    border-left: 1px solid rgba(255,255,255,0.04);
  }
}

@media (max-width: 720px) {
  #loginScreen .login-card {
    width: 100%;
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 12px;
    border-radius: 18px;
  }

  #loginScreen .login-shell {
    width: min(100%, calc(100vw - 20px));
    gap: 10px;
  }

  #loginScreen .login-showcase {
    width: 100%;
    min-width: 0;
    order: 2;
    justify-items: stretch;
  }

  #loginScreen .login-community-hero {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 0;
    padding: 0;
    border-radius: 14px;
  }

  #loginScreen .login-community-badge {
    top: 10px;
    left: 10px;
    min-height: 26px;
    padding: 0 10px;
    font-size: 11px;
  }

  #loginScreen .login-community-hero-media {
    height: auto;
    min-height: 0;
    padding: 0;
  }

  #loginScreen .login-community-hero-media-image {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: min(48vh, 420px);
    object-fit: contain;
    border-radius: 10px;
  }

  #loginScreen .login-panel {
    order: 1;
    max-width: none;
    min-height: 0;
    align-self: stretch;
    justify-content: flex-start;
    padding: 0;
    border: 0;
    border-left: 0;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
  }

  #loginScreen .login-copyright {
    margin-top: 6px;
    text-align: center;
  }
}

/* PPT generator parity with the main workbench. */
body:has(#appScreen:not(.hidden)) #presentationView {
  min-height: calc(100vh - 144px);
  border-radius: 12px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255,255,255,0.035), transparent 28%),
    radial-gradient(circle at 84% 8%, rgba(143,208,183,0.045), transparent 26%),
    linear-gradient(180deg, #050607, #111316 58%, #121417);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-panel {
  gap: 12px;
  padding: 12px;
  border-color: rgba(255,255,255,0.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.014)),
    rgba(17,19,22,0.94);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-panel > .panel-head {
  min-height: 54px;
  align-items: center;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.018)),
    rgba(19,21,23,0.92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-hero-copy h3,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-section-head h4,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-editor-head h4,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-metric-card strong,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-summary-item strong,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-copy strong,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-reference-head strong,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-nav-item strong {
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-hero-copy p,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-metric-card span,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-summary-item span,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-copy small,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-reference-head,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-reference-meta span,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-reference-preview,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-nav-item span,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-nav-item small,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-head,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-meta,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-editor-head p:last-child {
  color: var(--muted);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-layout {
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 12px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-form-panel,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-slides-panel {
  gap: 10px;
}

body:has(#appScreen:not(.hidden)) #presentationView .panel-shell,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-panel-section,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-metric-card,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-summary-item,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-message-card,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-item,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-reference-card,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-flow-card,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-nav-item,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-card,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-design-grid {
  border-color: rgba(255,255,255,0.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.014)),
    rgba(17,19,22,0.90);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

body:has(#appScreen:not(.hidden)) #presentationView .panel-shell {
  padding: 12px;
  border-radius: 16px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-panel-section {
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-brief-section {
  border-color: rgba(143,208,183,0.18);
  background:
    radial-gradient(circle at 0% 0%, rgba(143,208,183,0.12), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.014)),
    rgba(14,18,16,0.86);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-brief-section textarea {
  min-height: 196px;
  border-radius: 14px;
  font-size: 16px;
  line-height: 1.58;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-section-tag,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-pipeline-step {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.025)),
    rgba(19,21,23,0.90);
  color: var(--soft);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-section-tag {
  min-height: 28px;
  padding: 0 10px;
  font-size: 11px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-pipeline-step.is-active {
  border-color: rgba(143,208,183,0.34);
  background: rgba(143,208,183,0.14);
  color: var(--success);
  box-shadow: 0 10px 24px rgba(143,208,183,0.08);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-pipeline-step.is-complete {
  border-color: rgba(143,208,183,0.22);
  background: rgba(143,208,183,0.08);
  color: var(--soft);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-summary-item,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-metric-card {
  border-radius: 12px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-metric-card strong {
  font-size: 18px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-inline-toggle-card {
  align-items: center;
  border-color: rgba(143,208,183,0.18);
  background: rgba(143,208,183,0.07);
  color: var(--soft);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-primary-actions .primary-button {
  min-width: 160px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-editor-head {
  align-items: center;
  padding: 0 0 10px;
  border-bottom-color: rgba(255,255,255,0.08);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-nav-item:hover,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-item:hover {
  border-color: rgba(34,197,94,0.38);
  background:
    linear-gradient(180deg, rgba(34,197,94,0.10), rgba(255,255,255,0.018)),
    rgba(17,19,22,0.94);
  box-shadow: 0 12px 24px rgba(34,197,94,0.08);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-nav-item.is-open,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-nav-item.active,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-item.active {
  border-color: rgba(143,208,183,0.34);
  background:
    linear-gradient(135deg, rgba(143,208,183,0.18), rgba(255,255,255,0.07)),
    rgba(31,33,37,0.94);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-row.active .presentation-history-delete {
  border-color: rgba(143,208,183,0.26);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-reference-preview {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 8px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-card.is-expanded {
  border-color: rgba(143,208,183,0.18);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.035),
    0 18px 42px rgba(0,0,0,0.18);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-head {
  border-bottom-color: rgba(255,255,255,0.08);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-head strong,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-toggle span:last-child {
  color: var(--soft);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-image {
  min-height: 220px;
  border-color: rgba(255,255,255,0.10);
  border-radius: 16px;
  background:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px),
    #090b0f;
  background-size: 28px 28px;
  color: var(--muted);
}

body:has(#appScreen:not(.hidden)) #presentationView div.presentation-slide-image.empty-state {
  display: grid;
  place-items: center;
  text-align: center;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slides-list.empty-state,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-slides-list .empty-state,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-nav.empty-state,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-reference-list.empty-state,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-list.empty-state {
  border: 1px dashed rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.035);
  color: var(--muted);
}

body:has(#appScreen:not(.hidden)) #presentationView input,
body:has(#appScreen:not(.hidden)) #presentationView textarea,
body:has(#appScreen:not(.hidden)) #presentationView select {
  border-color: rgba(255,255,255,0.12);
  background-color: rgba(16,17,19,0.96);
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) #presentationView input:focus,
body:has(#appScreen:not(.hidden)) #presentationView textarea:focus,
body:has(#appScreen:not(.hidden)) #presentationView select:focus {
  border-color: rgba(143,208,183,0.54);
  box-shadow: 0 0 0 3px rgba(143,208,183,0.13);
}

@media (max-width: 1100px) {
  body:has(#appScreen:not(.hidden)) #presentationView .presentation-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  body:has(#appScreen:not(.hidden)) #presentationView .presentation-panel > .panel-head {
    align-items: stretch;
  }
}

@media (max-width: 720px) {
  body:has(#appScreen:not(.hidden)) #presentationView {
    min-height: auto;
  }

  body:has(#appScreen:not(.hidden)) #presentationView .presentation-panel {
    padding: 10px;
  }

  body:has(#appScreen:not(.hidden)) #presentationView .presentation-panel > .panel-head {
    display: grid;
  }

  body:has(#appScreen:not(.hidden)) #presentationView .presentation-primary-actions .primary-button,
  body:has(#appScreen:not(.hidden)) #presentationView .presentation-primary-actions .ghost-button,
  body:has(#appScreen:not(.hidden)) #presentationView .presentation-primary-actions a.ghost-button {
    flex: 1 1 160px;
  }
}

/* PPT workbench layout refinement: denser controls, lighter stage, fewer nested-card cues. */
body:has(#appScreen:not(.hidden)) #presentationView {
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 132px);
  padding: 0;
  background: transparent;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-panel {
  width: 100%;
  max-width: none;
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-panel > .panel-head {
  min-height: 50px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 14px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-hero-copy {
  gap: 2px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-hero-copy .eyebrow {
  margin: 0;
  font-size: 9px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-hero-copy h3 {
  font-size: 18px;
  line-height: 1.1;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-hero-metrics {
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-metric-card {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border-radius: 999px;
  white-space: nowrap;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-metric-card strong,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-metric-card span {
  font-size: 11px;
  line-height: 1;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-metric-card strong {
  font-weight: 900;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-layout {
  grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

body:has(#appScreen:not(.hidden)) #presentationView .panel-shell {
  border: 0;
  background: transparent;
  box-shadow: none;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-form-panel {
  position: sticky;
  top: calc(var(--workspace-head-height) + 86px);
  max-height: calc(100vh - 154px);
  overflow: auto;
  padding: 0 2px 0 0;
  align-content: start;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slides-panel {
  min-height: calc(100vh - 154px);
  align-content: start;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.042), rgba(255,255,255,0.012)),
    rgba(13,15,18,0.86);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-panel-section {
  gap: 9px;
  padding: 10px;
  border-radius: 12px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-section-head {
  align-items: center;
  gap: 8px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-section-head .eyebrow,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-editor-head .eyebrow {
  display: none;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-section-head h4,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-editor-head h4 {
  color: var(--soft);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.25;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-section-tag {
  min-height: 22px;
  padding: 0 8px;
  font-size: 10px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-flow-board {
  gap: 8px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-flow-card {
  gap: 7px;
  padding: 11px 11px 10px;
  border-radius: 14px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-flow-card::after {
  background: rgba(255,255,255,0.08);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-flow-card strong {
  color: var(--soft);
  font-size: 13px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-flow-card p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-flow-index,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-flow-state {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: rgba(230,238,246,0.72);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-flow-card.is-current {
  border-color: rgba(125,211,252,0.28);
  background:
    radial-gradient(circle at top left, rgba(14,165,233,0.16), transparent 36%),
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.018)),
    rgba(11,23,32,0.9);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-flow-card.is-current::after {
  background: linear-gradient(90deg, rgba(125,211,252,0.9), rgba(56,189,248,0.4));
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-flow-card.is-current .presentation-flow-index,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-flow-card.is-current .presentation-flow-state {
  border-color: rgba(125,211,252,0.28);
  background: rgba(14,165,233,0.12);
  color: #7dd3fc;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-flow-card.is-complete {
  border-color: rgba(143,208,183,0.24);
  background:
    radial-gradient(circle at top left, rgba(143,208,183,0.13), transparent 36%),
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.018)),
    rgba(10,24,18,0.9);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-flow-card.is-complete::after {
  background: linear-gradient(90deg, rgba(134,239,172,0.82), rgba(52,211,153,0.38));
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-flow-card.is-complete .presentation-flow-index,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-flow-card.is-complete .presentation-flow-state {
  border-color: rgba(143,208,183,0.24);
  background: rgba(34,197,94,0.12);
  color: #86efac;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-flow-card.is-failed {
  border-color: rgba(248,113,113,0.24);
  background:
    radial-gradient(circle at top left, rgba(239,68,68,0.14), transparent 36%),
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.018)),
    rgba(34,14,18,0.9);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-flow-card.is-failed::after {
  background: linear-gradient(90deg, rgba(248,113,113,0.88), rgba(239,68,68,0.4));
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-flow-card.is-failed .presentation-flow-index,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-flow-card.is-failed .presentation-flow-state {
  border-color: rgba(248,113,113,0.24);
  background: rgba(239,68,68,0.12);
  color: #fca5a5;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-control-stack {
  gap: 8px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-brief-helper {
  gap: 8px;
  padding: 9px;
  border-color: rgba(255,255,255,0.09);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012)),
    rgba(12,14,16,0.74);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-brief-helper-head {
  align-items: start;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-brief-helper-head strong {
  color: var(--soft);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-brief-helper-head span {
  color: var(--muted);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-helper-tag {
  background: rgba(143,208,183,0.1);
  color: var(--success) !important;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-tabs {
  gap: 5px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-tab {
  min-height: 26px;
  padding: 0 8px;
  border-color: rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-tab.active {
  border-color: rgba(143,208,183,0.25);
  background: rgba(143,208,183,0.1);
  color: var(--success);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-cards {
  gap: 7px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-card {
  min-height: 64px;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 8px;
  border-color: rgba(255,255,255,0.09);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.014)),
    rgba(17,19,22,0.88);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-card:hover {
  border-color: rgba(143,208,183,0.24);
  background:
    linear-gradient(180deg, rgba(143,208,183,0.08), rgba(255,255,255,0.014)),
    rgba(18,22,20,0.9);
  box-shadow: 0 12px 24px rgba(0,0,0,0.16);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-card.active {
  border-color: rgba(143,208,183,0.32);
  background:
    linear-gradient(135deg, rgba(143,208,183,0.16), rgba(255,255,255,0.04)),
    rgba(19,24,21,0.92);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-card-mark {
  width: 7px;
  height: 38px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-card-title {
  color: var(--soft);
  font-size: 12px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-card-kicker,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-card-label {
  color: var(--muted);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-card-structure em {
  background: rgba(255,255,255,0.055);
  color: rgba(230,238,246,0.68);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-template-layouts span {
  background: rgba(255,255,255,0.055);
  color: rgba(230,238,246,0.72);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-card-state {
  min-width: 32px;
  min-height: 22px;
  border-color: rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-card.active .presentation-style-card-state {
  border-color: rgba(143,208,183,0.24);
  background: rgba(143,208,183,0.1);
  color: var(--success);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-brief-section textarea {
  min-height: 132px;
  font-size: 14px;
  line-height: 1.55;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-form-grid-wide {
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 8px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-inline-toggle-card {
  grid-column: 1 / -1;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 12px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-summary-item {
  min-height: 48px;
  gap: 3px;
  padding: 8px 9px;
  border-radius: 10px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-summary-item span {
  font-size: 10px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-summary-item strong {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-reference-panel .form-note {
  display: none;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-reference-actions,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-primary-actions,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-secondary-actions,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-workspace-actions {
  gap: 7px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-primary-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: stretch;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-primary-actions .primary-button {
  min-width: 0;
  width: 100%;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-draft-status {
  min-height: 32px;
  padding-inline: 10px;
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: rgba(230,238,246,0.72);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-draft-status.is-dirty {
  border-color: rgba(251,191,36,0.28);
  background: rgba(251,191,36,0.1);
  color: #fbbf24;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-draft-status.is-working {
  border-color: rgba(125,211,252,0.28);
  background: rgba(14,165,233,0.1);
  color: #7dd3fc;
}

body:has(#appScreen:not(.hidden)) #presentationView .ghost-button.is-stale {
  border-color: rgba(251,191,36,0.3);
  background: rgba(251,191,36,0.09);
  color: #facc15;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-secondary-actions .ghost-button,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-workspace-actions .ghost-button,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-reference-actions .ghost-button {
  min-height: 32px;
  padding-inline: 10px;
  font-size: 12px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-pipeline-status {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-pipeline-step {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 10px;
  font-size: 11px;
  line-height: 28px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-message-card {
  padding: 9px 10px;
  border-radius: 12px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-generate-hint {
  padding: 9px 10px;
  border-radius: 12px;
  border-color: rgba(255,255,255,0.1);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.014)),
    rgba(17,19,22,0.9);
  color: var(--muted);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-generate-hint.is-pass {
  border-color: rgba(143,208,183,0.24);
  background: rgba(34,197,94,0.08);
  color: #86efac;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-generate-hint.is-warn {
  border-color: rgba(251,191,36,0.24);
  background: rgba(251,191,36,0.08);
  color: #fde68a;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-generate-hint.is-info {
  border-color: rgba(125,211,252,0.24);
  background: rgba(14,165,233,0.08);
  color: #bae6fd;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-reference-list,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-list {
  max-height: 240px;
  overflow: auto;
  padding-right: 2px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-reference-card,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-item {
  padding: 10px;
  border-radius: 12px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-delete-button {
  border-color: rgba(248,113,113,0.2);
  background:
    linear-gradient(180deg, rgba(248,113,113,0.12), rgba(127,29,29,0.08)),
    rgba(25,17,19,0.9);
  color: #fecaca;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-delete-button:hover:not(:disabled) {
  border-color: rgba(252,165,165,0.34);
  background:
    linear-gradient(180deg, rgba(248,113,113,0.18), rgba(127,29,29,0.1)),
    rgba(30,17,20,0.92);
  color: #fee2e2;
  box-shadow: 0 14px 24px rgba(127, 29, 29, 0.2);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-delete {
  min-width: 92px;
  padding-inline: 10px;
  font-size: 12px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-copy {
  min-width: 0;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-status {
  min-height: 24px;
  padding-inline: 8px;
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: rgba(230,238,246,0.72);
  font-size: 11px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-status.is-success {
  border-color: rgba(34,197,94,0.25);
  background: rgba(34,197,94,0.1);
  color: #86efac;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-status.is-warning {
  border-color: rgba(251,191,36,0.28);
  background: rgba(251,191,36,0.1);
  color: #fbbf24;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-status.is-danger {
  border-color: rgba(248,113,113,0.28);
  background: rgba(248,113,113,0.1);
  color: #fca5a5;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-copy strong,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-filters {
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 8px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-editor-head {
  min-height: 42px;
  align-items: center;
  gap: 10px;
  padding-bottom: 9px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-editor-head p:last-child {
  display: none;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-editor-controls {
  gap: 7px;
  justify-content: flex-end;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-editor-controls .ghost-button {
  min-height: 30px;
  padding-inline: 10px;
  font-size: 12px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-nav {
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 7px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-nav-item {
  min-height: 58px;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 8px;
  row-gap: 2px;
  padding: 8px 9px;
  border-radius: 12px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-nav-item strong {
  grid-row: 1 / 3;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  font-size: 12px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-nav-item span,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-nav-item small {
  min-width: 0;
  font-size: 11px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slides-list {
  gap: 10px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-card {
  gap: 9px;
  padding: 12px;
  border-radius: 14px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-card.is-collapsed {
  padding: 10px 12px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-toggle {
  min-height: 30px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-head {
  padding-bottom: 4px;
  font-size: 11px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-meta {
  margin-top: -4px;
  font-size: 11px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-body {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.72fr);
  align-items: start;
  gap: 10px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-body > .field:nth-of-type(1),
body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-body > .field:nth-of-type(3) {
  grid-column: 1;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-body > .field:nth-of-type(2),
body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-body > .field:nth-of-type(4) {
  grid-column: 2;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-body > .field textarea {
  min-height: 116px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-body > .field:nth-of-type(1) input,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-body > .field:nth-of-type(2) input {
  min-height: 38px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-design-grid,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-actions,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-image {
  grid-column: 1 / -1;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-design-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-actions {
  gap: 7px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-actions .ghost-button {
  min-height: 32px;
  padding-inline: 10px;
  font-size: 12px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-image {
  min-height: 176px;
  max-height: 320px;
  object-fit: contain;
}

@media (max-width: 1180px) {
  body:has(#appScreen:not(.hidden)) #presentationView .presentation-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  body:has(#appScreen:not(.hidden)) #presentationView .presentation-form-panel {
    position: static;
    max-height: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  body:has(#appScreen:not(.hidden)) #presentationView .presentation-brief-section,
  body:has(#appScreen:not(.hidden)) #presentationView .presentation-action-section {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  body:has(#appScreen:not(.hidden)) #presentationView .presentation-panel > .panel-head,
  body:has(#appScreen:not(.hidden)) #presentationView .presentation-flow-board,
  body:has(#appScreen:not(.hidden)) #presentationView .presentation-primary-actions,
  body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-filters,
  body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-body,
  body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-design-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body:has(#appScreen:not(.hidden)) #presentationView .presentation-hero-metrics {
    justify-content: flex-start;
    overflow-x: auto;
  }

  body:has(#appScreen:not(.hidden)) #presentationView .presentation-form-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-body > .field:nth-of-type(1),
  body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-body > .field:nth-of-type(2),
  body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-body > .field:nth-of-type(3),
  body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-body > .field:nth-of-type(4) {
    grid-column: auto;
  }
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-layout {
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: 12px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-form-panel {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 116px);
  overflow: auto;
  gap: 10px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-brief-section,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-mode-section,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-config-section,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-summary-section,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-reference-panel,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-optional-assets-panel,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-create-run-controls,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit #generatePresentationButton {
  display: none !important;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-primary-actions,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-secondary-actions,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-workspace-actions {
  grid-template-columns: minmax(0, 1fr);
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-history-filters {
  grid-template-columns: minmax(0, 1fr);
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-history-list {
  max-height: 300px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-slides-panel {
  min-height: calc(100vh - 132px);
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-slide-nav {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  max-height: 156px;
  overflow: auto;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-slides-list {
  gap: 12px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-slide-card {
  padding: 14px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-slide-body {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.62fr);
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create #savePresentationButton,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create #downloadPresentationButton,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create #presentationDraftStatus,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-secondary-actions,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-workspace-actions,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create #presentationPipelineStatus {
  display: none !important;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-primary-actions {
  justify-content: flex-start;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-create-run-controls {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-create-run-controls .field {
  min-width: 116px;
}

@media (max-width: 1180px) {
  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-form-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 820px) {
  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-layout,
  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-layout,
  body:has(#appScreen:not(.hidden)) #presentationView .presentation-generation-modes,
  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-slide-body {
    grid-template-columns: minmax(0, 1fr);
  }

  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-slide-nav {
    max-height: 220px;
  }
}

/* PPT workspace IA reset: create as one clean form, edit as focused two-column stage. */
body:has(#appScreen:not(.hidden)) #presentationView .presentation-panel > .panel-head {
  display: none;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-layout {
  width: 100%;
  max-width: none;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-form-panel {
  position: static;
  max-height: none;
  overflow: visible;
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  grid-column: 1 / -1;
  gap: 12px;
  padding: 0;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-slides-panel,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-slide-nav-panel,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-flow-board {
  display: none !important;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-create-entry {
  display: grid;
  grid-column: 2;
  gap: 12px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-history-panel {
  display: grid !important;
  grid-column: 1;
  grid-row: 1;
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 116px);
  overflow: hidden;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-history-panel .presentation-section-head {
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-history-list {
  max-height: calc(100vh - 302px);
  overflow: auto;
  padding-right: 2px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-history-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 8px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-history-filters .field {
  gap: 4px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-history-filters input,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-history-filters select {
  min-height: 34px;
  padding: 0 9px;
  font-size: 12px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-history-row {
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 6px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-history-item {
  min-height: 58px;
  padding: 9px 10px;
  border-radius: 10px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-history-delete {
  min-width: 0;
  padding-inline: 0;
  border-radius: 10px;
  font-size: 12px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-history-copy {
  gap: 2px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-history-copy strong {
  font-size: 13px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-history-copy small {
  font-size: 11px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-history-status {
  min-height: 22px;
  padding: 0 7px;
  font-size: 10px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-brief-section {
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.018)),
    rgba(13,15,18,0.92);
  box-shadow: 0 18px 42px rgba(0,0,0,0.22);
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-reference-panel,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-template-panel,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-action-section,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-optional-assets-panel,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-history-panel {
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.014)),
    rgba(13,15,18,0.88);
  box-shadow: none;
}

body:has(#appScreen:not(.hidden)) #presentationView input,
body:has(#appScreen:not(.hidden)) #presentationView textarea,
body:has(#appScreen:not(.hidden)) #presentationView select {
  border-color: rgba(255,255,255,0.12);
  background-color: rgba(16,17,19,0.96);
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) #presentationView input:focus,
body:has(#appScreen:not(.hidden)) #presentationView textarea:focus,
body:has(#appScreen:not(.hidden)) #presentationView select:focus {
  border-color: rgba(143,208,183,0.54);
  box-shadow: 0 0 0 3px rgba(143,208,183,0.13);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-brief-helper,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-office-starter,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-guided-steps,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-card,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-generation-mode,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-summary-item,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-reference-card,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-item,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-nav-item,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-generate-hint,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-message-card,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-reference-summary {
  border-color: rgba(255,255,255,0.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.014)),
    rgba(17,19,22,0.88);
  color: var(--soft);
  box-shadow: none;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-brief-helper {
  gap: 14px;
  padding: 14px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-guided-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-guided-steps span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-right: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-guided-steps span:last-child {
  border-right: 0;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-guided-steps strong {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(143,208,183,0.12);
  color: var(--success);
  font-size: 11px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-brief-helper summary {
  cursor: pointer;
  list-style: none;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-brief-helper summary::-webkit-details-marker {
  display: none;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-office-starter {
  display: grid;
  grid-template-columns: minmax(180px, 0.42fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-office-starter-head {
  display: grid;
  gap: 4px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-office-starter-head strong {
  color: var(--soft);
  font-size: 13px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-office-starter-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-office-starter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-office-starter-button {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(143,208,183,0.18);
  border-radius: 999px;
  background: rgba(143,208,183,0.07);
  color: var(--soft);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-office-starter-button:hover {
  border-color: rgba(143,208,183,0.34);
  background: rgba(143,208,183,0.12);
  color: #d1fae5;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-brief-helper-head {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-brief-helper:not([open]) {
  padding: 10px 12px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-brief-helper:not([open]) .presentation-brief-helper-head {
  padding-bottom: 0;
  border-bottom: 0;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-brief-helper-head::before {
  content: "+";
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  color: var(--muted);
  font-weight: 900;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-brief-helper[open] .presentation-brief-helper-head::before {
  content: "-";
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-browser {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-tabs {
  position: sticky;
  top: 96px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-tab {
  min-height: 34px;
  justify-content: flex-start;
  padding: 0 10px;
  border-radius: 10px;
  text-align: left;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-card {
  min-height: 148px;
  grid-template-columns: 74px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
  padding: 12px;
  border-radius: 14px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-card-preview {
  grid-row: 1 / 3;
  min-height: 100%;
  display: grid;
  align-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.018)),
    rgba(255,255,255,0.035);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-card-mark {
  width: 100%;
  height: 28px;
  border-radius: 8px;
  background: var(--presentation-template-accent, #8fd0b7);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-card-slide-lines {
  display: grid;
  gap: 6px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-card-slide-lines i {
  display: block;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-card-slide-lines i:nth-child(2) {
  width: 72%;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-card-slide-lines i:nth-child(3) {
  width: 48%;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-card-copy {
  align-content: start;
  gap: 6px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-card-kicker {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-card-title {
  font-size: 16px;
  line-height: 1.25;
  white-space: normal;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-card-label {
  line-height: 1.45;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-card-structure {
  margin-top: 4px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-card-state {
  grid-column: 2;
  justify-self: start;
  min-height: 28px;
  padding-inline: 10px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-card:hover {
  border-color: rgba(143,208,183,0.24);
  background:
    linear-gradient(180deg, rgba(143,208,183,0.08), rgba(255,255,255,0.014)),
    rgba(18,22,20,0.9);
  box-shadow: 0 12px 24px rgba(0,0,0,0.16);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-card.active,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-generation-mode.active,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-nav-item.active,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-nav-item.is-open,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-item.active {
  border-color: rgba(143,208,183,0.32);
  background:
    linear-gradient(135deg, rgba(143,208,183,0.16), rgba(255,255,255,0.04)),
    rgba(19,24,21,0.92);
  color: var(--text);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-topic-checklist-inline {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px 10px;
  padding: 10px 12px;
  border-color: rgba(255,255,255,0.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.014)),
    rgba(17,19,22,0.88);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-topic-check-status {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--soft);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-topic-check-copy {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-topic-check-points {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-topic-check-points em {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 999px;
  background: rgba(255,255,255,0.035);
  color: rgba(230,238,246,0.58);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-topic-check-points em.is-ok {
  border-color: rgba(143,208,183,0.22);
  background: rgba(143,208,183,0.08);
  color: var(--success);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-topic-checklist-inline.is-pass .presentation-topic-check-status {
  background: rgba(143,208,183,0.12);
  color: var(--success);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-topic-checklist-inline.is-warn .presentation-topic-check-status {
  background: rgba(251,191,36,0.12);
  color: #fbbf24;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-advanced-config {
  gap: 10px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.012)),
    rgba(14,16,19,0.82);
  overflow: hidden;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-advanced-config summary {
  min-height: 44px;
  padding: 0 12px;
  color: var(--soft);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-advanced-config summary::before {
  width: 22px;
  height: 22px;
  align-items: center;
  margin-right: 8px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  color: var(--muted);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-advanced-config summary small {
  max-width: min(52vw, 520px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-advanced-config-body {
  gap: 10px;
  padding: 0 12px 12px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-advanced-block {
  display: grid;
  grid-template-columns: minmax(150px, 0.42fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: rgba(255,255,255,0.026);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-advanced-block-head {
  display: grid;
  gap: 4px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-advanced-block-head strong {
  color: var(--soft);
  font-size: 12px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-advanced-block-head span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-advanced-config .presentation-generation-modes,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-advanced-config .presentation-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-advanced-config .presentation-generation-mode {
  min-height: 64px;
  padding: 10px;
  border-color: rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.035);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-advanced-config .presentation-generation-mode strong {
  color: var(--soft);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-advanced-config .presentation-generation-mode span {
  color: var(--muted);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-advanced-config .presentation-generation-mode.active {
  border-color: rgba(143,208,183,0.30);
  background: rgba(143,208,183,0.09);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-advanced-config .presentation-image-toggle {
  min-height: 42px;
  border-color: rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.035);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-advanced-config .presentation-image-toggle span {
  color: var(--soft);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-brief-helper-head strong,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-card-title,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-summary-item strong,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-copy strong,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-reference-head strong,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-nav-item strong,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-head strong {
  color: var(--soft);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-brief-helper-head span,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-card-kicker,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-card-label,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-summary-item span,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-copy small,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-reference-meta,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-reference-preview,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-nav-item span,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-nav-item small,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-meta {
  color: var(--muted);
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-section-head .eyebrow,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-section-tag {
  display: none;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-section-head h4 {
  font-size: 18px;
  color: var(--soft);
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-brief-section {
  padding: 14px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-control-stack {
  gap: 10px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-light-options {
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: rgba(255,255,255,0.022);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-optional-assets-panel {
  overflow: hidden;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-optional-assets-panel > summary {
  cursor: pointer;
  list-style: none;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-optional-assets-panel > summary::-webkit-details-marker {
  display: none;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-optional-assets-panel > summary::before {
  content: "+";
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  color: var(--muted);
  font-weight: 900;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-optional-assets-panel[open] > summary::before {
  content: "-";
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-optional-assets-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-optional-assets-grid .presentation-reference-panel,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-optional-assets-grid .presentation-template-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: rgba(255,255,255,0.024);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-optional-assets-panel:not([open]) {
  padding-block: 12px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-flow-board {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,0.024);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-flow-card {
  min-height: 70px;
  gap: 4px;
  padding: 12px;
  border: 0;
  border-right: 1px solid rgba(255,255,255,0.08);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-flow-card:last-child {
  border-right: 0;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-flow-card p {
  display: none;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-flow-card strong {
  font-size: 12px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-flow-index,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-flow-state {
  min-height: 22px;
  font-size: 10px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-light-options {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-style-cards {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-style-card {
  min-height: 148px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-primary-actions {
  display: flex;
  align-items: end;
  gap: 12px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-create-run-controls {
  width: 100%;
  display: grid;
  grid-template-columns: 132px minmax(180px, 1fr);
  gap: 12px;
  align-items: end;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-create-run-controls .primary-button {
  min-height: 44px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-layout {
  grid-template-columns: minmax(220px, 272px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-form-panel {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 116px);
  overflow: auto;
  display: grid;
  gap: 10px;
  padding: 0 2px 0 0;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-action-section,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-history-panel,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-slide-nav-panel {
  display: grid !important;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.014)),
    rgba(13,15,18,0.88);
  box-shadow: none;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-action-section {
  display: none !important;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-action-section .presentation-section-head,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-action-section #presentationGenerateHint,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-action-section #presentationMessage {
  display: none !important;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-slide-nav-panel {
  order: -1;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-history-panel {
  order: 2;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-action-section {
  order: 3;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-slide-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  max-height: 42vh;
  overflow: auto;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-slide-nav-item {
  min-height: 50px;
  grid-template-columns: 28px minmax(0, 1fr);
  padding: 8px;
  border-radius: 10px;
  box-shadow: none;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-history-list {
  max-height: 220px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-history-row {
  grid-template-columns: minmax(0, 1fr);
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-history-delete {
  min-width: 0;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-primary-actions,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-secondary-actions,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-workspace-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-slides-panel {
  min-height: calc(100vh - 132px);
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.014)),
    rgba(13,15,18,0.9);
  box-shadow: 0 18px 42px rgba(0,0,0,0.22);
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-editor-head {
  min-height: 46px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  align-items: start;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-editor-head h4 {
  font-size: 16px;
  color: var(--soft);
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-editor-controls {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 8px;
  align-items: start;
  justify-content: flex-end;
  max-width: min(820px, 100%);
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-editor-action-group {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-height: 40px;
  padding: 18px 8px 8px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 12px;
  background: rgba(255,255,255,0.026);
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-editor-action-group::before {
  content: attr(data-editor-action-label);
  position: absolute;
  top: 5px;
  left: 9px;
  color: rgba(230,238,246,0.46);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-editor-action-group-generate {
  border-color: rgba(143,208,183,0.18);
  background: rgba(143,208,183,0.045);
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-editor-action-group-main {
  grid-column: 1;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-editor-action-group-generate {
  grid-column: 2;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-editor-action-group-manage,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-editor-action-group-view {
  grid-column: auto;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-editor-controls .ghost-button,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-editor-controls a.ghost-button {
  min-height: 32px;
  padding-inline: 10px;
  font-size: 12px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit #presentationRegenerateImagesButton {
  border-color: rgba(143,208,183,0.36);
  background:
    linear-gradient(180deg, rgba(143,208,183,0.22), rgba(143,208,183,0.1)),
    rgba(12,24,18,0.92);
  color: #d1fae5;
  font-weight: 900;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit #downloadPresentationButton {
  border-color: rgba(125,211,252,0.32);
  background: rgba(14,165,233,0.11);
  color: #bae6fd;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-download-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.18);
  color: rgba(226, 232, 240, 0.9);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-download-status.is-preview {
  border-color: rgba(125, 211, 252, 0.24);
  background: rgba(14, 165, 233, 0.12);
  color: #bae6fd;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-download-status.is-preview-confirmed {
  border-color: rgba(134, 239, 172, 0.24);
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-download-status.is-final {
  border-color: rgba(196, 181, 253, 0.22);
  background: rgba(99, 102, 241, 0.12);
  color: #ddd6fe;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-editor-controls .presentation-draft-status {
  min-height: 32px;
  order: 3;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-slides-list {
  gap: 0;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-slide-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-slide-head {
  min-height: 38px;
  padding: 0 0 10px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-slide-body {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.78fr);
  gap: 12px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-slide-content-panel {
  grid-column: 1;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  background: rgba(255,255,255,0.035);
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-slide-content-panel textarea {
  resize: vertical;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-slide-visual-panel {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  background: rgba(255,255,255,0.035);
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-slide-visual-stage {
  display: grid;
  min-height: 320px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-slide-image {
  width: 100%;
  height: 100%;
  min-height: 320px;
  max-height: 520px;
  border-radius: 12px;
  object-fit: contain;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-slide-visual-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-slide-visual-meta span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-slide-actions,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-slide-advanced {
  grid-column: 1 / -1;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-slide-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-advanced {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  background: rgba(255,255,255,0.035);
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-advanced summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  color: var(--soft);
  font-size: 13px;
  font-weight: 800;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-advanced summary::-webkit-details-marker {
  display: none;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-advanced summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-design-grid {
  margin-top: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0;
  border: 0;
  background: transparent;
}

@media (max-width: 1180px) {
  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-layout,
  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-form-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-history-panel,
  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-create-entry {
    grid-column: 1;
  }

  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-history-panel {
    position: static;
    max-height: none;
  }

  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-history-list {
    max-height: 260px;
  }

  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-light-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-form-panel {
    position: static;
    max-height: none;
    grid-template-columns: minmax(0, 1fr);
  }

  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-slide-nav {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    max-height: 180px;
  }
}

@media (max-width: 820px) {
  body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-browser {
    grid-template-columns: minmax(0, 1fr);
  }

  body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-tabs {
    position: static;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow-x: auto;
  }

  body:has(#appScreen:not(.hidden)) #presentationView .presentation-style-tab {
    min-width: 68px;
    justify-content: center;
    text-align: center;
  }

  body:has(#appScreen:not(.hidden)) #presentationView .presentation-topic-checklist-inline,
  body:has(#appScreen:not(.hidden)) #presentationView .presentation-guided-steps,
  body:has(#appScreen:not(.hidden)) #presentationView .presentation-office-starter,
  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-history-filters,
  body:has(#appScreen:not(.hidden)) #presentationView .presentation-optional-assets-grid,
  body:has(#appScreen:not(.hidden)) #presentationView .presentation-flow-board,
  body:has(#appScreen:not(.hidden)) #presentationView .presentation-advanced-block,
  body:has(#appScreen:not(.hidden)) #presentationView .presentation-advanced-config .presentation-generation-modes,
  body:has(#appScreen:not(.hidden)) #presentationView .presentation-advanced-config .presentation-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body:has(#appScreen:not(.hidden)) #presentationView .presentation-advanced-config summary {
    align-items: flex-start;
    padding: 10px 12px;
  }

  body:has(#appScreen:not(.hidden)) #presentationView .presentation-advanced-config summary small {
    max-width: none;
    white-space: normal;
  }

  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-light-options,
  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-style-cards,
  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-create-run-controls,
  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-slide-body,
  body:has(#appScreen:not(.hidden)) #presentationView .presentation-slide-design-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body:has(#appScreen:not(.hidden)) #presentationView .presentation-flow-card {
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }

  body:has(#appScreen:not(.hidden)) #presentationView .presentation-flow-card:last-child {
    border-bottom: 0;
  }

  body:has(#appScreen:not(.hidden)) #presentationView .presentation-guided-steps span {
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }

  body:has(#appScreen:not(.hidden)) #presentationView .presentation-guided-steps span:last-child {
    border-bottom: 0;
  }

  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-slide-image {
    grid-column: auto;
    grid-row: auto;
    min-height: 220px;
  }

  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-editor-head {
    display: grid;
    gap: 10px;
  }

  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-editor-controls {
    grid-template-columns: minmax(0, 1fr);
    max-width: none;
    justify-content: stretch;
  }

  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-editor-action-group,
  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-editor-action-group-main,
  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-editor-action-group-generate,
  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-editor-action-group-manage,
  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-editor-action-group-view {
    grid-column: auto;
    justify-content: flex-start;
  }

  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-editor-controls .ghost-button,
  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-editor-controls a.ghost-button,
  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-editor-controls .presentation-draft-status {
    flex: 1 1 136px;
  }
}

/* PPT draft browser final layout: keep records visible, compact, and predictable. */
body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-panel {
  min-width: 0;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-list {
  min-height: 96px;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-list.empty-state {
  min-height: 112px;
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-row {
  min-width: 0;
  align-items: stretch;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-item {
  min-width: 0;
  overflow: hidden;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-copy strong,
body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body:has(#appScreen:not(.hidden)) #presentationView .presentation-history-status {
  max-width: 74px;
  overflow: hidden;
  text-overflow: ellipsis;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-layout,
body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-form-panel {
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-history-panel {
  align-self: start;
  gap: 10px;
  padding: 12px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-history-panel .presentation-section-head {
  min-height: 32px;
  align-items: center;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-history-panel .presentation-section-head h4 {
  font-size: 15px;
  line-height: 1.2;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-history-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 8px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-history-list {
  max-height: min(52vh, 520px);
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-history-row {
  grid-template-columns: minmax(0, 1fr) 42px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-history-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 56px;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-history-delete {
  width: 42px;
  min-width: 42px;
  min-height: 56px;
  padding: 0;
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-history-row {
  grid-template-columns: minmax(0, 1fr);
}

body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-edit .presentation-history-delete {
  width: 100%;
}

@media (max-width: 1180px) {
  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-layout,
  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-form-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-history-list {
    max-height: 260px;
  }
}

@media (max-width: 820px) {
  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-history-filters {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-history-row {
    grid-template-columns: minmax(0, 1fr);
  }

  body:has(#appScreen:not(.hidden)) #presentationView.presentation-mode-create .presentation-history-delete {
    width: 100%;
    min-width: 0;
    min-height: 34px;
  }
}

/* Mobile app shell final override: keep the main workspace usable on phones after theme overrides. */
@media (max-width: 1080px) {
  body:has(#appScreen:not(.hidden)) {
    overflow-x: hidden !important;
  }

  body:has(#appScreen:not(.hidden)) .app-shell {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 100dvh !important;
    margin: 0 !important;
    padding: calc(max(10px, env(safe-area-inset-top)) + 42px) 8px max(12px, env(safe-area-inset-bottom)) !important;
    gap: 8px !important;
    overflow-x: hidden !important;
  }

  body:has(#appScreen:not(.hidden)) .app-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
    width: 100% !important;
  }

  body:has(#appScreen:not(.hidden)) .mobile-menu-button {
    position: fixed !important;
    top: max(10px, env(safe-area-inset-top)) !important;
    left: max(10px, env(safe-area-inset-left)) !important;
    z-index: 80 !important;
    min-width: 54px !important;
    min-height: 34px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 7px 10px !important;
    border-radius: 999px !important;
    border: 1px solid rgba(255,255,255,0.16) !important;
    background: rgba(17,18,20,0.96) !important;
    color: var(--text) !important;
    box-shadow: 0 14px 32px rgba(0,0,0,0.28) !important;
  }

  body:has(#appScreen:not(.hidden)) .mobile-menu-overlay:not(.hidden) {
    position: fixed !important;
    inset: 0 !important;
    z-index: 68 !important;
    display: block !important;
    background: rgba(0,0,0,0.58) !important;
    backdrop-filter: blur(6px) !important;
  }

  body:has(#appScreen:not(.hidden)) .sidebar {
    position: fixed !important;
    top: calc(max(10px, env(safe-area-inset-top)) + 46px) !important;
    left: max(8px, env(safe-area-inset-left)) !important;
    bottom: max(10px, env(safe-area-inset-bottom)) !important;
    z-index: 76 !important;
    width: min(300px, calc(100dvw - 16px)) !important;
    max-width: calc(100dvw - 16px) !important;
    height: auto !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    transform: translateX(calc(-100% - 20px)) !important;
    transition: transform 180ms ease !important;
  }

  body:has(#appScreen:not(.hidden)) .app-shell.mobile-menu-open .sidebar {
    transform: translateX(0) !important;
  }

  body:has(#appScreen:not(.hidden)) .topbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
    width: 100% !important;
    min-height: 52px !important;
    padding: 5px 8px 5px 52px !important;
    border-radius: 12px !important;
  }

  body:has(#appScreen:not(.hidden)) .topbar-main {
    width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    gap: 8px !important;
    align-items: end !important;
  }

  body:has(#appScreen:not(.hidden)) .topbar-spacer {
    display: none !important;
  }

  body:has(#appScreen:not(.hidden)) .topbar-brand {
    min-width: 0 !important;
    gap: 9px !important;
    flex-wrap: nowrap !important;
    align-items: flex-end !important;
    padding-bottom: 1px !important;
  }

  body:has(#appScreen:not(.hidden)) .topbar-brand .brand-mark {
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    overflow: visible !important;
    display: inline-flex !important;
    align-items: flex-end !important;
  }

  body:has(#appScreen:not(.hidden)) .topbar-brand .brand-mark img {
    width: auto !important;
    max-width: none !important;
    height: clamp(25px, 4.7vw, 32px) !important;
    transform: translateY(1px);
  }

  body:has(#appScreen:not(.hidden)) .topbar-brand .brand-title {
    display: inline-flex !important;
    align-items: flex-end !important;
    min-height: 1em !important;
    max-width: none !important;
    font-size: clamp(23px, 5vw, 29px) !important;
    line-height: 0.95 !important;
    letter-spacing: -0.025em !important;
    white-space: nowrap !important;
    transform: translateY(1px);
  }

  body:has(#appScreen:not(.hidden)) .topbar-brand .brand-title::after {
    top: -4px !important;
    right: -17px !important;
    width: 16px !important;
    height: 16px !important;
    font-size: 7px !important;
  }

  body:has(#appScreen:not(.hidden)) .topbar-tabs {
    justify-self: stretch !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    padding: 2px 3px !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x proximity !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }

  body:has(#appScreen:not(.hidden)) .topbar-tabs::-webkit-scrollbar {
    display: none !important;
  }

  body:has(#appScreen:not(.hidden)) .topbar-tab {
    flex: 0 0 auto !important;
    min-height: 28px !important;
    padding: 0 8px !important;
    font-size: 12px !important;
    scroll-snap-align: start !important;
    white-space: nowrap !important;
  }

  body:has(#appScreen:not(.hidden)) .workspace {
    width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
  }

  body:has(#appScreen:not(.hidden)) .workspace-head {
    min-height: 50px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 8px !important;
    padding: 10px !important;
    margin-bottom: 8px !important;
  }

  body:has(#appScreen:not(.hidden)) .workspace-head h1 {
    font-size: 20px !important;
  }

  body:has(#appScreen:not(.hidden)) .head-meta {
    width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    padding-bottom: 2px !important;
  }
}

@media (max-width: 760px) {
  body:has(#appScreen:not(.hidden)) .panel,
  body:has(#appScreen:not(.hidden)) .idea-composer,
  body:has(#appScreen:not(.hidden)) .jobs-panel,
  body:has(#appScreen:not(.hidden)) .results-panel {
    border-radius: 12px !important;
  }

  body:has(#appScreen:not(.hidden)) .view,
  body:has(#appScreen:not(.hidden)) .workbench-stage,
  body:has(#appScreen:not(.hidden)) .dashboard-grid,
  body:has(#appScreen:not(.hidden)) .workbench-grid,
  body:has(#appScreen:not(.hidden)) .workbench-support-grid,
  body:has(#appScreen:not(.hidden)) .workbench-jobs-only,
  body:has(#appScreen:not(.hidden)) .composer-control-groups,
  body:has(#appScreen:not(.hidden)) .composer-control-strip,
  body:has(#appScreen:not(.hidden)) .composer-bottom,
  body:has(#appScreen:not(.hidden)) .compact-composer-bottom,
  body:has(#appScreen:not(.hidden)) .composer-action-bar,
  body:has(#appScreen:not(.hidden)) .prompt-config-strip,
  body:has(#appScreen:not(.hidden)) .grid-five,
  body:has(#appScreen:not(.hidden)) .compact-grid,
  body:has(#appScreen:not(.hidden)) .inline-form,
  body:has(#appScreen:not(.hidden)) .records-toolbar,
  body:has(#appScreen:not(.hidden)) .community-toolbar,
  body:has(#appScreen:not(.hidden)) .management-toolbar,
  body:has(#appScreen:not(.hidden)) .admin-user-filters,
  body:has(#appScreen:not(.hidden)) .admin-job-filters {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body:has(#appScreen:not(.hidden)) .workbench-toolbar {
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
    padding: 8px !important;
  }

  body:has(#appScreen:not(.hidden)) .creation-stat-cards {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  body:has(#appScreen:not(.hidden)) .creation-stat-card {
    min-width: 0 !important;
    width: 100% !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-rows: auto auto !important;
    padding: 8px !important;
  }

  body:has(#appScreen:not(.hidden)) .creation-stat-card .branch-status-open-button {
    grid-column: 2 !important;
    grid-row: 1 / 3 !important;
    max-width: 78px !important;
    white-space: normal !important;
    line-height: 1.15 !important;
  }

  body:has(#appScreen:not(.hidden)) .toolbar-status,
  body:has(#appScreen:not(.hidden)) .composer-title-row,
  body:has(#appScreen:not(.hidden)) .inline-reference-row,
  body:has(#appScreen:not(.hidden)) .panel-head,
  body:has(#appScreen:not(.hidden)) .panel-head-actions,
  body:has(#appScreen:not(.hidden)) .table-actions,
  body:has(#appScreen:not(.hidden)) .action-row {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  body:has(#appScreen:not(.hidden)) .toolbar-status > *,
  body:has(#appScreen:not(.hidden)) .inline-reference-row > *,
  body:has(#appScreen:not(.hidden)) .panel-head-actions > *,
  body:has(#appScreen:not(.hidden)) .table-actions > * {
    max-width: 100% !important;
  }

  body:has(#appScreen:not(.hidden)) .composer-ai-shortcut,
  body:has(#appScreen:not(.hidden)) .composer-ai-shortcut-actions,
  body:has(#appScreen:not(.hidden)) .control-action-buttons {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body:has(#appScreen:not(.hidden)) .composer-inline-template-select,
  body:has(#appScreen:not(.hidden)) .mode-field,
  body:has(#appScreen:not(.hidden)) .aspect-field,
  body:has(#appScreen:not(.hidden)) .quality-field {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
  }

  body:has(#appScreen:not(.hidden)) textarea,
  body:has(#appScreen:not(.hidden)) input,
  body:has(#appScreen:not(.hidden)) select,
  body:has(#appScreen:not(.hidden)) button {
    max-width: 100% !important;
  }

  body:has(#appScreen:not(.hidden)) .idea-composer textarea {
    min-height: 150px !important;
    font-size: 15px !important;
  }

  body:has(#appScreen:not(.hidden)) .results-grid,
  body:has(#appScreen:not(.hidden)) .results-grid-fixed {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body:has(#appScreen:not(.hidden)) .branch-status-dialog {
    width: calc(100dvw - 20px) !important;
    max-height: calc(100dvh - 28px) !important;
    padding: 14px !important;
  }

  body:has(#appScreen:not(.hidden)) .branch-status-metrics,
  body:has(#appScreen:not(.hidden)) .branch-status-models,
  body:has(#appScreen:not(.hidden)) .branch-model-card-meta {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (max-width: 1080px) {
  html.app-mobile-menu-open,
  body.app-mobile-menu-open {
    overflow: hidden !important;
    overscroll-behavior: none !important;
  }

  body.app-mobile-menu-open #appScreen {
    overflow: hidden !important;
  }
}

@media (max-width: 1320px) {
  body:has(#appScreen:not(.hidden)) #quickStatsChip {
    display: none !important;
  }

  body:has(#appScreen:not(.hidden)) .workbench-toolbar {
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    align-items: stretch !important;
  }

  body:has(#appScreen:not(.hidden)) .creation-stat-cards {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  body:has(#appScreen:not(.hidden)) .creation-stat-card {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-rows: auto auto !important;
    align-items: center !important;
    gap: 6px 10px !important;
    padding: 10px 12px !important;
  }

  body:has(#appScreen:not(.hidden)) .creation-stat-card span {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  body:has(#appScreen:not(.hidden)) .creation-stat-card strong {
    grid-column: 1 !important;
    grid-row: 2 !important;
    font-size: clamp(20px, 2.6vw, 32px) !important;
    line-height: 1 !important;
  }

  body:has(#appScreen:not(.hidden)) .creation-stat-card .branch-status-open-button {
    grid-column: 2 !important;
    grid-row: 1 / 3 !important;
    align-self: center !important;
    justify-self: end !important;
    max-width: 96px !important;
    white-space: normal !important;
    line-height: 1.15 !important;
    text-align: center !important;
  }

  body:has(#appScreen:not(.hidden)) .toolbar-status {
    width: 100% !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    justify-content: stretch !important;
    align-items: stretch !important;
    padding: 10px !important;
    row-gap: 10px !important;
    column-gap: 8px !important;
  }

  body:has(#appScreen:not(.hidden)) .toolbar-status-primary {
    width: 100% !important;
    min-width: 0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 8px !important;
  }

  body:has(#appScreen:not(.hidden)) .toolbar-status-primary > * {
    flex: 0 0 auto !important;
    max-width: 100% !important;
  }

  body:has(#appScreen:not(.hidden)) #quickStatsChipMirror {
    display: inline-flex !important;
    width: 100% !important;
    min-width: 0 !important;
    justify-content: flex-start !important;
    white-space: normal !important;
    line-height: 1.35 !important;
    text-align: left !important;
  }
}

@media (max-width: 760px) {
  body:has(#appScreen:not(.hidden)) #quickStatsChipMirror {
    display: inline-flex !important;
    width: 100% !important;
    min-width: 0 !important;
    justify-content: flex-start !important;
    white-space: normal !important;
    line-height: 1.35 !important;
    text-align: left !important;
  }

  body:has(#appScreen:not(.hidden)) .toolbar-status {
    align-items: flex-start !important;
  }

  body:has(#appScreen:not(.hidden)) .toolbar-status .toolbar-jump-button,
  body:has(#appScreen:not(.hidden)) .toolbar-status #runStatus {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
  }

  body:has(#appScreen:not(.hidden)) .toolbar-status .status-chip,
  body:has(#appScreen:not(.hidden)) .toolbar-status .head-chip {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body:has(#appScreen:not(.hidden)) .pager-row,
  body:has(#appScreen:not(.hidden)) .pager-control,
  body:has(#appScreen:not(.hidden)) .pager-jump-form {
    width: 100% !important;
  }

  body:has(#appScreen:not(.hidden)) .pager-control {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  body:has(#appScreen:not(.hidden)) .pager-jump-form {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: end !important;
    gap: 8px !important;
  }

  body:has(#appScreen:not(.hidden)) .pager-jump-form label {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 6px !important;
    white-space: normal !important;
  }

  body:has(#appScreen:not(.hidden)) .pager-control select,
  body:has(#appScreen:not(.hidden)) .pager-jump-form input {
    width: 100% !important;
    max-width: 100% !important;
  }
}

body:has(#appScreen:not(.hidden)) .topbar {
  z-index: 140 !important;
  isolation: isolate;
}

body:has(#appScreen:not(.hidden)) .topbar-main,
body:has(#appScreen:not(.hidden)) .topbar-brand,
body:has(#appScreen:not(.hidden)) .topbar-tabs,
body:has(#appScreen:not(.hidden)) .topbar-tab,
body:has(#appScreen:not(.hidden)) .topbar-tab-label {
  position: relative;
  z-index: 2;
}

body:has(#appScreen:not(.hidden)) .toolbar-status {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
}

body:has(#appScreen:not(.hidden)) .toolbar-status-primary {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
}

.idea-graph-shell {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(420px, 1.22fr);
  gap: 14px;
  align-items: start;
}

.idea-graph-control-panel,
.idea-graph-map-panel,
.idea-graph-terms-panel,
.idea-graph-history-panel,
.idea-graph-prompts-panel {
  min-width: 0;
}

.idea-graph-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.idea-graph-seed-field input {
  font-size: 18px;
  font-weight: 700;
}

.idea-graph-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 12px;
}

.idea-graph-history-search {
  margin: 0 0 12px;
}

.idea-graph-history-panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.idea-graph-history-panel-actions .ghost-button {
  min-height: 32px;
  padding: 6px 10px;
  white-space: nowrap;
}

.idea-graph-history-section-head {
  margin: 12px 0 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.idea-graph-history-section-head.is-collapsed {
  margin-bottom: 0;
  opacity: 0.68;
}

.idea-graph-history-section-head h4 {
  margin: 0;
  color: rgba(226, 232, 240, 0.82);
  font-size: 13px;
}

.idea-graph-map-panel {
  grid-row: span 2;
}

.idea-graph-map-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.idea-graph-fullscreen-button {
  min-height: 32px;
  padding: 6px 12px;
}

body.idea-graph-fullscreen-open {
  overflow: hidden;
}

.idea-graph-map-panel.is-fullscreen {
  position: fixed;
  inset: 18px;
  z-index: 2600;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  max-width: none;
  border-radius: 8px;
  background: rgba(9, 12, 17, 0.98);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.5);
}

.idea-graph-map-panel.is-fullscreen::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(2, 6, 23, 0.78);
}

.idea-graph-map-panel.is-fullscreen .idea-graph-canvas {
  min-height: 0;
  height: 100%;
}

.idea-graph-map-panel.is-fullscreen .idea-graph-d3 {
  min-height: 0;
}

.idea-graph-canvas {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)),
    radial-gradient(circle at 50% 48%, rgba(65, 179, 255, 0.1), transparent 34%),
    rgba(11, 15, 20, 0.24);
}

.idea-graph-d3 {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 520px;
}

.idea-graph-d3-link {
  stroke: rgba(148, 163, 184, 0.34);
  stroke-linecap: round;
}

.idea-graph-d3-ring {
  fill: none;
  stroke: rgba(148, 163, 184, 0.16);
  stroke-dasharray: 7 9;
  pointer-events: none;
}

.idea-graph-d3-ring-category {
  stroke: rgba(251, 191, 36, 0.26);
}

.idea-graph-d3-ring-term {
  stroke: rgba(52, 211, 153, 0.2);
}

.idea-graph-d3-link-hierarchy {
  stroke: rgba(94, 234, 212, 0.36);
}

.idea-graph-d3-link-category {
  stroke: rgba(251, 191, 36, 0.42);
}

.idea-graph-d3-link-term {
  stroke: rgba(148, 163, 184, 0.28);
}

.idea-graph-d3-link-to-ai {
  stroke: rgba(56, 189, 248, 0.42);
}

.idea-graph-d3-link-to-knowledge {
  stroke: rgba(196, 181, 253, 0.4);
}

.idea-graph-d3-link-to-mock {
  stroke: rgba(52, 211, 153, 0.36);
}

.idea-graph-d3-link-cross {
  stroke: rgba(203, 213, 225, 0.24);
  stroke-dasharray: 4 6;
}

.idea-graph-d3-link-parent {
  stroke: rgba(251, 113, 133, 0.56);
  stroke-dasharray: 8 5;
}

.idea-graph-d3-node {
  cursor: grab;
  outline: none;
}

.idea-graph-d3-node:active {
  cursor: grabbing;
}

.idea-graph-d3-node circle {
  stroke: rgba(148, 163, 184, 0.42);
  stroke-width: 1.35;
  fill: rgba(15, 23, 42, 0.86);
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.22));
}

.idea-graph-d3-node-seed circle {
  stroke: rgba(94, 234, 212, 0.9);
  stroke-width: 2;
  fill: rgba(13, 148, 136, 0.95);
}

.idea-graph-d3-node-category circle {
  stroke: rgba(251, 191, 36, 0.86);
  fill: rgba(146, 96, 12, 0.9);
}

.idea-graph-d3-node-ancestor circle {
  stroke: rgba(251, 113, 133, 0.84);
  fill: rgba(136, 19, 55, 0.84);
}

.idea-graph-d3-node-ai circle {
  stroke: rgba(56, 189, 248, 0.86);
  fill: rgba(7, 89, 133, 0.9);
}

.idea-graph-d3-node-knowledge circle {
  stroke: rgba(196, 181, 253, 0.82);
  fill: rgba(91, 33, 182, 0.82);
}

.idea-graph-d3-node-mock circle {
  stroke: rgba(52, 211, 153, 0.82);
  fill: rgba(6, 95, 70, 0.86);
}

.idea-graph-d3-node:hover circle,
.idea-graph-d3-node:focus-visible circle {
  stroke: rgba(248, 250, 252, 0.86);
  stroke-width: 1.7;
}

.idea-graph-d3-label {
  fill: rgba(248, 250, 252, 0.95);
  font-size: 12px;
  font-weight: 800;
  pointer-events: none;
}

.idea-graph-d3-node-seed .idea-graph-d3-label {
  font-size: 14px;
}

.idea-graph-d3-node-category .idea-graph-d3-label {
  font-size: 13px;
}

.idea-graph-d3-node-ancestor .idea-graph-d3-label {
  fill: rgba(255, 228, 230, 0.96);
  font-size: 12px;
}

.idea-graph-d3-node-ai .idea-graph-d3-category {
  fill: rgba(186, 230, 253, 0.9);
}

.idea-graph-d3-node-knowledge .idea-graph-d3-category {
  fill: rgba(221, 214, 254, 0.9);
}

.idea-graph-d3-node-mock .idea-graph-d3-category {
  fill: rgba(167, 243, 208, 0.9);
}

.idea-graph-d3-category {
  fill: rgba(203, 213, 225, 0.74);
  font-size: 10px;
  font-weight: 700;
  pointer-events: none;
}

.idea-graph-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  stroke: rgba(148, 163, 184, 0.28);
  stroke-width: 0.22;
  pointer-events: none;
}

.idea-graph-seed-node,
.idea-graph-node {
  position: absolute;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 8px;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.82);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.idea-graph-seed-node {
  left: 50%;
  top: 50%;
  min-width: 120px;
  max-width: 190px;
  padding: 14px 18px;
  font-size: 18px;
  font-weight: 800;
  background: rgba(16, 112, 144, 0.92);
  border-color: rgba(125, 211, 252, 0.72);
}

.idea-graph-node {
  width: 104px;
  min-height: 54px;
  padding: 8px 9px;
  display: grid;
  gap: 3px;
  place-items: center;
  text-align: center;
}

.idea-graph-node span {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
}

.idea-graph-node small {
  max-width: 100%;
  color: rgba(226, 232, 240, 0.72);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.idea-graph-node-ai,
.idea-graph-term-card-ai {
  border-color: rgba(56, 189, 248, 0.58);
  background:
    linear-gradient(90deg, rgba(56, 189, 248, 0.16), transparent 42%),
    rgba(14, 72, 96, 0.76);
}

.idea-graph-node-knowledge,
.idea-graph-term-card-knowledge {
  border-color: rgba(196, 181, 253, 0.54);
  background:
    linear-gradient(90deg, rgba(167, 139, 250, 0.18), transparent 42%),
    rgba(48, 38, 86, 0.72);
}

.idea-graph-node-mock,
.idea-graph-term-card-mock {
  border-color: rgba(52, 211, 153, 0.5);
  background:
    linear-gradient(90deg, rgba(52, 211, 153, 0.15), transparent 42%),
    rgba(6, 78, 59, 0.58);
}

.idea-graph-terms,
.idea-graph-histories,
.idea-graph-history-terms,
.idea-graph-prompts {
  display: grid;
  gap: 12px;
}

.idea-graph-term-group {
  display: grid;
  gap: 10px;
  padding: 10px 0 0;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.idea-graph-term-group:first-child {
  padding-top: 0;
  border-top: 0;
}

.idea-graph-term-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.idea-graph-term-group h4 {
  margin: 0;
  color: rgba(226, 232, 240, 0.82);
  font-size: 13px;
}

.idea-graph-term-group-head span {
  color: rgba(148, 163, 184, 0.82);
  font-size: 12px;
}

.idea-graph-term-list {
  display: grid;
  gap: 8px;
}

.idea-graph-term-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.48);
}

.idea-graph-history-term-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.48);
}

.idea-graph-history-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 8px;
  color: #e5e7eb;
  background:
    linear-gradient(90deg, rgba(125, 211, 252, 0.12), transparent 46%),
    rgba(15, 23, 42, 0.44);
}

.idea-graph-history-card-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.idea-graph-history-card-main strong,
.idea-graph-history-card-main p {
  overflow-wrap: anywhere;
}

.idea-graph-history-card-main strong {
  display: block;
  margin-bottom: 4px;
  color: rgba(248, 250, 252, 0.94);
  font-size: 14px;
}

.idea-graph-history-card-main p {
  margin: 0;
  color: rgba(203, 213, 225, 0.72);
  font-size: 12px;
  line-height: 1.4;
}

.idea-graph-term-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.idea-graph-term-main strong,
.idea-graph-term-main p {
  overflow-wrap: anywhere;
}

.idea-graph-term-main strong {
  display: block;
  margin-bottom: 4px;
  color: rgba(248, 250, 252, 0.94);
  font-size: 14px;
}

.idea-graph-term-main p {
  margin: 0;
  color: rgba(203, 213, 225, 0.72);
  font-size: 12px;
  line-height: 1.4;
}

.idea-graph-source-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 3px 7px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  color: rgba(226, 232, 240, 0.78);
  background: rgba(2, 6, 23, 0.26);
  font-size: 11px;
  font-weight: 800;
}

.idea-graph-term-card-ai .idea-graph-source-pill {
  border-color: rgba(56, 189, 248, 0.42);
  color: rgba(186, 230, 253, 0.94);
  background: rgba(7, 89, 133, 0.34);
}

.idea-graph-term-card-knowledge .idea-graph-source-pill {
  border-color: rgba(196, 181, 253, 0.4);
  color: rgba(221, 214, 254, 0.94);
  background: rgba(91, 33, 182, 0.28);
}

.idea-graph-term-card-mock .idea-graph-source-pill {
  border-color: rgba(52, 211, 153, 0.38);
  color: rgba(167, 243, 208, 0.94);
  background: rgba(6, 95, 70, 0.28);
}

.idea-graph-term-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.idea-graph-history-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: rgba(148, 163, 184, 0.78);
  font-size: 11px;
  line-height: 1.35;
}

.idea-graph-history-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.idea-graph-term-action-buttons,
.idea-graph-prompt-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.idea-graph-term-actions > span {
  color: rgba(125, 211, 252, 0.82);
  font-size: 12px;
  font-weight: 800;
}

.idea-graph-term-actions .ghost-button {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}

.idea-graph-prompt-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.38);
}

.idea-graph-prompt-card > span {
  color: rgba(125, 211, 252, 0.88);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.idea-graph-prompt-card p {
  margin: 0;
  color: rgba(241, 245, 249, 0.9);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.idea-graph-prompt-card .ghost-button {
  justify-self: start;
}

@media (max-width: 980px) {
  .idea-graph-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .idea-graph-map-panel {
    grid-row: auto;
  }

  .idea-graph-canvas {
    min-height: 460px;
  }
}

@media (max-width: 640px) {
  .idea-graph-canvas {
    min-height: 520px;
  }

  .idea-graph-node {
    width: 92px;
    min-height: 50px;
    padding: 7px;
  }

  .idea-graph-node span {
    font-size: 12px;
  }
}

/* Skills detail fullscreen pass. */
body:has(#appScreen:not(.hidden)) .work-skill-template-preview-modal {
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
  height: var(--app-viewport-height);
  padding: 0;
  place-items: stretch;
  overflow: hidden;
}

body:has(#appScreen:not(.hidden)) .work-skill-template-detail-card {
  display: grid;
  place-items: center;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: clamp(10px, 1.2vw, 16px);
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.018), rgba(255,255,255,0)),
    #070809;
  box-shadow: none;
  overflow: hidden;
}

body:has(#appScreen:not(.hidden)) .work-skill-template-preview-layout {
  width: min(100%, 1680px);
  height: 100%;
  max-height: 920px;
  min-width: 0;
  min-height: 0;
  justify-self: center;
  align-self: center;
  grid-template-columns: minmax(0, 1fr) clamp(300px, 22vw, 360px);
  grid-template-rows: minmax(0, 1fr);
  gap: clamp(10px, 1.1vw, 16px);
}

body:has(#appScreen:not(.hidden)) .work-skill-template-preview-stage {
  min-width: 0;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
  justify-items: stretch;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}

body:has(#appScreen:not(.hidden)) .work-skill-template-preview-rail {
  position: absolute;
  left: clamp(10px, 1.2vw, 18px);
  top: 50%;
  z-index: 7;
  width: auto;
  padding: 0;
  transform: translateY(-50%);
}

body:has(#appScreen:not(.hidden)) .work-skill-template-preview-rail .preview-rail-section {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  background: rgba(10,11,13,0.72);
  box-shadow: 0 14px 34px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.05);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

body:has(#appScreen:not(.hidden)) .work-skill-template-preview-rail .preview-nav-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  justify-content: center;
  border-radius: 999px;
  font-size: 20px;
  line-height: 1;
}

body:has(#appScreen:not(.hidden)) .work-skill-template-detail-media {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 12px;
}

body:has(#appScreen:not(.hidden)) .work-skill-template-detail-media img {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
}

body:has(#appScreen:not(.hidden)) .work-skill-template-preview-stage .preview-nav-meta {
  justify-self: center;
  margin: 0;
  padding: 5px 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  background: rgba(10,11,13,0.62);
}

body:has(#appScreen:not(.hidden)) .work-skill-template-detail-body {
  height: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  align-content: start;
  gap: 12px;
  overflow-y: auto;
  padding: 14px 4px 10px clamp(2px, 0.7vw, 8px);
}

@media (max-width: 1080px) {
  body:has(#appScreen:not(.hidden)) .work-skill-template-detail-card {
    overflow: auto;
  }

  body:has(#appScreen:not(.hidden)) .work-skill-template-preview-layout {
    height: auto;
    max-height: none;
    width: min(100%, 860px);
    min-height: 100%;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(420px, calc(var(--app-viewport-height) - 210px)) auto;
  }

  body:has(#appScreen:not(.hidden)) .work-skill-template-detail-body {
    height: auto;
    max-height: none;
    padding: 0 2px 8px;
  }
}

@media (max-width: 720px) {
  body:has(#appScreen:not(.hidden)) .work-skill-template-detail-card {
    padding: 10px;
  }

  body:has(#appScreen:not(.hidden)) .work-skill-template-preview-layout {
    grid-template-rows: minmax(360px, calc(var(--app-viewport-height) - 230px)) auto;
    gap: 10px;
  }

  body:has(#appScreen:not(.hidden)) .work-skill-template-preview-rail {
    left: 50%;
    top: auto;
    bottom: 44px;
    transform: translateX(-50%);
  }

  body:has(#appScreen:not(.hidden)) .work-skill-template-preview-rail .preview-rail-section {
    display: flex;
  }

  body:has(#appScreen:not(.hidden)) .work-skill-template-preview-rail .preview-nav-button {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
  }

  body:has(#appScreen:not(.hidden)) .work-skill-template-detail-body h3 {
    padding-right: 0;
    font-size: 20px;
  }
}

/* Skills detail final centering: make the detail view independent from app-shell state. */
#workSkillTemplateDetailModal.work-skill-template-preview-modal {
  inset: 0 !important;
  width: 100vw !important;
  width: 100dvw !important;
  height: 100vh !important;
  height: 100dvh !important;
  height: var(--app-viewport-height) !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  min-height: var(--app-viewport-height) !important;
  display: grid !important;
  place-items: center !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: rgba(0,0,0,0.88) !important;
}

#workSkillTemplateDetailModal .work-skill-template-detail-card {
  display: grid !important;
  place-items: center !important;
  width: 100vw !important;
  width: 100dvw !important;
  max-width: none !important;
  height: 100vh !important;
  height: 100dvh !important;
  height: var(--app-viewport-height) !important;
  max-height: none !important;
  margin: 0 !important;
  padding: clamp(12px, 1.6vw, 24px) !important;
  border: 0 !important;
  border-radius: 0 !important;
  background:
    radial-gradient(circle at 50% 0%, rgba(143,208,183,0.08), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,0.018), rgba(255,255,255,0)),
    #070809 !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

#workSkillTemplateDetailModal .work-skill-template-preview-layout {
  width: min(calc(100vw - 48px), 1500px) !important;
  width: min(calc(100dvw - 48px), 1500px) !important;
  height: min(calc(var(--app-viewport-height) - 48px), 860px) !important;
  min-width: 0 !important;
  min-height: 0 !important;
  justify-self: center !important;
  align-self: center !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  align-items: center !important;
  gap: clamp(14px, 1.4vw, 22px) !important;
  margin: auto !important;
}

#workSkillTemplateDetailModal .work-skill-template-preview-stage {
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  align-self: center !important;
  justify-self: center !important;
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  gap: 10px !important;
  padding: 0 !important;
  overflow: hidden !important;
}

#workSkillTemplateDetailModal .work-skill-template-detail-media {
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  align-self: center !important;
  justify-self: center !important;
  border-radius: 14px !important;
}

#workSkillTemplateDetailModal .work-skill-template-detail-body {
  width: 100% !important;
  max-width: 360px !important;
  max-height: min(100%, 720px) !important;
  min-width: 0 !important;
  min-height: 0 !important;
  align-self: center !important;
  justify-self: center !important;
  display: grid !important;
  align-content: start !important;
  gap: 12px !important;
  overflow-y: auto !important;
  padding: 4px 4px 4px 0 !important;
}

#workSkillTemplateDetailModal .work-skill-template-preview-rail {
  left: clamp(10px, 1.2vw, 18px) !important;
  top: 50% !important;
  bottom: auto !important;
  transform: translateY(-50%) !important;
}

@media (max-width: 1080px) {
  #workSkillTemplateDetailModal.work-skill-template-preview-modal {
    overflow-y: auto !important;
  }

  #workSkillTemplateDetailModal .work-skill-template-detail-card {
    min-height: var(--app-viewport-height) !important;
    height: auto !important;
    overflow: visible !important;
  }

  #workSkillTemplateDetailModal .work-skill-template-preview-layout {
    width: min(calc(100vw - 28px), 860px) !important;
    width: min(calc(100dvw - 28px), 860px) !important;
    height: auto !important;
    min-height: calc(var(--app-viewport-height) - 28px) !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(420px, calc(var(--app-viewport-height) - 230px)) auto !important;
    align-content: center !important;
  }

  #workSkillTemplateDetailModal .work-skill-template-detail-body {
    max-width: 100% !important;
    max-height: none !important;
    padding: 0 2px 8px !important;
  }
}

@media (max-width: 720px) {
  #workSkillTemplateDetailModal .work-skill-template-detail-card {
    padding: 10px !important;
  }

  #workSkillTemplateDetailModal .work-skill-template-preview-layout {
    width: calc(100vw - 20px) !important;
    width: calc(100dvw - 20px) !important;
    min-height: calc(var(--app-viewport-height) - 20px) !important;
    grid-template-rows: minmax(360px, calc(var(--app-viewport-height) - 250px)) auto !important;
    gap: 10px !important;
  }

  #workSkillTemplateDetailModal .work-skill-template-preview-rail {
    left: 50% !important;
    top: auto !important;
    bottom: 46px !important;
    transform: translateX(-50%) !important;
  }
}

/* Skills detail v5: centered full-screen stage with a bottom information rail. */
#workSkillTemplateDetailModal .work-skill-template-detail-card {
  padding: clamp(10px, 1.2vw, 18px) !important;
}

#workSkillTemplateDetailModal .work-skill-template-preview-layout {
  position: relative !important;
  width: min(calc(100vw - 28px), 1760px) !important;
  width: min(calc(100dvw - 28px), 1760px) !important;
  height: min(calc(var(--app-viewport-height) - 28px), 980px) !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  place-items: center !important;
  gap: 0 !important;
  margin: auto !important;
}

#workSkillTemplateDetailModal .work-skill-template-preview-stage {
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: 100% !important;
  height: 100% !important;
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) !important;
  place-items: center !important;
  padding: 0 !important;
  overflow: hidden !important;
}

#workSkillTemplateDetailModal .work-skill-template-detail-media {
  width: 100% !important;
  height: 100% !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 16px !important;
}

#workSkillTemplateDetailModal .work-skill-template-detail-media img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

#workSkillTemplateDetailModal .work-skill-template-detail-body {
  position: absolute !important;
  left: 50% !important;
  right: auto !important;
  bottom: clamp(14px, 2vh, 24px) !important;
  z-index: 6 !important;
  width: min(calc(100% - 56px), 980px) !important;
  max-width: none !important;
  max-height: min(30vh, 220px) !important;
  transform: translateX(-50%) !important;
  display: grid !important;
  grid-template-columns: minmax(200px, 0.72fr) repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: auto auto minmax(0, 1fr) !important;
  align-content: start !important;
  gap: 8px 12px !important;
  overflow: hidden !important;
  padding: 14px !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  border-radius: 16px !important;
  background: rgba(10,11,13,0.78) !important;
  box-shadow: 0 18px 52px rgba(0,0,0,0.34), inset 0 1px 0 rgba(255,255,255,0.05) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  backdrop-filter: blur(16px) !important;
}

#workSkillTemplateDetailModal .work-skill-template-detail-body > .eyebrow {
  grid-column: 1 !important;
  grid-row: 1 !important;
}

#workSkillTemplateDetailModal .work-skill-template-detail-body > h3 {
  grid-column: 1 !important;
  grid-row: 2 !important;
  padding-right: 0 !important;
  font-size: clamp(18px, 1.6vw, 24px) !important;
}

#workSkillTemplateDetailModal .work-skill-template-detail-body > .form-note {
  grid-column: 1 !important;
  grid-row: 3 !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

#workSkillTemplateDetailModal .work-skill-template-detail-body > .work-skill-template-detail-block:nth-of-type(1) {
  grid-column: 2 !important;
  grid-row: 1 / 4 !important;
}

#workSkillTemplateDetailModal .work-skill-template-detail-body > .work-skill-template-detail-block:nth-of-type(2) {
  grid-column: 3 !important;
  grid-row: 1 / 4 !important;
}

#workSkillTemplateDetailModal .work-skill-template-detail-block {
  min-height: 0 !important;
  max-height: 100% !important;
  padding: 10px !important;
  overflow: hidden !important;
  border-radius: 12px !important;
  background: rgba(255,255,255,0.045) !important;
}

#workSkillTemplateDetailModal .work-skill-template-detail-block p {
  max-height: 118px !important;
  overflow: auto !important;
}

#workSkillTemplateDetailModal .work-skill-template-preview-stage .preview-nav-meta {
  position: absolute !important;
  left: 50% !important;
  bottom: clamp(176px, 25vh, 252px) !important;
  z-index: 7 !important;
  transform: translateX(-50%) !important;
}

#workSkillTemplateDetailModal .work-skill-template-preview-rail {
  left: auto !important;
  right: clamp(18px, 3vw, 44px) !important;
  top: 50% !important;
  bottom: auto !important;
  transform: translateY(-50%) !important;
}

@media (max-width: 1080px) {
  #workSkillTemplateDetailModal .work-skill-template-preview-layout {
    width: min(calc(100vw - 24px), 980px) !important;
    width: min(calc(100dvw - 24px), 980px) !important;
    height: min(calc(var(--app-viewport-height) - 24px), 860px) !important;
    min-height: 0 !important;
  }

  #workSkillTemplateDetailModal .work-skill-template-detail-body {
    width: min(calc(100% - 32px), 760px) !important;
    max-height: min(34vh, 260px) !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto auto auto auto !important;
    overflow-y: auto !important;
  }

  #workSkillTemplateDetailModal .work-skill-template-detail-body > .eyebrow,
  #workSkillTemplateDetailModal .work-skill-template-detail-body > h3,
  #workSkillTemplateDetailModal .work-skill-template-detail-body > .form-note,
  #workSkillTemplateDetailModal .work-skill-template-detail-body > .work-skill-template-detail-block:nth-of-type(1),
  #workSkillTemplateDetailModal .work-skill-template-detail-body > .work-skill-template-detail-block:nth-of-type(2) {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  #workSkillTemplateDetailModal .work-skill-template-preview-stage .preview-nav-meta {
    bottom: clamp(218px, 34vh, 284px) !important;
  }
}

@media (max-width: 720px) {
  #workSkillTemplateDetailModal .work-skill-template-preview-layout {
    width: calc(100vw - 16px) !important;
    width: calc(100dvw - 16px) !important;
    height: calc(var(--app-viewport-height) - 16px) !important;
  }

  #workSkillTemplateDetailModal .work-skill-template-detail-body {
    width: calc(100% - 18px) !important;
    bottom: 9px !important;
    max-height: 38vh !important;
    padding: 12px !important;
  }

  #workSkillTemplateDetailModal .work-skill-template-preview-stage .preview-nav-meta {
    bottom: calc(38vh + 24px) !important;
  }

  #workSkillTemplateDetailModal .work-skill-template-preview-rail {
    right: auto !important;
    left: 50% !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
  }
}

/* Skills detail v6: mirror the forge community preview detail layout. */
#workSkillTemplateDetailModal.hidden {
  display: none !important;
}

#workSkillTemplateDetailModal.work-skill-template-preview-modal {
  inset: 0 !important;
  width: 100vw !important;
  width: 100dvw !important;
  height: 100vh !important;
  height: 100dvh !important;
  height: var(--app-viewport-height) !important;
  min-height: 0 !important;
  display: grid !important;
  place-items: stretch !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: rgba(0,0,0,0.88) !important;
}

#workSkillTemplateDetailModal .work-skill-template-detail-card {
  display: block !important;
  width: 100vw !important;
  width: 100dvw !important;
  max-width: none !important;
  height: 100vh !important;
  height: 100dvh !important;
  height: var(--app-viewport-height) !important;
  max-height: none !important;
  margin: 0 !important;
  padding: clamp(10px, 1.6dvw, 18px) !important;
  border: 0 !important;
  border-radius: 0 !important;
  overflow: hidden !important;
  background:
    radial-gradient(circle at 20% 0%, rgba(143,208,183,0.12), transparent 32%),
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0)),
    var(--surface) !important;
  box-shadow: none !important;
}

#workSkillTemplateDetailModal .work-skill-template-preview-layout {
  position: relative !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  max-height: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
  display: grid !important;
  grid-template-columns: clamp(72px, 7dvw, 96px) minmax(0, 1fr) minmax(280px, clamp(300px, 24dvw, 380px)) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  align-items: stretch !important;
  place-items: stretch !important;
  gap: clamp(8px, 1.2dvw, 16px) !important;
  margin: 0 !important;
}

#workSkillTemplateDetailModal .work-skill-template-preview-actions,
#workSkillTemplateDetailModal .work-skill-template-preview-stage,
#workSkillTemplateDetailModal .work-skill-template-detail-body {
  min-width: 0 !important;
  min-height: 0 !important;
}

#workSkillTemplateDetailModal .work-skill-template-preview-actions {
  position: relative !important;
  z-index: 9 !important;
  width: auto !important;
  display: grid !important;
  align-content: start !important;
  gap: 14px !important;
  padding-top: clamp(8px, 1.4dvh, 18px) !important;
}

#workSkillTemplateDetailModal .work-skill-template-preview-stage {
  position: relative !important;
  z-index: 1 !important;
  width: 100% !important;
  height: 100% !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  gap: 8px !important;
  justify-items: stretch !important;
  align-items: stretch !important;
  place-items: stretch !important;
  padding: 0 !important;
  overflow: hidden !important;
}

#workSkillTemplateDetailModal .preview-stage-header {
  min-height: 34px !important;
  padding-top: 0 !important;
}

#workSkillTemplateDetailModal .modal-stage-wrap {
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  align-self: stretch !important;
  justify-self: stretch !important;
}

#workSkillTemplateDetailModal .work-skill-template-detail-media {
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-height: none !important;
  display: grid !important;
  place-items: center !important;
  padding: 18px !important;
  overflow: hidden !important;
  border-radius: 10px !important;
  background:
    radial-gradient(circle at 50% 15%, rgba(143,208,183,0.13), transparent 34%),
    linear-gradient(45deg, rgba(255,255,255,0.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.035) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.035) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.035) 75%),
    #0b0c0e !important;
  background-position: center, 0 0, 0 10px, 10px -10px, -10px 0 !important;
  background-size: auto, 20px 20px, 20px 20px, 20px 20px, 20px 20px !important;
}

#workSkillTemplateDetailModal .work-skill-template-detail-media.empty {
  color: rgba(143,208,183,0.78) !important;
  font-family: "Space Mono", "IBM Plex Mono", monospace !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  letter-spacing: 0 !important;
}

#workSkillTemplateDetailModal .work-skill-template-detail-media img {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  display: block !important;
  margin: auto !important;
  background: transparent !important;
}

#workSkillTemplateDetailModal .work-skill-template-preview-rail {
  position: absolute !important;
  top: 50% !important;
  right: 12px !important;
  bottom: auto !important;
  left: auto !important;
  z-index: 7 !important;
  display: grid !important;
  gap: 10px !important;
  width: auto !important;
  padding: 0 !important;
  transform: translateY(-50%) !important;
}

#workSkillTemplateDetailModal .work-skill-template-preview-rail .preview-nav-float {
  width: 40px !important;
  min-width: 40px !important;
  height: 72px !important;
  min-height: 72px !important;
  padding: 0 !important;
  border-radius: 14px !important;
}

#workSkillTemplateDetailModal .preview-stage-footer {
  display: flex !important;
  align-items: center !important;
  min-height: 22px !important;
  min-width: 0 !important;
}

#workSkillTemplateDetailModal .work-skill-template-preview-stage .preview-nav-meta {
  position: static !important;
  left: auto !important;
  bottom: auto !important;
  z-index: auto !important;
  transform: none !important;
  justify-self: start !important;
  margin: 0 !important;
  padding: 0 0 0 4px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  white-space: nowrap !important;
}

#workSkillTemplateDetailModal .work-skill-template-detail-body {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  z-index: auto !important;
  width: auto !important;
  max-width: none !important;
  height: 100% !important;
  max-height: none !important;
  transform: none !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-auto-rows: max-content !important;
  align-content: start !important;
  gap: 12px !important;
  overflow-y: auto !important;
  padding: clamp(8px, 1.4dvh, 18px) 4px 8px 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

#workSkillTemplateDetailModal .work-skill-template-detail-body > .eyebrow,
#workSkillTemplateDetailModal .work-skill-template-detail-body > h3,
#workSkillTemplateDetailModal .work-skill-template-detail-body > .form-note,
#workSkillTemplateDetailModal .work-skill-template-detail-body > .work-skill-template-detail-block,
#workSkillTemplateDetailModal .work-skill-template-detail-body > .work-skill-template-detail-block:nth-of-type(1),
#workSkillTemplateDetailModal .work-skill-template-detail-body > .work-skill-template-detail-block:nth-of-type(2) {
  grid-column: auto !important;
  grid-row: auto !important;
}

#workSkillTemplateDetailModal .work-skill-template-detail-body .preview-meta-head {
  padding: 4px 0 10px !important;
}

#workSkillTemplateDetailModal .work-skill-template-detail-body .preview-meta-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

#workSkillTemplateDetailModal .preview-head-action.is-disabled {
  opacity: 0.42 !important;
  pointer-events: none !important;
}

#workSkillTemplateDetailModal .work-skill-template-detail-block {
  display: grid !important;
  gap: 7px !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 11px !important;
  overflow: visible !important;
  border: 1px solid rgba(143,208,183,0.22) !important;
  border-radius: 12px !important;
  background: rgba(143,208,183,0.055) !important;
}

#workSkillTemplateDetailModal .work-skill-template-detail-block h4 {
  display: none !important;
}

#workSkillTemplateDetailModal .work-skill-template-detail-block span {
  color: var(--muted) !important;
  font-size: 12px !important;
}

#workSkillTemplateDetailModal .work-skill-template-detail-block p {
  max-height: 180px !important;
  margin: 0 !important;
  overflow: auto !important;
  color: var(--soft) !important;
  font-size: 13px !important;
  line-height: 1.65 !important;
  white-space: pre-wrap !important;
}

#workSkillTemplateDetailModal #workSkillTemplateDetailMetaGrid {
  max-height: 260px !important;
  overflow: auto !important;
}

@media (max-width: 1180px) {
  #workSkillTemplateDetailModal .work-skill-template-preview-layout {
    grid-template-columns: clamp(68px, 8dvw, 84px) minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) minmax(180px, 30dvh) !important;
  }

  #workSkillTemplateDetailModal .work-skill-template-detail-body {
    grid-column: 1 / -1 !important;
    height: auto !important;
    max-height: none !important;
    padding: 0 4px 8px !important;
  }
}

@media (max-width: 760px) {
  #workSkillTemplateDetailModal.work-skill-template-preview-modal {
    overflow-y: auto !important;
  }

  #workSkillTemplateDetailModal .work-skill-template-detail-card {
    min-height: 100dvh !important;
    height: auto !important;
    overflow: visible !important;
    padding: 10px !important;
  }

  #workSkillTemplateDetailModal .work-skill-template-preview-layout {
    height: auto !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto minmax(360px, calc(var(--app-viewport-height) - 240px)) auto !important;
  }

  #workSkillTemplateDetailModal .work-skill-template-preview-actions {
    order: 1 !important;
    width: auto !important;
    padding-top: 0 !important;
  }

  #workSkillTemplateDetailModal .work-skill-template-preview-stage {
    order: 2 !important;
    min-height: 360px !important;
  }

  #workSkillTemplateDetailModal .work-skill-template-detail-body {
    order: 3 !important;
    grid-column: auto !important;
    height: auto !important;
    overflow: visible !important;
    padding: 0 0 8px !important;
  }

  #workSkillTemplateDetailModal .preview-rail-section {
    grid-auto-flow: column !important;
    grid-auto-columns: minmax(108px, 1fr) !important;
    overflow-x: auto !important;
  }

  #workSkillTemplateDetailModal .work-skill-template-preview-rail {
    top: 50% !important;
    right: 10px !important;
    bottom: auto !important;
    left: auto !important;
    transform: translateY(-50%) !important;
  }

  #workSkillTemplateDetailModal .work-skill-template-preview-rail .preview-nav-float {
    width: 38px !important;
    min-width: 38px !important;
    height: 64px !important;
    min-height: 64px !important;
  }

  #workSkillTemplateDetailModal .work-skill-template-detail-body .preview-meta-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 520px) {
  #workSkillTemplateDetailModal .work-skill-template-detail-body .preview-meta-actions {
    grid-template-columns: 1fr !important;
  }
}

#workSkillTemplateDetailModal.work-skill-template-preview-modal.hidden {
  display: none !important;
}

/* Skills detail v8: read-only two-column layout with a fixed detail panel. */
#workSkillTemplateDetailModal .work-skill-template-preview-actions,
#workSkillTemplateDetailModal .work-skill-template-detail-body .preview-meta-actions,
#workSkillTemplateDetailModal .preview-stage-header {
  display: none !important;
}

#workSkillTemplateDetailModal {
  --work-skill-template-detail-panel-width: 400px;
}

#workSkillTemplateDetailModal .work-skill-template-preview-layout {
  grid-template-columns: minmax(0, 1fr) var(--work-skill-template-detail-panel-width) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  grid-template-areas: "stage detail" !important;
  gap: clamp(14px, 1.8dvw, 24px) !important;
}

#workSkillTemplateDetailModal .work-skill-template-preview-stage {
  grid-area: stage !important;
  order: 0 !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  gap: 10px !important;
}

#workSkillTemplateDetailModal .work-skill-template-detail-body {
  grid-area: detail !important;
  grid-column: auto !important;
  order: 0 !important;
  width: var(--work-skill-template-detail-panel-width) !important;
  min-width: var(--work-skill-template-detail-panel-width) !important;
  max-width: var(--work-skill-template-detail-panel-width) !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  align-content: stretch !important;
  padding: clamp(10px, 1.7dvh, 22px) 4px clamp(10px, 1.7dvh, 22px) 0 !important;
  border-left: 1px solid rgba(255,255,255,0.08) !important;
  padding-left: clamp(14px, 1.8dvw, 24px) !important;
}

#workSkillTemplateDetailModal .work-skill-template-detail-scroll {
  min-height: 0 !important;
  overflow-y: auto !important;
  display: grid !important;
  grid-template-rows: auto auto !important;
  align-content: start !important;
  gap: 12px !important;
  padding-right: 4px !important;
}

#workSkillTemplateDetailModal .work-skill-template-detail-body .preview-meta-head {
  padding: 2px 0 12px !important;
}

#workSkillTemplateDetailModal .work-skill-template-combined-panel {
  min-height: 0 !important;
  height: auto !important;
  display: grid !important;
  grid-template-rows: auto auto auto !important;
  align-content: start !important;
  gap: 14px !important;
  overflow: visible !important;
}

#workSkillTemplateDetailModal .work-skill-template-copy-section {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  gap: 8px !important;
  min-width: 0 !important;
  min-height: 0 !important;
}

#workSkillTemplateDetailModal .work-skill-template-copy-section strong {
  color: var(--soft) !important;
  font-size: 13px !important;
}

#workSkillTemplateDetailModal .work-skill-template-detail-block p {
  height: auto !important;
  min-height: 0 !important;
  max-height: 440px !important;
  overflow: auto !important;
}

#workSkillTemplateDetailModal .work-skill-template-detail-actions {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 10px !important;
  padding-top: 14px !important;
  border-top: 1px solid rgba(255,255,255,0.08) !important;
}

#workSkillTemplateDetailModal .work-skill-template-detail-actions > button {
  width: 100% !important;
  min-height: 44px !important;
  justify-content: center !important;
}

@media (max-width: 980px) {
  #workSkillTemplateDetailModal {
    --work-skill-template-detail-panel-width: 320px;
  }

  #workSkillTemplateDetailModal .work-skill-template-preview-layout {
    grid-template-columns: minmax(0, 1fr) var(--work-skill-template-detail-panel-width) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    grid-template-areas: "stage detail" !important;
  }

  #workSkillTemplateDetailModal .work-skill-template-detail-body {
    height: 100% !important;
    padding: 10px 4px 10px 16px !important;
  }
}

@media (max-width: 760px) {
  #workSkillTemplateDetailModal .work-skill-template-preview-layout {
    height: auto !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(360px, calc(var(--app-viewport-height) - 300px)) auto !important;
    grid-template-areas:
      "stage"
      "detail" !important;
    gap: 14px !important;
  }

  #workSkillTemplateDetailModal .work-skill-template-preview-stage {
    min-height: 360px !important;
  }

  #workSkillTemplateDetailModal .work-skill-template-detail-body {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    overflow: visible !important;
    border-left: 0 !important;
    border-top: 1px solid rgba(255,255,255,0.08) !important;
    padding: 14px 0 8px !important;
  }

  #workSkillTemplateDetailModal .work-skill-template-detail-scroll {
    grid-template-rows: auto auto !important;
    overflow: visible !important;
  }

  #workSkillTemplateDetailModal .work-skill-template-combined-panel {
    height: auto !important;
    grid-template-rows: auto auto auto !important;
    overflow: visible !important;
  }

  #workSkillTemplateDetailModal .work-skill-template-detail-block p {
    height: auto !important;
    max-height: none !important;
  }
}

#workSkillTemplateDetailModal.work-skill-template-preview-modal.hidden {
  display: none !important;
}
