:root {
  --bg: #0e1117;
  --card: #161b22;
  --border: #30363d;
  --fg: #c9d1d9;
  --muted: #8b949e;
  --green: #3fb950;
  --red: #f85149;
  --orange: #d29922;
  --blue: #58a6ff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  background: var(--bg);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
header .brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(0, 245, 255, 0.25);
}
header h1 { font-size: 18px; margin: 0; flex: 0 0 auto; }
.pills { display: flex; gap: 6px; align-items: center; }
.pill {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
}
.pill.running { background: var(--green); color: #000; }
.pill.starting { background: var(--orange); color: #000; animation: pulse 1.2s infinite; }
.pill.stopped { background: var(--red); color: #000; }
.pill.oom { background: var(--orange); color: #000; }
.pill.unknown { background: var(--muted); color: #000; }
.pill.computing { background: #00F5FF; color: #000; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.6} }
nav { margin-left: auto; display: flex; gap: 8px; align-items: center; }
nav button {
  background: #21262d;
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}
nav button:hover { background: #30363d; }
nav button.btn-dim { opacity: 0.35; cursor: not-allowed; }
nav button.btn-dim:hover { background: #21262d; }
nav button.btn-highlight {
  background: #1a3a2e;
  border-color: var(--green);
  color: var(--green);
  box-shadow: 0 0 6px rgba(63,185,80,0.3);
}
nav button.btn-highlight:hover { background: #2a5a3e; }
nav button:disabled { opacity: 0.35; cursor: not-allowed; }
nav button:disabled:hover { background: #21262d; }

/* Menus déroulants de la nav */
.nav-menu { position: relative; }
.nav-trigger {
  background: #21262d;
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.nav-trigger:hover { background: #30363d; }
.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #161b22;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  min-width: 180px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 100;
  flex-direction: column;
  gap: 2px;
}
.nav-dropdown.open { display: flex; }
.nav-dropdown button,
.nav-dropdown a {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--fg);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  text-decoration: none;
}
.nav-dropdown button:hover,
.nav-dropdown a:hover { background: #21262d; }
.nav-dropdown button:disabled { opacity: 0.35; cursor: not-allowed; }
.nav-dropdown button:disabled:hover { background: transparent; }
.nav-dropdown hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}
.nav-dropdown .btn-app {
  font-weight: 600;
  color: #e9d5ff;
}
.nav-dropdown .btn-app:hover { color: #fff; }
.nav-subgroup { padding: 4px 0; }
.nav-sublabel {
  display: block;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 12px 4px;
}
.nav-sub-row { display: flex; gap: 4px; padding: 0 6px; }
.nav-sub-row .btn-mini {
  flex: 1;
  text-align: center;
  background: #2a1840;
  border: 1px solid #A855F7;
  color: #e9d5ff;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.nav-sub-row .btn-mini:hover { background: #3b1d5c; color: #fff; }
.nav-sub-row .btn-mini:disabled,
.nav-sub-row a.btn-mini.disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }
#lora-scan-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: #2a2310;
  border-bottom: 1px solid #d29922;
  color: #e3b341;
  font-size: 13px;
  flex-shrink: 0;
}
#lora-scan-bar[hidden] { display: none !important; }
#lora-scan-bar button {
  background: #21262d; color: var(--fg); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 10px; cursor: pointer; font-family: inherit;
}
#lora-scan-yes { border-color: var(--green); color: var(--green); }
#lora-scan-no { border-color: #d29922; color: #e3b341; }
body.has-lora-prompt #workspace { /* unused on dashboard */ }
body.has-lora-prompt #overview { margin-top: 0; }
#overview {
  display: grid;
  grid-template-columns: 0.7fr 0.7fr 1fr 0.9fr 0.8fr;
  gap: 12px;
  padding: 12px 16px;
  flex-shrink: 0;
}
@media (max-width: 1400px) { #overview { grid-template-columns: 1fr 1fr 1fr; } }
@media (max-width: 900px) { #overview { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { #overview { grid-template-columns: 1fr; } }
#users-section {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 12px;
  padding: 0 16px 12px;
  flex-shrink: 0;
  max-height: 260px;
}
@media (max-width: 1100px) { #users-section { grid-template-columns: 1fr; max-height: none; } }
.users-list { font-size: 12px; max-height: 180px; overflow-y: auto; }
.users-list .urow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); }
.users-list button { font: inherit; font-size: 11px; cursor: pointer; background: transparent; color: var(--blue); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; }
.users-hist-filters { display: flex; gap: 12px; margin-bottom: 8px; font-size: 12px; }
.users-hist-filters select { background: var(--bg); color: var(--fg); border: 1px solid var(--border); border-radius: 6px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}
.card h2 { font-size: 14px; margin: 0 0 8px; color: var(--blue); }
dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; word-break: break-all; }
.muted { color: var(--muted); font-size: 12px; }

/* Main grid: preview | chat/queue | logs */
#main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  padding: 0 16px 12px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
@media (max-width: 1400px) { #main-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { #main-grid { grid-template-columns: 1fr; overflow-y: auto; } }
#left-col, #mid-col, #right-col { min-width: 0; min-height: 0; display: flex; }
#left-col .card, #mid-col .card, #right-col .card { width: 100%; display: flex; flex-direction: column; min-height: 0; }
#right-col .card, #mid-col .card { height: 100%; }

/* Preview/Compare card fills height */
.preview-card { height: 100%; }
.preview-toolbar { flex-shrink: 0; padding: 4px 0 8px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.toggle-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; cursor: pointer; }
.preview-area { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; overflow: hidden; position: relative; }
#preview-img, #result-video {
  max-width: 100%; max-height: 100%; border-radius: 4px; background: #000;
  object-fit: contain; flex: 1; min-height: 0; display: block; cursor: zoom-in;
}
#result-video { border-radius: 8px; }
#preview-meta { flex-shrink: 0; margin-top: 4px; }

/* Tab content fills remaining height */
.tab-content { flex: 1; min-height: 0; display: none; flex-direction: column; }
.tab-content.active { display: flex; }

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 0; flex-shrink: 0; }
.tab {
  background: none; border: none; color: var(--muted);
  padding: 8px 16px; cursor: pointer; font-family: inherit; font-size: 13px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--fg); }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }

/* Compare */
#compare-container {
  position: relative; width: 100%; flex: 1; min-height: 0;
  overflow: hidden; border-radius: 8px; background: #111;
  cursor: zoom-in; display: flex; align-items: center; justify-content: center;
}
#compare-placeholder {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--muted);
}
#compare-wrapper { display: none; position: relative; line-height: 0; flex-shrink: 0; }
#compare-img-b, #compare-img-a {
  display: block; width: 100%; height: 100%; object-fit: fill; user-select: none;
}
#compare-img-a {
  position: absolute; top: 0; left: 0;
  clip-path: inset(0 50% 0 0);
}
#compare-slider {
  position: absolute; top: 0; left: 50%; height: 100%; width: 3px;
  background: #00F5FF; cursor: ew-resize; transform: translateX(-50%);
  box-shadow: 0 0 8px rgba(0,245,255,0.5);
}
.compare-label {
  position: absolute; top: 4px; font-size: 0.7rem;
  background: rgba(0,0,0,0.6); padding: 2px 6px; border-radius: 3px;
}
.compare-label-a { left: 4px; color: #9CA3AF; }
.compare-label-b { right: 4px; color: #00F5FF; }
#compare-info { margin-top: 6px; flex-shrink: 0; }

/* Fullscreen overlay */
#fs-overlay {
  display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.95); z-index: 9999; align-items: center; justify-content: center;
  cursor: zoom-out;
}
#fs-overlay.active { display: flex; }
#fs-overlay img, #fs-overlay video {
  max-width: 95vw; max-height: 95vh; object-fit: contain; border-radius: 4px;
}
#fs-close {
  position: absolute; top: 12px; right: 16px; font-size: 28px;
  color: var(--muted); cursor: pointer; background: none; border: none;
}
#fs-close:hover { color: var(--fg); }

#down-overlay {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6, 8, 12, 0.78);
  backdrop-filter: blur(4px);
}
#down-overlay[hidden] { display: none; }
.down-card {
  max-width: 420px; margin: 16px; padding: 22px 24px;
  background: #161b22; border: 1px solid #f85149; border-radius: 12px;
  color: var(--fg); text-align: center; box-shadow: 0 16px 48px rgba(0,0,0,.55);
}
.down-card strong { display: block; font-size: 18px; color: #ff7b72; margin-bottom: 8px; }
.down-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }

/* Logs / History */
.logs-card { height: 100%; }
.logs-head { flex-shrink: 0; }
#log-controls { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; font-size: 12px; flex-shrink: 0; }
#log-controls button, #log-controls select {
  background: #21262d; color: var(--fg); border: 1px solid var(--border);
  padding: 4px 8px; border-radius: 4px; font-family: inherit;
}
#logs {
  background: #010409; border: 1px solid var(--border); border-radius: 6px;
  padding: 8px; flex: 1; min-height: 0; overflow-y: auto;
  font-size: 12px; line-height: 1.5; margin: 0;
  white-space: pre-wrap; word-break: break-all;
}
.log-line { display: block; }
.log-line.debug { color: #67E8F9; }
.log-line.detail { color: #60A5FA; }
.log-line.info { color: var(--fg); }
.log-line.warn { color: var(--orange); }
.log-line.error { color: var(--red); }
.log-line.critical { color: #E879F9; font-weight: 700; }
.log-line.oom { color: var(--red); font-weight: 700; }
.log-line.diagnostic { color: #A78BFA; }
.log-line.node { color: var(--blue); }
.log-line .ts { color: var(--muted); }
.log-line .src { color: var(--blue); }
.log-line .log-text { white-space: pre-wrap; }
.ansi-cyan { color: #22d3ee; }
.ansi-green { color: #3fb950; }
.ansi-yellow { color: #e3b341; }
.ansi-red { color: #f85149; }
.ansi-magenta { color: #c084fc; }
.ansi-bright { font-weight: 600; }
#hist-controls { display: flex; gap: 6px; flex-shrink: 0; padding: 8px 0; }
.hist-chip {
  background: #21262d; color: var(--muted); border: 1px solid var(--border);
  padding: 3px 8px; border-radius: 10px; font-family: inherit; font-size: 11px; cursor: pointer;
}
.hist-chip.active { color: var(--fg); border-color: var(--blue); }
#hist-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-bottom: 8px; }
.hist-card {
  position: relative; background: #0d1117; border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px 8px 14px; cursor: default;
  animation: hist-slide 0.3s ease;
}
.hist-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  border-radius: 8px 0 0 8px; background: var(--muted);
}
.hist-card.sys-comfy::before { background: #00F5FF; }
.hist-card.sys-ollama::before { background: #A855F7; }
.hist-card.sys-supervisor::before { background: #58a6ff; }
.hist-card.sys-training::before { background: var(--orange); }
.hist-card.sys-todo::before { background: #3fb950; }
@keyframes hist-slide {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.hist-card-top { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.hist-sys {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  padding: 1px 6px; border-radius: 4px; color: #000;
}
.hist-sys.comfy { background: #00F5FF; }
.hist-sys.ollama { background: #A855F7; color: #fff; }
.hist-sys.supervisor { background: #58a6ff; }
.hist-sys.todo { background: #3fb950; }
.hist-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-status { color: var(--muted); font-size: 11px; }
.hist-status.running, .hist-status.started { color: var(--green); }
.hist-status.waiting { color: var(--orange); }
.hist-status.error, .hist-status.interrupted, .hist-status.alert { color: var(--red); }
.hist-card-sub { margin-top: 4px; font-size: 11px; color: var(--muted); }
#hist-dialog { max-width: 720px; width: 90vw; max-height: 85vh; flex-direction: column; }
#hist-dialog[open] { display: flex; }
.hist-dialog-head { display: flex; align-items: center; justify-content: space-between; }
#hist-dlg-close { background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; }
#hist-dlg-meta { margin: 6px 0 12px; font-size: 12px; }
#hist-dialog h3 { font-size: 13px; color: var(--blue); margin: 10px 0 6px; }
#hist-dlg-files { display: flex; flex-wrap: wrap; gap: 8px; }
#hist-dlg-files img, #hist-dlg-files video { max-width: 180px; max-height: 140px; border-radius: 6px; background: #000; }
#hist-dlg-files a { color: var(--blue); font-size: 12px; }
#hist-dlg-cmd {
  background: #010409; border: 1px solid var(--border); border-radius: 6px;
  padding: 8px; font-size: 11px; max-height: 280px; overflow: auto; white-space: pre-wrap;
}
#hist-dlg-copy { font-size: 11px; margin-left: 8px; }
dialog {
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  max-width: 600px;
}
dialog form { display: flex; flex-direction: column; gap: 8px; }
dialog label { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 13px; }
dialog input { flex: 1; background: #010409; color: var(--fg); border: 1px solid var(--border); padding: 4px 8px; border-radius: 4px; font-family: inherit; }
dialog fieldset { border: 1px solid var(--border); border-radius: 6px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
dialog legend { color: var(--blue); padding: 0 4px; }
dialog .cfg-hint { margin: 0 0 8px; color: var(--muted); font-size: 12px; line-height: 1.4; }
dialog .cfg-hint code { font-size: 11px; }
dialog menu { display: flex; justify-content: flex-end; gap: 8px; padding: 0; margin: 8px 0 0; }
dialog button { background: #21262d; color: var(--fg); border: 1px solid var(--border); padding: 6px 12px; border-radius: 4px; cursor: pointer; font-family: inherit; }
/* Workflow progress bars (matching stat-bar style) */
.wf-progress-dd { display: flex; align-items: center; gap: 8px; }
.wf-bar { flex: 1; height: 10px; background: rgba(255,255,255,0.08); border-radius: 5px; overflow: hidden; position: relative; }
.wf-bar-fill { height: 100%; border-radius: 5px; transition: width 0.5s ease; width: 0%; background: linear-gradient(90deg, #00F5FF, #3B82F6); }
.wf-bar-fill.node { background: linear-gradient(90deg, #A855F7, #E879F9); }
.wf-bar-val { min-width: 36px; text-align: right; font-size: 12px; font-weight: 600; }

/* System stats bars */
.sysstats { display: flex; flex-direction: column; gap: 6px; }
.stat-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.stat-label { width: 40px; font-weight: 700; flex-shrink: 0; }
.stat-bar { flex: 1; height: 8px; background: rgba(255,255,255,0.08); border-radius: 4px; overflow: hidden; position: relative; }
.stat-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; width: 0%; }
.stat-bar-fill.cpu { background: #00F5FF; }
.stat-bar-fill.gpu { background: #A855F7; }
.stat-bar-fill.ram { background: #10B981; }
.stat-bar-fill.vram { background: #FB923C; }
.stat-bar-fill.gpup { background: #f472b6; }
#card-system.gpup-hot {
  border-color: #f85149;
  box-shadow: 0 0 0 1px #f85149, 0 0 14px rgba(248,81,73,.4);
}
#card-system.gpup-hot .stat-bar-fill.gpup { background: #f85149; }
/* Max-value marker: thin vertical line inside the bar */
.stat-bar-max {
  position: absolute; top: 0; height: 100%; width: 2px;
  background: rgba(255,255,255,0.7); box-shadow: 0 0 4px rgba(255,255,255,0.5);
  transition: left 0.5s ease; left: 0%; pointer-events: none;
}
.stat-val { min-width: 60px; text-align: right; color: var(--fg); font-weight: 600; flex-shrink: 0; }
.queue-info { display: flex; gap: 16px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.queue-item { display: flex; align-items: center; gap: 4px; }
.queue-item b { color: var(--fg); }
.queue-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.queue-dot.running { background: #00F5FF; box-shadow: 0 0 6px rgba(0,245,255,0.5); }
.queue-dot.pending { background: #d29922; box-shadow: 0 0 6px rgba(210,153,34,0.5); }

.pill.vram-idle { background: #30363d; color: var(--fg); }
.pill.vram-comfy { background: #00F5FF; color: #000; }
.pill.vram-training { background: var(--orange); color: #000; animation: pulse 1.2s infinite; }
.pill.vram-ollama { background: #A855F7; color: #000; }
.pill.vram-externe { background: #f85149; color: #fff; animation: pulse 1.2s infinite; }

.mid-card { height: 100%; }
.chat-toolbar {
  display: flex; gap: 8px; align-items: center; flex-shrink: 0;
  padding: 8px 0; font-size: 12px; border-bottom: 1px solid var(--border);
}
.chat-toolbar select {
  background: #21262d; color: var(--fg); border: 1px solid var(--border);
  padding: 4px 8px; border-radius: 4px; font-family: inherit; max-width: 240px;
}
.chat-toolbar button {
  background: #21262d; color: var(--fg); border: 1px solid var(--border);
  padding: 4px 8px; border-radius: 4px; font-family: inherit; cursor: pointer;
  margin-left: auto;
}
#chat-log {
  flex: 1; min-height: 0; overflow-y: auto; padding: 8px 0;
  display: flex; flex-direction: column; gap: 8px;
}
.chat-msg {
  max-width: 92%; padding: 8px 10px; border-radius: 8px;
  font-size: 13px; line-height: 1.45; white-space: pre-wrap; word-break: break-word;
}
.chat-msg.user { align-self: flex-end; background: #1f3b5b; }
.chat-msg.assistant { align-self: flex-start; background: #21262d; border: 1px solid var(--border); }
.chat-msg.system { align-self: center; background: transparent; color: var(--muted); font-size: 12px; }
.chat-wait {
  flex-shrink: 0; font-size: 12px; color: var(--orange); padding: 4px 0;
}
#chat-form {
  display: flex; gap: 8px; flex-shrink: 0; padding-top: 8px;
  border-top: 1px solid var(--border);
}
#chat-input {
  flex: 1; resize: none; background: #010409; color: var(--fg);
  border: 1px solid var(--border); border-radius: 6px; padding: 8px;
  font-family: inherit; font-size: 13px;
}
#chat-send {
  background: #21262d; color: var(--fg); border: 1px solid var(--border);
  border-radius: 6px; padding: 8px 12px; cursor: pointer; font-family: inherit;
}
.queue-toolbar {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  padding: 8px 0; border-bottom: 1px solid var(--border); margin-bottom: 4px;
}
.watch-btn {
  background: #21262d; color: var(--muted); border: 1px solid var(--border);
  padding: 6px 10px; border-radius: 6px; cursor: pointer; font-family: inherit; font-size: 12px;
}
.watch-btn:hover { background: #30363d; color: var(--fg); }
.watch-btn.on {
  background: #3d2e12; border-color: var(--orange); color: var(--orange);
  box-shadow: 0 0 6px rgba(210,153,34,0.3);
}
#queue-summary { flex-shrink: 0; padding: 8px 0; font-size: 12px; }
#queue-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.q-row {
  border: 1px solid var(--border); border-radius: 6px; padding: 8px;
  font-size: 12px; background: #0d1117;
}
.q-row-head { display: flex; gap: 8px; align-items: center; }
.q-kind {
  font-weight: 700; text-transform: uppercase; font-size: 10px;
  padding: 2px 6px; border-radius: 4px;
}
.q-kind.training { background: var(--orange); color: #000; }
.q-kind.comfy { background: #00F5FF; color: #000; }
.q-kind.ollama { background: #A855F7; color: #000; }
.q-status { margin-left: auto; color: var(--muted); }
.q-status.running { color: var(--green); }
.q-status.waiting { color: var(--orange); }
.q-title { margin-top: 4px; color: var(--fg); word-break: break-all; }
.q-reason { margin-top: 2px; color: var(--muted); }
.q-row button {
  margin-top: 6px; background: #21262d; color: var(--fg);
  border: 1px solid var(--border); border-radius: 4px; padding: 3px 8px;
  cursor: pointer; font-family: inherit; font-size: 11px;
}

.card-ollama h2 { color: #c4b5fd; margin: 0; }
.chumpy-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin: 0 0 8px;
}
.btn-vram {
  flex: 0 0 auto;
  background: #2a1840;
  color: #e9d5ff;
  border: 1px solid #A855F7;
  border-radius: 5px;
  padding: 2px 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.btn-vram:hover { background: #3b1d5c; color: #fff; }
.btn-vram:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-vram:disabled:hover { background: #2a1840; color: #e9d5ff; }

.card-minimax h2 { color: #fb7185; margin: 0; }
.minimax-actions { display: flex; gap: 6px; }
.minimax-actions .btn-vram { padding: 4px 10px; font-size: 11px; }
.minimax-actions a.btn-vram { display: inline-flex; align-items: center; text-decoration: none; }
.minimax-actions a.btn-vram.disabled { pointer-events: none; opacity: 0.4; }
#minimax-info dt { color: #8b949e; }
#minimax-info dd { color: #d5dbe6; }

.unknown-app-warning {
  background: #2a1010;
  border: 1px solid #f85149;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.unknown-app-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.unknown-app-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #f85149;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.unknown-app-label {
  color: #f85149;
  font-weight: 600;
  font-size: 13px;
}
.unknown-app-detail {
  color: var(--muted);
  font-size: 12px;
}
.btn-free-all {
  align-self: flex-start;
  background: #f85149;
  color: #fff;
  border: 1px solid #f85149;
  border-radius: 5px;
  padding: 4px 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.btn-free-all:hover { background: #ff6b5e; }
.btn-free-all:disabled { opacity: 0.4; cursor: not-allowed; }
.chat-line { margin: 6px 0; white-space: pre-wrap; font-size: 13px; line-height: 1.45; }
.chat-line.user { color: var(--cyan); }
.chat-line.bot { color: var(--fg); }
.chat-line.tools { color: var(--muted); font-size: 11px; }
.chat-line.err { color: #f85149; }
