/* ══════════════════════════════════════════════════════════
   3DismZ AI Pipeline Console — Fluxio Dark Theme
   ══════════════════════════════════════════════════════════ */

/* ── TOKENS ───────────────────────────────────────────────── */
:root {
  --bg:           #0d1117;
  --bg2:          #131929;
  --surface:      #161c2d;
  --surface2:     #1e2a45;
  --border:       #2a3556;
  --border-light: #334270;
  --text:         #e8edf5;
  --text-dim:     #7a8aaa;
  --text-muted:   #4a5878;
  --accent:       #3b82f6;
  --accent-dark:  #2563eb;
  --accent-glow:  rgba(59,130,246,0.12);
  --accent-grad:  linear-gradient(135deg, #1e40af, #3b82f6);
  --accent-grad2: linear-gradient(135deg, #3b82f6, #06b6d4);
  --accent2:      #f59e0b;
  --accent3:      #06b6d4;
  --success:      #22c55e;
  --danger:       #ef4444;
  --sidebar-w:    230px;
  --mono:         'JetBrains Mono', monospace;
  --sans:         'Syne', sans-serif;
  --radius:       10px;
  --shadow:       0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:    0 16px 48px rgba(0,0,0,0.6);
  --shadow-blue:  0 4px 20px rgba(59,130,246,0.2);
  --transition:   0.18s cubic-bezier(0.4,0,0.2,1);
}

/* ── RESET ────────────────────────────────────────────────── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--accent3); text-decoration: none; }
a:hover { color: var(--accent); text-decoration: none; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ── APP SHELL ────────────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }

/* ── SIDEBAR ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: #080d16;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sidebar-brand { padding: 20px 16px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.brand-mark { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-bottom: 4px; }
.brand-mark:hover { text-decoration: none; }
.brand-icon {
  width: 32px; height: 32px;
  background: var(--accent-grad);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 10px; font-weight: 600; color: #fff;
  flex-shrink: 0; box-shadow: var(--shadow-blue);
}
.brand-name { font-size: 16px; font-weight: 800; letter-spacing: -0.3px; color: #fff; }
.brand-sub { font-family: var(--mono); font-size: 9px; color: var(--text-muted); letter-spacing: 2px; text-transform: uppercase; padding-left: 42px; }

.sidebar-section-label { font-family: var(--mono); font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 2.5px; color: var(--text-muted); padding: 16px 16px 5px; }
.sidebar-nav { padding: 4px 8px 8px; }

.nav-link {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: 8px; text-decoration: none;
  color: var(--text-dim); font-size: 12px; font-weight: 600;
  transition: all var(--transition); margin-bottom: 2px;
}
.nav-link:hover { background: var(--accent-glow); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--accent-glow); color: #fff; border-left: 3px solid var(--accent); padding-left: 7px; }

.nav-dot {
  width: 18px; height: 18px; border-radius: 5px;
  background: var(--surface2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; flex-shrink: 0; color: var(--text-muted);
  transition: all var(--transition);
}
.nav-link:hover .nav-dot  { background: var(--accent-glow); border-color: var(--accent); color: var(--accent); }
.nav-link.active .nav-dot { background: var(--accent); border-color: var(--accent); color: #fff; }

.nav-type {
  font-family: var(--mono); font-size: 8px; text-transform: uppercase;
  letter-spacing: 1px; margin-left: auto;
  background: var(--surface2); border: 1px solid var(--border);
  padding: 1px 5px; border-radius: 3px; color: var(--text-muted); flex-shrink: 0;
}
.nav-link.active .nav-type { background: rgba(59,130,246,0.2); border-color: rgba(59,130,246,0.4); color: var(--accent); }

.sidebar-studio-section { border-top: 1px solid var(--accent); border-bottom: 1px solid var(--accent); padding: 6px 8px; background: rgba(59,130,246,0.03); }
.sidebar-library-section { flex: 1; padding: 6px 8px; border-bottom: 1px solid var(--border); }

.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; }
.user-pill { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.user-initial { width: 26px; height: 26px; background: var(--accent-grad); color: #fff; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex-shrink: 0; }
.user-name { font-size: 11px; font-weight: 600; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-form { margin: 0; }
.logout-btn { width: 100%; background: none; border: 1px solid var(--border); color: var(--text-muted); font-family: var(--sans); font-size: 11px; font-weight: 600; padding: 7px 12px; border-radius: 7px; cursor: pointer; transition: all var(--transition); text-align: center; }
.logout-btn:hover { background: var(--surface2); color: var(--text-dim); border-color: var(--border-light); }
.auth-btn { display: block; text-align: center; padding: 9px 12px; border-radius: 7px; font-size: 12px; font-weight: 700; text-decoration: none; transition: all var(--transition); border: 1px solid var(--border); color: var(--text-dim); }
.auth-btn:hover { background: var(--surface2); color: var(--text); text-decoration: none; }
.auth-btn.primary { background: var(--accent-grad); border-color: var(--accent); color: #fff; }
.auth-btn.primary:hover { box-shadow: var(--shadow-blue); }

/* ── MAIN ─────────────────────────────────────────────────── */
.main-content { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }

/* ── PAGE HEADER ──────────────────────────────────────────── */
.page-header { padding: 32px 36px 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.page-eyebrow { font-family: var(--mono); font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 2.5px; color: var(--text-muted); margin-bottom: 6px; }
.page-title { font-size: 28px; font-weight: 800; letter-spacing: -0.8px; line-height: 1.1; color: var(--text); }
.page-title span { color: var(--accent); }
.page-divider { height: 1px; background: var(--border); margin: 20px 36px 0; }
.page-body { padding: 28px 36px 48px; flex: 1; }

/* ── CARDS ────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--surface2); display: flex; align-items: center; gap: 12px; }
.card-icon { width: 32px; height: 32px; background: var(--accent-grad); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; box-shadow: var(--shadow-blue); }
.card-title { font-size: 14px; font-weight: 700; letter-spacing: -0.2px; color: var(--text); }
.card-subtitle { font-family: var(--mono); font-size: 10px; color: var(--text-dim); margin-top: 1px; }
.card-body { padding: 20px; }

/* ── FORMS ────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-dim); margin-bottom: 6px; }
.form-label .hint { font-weight: 400; font-size: 9px; text-transform: none; letter-spacing: 0; color: var(--text-muted); margin-left: 4px; }
.form-control { width: 100%; background: var(--bg2); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-family: var(--mono); font-size: 12px; padding: 10px 12px; outline: none; transition: border-color var(--transition), box-shadow var(--transition); resize: vertical; }
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,0.12); }
textarea.form-control { min-height: 90px; line-height: 1.5; }
select.form-control option { background: var(--surface); color: var(--text); }

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--sans); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; padding: 11px 20px; border-radius: 7px; border: none; cursor: pointer; transition: all var(--transition); text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--accent-grad); color: #fff; box-shadow: var(--shadow-blue); }
.btn-primary:hover { background: linear-gradient(135deg, #1d4ed8, #2563eb); box-shadow: 0 6px 24px rgba(59,130,246,0.35); color: #fff; text-decoration: none; }
.btn-primary:disabled { background: var(--surface2); color: var(--text-muted); cursor: not-allowed; box-shadow: none; }
.btn-secondary { background: var(--surface2); border: 1px solid var(--border); color: var(--text-dim); }
.btn-secondary:hover { background: var(--surface); color: var(--text); border-color: var(--border-light); text-decoration: none; }
.btn-cancel { background: none; border: 2px solid var(--accent2); color: var(--accent2); display: none; }
.btn-cancel:hover { background: rgba(245,158,11,0.08); }
.btn-cancel.visible { display: inline-flex; }
.btn-full { width: 100%; }
.btn-sm { font-size: 10px; padding: 6px 12px; }

/* ── ACTION ROW ───────────────────────────────────────────── */
.action-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 4px; }

/* ── STATUS BOX ───────────────────────────────────────────── */
.status-box { display: none; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-top: 16px; }
.status-box.visible { display: block; }
.status-header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface2); }
.spinner { width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner.done { border-top-color: var(--success); animation: none; }
.spinner.err  { border-top-color: var(--danger); animation: none; }
.status-text      { font-family: var(--mono); font-size: 12px; color: var(--accent); font-weight: 500; }
.status-text.done { color: var(--success); }
.status-text.err  { color: var(--danger); }
.log-area { padding: 10px 16px; max-height: 160px; overflow-y: auto; font-family: var(--mono); font-size: 11px; }
.log-line { display: flex; gap: 10px; padding: 2px 0; border-bottom: 1px solid rgba(42,53,86,0.5); line-height: 1.6; }
.log-line:last-child { border-bottom: none; }
.log-ts  { color: var(--text-muted); flex-shrink: 0; min-width: 58px; font-size: 10px; }
.log-msg { color: var(--text-dim); }
.log-msg.queue    { color: var(--accent2); }
.log-msg.progress { color: var(--accent); }
.log-msg.complete { color: var(--success); }
.log-msg.error    { color: var(--danger); }

/* ── PIPELINE LAYOUT ──────────────────────────────────────── */
.pipeline-layout { display: flex; align-items: flex-start; gap: 20px; }
.output-panel { display: none; flex-direction: column; gap: 0; flex: 1; min-width: 0; position: sticky; top: 24px; }
.output-panel.visible { display: flex; }
.output-panel-header { background: var(--surface2); border: 1px solid var(--border); border-top: 3px solid var(--accent); border-radius: var(--radius) var(--radius) 0 0; padding: 13px 18px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.output-panel-body { background: var(--surface); border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius) var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.output-placeholder { text-align: center; padding: 40px 20px; border: 2px dashed var(--border); border-radius: 8px; font-family: var(--mono); font-size: 11px; color: var(--text-muted); }
.output-panel-body img, .output-panel-body video { width: 100%; border-radius: 6px; border: 1px solid var(--border); display: block; }
.output-links { display: flex; gap: 8px; flex-wrap: wrap; }
.output-links a { font-family: var(--mono); font-size: 10px; color: var(--accent); border: 1px solid rgba(59,130,246,0.3); padding: 5px 10px; border-radius: 4px; text-decoration: none; text-transform: uppercase; letter-spacing: 1px; transition: background var(--transition); }
.output-links a:hover { background: var(--accent-glow); }
.output-links a.dl { color: var(--success); border-color: rgba(34,197,94,0.3); }
details summary { font-family: var(--mono); font-size: 10px; color: var(--text-dim); cursor: pointer; text-transform: uppercase; letter-spacing: 1px; padding: 4px 0; }
details pre { font-family: var(--mono); font-size: 10px; background: var(--bg2); border: 1px solid var(--border); border-radius: 4px; padding: 10px; overflow-x: auto; color: var(--text-dim); margin-top: 6px; white-space: pre-wrap; word-break: break-all; max-height: 200px; overflow-y: auto; }

/* ── PIPELINE FORM CARD ───────────────────────────────────── */
.pipeline-form-card { width: 100%; max-width: 520px; flex-shrink: 0; }

/* ── DROP ZONE ────────────────────────────────────────────── */
.drop-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 28px 20px; text-align: center; cursor: pointer; transition: border-color var(--transition), background var(--transition); position: relative; background: var(--bg2); }
.drop-zone:hover, .drop-zone.dragover { border-color: var(--accent); background: var(--accent-glow); }
.drop-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.drop-icon { font-size: 26px; margin-bottom: 8px; }
.drop-text { font-size: 12px; color: var(--text-dim); }
.drop-text span { color: var(--accent); }
.preview-wrap { display: none; margin-top: 12px; position: relative; }
.preview-wrap img { width: 100%; max-height: 200px; object-fit: contain; border-radius: 6px; border: 1px solid var(--border); }
.preview-clear { position: absolute; top: 6px; right: 6px; background: var(--danger); border: none; color: #fff; font-size: 10px; font-family: var(--mono); padding: 3px 8px; border-radius: 3px; cursor: pointer; }
.toggle-row { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--text-dim); margin: 12px 0; }
.toggle-row span { flex: 1; text-align: center; }
.toggle-btn { background: none; border: 1px solid var(--border); color: var(--accent); font-family: var(--mono); font-size: 10px; padding: 4px 10px; border-radius: 4px; cursor: pointer; text-transform: uppercase; letter-spacing: 1px; transition: background var(--transition); }
.toggle-btn:hover { background: var(--accent-glow); }
.url-field { display: none; }

/* ── SEED ROW ─────────────────────────────────────────────── */
.seed-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.seed-row .rand-btn { background: var(--surface2); border: 1px solid var(--border); color: var(--text-dim); font-size: 18px; padding: 8px 14px; border-radius: 6px; cursor: pointer; line-height: 1; transition: all var(--transition); }
.seed-row .rand-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ── DASHBOARD WORKFLOW GRID ──────────────────────────────── */
.workflow-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.workflow-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; text-decoration: none; display: flex; flex-direction: column; transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition); position: relative; animation: fadeUp 0.35s ease both; }
@keyframes fadeUp { from { opacity:0; transform: translateY(14px); } to { opacity:1; transform: translateY(0); } }
.workflow-card:nth-child(1) { animation-delay:0.04s; } .workflow-card:nth-child(2) { animation-delay:0.08s; }
.workflow-card:nth-child(3) { animation-delay:0.12s; } .workflow-card:nth-child(4) { animation-delay:0.16s; }
.workflow-card:nth-child(5) { animation-delay:0.20s; }
.workflow-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-blue); border-color: var(--accent); text-decoration: none; }
.workflow-card::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; background:var(--accent-grad); opacity:0; transition: opacity var(--transition); }
.workflow-card:hover::before { opacity:1; }
.wf-thumb { height: 90px; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; background: var(--bg2); }
.wf-thumb-icon { font-size: 38px; position: relative; z-index: 1; transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1); }
.workflow-card:hover .wf-thumb-icon { transform: scale(1.12); }
.wf-type-badge { position: absolute; top: 8px; right: 8px; font-family: var(--mono); font-size: 9px; font-weight: 500; text-transform: uppercase; letter-spacing: 1.5px; padding: 3px 7px; border-radius: 4px; border: 1px solid; }
.badge-img  { color: var(--accent);  border-color: rgba(59,130,246,0.3);  background: rgba(59,130,246,0.1); }
.badge-vid  { color: var(--success); border-color: rgba(34,197,94,0.3);   background: rgba(34,197,94,0.1); }
.badge-edit { color: var(--accent2); border-color: rgba(245,158,11,0.3);  background: rgba(245,158,11,0.1); }
.badge-fix  { color: var(--accent3); border-color: rgba(6,182,212,0.3);   background: rgba(6,182,212,0.1); }
.wf-body { padding: 10px 14px 14px; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.wf-name  { font-size: 13px; font-weight: 800; letter-spacing: -0.2px; color: var(--text); }
.wf-model { font-family: var(--mono); font-size: 10px; color: var(--text-muted); }
.wf-desc  { font-size: 12px; color: var(--text-dim); line-height: 1.5; margin-top: 4px; flex: 1; }
.wf-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.wf-hw { font-family: var(--mono); font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.wf-arrow { width: 24px; height: 24px; border-radius: 6px; background: var(--surface2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--text-dim); transition: all var(--transition); }
.workflow-card:hover .wf-arrow { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── LIBRARY ──────────────────────────────────────────────── */
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.lib-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: box-shadow var(--transition), border-color var(--transition); }
.lib-item:hover { box-shadow: var(--shadow-blue); border-color: var(--border-light); }
.lib-thumb { aspect-ratio: 1; background: var(--bg2); display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.lib-thumb img, .lib-thumb video { width: 100%; height: 100%; object-fit: cover; }
.lib-thumb .lib-placeholder { font-size: 32px; color: var(--border); }
.lib-status { position: absolute; bottom: 6px; right: 6px; font-family: var(--mono); font-size: 9px; padding: 2px 6px; border-radius: 3px; text-transform: uppercase; }
.lib-status.submitted, .lib-status.SUBMITTED { background: rgba(245,158,11,0.15); color: var(--accent2); }
.lib-status.completed,  .lib-status.COMPLETED { background: rgba(34,197,94,0.12);  color: var(--success); }
.lib-status.failed  { background: rgba(239,68,68,0.12);  color: var(--danger); }
.lib-status.review  { background: rgba(6,182,212,0.15);  color: var(--accent3); }
.lib-status.running { background: rgba(59,130,246,0.15); color: var(--accent); }
.lib-meta { padding: 10px 12px; }
.lib-wf     { font-family: var(--mono); font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 3px; }
.lib-prompt { font-size: 11px; color: var(--text); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lib-date   { font-family: var(--mono); font-size: 9px; color: var(--text-muted); margin-top: 6px; }
.lib-actions { display: flex; gap: 6px; padding: 0 12px 10px; flex-wrap: wrap; }
.lib-actions a { font-family: var(--mono); font-size: 9px; color: var(--accent); border: 1px solid rgba(59,130,246,0.25); padding: 3px 8px; border-radius: 3px; text-decoration: none; text-transform: uppercase; }
.lib-delete { position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; background: rgba(239,68,68,0.85); border: none; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity var(--transition); line-height: 1; backdrop-filter: blur(4px); }
.lib-item:hover .lib-delete { opacity: 1; }
.lib-delete:hover { background: var(--danger); transform: scale(1.1); }
.lib-expiry-warn { position: absolute; bottom: 30px; right: 6px; font-family: var(--mono); font-size: 9px; padding: 2px 6px; border-radius: 3px; background: rgba(245,158,11,0.85); color: #fff; text-transform: uppercase; letter-spacing: 0.5px; backdrop-filter: blur(4px); }
.lib-footer { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px 10px; }
.expiry-badge { font-family: var(--mono); font-size: 9px; text-transform: uppercase; letter-spacing: 1px; padding: 2px 7px; border-radius: 3px; border: 1px solid; }
.expiry-ok       { color: var(--success); border-color: rgba(34,197,94,0.3);  background: rgba(34,197,94,0.08); }
.expiry-warn     { color: var(--accent2); border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.08); }
.expiry-critical { color: var(--danger);  border-color: rgba(239,68,68,0.3);  background: rgba(239,68,68,0.08); }
.lib-delete-btn { background: none; border: 1px solid var(--border); color: var(--text-muted); font-size: 11px; width: 24px; height: 24px; border-radius: 5px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all var(--transition); padding: 0; line-height: 1; }
.lib-delete-btn:hover { background: rgba(239,68,68,0.08); border-color: var(--danger); color: var(--danger); }
.lib-delete-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── EXPIRY / NOTICE BANNERS ──────────────────────────────── */
.expiry-banner { display: flex; align-items: flex-start; gap: 12px; background: rgba(245,158,11,0.06); border: 1px solid rgba(245,158,11,0.2); border-left: 4px solid var(--accent2); border-radius: var(--radius); padding: 14px 18px; font-size: 13px; color: var(--text); margin-bottom: 24px; line-height: 1.5; }
.expiry-banner .expiry-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.expiry-banner strong { color: var(--accent2); }
.cleanup-notice { background: rgba(34,197,94,0.06); border: 1px solid rgba(34,197,94,0.2); border-radius: var(--radius); padding: 10px 16px; font-family: var(--mono); font-size: 11px; color: var(--success); margin-bottom: 16px; }
.library-notice { display: flex; align-items: flex-start; gap: 12px; background: rgba(245,158,11,0.06); border: 1px solid rgba(245,158,11,0.2); border-left: 4px solid var(--accent2); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 24px; font-size: 13px; color: var(--text-dim); line-height: 1.5; }
.notice-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.library-notice strong { color: var(--text); }

/* ── SECTION / COUNT BADGES ───────────────────────────────── */
.section-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-label h2 { font-size: 11px; font-weight: 600; font-family: var(--mono); text-transform: uppercase; letter-spacing: 2px; color: var(--text-dim); }
.count-badge { font-family: var(--mono); font-size: 10px; color: var(--text-dim); background: var(--surface2); border: 1px solid var(--border); padding: 2px 8px; border-radius: 4px; }
.stats-row { display: flex; gap: 20px; padding-bottom: 4px; }
.stat-box { text-align: right; }
.stat-num   { font-size: 22px; font-weight: 800; font-family: var(--mono); color: var(--text); line-height: 1; }
.stat-label { font-size: 9px; font-family: var(--mono); text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-dim); margin-top: 2px; }

/* ── IDENTITY PAGES ───────────────────────────────────────── */
.main-content > .row, .main-content > h1, .main-content > h2, .main-content > h3, .main-content > form, .main-content > p { padding-left: 36px; padding-right: 36px; }
.main-content > .row { padding-top: 32px; margin-left: 0; margin-right: 0; }

/* ── UTILITY ──────────────────────────────────────────────── */
.spacer-16 { height: 16px; } .spacer-24 { height: 24px; } .spacer-32 { height: 32px; }
.text-dim { color: var(--text-dim); } .mono { font-family: var(--mono); }

/* ── PIPELINE STUDIO ──────────────────────────────────────── */
.studio-layout { display: grid; grid-template-columns: 280px 1fr; gap: 20px; align-items: flex-start; }
.studio-layout.solo { grid-template-columns: 1fr; justify-items: center; }
.studio-recent { display: flex; flex-direction: column; gap: 8px; }
.recent-session-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; transition: border-color var(--transition); }
.recent-session-card:hover { border-color: var(--accent); }
.recent-name { font-size: 13px; font-weight: 700; color: var(--text); text-decoration: none; display: block; margin-bottom: 4px; }
.recent-name:hover { color: var(--accent); text-decoration: none; }
.recent-meta { display: flex; justify-content: space-between; margin-bottom: 8px; }
.progress-bar { height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent-grad); border-radius: 2px; transition: width 0.4s ease; }
.workflow-picker { display: flex; flex-direction: column; gap: 6px; }
.wf-pick-item { display: flex; align-items: center; gap: 10px; background: var(--bg2); border: 1px solid var(--border); border-radius: 7px; padding: 8px 12px; transition: all var(--transition); }
.wf-pick-item:hover { border-color: var(--accent); background: var(--accent-glow); }
.wf-pick-icon { font-size: 16px; }
.wf-pick-name { font-size: 13px; font-weight: 600; flex: 1; color: var(--text); }
.wf-pick-badge { font-family: var(--mono); font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.wf-pick-add { background: var(--accent-grad); border: none; color: #fff; width: 22px; height: 22px; border-radius: 5px; cursor: pointer; font-size: 14px; line-height: 1; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all var(--transition); }
.wf-pick-add:hover { box-shadow: var(--shadow-blue); transform: scale(1.1); }
.pipeline-builder { min-height: 60px; background: var(--bg2); border: 2px dashed var(--border); border-radius: var(--radius); padding: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pipeline-empty { font-family: var(--mono); font-size: 11px; color: var(--text-muted); text-align: center; width: 100%; }
.pipeline-step-chip { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 5px 10px; font-size: 12px; font-weight: 600; transition: border-color var(--transition); }
.pipeline-step-chip:hover { border-color: var(--accent); }
.chip-num     { font-family: var(--mono); font-size: 10px; color: var(--text-muted); }
.chip-icon    { font-size: 14px; }
.chip-name    { color: var(--text); }
.chip-remove  { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 12px; padding: 0; line-height: 1; transition: color var(--transition); }
.chip-remove:hover { color: var(--danger); }
.chip-arrow   { color: var(--text-muted); font-size: 12px; }
.chip-produces { font-size: 11px; opacity: 0.6; flex-shrink: 0; }
.chip-incompat { color: var(--accent2); font-size: 13px; flex-shrink: 0; cursor: help; }
.wf-pick-produces { font-size: 10px; opacity: 0.5; margin-left: auto; margin-right: 6px; flex-shrink: 0; }

/* Session layout */
.studio-session-layout { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: flex-start; }
.step-rail { display: flex; flex-direction: column; gap: 0; position: sticky; top: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.step-rail-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background var(--transition); }
.step-rail-item:last-of-type { border-bottom: none; }
.step-rail-item:hover    { background: var(--bg2); }
.step-rail-item.current  { background: var(--accent-glow); border-left: 3px solid var(--accent); }
.step-rail-item.accepted { opacity: 0.6; }
.step-rail-item.locked   { opacity: 0.4; }
.step-rail-num { width: 22px; height: 22px; border-radius: 50%; background: var(--surface2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 10px; font-weight: 600; flex-shrink: 0; }
.step-rail-item.current  .step-rail-num { background: var(--accent); border-color: var(--accent); color: #fff; }
.step-rail-item.accepted .step-rail-num { background: var(--success); border-color: var(--success); color: #fff; }
.step-rail-info { flex: 1; min-width: 0; }
.step-rail-name   { font-size: 11px; font-weight: 700; color: var(--text); }
.step-rail-status { font-family: var(--mono); font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.step-rail-icon   { font-size: 14px; flex-shrink: 0; }
.step-connector   { height: 1px; background: var(--border); }
.step-connector.done { background: var(--success); }
.step-complete-badge { padding: 14px; text-align: center; font-weight: 700; color: var(--success); font-size: 13px; }
.step-panel { display: none; }
.step-panel.active { display: block; }
.step-panel-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.step-num-badge { font-family: var(--mono); font-size: 10px; background: var(--accent-grad); color: #fff; padding: 3px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: 1px; flex-shrink: 0; }
.step-wf-name  { font-size: 16px; font-weight: 800; color: var(--text); }
.step-attempt  { font-family: var(--mono); font-size: 10px; color: var(--text-muted); margin-left: auto; }
.step-output { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.step-output-label { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-dim); margin-bottom: 10px; }
.step-output-media { width: 100%; border-radius: 6px; border: 1px solid var(--border); display: block; margin-bottom: 10px; }
.step-output-links { display: flex; gap: 8px; }
.prefill-img-wrap { margin-bottom: 8px; }
.prefill-img { width: 100%; max-height: 160px; object-fit: contain; border-radius: 6px; border: 1px solid rgba(34,197,94,0.4); display: block; }

.review-gate { background: rgba(59,130,246,0.05); border: 1px solid rgba(59,130,246,0.2); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 16px; margin-top: 16px; }
.review-gate-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--accent); margin-bottom: 12px; }
.review-gate-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.review-accept { background: var(--success); color: #fff; border: none; flex: 1; min-width: 140px; }
.review-accept:hover { background: #16a34a; color: #fff; }
.review-rerun { background: var(--surface2); border: 1px solid var(--accent2); color: var(--accent2); flex: 1; min-width: 140px; }
.review-rerun:hover { background: rgba(245,158,11,0.08); color: var(--accent2); }
.review-reject { background: none; border: 1px solid var(--border); color: var(--text-dim); }
.review-reject:hover { border-color: var(--danger); color: var(--danger); }
.step-accepted-banner { background: rgba(34,197,94,0.06); border: 1px solid rgba(34,197,94,0.2); border-radius: 6px; padding: 10px 14px; font-size: 13px; color: var(--success); font-weight: 600; margin-top: 12px; }
.session-complete { text-align: center; padding: 60px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.studio-builder { max-width: 760px; width: 100%; }
.studio-layout:has(> .studio-builder:only-child) { display: flex; justify-content: center; }
.studio-layout:has(> .studio-builder:only-child) .studio-builder { max-width: 860px; }
.session-delete-btn { background: none; border: none; color: var(--text-muted); font-size: 14px; cursor: pointer; padding: 0 2px; line-height: 1; flex-shrink: 0; transition: color var(--transition); }
.session-delete-btn:hover { color: var(--danger); }

/* ── ACTIVE STEP LAYOUT ───────────────────────────────────── */
.active-step-layout { display: grid; grid-template-columns: 200px 1fr; gap: 20px; align-items: flex-start; }
.step-main { min-width: 0; }
.step-progress-bar { margin-bottom: 4px; }
.step-progress-label { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.step-progress-track { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.step-progress-fill { height: 100%; background: var(--accent-grad2); border-radius: 2px; transition: width 0.5s ease; }

.prefill-banner { display: flex; gap: 12px; align-items: flex-start; background: rgba(34,197,94,0.06); border: 1px solid rgba(34,197,94,0.2); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.prefill-thumb { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; border: 1px solid rgba(34,197,94,0.3); flex-shrink: 0; }
.prefill-info { flex: 1; min-width: 0; }
.prefill-label { font-size: 11px; font-weight: 700; color: var(--success); margin-bottom: 4px; }
.prefill-url { font-family: var(--mono); font-size: 9px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.final-outputs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 20px 0; }
.final-output-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.final-output-item img, .final-output-item video { width: 100%; display: block; }
.final-output-links { display: flex; gap: 6px; padding: 8px; }

/* ── AI DESCRIPTION PANEL ─────────────────────────────────── */
.ai-desc-panel { margin-top: 12px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; display: none; }
.ai-desc-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: var(--surface2); cursor: pointer; border-bottom: 1px solid var(--border); transition: background var(--transition); }
.ai-desc-header:hover { background: var(--bg2); }
.ai-desc-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--accent); }
.ai-desc-toggle { font-size: 10px; color: var(--text-dim); }
.ai-desc-body { padding: 12px 14px; background: var(--bg2); }
.ai-desc-loading { font-family: var(--mono); font-size: 11px; color: var(--text-dim); padding: 4px 0; }
.ai-desc-text { width: 100%; min-height: 80px; font-size: 12px; line-height: 1.6; resize: vertical; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-family: var(--sans); }
.ai-desc-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 700px) {
  .studio-layout, .studio-session-layout, .active-step-layout { grid-template-columns: 1fr; }
  .step-rail { position: static; display: flex; flex-direction: row; overflow-x: auto; }
}
/* ══════════════════════════════════════════════════════════
   site.css PATCH — append to end of site.css
   ══════════════════════════════════════════════════════════

   Fixes:
   1. Max content width ~70% on all pages
   2. More top padding on pipeline/model pages
   3. Workflow card tiles visible in dark theme
   ══════════════════════════════════════════════════════════ */

/* ── FIX 1: Content max width ─────────────────────────────── */
/* Constrains all page content to ~70% — comfortable reading
   width without stretching edge to edge on wide monitors     */
.page-body {
  max-width: 1080px;
}

/* ── FIX 2: Top padding on model/pipeline pages ───────────── */
/* Pipeline pages have .pipeline-layout as the first child
   inside .page-body — the .page-header above needs more air  */
.page-header {
  padding-top: 40px;
}

/* ── FIX 3: Workflow card tiles visible in dark theme ─────── */
/* Cards need stronger contrast against the dark bg           */
.workflow-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.workflow-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-blue);
  transform: translateY(-3px);
}

/* Thumb area — taller, more visual impact */
.wf-thumb {
  height: 110px;
  position: relative;
}

/* Accent top stripe appears on hover */
.workflow-card::before {
  background: var(--accent-grad);
}

/* Emoji icon bigger and brighter */
.wf-thumb-icon {
  font-size: 42px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

/* Card body — add model line back for visual weight */
.wf-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
}

/* Arrow button more visible */
.wf-arrow {
  background: var(--surface2);
  border: 1px solid var(--border-light);
  color: var(--text-dim);
  font-size: 13px;
}
.workflow-card:hover .wf-arrow {
  background: var(--accent-grad);
  border-color: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-blue);
}

/* Hardware tag */
.wf-hw {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-muted);
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 3px;
}

/* Section label headings */
.section-label h2 {
  color: var(--text-dim);
  font-size: 11px;
}

/* Workflow grid — min tile width bumped slightly */
.workflow-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

/* ── Pipeline room backdrop — vertically tiled ComfyUI watermark ──────────────
   Scoped to .pipeline-room (set on <main> for PipelinePageBase rooms only),
   so generation rooms get the backdrop while Library / Intelligence pages stay clean.
   Asset lives at wwwroot/assets/cui2.png → served at /assets/cui2.png. */
.pipeline-room .page-body {
    background-image: url('/assets/cui2.png');
    background-repeat: repeat-y;
    background-position: top center;
}
