:root {
  --deck-bg: #f2f1ea;
  --deck-panel: rgba(255, 255, 255, 0.54);
  --deck-panel-strong: rgba(255, 255, 255, 0.72);
  --deck-ink: #27332e;
  --deck-muted: #6f7870;
  --deck-line: rgba(139, 153, 143, 0.34);
  --deck-line-strong: rgba(116, 134, 122, 0.5);
  --deck-sage: #5d806c;
  --deck-sage-soft: #e7efe9;
  --deck-lavender: #756c9a;
  --deck-lavender-soft: #efedf8;
  --deck-amber: #987448;
  --deck-amber-soft: #f8efd9;
  --deck-alert: #a7604a;
  --deck-alert-soft: #f8e9df;
  --deck-shadow: 0 24px 80px rgba(40, 55, 48, 0.12), 0 4px 16px rgba(40, 55, 48, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.82);
  --deck-radius: 14px;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

body.dashboard-page {
  display: block;
  min-height: 100vh;
  background: var(--deck-bg);
  color: var(--deck-ink);
  font-family: "Noto Sans SC", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

.command-deck-page.deck-dark {
  --deck-bg: #121615;
  --deck-panel: rgba(20, 24, 23, 0.68);
  --deck-panel-strong: rgba(26, 33, 31, 0.8);
  --deck-ink: #dce0dc;
  --deck-muted: #a7b0a9;
  --deck-line: rgba(229, 235, 230, 0.08);
  --deck-line-strong: rgba(229, 235, 230, 0.14);
  --deck-sage: #94b4a2;
  --deck-sage-soft: rgba(38, 62, 52, 0.44);
  --deck-lavender: #bfb8e5;
  --deck-lavender-soft: rgba(51, 47, 69, 0.48);
  --deck-amber: #d6b77f;
  --deck-amber-soft: rgba(67, 56, 39, 0.5);
  --deck-alert: #e3ab96;
  --deck-alert-soft: rgba(70, 47, 43, 0.52);
  --deck-shadow: 0 24px 80px rgba(0, 0, 0, 0.35), 0 4px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.deck-background {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(135deg, rgba(250, 249, 245, 0.94), rgba(238, 242, 236, 0.8) 42%, rgba(232, 235, 229, 0.92)),
    var(--deck-bg);
}

.deck-background::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.028;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.deck-dark .deck-background {
  background:
    linear-gradient(135deg, rgba(24, 30, 28, 0.96), rgba(20, 26, 24, 0.88) 48%, rgba(17, 20, 19, 0.98)),
    var(--deck-bg);
}

.deck-shell,
.operations-shell {
  width: min(1440px, calc(100vw - 48px));
  margin: 0 auto;
}

.deck-shell {
  min-height: 720px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--deck-radius);
  background: rgba(255, 255, 255, 0.32);
  box-shadow: var(--deck-shadow);
  backdrop-filter: blur(22px) saturate(1.08);
}

.deck-dark .deck-shell {
  border-color: rgba(255, 255, 255, 0.04);
  background: rgba(20, 24, 23, 0.64);
}

.deck-topbar {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  align-items: center;
  min-height: 48px;
  gap: 18px;
  padding: 0 24px;
  border-bottom: 1px solid var(--deck-line);
  background: rgba(246, 245, 240, 0.62);
  box-shadow: 0 1px 8px rgba(49, 63, 54, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
}

.deck-dark .deck-topbar {
  background: rgba(25, 30, 29, 0.62);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.deck-brand,
.deck-top-actions,
.deck-nav,
.autopilot-primary,
.autopilot-side,
.pipeline-head,
.deck-section-title,
.task-focus-head,
.mini-heading,
.queue-row,
.editor-title,
.form-actions,
.block-heading,
.section-heading {
  display: flex;
  align-items: center;
}

.deck-brand { gap: 12px; min-width: 248px; }
.deck-brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: #fff;
  background: linear-gradient(180deg, #556d62, #3a4d45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
  font-size: 10px;
  font-weight: 900;
}
.deck-brand strong,
.deck-brand span { display: block; }
.deck-brand strong { font-size: 15px; line-height: 1.05; }
.deck-brand span { margin-top: 2px; color: var(--deck-muted); font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; }

.deck-nav {
  justify-content: center;
  gap: 4px;
  min-width: 0;
}
.deck-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 7px;
  color: var(--deck-muted);
  padding: 0 10px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.deck-nav a.active,
.deck-nav a:hover { color: var(--deck-ink); background: rgba(255, 255, 255, 0.5); }
.deck-dark .deck-nav a.active,
.deck-dark .deck-nav a:hover { background: rgba(255, 255, 255, 0.04); }

.deck-top-actions { justify-content: flex-end; gap: 12px; min-width: 330px; }
.mono,
.deck-code { font-family: var(--mono); }
.mono { color: var(--deck-muted); font-size: 9px; }
.deck-code { margin: 0; color: var(--deck-muted); font-size: 8.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }

.deck-live-badge,
.deck-status-chip,
.state-badge,
.task-state,
.asset-tag,
.muted-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  border: 1px solid var(--deck-line);
  border-radius: 6px;
  padding: 2px 8px;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.2;
  background: rgba(255, 255, 255, 0.35);
  color: var(--deck-muted);
}
.deck-live-badge i,
.state-badge::before,
.task-state::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--deck-amber);
}
.deck-live-badge.good,
.deck-status-chip.good,
.state-badge.good,
.task-state.status-succeeded { border-color: rgba(118, 168, 138, 0.42); background: var(--deck-sage-soft); color: var(--deck-sage); }
.deck-live-badge.good i,
.state-badge.good::before,
.task-state.status-succeeded::before { background: var(--deck-sage); box-shadow: 0 0 8px rgba(120, 168, 138, 0.56); }
.deck-live-badge.warn,
.deck-status-chip.warn,
.state-badge.warn,
.task-state.status-awaiting_configuration,
.task-state.status-awaiting_worker,
.task-state.status-backend_unavailable { border-color: rgba(196, 153, 99, 0.45); background: var(--deck-amber-soft); color: var(--deck-amber); }
.deck-live-badge.bad,
.deck-status-chip.bad,
.state-badge.bad,
.task-state.status-failed,
.task-state.status-canceled { border-color: rgba(201, 127, 103, 0.45); background: var(--deck-alert-soft); color: var(--deck-alert); }
.task-state.status-queued,
.task-state.status-running,
.task-state.status-uploading,
.task-state.status-prompt_ready { border-color: rgba(146, 136, 185, 0.46); background: var(--deck-lavender-soft); color: var(--deck-lavender); }
.task-state.status-queued::before,
.task-state.status-running::before,
.task-state.status-uploading::before,
.task-state.status-prompt_ready::before { background: var(--deck-lavender); }

.icon-button,
.icon-text-button,
.queue-refresh,
.steward-action,
.dashboard-page button {
  border: 1px solid var(--deck-line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.4);
  color: var(--deck-ink);
  cursor: pointer;
  font-weight: 800;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.icon-button { width: 30px; height: 30px; padding: 0; }
.icon-text-button { min-height: 30px; padding: 0 10px; font-size: 11px; }
.dashboard-page button:hover { border-color: var(--deck-sage); background: rgba(255, 255, 255, 0.62); }
.dashboard-page button:disabled { opacity: 0.48; cursor: not-allowed; }
.deck-dark .dashboard-page button,
.deck-dark button,
.deck-dark .icon-button,
.deck-dark .icon-text-button { background: rgba(255, 255, 255, 0.04); }

.autopilot-bar {
  display: grid;
  grid-template-columns: minmax(390px, 1.35fr) minmax(260px, 0.85fr) minmax(230px, 0.75fr);
  min-height: 58px;
  border-bottom: 1px solid var(--deck-line);
  background: linear-gradient(90deg, rgba(231, 239, 233, 0.84), rgba(241, 243, 237, 0.8));
  box-shadow: 0 4px 16px rgba(55, 80, 65, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
}
.deck-dark .autopilot-bar { background: linear-gradient(90deg, rgba(27, 35, 32, 0.84), rgba(23, 30, 28, 0.82)); }
.autopilot-primary,
.autopilot-side,
.autopilot-return { position: relative; padding: 10px 24px; }
.autopilot-primary::after,
.autopilot-side::after {
  content: "";
  position: absolute;
  right: 0;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--deck-line-strong), transparent);
}
.autopilot-primary { gap: 15px; }
.autopilot-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(180deg, #698c79, #4f6e5c);
  box-shadow: 0 2px 8px rgba(85, 116, 101, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.38);
  font-weight: 900;
}
.autopilot-title-row { display: flex; align-items: baseline; gap: 12px; margin-top: 2px; }
.autopilot-title-row h1 { margin: 0; font-size: 20px; line-height: 1.15; letter-spacing: 0; }
.autopilot-title-row p { margin: 0; color: var(--deck-muted); font-size: 11.5px; line-height: 1.45; }
.autopilot-side { gap: 12px; }
.side-icon,
.steward-mark {
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--deck-sage-soft);
  color: var(--deck-sage);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 900;
}
.side-icon { width: 30px; height: 30px; }
.steward-mark { width: 28px; height: 24px; }
.autopilot-side strong,
.autopilot-side span,
.autopilot-return span,
.autopilot-return strong { display: block; }
.autopilot-side strong { font-size: 11.5px; }
.autopilot-side span,
.autopilot-return span { margin-top: 2px; color: var(--deck-muted); font-size: 9.5px; }
.autopilot-return { display: flex; flex-direction: column; justify-content: center; }
.autopilot-return strong { margin-top: 5px; font-size: 11.5px; }

.deck-pipeline { padding: 10px 24px 12px; }
.pipeline-head { justify-content: space-between; margin-bottom: 8px; }
.pipeline-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.pipeline-track::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, rgba(194, 211, 197, 0.9), rgba(146, 136, 185, 0.7), rgba(235, 220, 196, 0.8));
}
.pipeline-step {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 48px;
  border-radius: 9px;
  padding: 7px 8px;
}
.pipeline-step.active {
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 12px rgba(94, 84, 137, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  outline: 1px solid rgba(192, 184, 222, 0.58);
  backdrop-filter: blur(12px);
}
.deck-dark .pipeline-step.active { background: rgba(37, 34, 51, 0.9); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22); }
.step-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #e2ebe4;
  color: #638771;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 900;
}
.pipeline-step.active .step-icon { background: linear-gradient(180deg, #9990bd, #7f76a5); color: #fff; box-shadow: 0 2px 8px rgba(127, 118, 165, 0.48); }
.pipeline-step.wait .step-icon { background: #efe7d7; color: #9a7447; }
.pipeline-step strong,
.pipeline-step small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pipeline-step strong { font-size: 9.5px; }
.pipeline-step small { margin-top: 2px; color: var(--deck-muted); font-family: var(--mono); font-size: 8px; }

.deck-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 0;
  border-top: 1px solid var(--deck-line);
}
.task-focus-panel {
  position: relative;
  min-height: 302px;
  margin: 8px 0 8px 8px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  background: var(--deck-panel);
  box-shadow: 0 8px 24px rgba(42, 58, 49, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.78);
  padding: 18px 20px;
  overflow: hidden;
  backdrop-filter: blur(18px);
}
.deck-dark .task-focus-panel { border-color: rgba(255, 255, 255, 0.03); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); }
.panel-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.34), transparent 48%);
}
.task-focus-panel > *:not(.panel-glow) { position: relative; z-index: 1; }
.task-focus-head { align-items: flex-start; justify-content: space-between; gap: 16px; }
.task-focus-head h2 { margin: 5px 0 0; max-width: 760px; font-size: 26px; line-height: 1.18; letter-spacing: 0; }
.task-context-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  margin-top: 12px;
  border: 1px solid var(--deck-line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.38);
  padding: 0 10px;
  font-family: var(--mono);
  font-size: 9.5px;
}
.task-context-line span { color: var(--deck-muted); }
.task-context-line strong { color: var(--deck-sage); }

.decision-area { margin-top: 18px; }
.mini-heading { justify-content: space-between; margin-bottom: 10px; }
.mini-heading small { color: var(--deck-muted); font-size: 9px; }
.decision-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.decision-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  border: 1px solid var(--deck-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 1px 6px rgba(43, 57, 49, 0.04);
  padding: 0 12px;
}
.decision-chip b { color: var(--deck-lavender); font-size: 10px; }
.decision-chip strong { font-size: 10.5px; }

.task-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.45fr);
  gap: 26px;
  margin-top: 18px;
  padding-top: 17px;
  border-top: 1px solid var(--deck-line);
}
.prompt-excerpt { margin: 8px 0 0; color: rgba(39, 51, 46, 0.88); font-size: 10.5px; font-style: italic; font-weight: 700; line-height: 1.75; }
.deck-dark .prompt-excerpt { color: rgba(220, 224, 220, 0.78); }
.return-preview {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 58px;
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 9px;
  background: rgba(238, 241, 237, 0.64);
  box-shadow: inset 0 1px 5px rgba(120, 130, 120, 0.12);
  padding: 8px;
}
.preview-box {
  display: grid;
  place-items: center;
  height: 40px;
  border-radius: 6px;
  background: #e3e6e0;
  color: #86918a;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 900;
}
.return-preview strong,
.return-preview span { display: block; }
.return-preview a.preview-box { color: #86918a; text-decoration: none; }
.return-preview a.preview-box:hover { color: var(--deck-sage); }
.return-preview strong { font-size: 10.5px; }
.return-preview span { margin-top: 3px; color: var(--deck-muted); font-size: 9px; line-height: 1.35; }

.connection-panel {
  min-height: 302px;
  padding: 18px 16px;
  border-left: 1px solid var(--deck-line);
}
.deck-section-title { justify-content: space-between; padding-bottom: 8px; margin-bottom: 10px; border-bottom: 1px solid var(--deck-line); }
.deck-section-title h3 { margin: 0; font-size: 12.5px; }
.deck-section-title span { color: var(--deck-muted); font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.1em; }
.connection-matrix { display: grid; gap: 2px; }
.connection-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 0.8fr) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 31px;
  border-radius: 7px;
  padding: 5px 8px;
}
.connection-row.warn { border: 1px solid rgba(224, 195, 155, 0.38); background: rgba(245, 235, 209, 0.52); }
.connection-row span { font-size: 10.5px; font-weight: 800; }
.connection-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; }
.connection-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--deck-muted); font-family: var(--mono); font-size: 8.5px; }
.asset-heading { margin-top: 18px; }
.asset-grid { display: grid; gap: 12px; }
.compact-assets > div > span,
.asset-board > div > span { display: block; color: var(--deck-muted); font-size: 10px; font-weight: 800; margin-bottom: 7px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.asset-tag,
.muted-tag { min-height: 21px; max-width: 100%; overflow-wrap: anywhere; font-family: var(--mono); font-size: 8.5px; }
.asset-tag { background: rgba(233, 243, 234, 0.68); border-color: rgba(118, 168, 138, 0.28); color: var(--deck-sage); }
.muted-tag { color: var(--deck-muted); background: rgba(255, 255, 255, 0.24); }

.steward-panel {
  display: flex;
  flex-direction: column;
  min-height: 302px;
  margin: 8px;
  margin-left: 0;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(242, 244, 238, 0.84), rgba(233, 236, 229, 0.82));
  box-shadow: 0 8px 32px rgba(39, 57, 47, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  padding: 17px 18px;
  backdrop-filter: blur(18px);
}
.deck-dark .steward-panel { border-color: rgba(255,255,255,.03); background: linear-gradient(180deg, rgba(25, 34, 31, 0.82), rgba(20, 27, 25, 0.86)); box-shadow: 0 8px 32px rgba(0,0,0,.3); }
.steward-head { display: flex; align-items: center; justify-content: space-between; }
.steward-panel h2 { margin: 13px 0 0; font-size: 22px; line-height: 1.15; }
.steward-subtitle { margin: 5px 0 0; color: var(--deck-sage); font-size: 11px; font-weight: 800; }
.steward-copy { margin: 10px 0 12px; color: var(--deck-muted); font-size: 10.5px; line-height: 1.65; }
.steward-checks { display: grid; gap: 6px; flex: 1; min-height: 92px; }
.doctor-check {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border-radius: 9px;
  padding: 9px 10px;
  background: rgba(234, 241, 235, 0.72);
}
.deck-dark .doctor-check { background: rgba(32, 46, 38, 0.36); }
.doctor-check b,
.doctor-check p,
.doctor-check small { display: block; }
.doctor-check b { font-size: 10.8px; }
.doctor-check p { margin: 2px 0 0; color: var(--deck-muted); font-size: 9.5px; line-height: 1.35; }
.doctor-check small { margin-top: 3px; color: var(--deck-muted); font-size: 9px; line-height: 1.35; }
.doctor-check a { color: var(--deck-sage); font-weight: 900; text-decoration: none; }
.doctor-dot {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
}
.doctor-dot::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: var(--deck-amber); }
.doctor-good .doctor-dot::before { background: var(--deck-sage); }
.doctor-bad .doctor-dot::before { background: var(--deck-alert); }
.doctor-bad { background: rgba(248, 233, 223, 0.74); }
.doctor-warn { background: rgba(248, 239, 217, 0.72); }
.low-priority-alert {
  margin-top: 12px;
  border: 1px solid rgba(214, 196, 166, 0.62);
  border-radius: 9px;
  background: linear-gradient(90deg, rgba(250, 235, 209, 0.58), transparent);
  color: var(--deck-amber);
  padding: 10px;
  font-size: 10px;
  line-height: 1.5;
}
.steward-action { width: 100%; min-height: 36px; margin-top: 12px; text-align: left; padding: 0 12px; font-size: 11px; }

.queue-strip {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 12px 24px 18px;
  border-top: 1px solid var(--deck-line);
}
.queue-strip .deck-section-title { grid-column: 1 / -1; margin-bottom: 0; }
.queue-list { display: grid; gap: 6px; min-width: 0; }
.queue-row {
  min-height: 34px;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 6px 12px;
}
.queue-row.active { border-color: rgba(255,255,255,0.42); background: rgba(255,255,255,0.5); box-shadow: 0 3px 12px rgba(42, 58, 49, 0.05); }
.deck-dark .queue-row.active { border-color: rgba(255,255,255,.03); background: rgba(24, 31, 29, .5); }
.queue-row .queue-id { width: 76px; flex: 0 0 auto; font-family: var(--mono); font-size: 9.5px; font-weight: 900; }
.queue-row a.queue-id { color: var(--deck-ink); text-decoration: none; }
.queue-row a.queue-id:hover { color: var(--deck-sage); }
.queue-row .queue-name { min-width: 140px; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 800; }
.queue-row .queue-spacer { flex: 1; }
.queue-row .queue-time { color: var(--deck-muted); font-family: var(--mono); font-size: 9px; }
.queue-refresh { align-self: end; min-height: 34px; padding: 0 12px; font-size: 11px; }

.operations-shell {
  display: grid;
  gap: 16px;
  margin-bottom: 44px;
}
.workspace-section {
  border: 1px solid var(--deck-line);
  border-radius: 12px;
  background: var(--deck-panel-strong);
  box-shadow: 0 10px 28px rgba(42, 58, 49, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.62);
  overflow: hidden;
  backdrop-filter: blur(14px);
}
.section-heading { justify-content: space-between; gap: 16px; padding: 18px 20px 14px; border-bottom: 1px solid var(--deck-line); }
.section-heading h3 { margin: 0 0 4px; font-size: 16px; }
.section-heading p,
.section-heading > span { margin: 0; color: var(--deck-muted); font-size: 12px; }
.worker-layout,
.role-layout,
.settings-layout { display: grid; grid-template-columns: minmax(260px, 0.72fr) minmax(420px, 1.28fr); }
.settings-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.worker-list,
.role-list { border-right: 1px solid var(--deck-line); min-height: 260px; }
.worker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--deck-line);
}
.worker-row b,
.worker-row small { display: block; }
.worker-row b { font-size: 13px; overflow-wrap: anywhere; }
.worker-row small { margin-top: 4px; color: var(--deck-muted); font-size: 11px; }
.worker-row.offline { opacity: 0.62; }
.asset-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.asset-board > div { padding: 16px 18px; border-right: 1px solid var(--deck-line); }
.asset-board > div:last-child { border-right: 0; }

.role-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--deck-line);
  border-radius: 0;
  background: transparent;
  text-align: left;
  padding: 13px 18px;
}
.role-item:hover,
.role-item.active { background: rgba(231, 239, 233, 0.6); }
.role-item strong,
.role-item small { display: block; }
.role-item strong { font-size: 13px; }
.role-item small { margin-top: 4px; color: var(--deck-muted); overflow-wrap: anywhere; }
.role-ready { color: var(--deck-sage); font-size: 12px; }
.role-pending { color: var(--deck-amber); font-size: 12px; }
.role-editor,
.settings-block { padding: 18px 20px 20px; min-width: 0; }
.role-editor.is-empty { min-height: 250px; display: grid; place-items: center; color: var(--deck-muted); }
.role-editor.is-empty > * { display: none; }
.role-editor.is-empty::after { content: "等待 SillyTavern 角色请求"; font-size: 13px; }
.editor-title,
.form-actions,
.block-heading { justify-content: space-between; gap: 14px; }
.editor-title,
.block-heading { padding-bottom: 14px; margin-bottom: 15px; border-bottom: 1px solid var(--deck-line); }
.editor-title strong,
.editor-title small,
.block-heading strong,
.block-heading span { display: block; }
.editor-title small,
.block-heading span,
.role-memory,
.form-actions span,
.field-title small { margin-top: 4px; color: var(--deck-muted); font-size: 12px; }
.dashboard-page label { display: grid; gap: 7px; margin-bottom: 14px; font-size: 12.5px; font-weight: 800; }
.dashboard-page input,
.dashboard-page select,
.dashboard-page textarea {
  width: 100%;
  border: 1px solid var(--deck-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.46);
  color: var(--deck-ink);
  padding: 10px 11px;
  outline: none;
}
.deck-dark input,
.deck-dark select,
.deck-dark textarea { background: rgba(255, 255, 255, 0.04); }
.dashboard-page input:focus,
.dashboard-page select:focus,
.dashboard-page textarea:focus { border-color: var(--deck-sage); box-shadow: 0 0 0 3px rgba(93, 128, 108, 0.12); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.switch-field { display: flex !important; align-items: center; gap: 8px; margin: 0 !important; }
.switch-field input { width: 17px; height: 17px; }
.field-title { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 9px; font-size: 13px; font-weight: 800; }
.lora-editor { border-top: 1px solid var(--deck-line); padding-top: 15px; }
.lora-list { border: 1px solid var(--deck-line); border-radius: 9px; max-height: 240px; overflow: auto; }
.lora-row {
  display: grid;
  grid-template-columns: 18px minmax(160px, 1fr) 86px 86px;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border-bottom: 1px solid var(--deck-line);
}
.lora-row:last-child { border-bottom: 0; }
.lora-row input[type="checkbox"] { width: 16px; height: 16px; }
.lora-row input[type="number"] { padding: 7px; }
.lora-row span { overflow-wrap: anywhere; font-size: 12px; }
.dashboard-page button.primary { background: #5d806c; border-color: #5d806c; color: #fff; }
.dashboard-page button.primary:hover { background: #4b6c5a; }
.model-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.model-row button { margin-bottom: 14px; min-height: 41px; }
.settings-block + .settings-block { border-left: 1px solid var(--deck-line); }
.auto-submit { margin: 3px 0 16px !important; }
.cell-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.cell-links a { text-align: center; border: 1px solid var(--deck-line); border-radius: 8px; padding: 9px; color: var(--deck-sage); text-decoration: none; font-weight: 800; }

.dashboard-table-wrap { max-width: 100%; overflow-x: auto; }
.dashboard-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.dashboard-table th,
.dashboard-table td { padding: 11px 12px; border-bottom: 1px solid var(--deck-line); text-align: left; font-size: 12px; vertical-align: middle; overflow-wrap: anywhere; }
.dashboard-table th { color: var(--deck-muted); font-weight: 800; background: rgba(255, 255, 255, 0.28); }
.dashboard-table tr:last-child td { border-bottom: 0; }
.dashboard-table a { color: var(--deck-sage); font-weight: 900; text-decoration: none; }
.dashboard-table th:nth-child(1) { width: 8%; }
.dashboard-table th:nth-child(2) { width: 17%; }
.dashboard-table th:nth-child(3) { width: 14%; }
.dashboard-table th:nth-child(4) { width: 19%; }
.dashboard-table th:nth-child(5) { width: 12%; }
.dashboard-table th:nth-child(6) { width: 12%; }
.dashboard-table th:nth-child(7) { width: 18%; }
.dashboard-page .empty { margin: 0; padding: 14px 16px; color: var(--deck-muted); font-size: 12px; }

@media (max-width: 1180px) {
  .deck-topbar { grid-template-columns: 1fr; gap: 8px; padding: 12px 18px; }
  .deck-brand,
  .deck-top-actions { min-width: 0; justify-content: space-between; }
  .deck-nav { justify-content: flex-start; overflow-x: auto; }
  .autopilot-bar,
  .deck-stage { grid-template-columns: 1fr; }
  .autopilot-primary::after,
  .autopilot-side::after { display: none; }
  .autopilot-side,
  .autopilot-return { border-top: 1px solid var(--deck-line); }
  .connection-panel { border-left: 0; border-top: 1px solid var(--deck-line); }
  .steward-panel { margin-left: 8px; }
  .worker-layout,
  .role-layout,
  .settings-layout { grid-template-columns: 1fr; }
  .worker-list,
  .role-list { border-right: 0; border-bottom: 1px solid var(--deck-line); min-height: auto; }
  .settings-block + .settings-block { border-left: 0; border-top: 1px solid var(--deck-line); }
}

@media (max-width: 820px) {
  .deck-shell,
  .operations-shell { width: calc(100vw - 24px); margin: 12px auto; }
  .deck-top-actions { flex-wrap: wrap; }
  .pipeline-track { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipeline-track::before { display: none; }
  .task-focus-head,
  .autopilot-title-row,
  .section-heading,
  .form-actions,
  .field-title { align-items: flex-start; flex-direction: column; }
  .task-detail-grid,
  .field-grid { grid-template-columns: 1fr; }
  .connection-row { grid-template-columns: 1fr; gap: 2px; }
  .asset-board { grid-template-columns: 1fr; }
  .asset-board > div { border-right: 0; border-bottom: 1px solid var(--deck-line); }
  .asset-board > div:last-child { border-bottom: 0; }
  .queue-strip { grid-template-columns: 1fr; }
  .queue-row { align-items: flex-start; flex-direction: column; }
  .queue-row .queue-id,
  .queue-row .queue-name { width: auto; white-space: normal; }
  .dashboard-table { min-width: 820px; }
}

@media (max-width: 560px) {
  .deck-pipeline,
  .queue-strip { padding-left: 14px; padding-right: 14px; }
  .autopilot-primary,
  .autopilot-side,
  .autopilot-return { padding-left: 14px; padding-right: 14px; }
  .task-focus-panel,
  .steward-panel { margin: 6px; padding: 14px; }
  .task-focus-head h2 { font-size: 21px; }
  .pipeline-track { grid-template-columns: 1fr; }
  .lora-row { grid-template-columns: 18px minmax(120px, 1fr) 72px 72px; }
}
/* Codex single-screen menu override start */
html { height: 100%; overflow: hidden; }
body.dashboard-page {
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  padding: 24px 0;
}

.deck-shell {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 48px);
  min-height: 0;
  margin: 0 auto;
}
.deck-topbar { flex: 0 0 auto; z-index: 6; }
.deck-topbar,
.autopilot-bar,
.deck-pipeline,
.queue-strip { flex: 0 0 auto; }
.deck-stage {
  flex: 1 1 auto;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 290px 290px;
}
.task-focus-panel,
.connection-panel,
.steward-panel {
  min-height: 0;
}
.steward-checks {
  min-height: 0;
  overflow: hidden;
}

.deck-nav button,
.deck-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--deck-muted);
  padding: 0 10px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1;
}
.deck-nav button.active,
.deck-nav button:hover,
.deck-nav a.active,
.deck-nav a:hover {
  color: var(--deck-ink);
  background: rgba(255, 255, 255, 0.5);
}
.deck-dark .deck-nav button.active,
.deck-dark .deck-nav button:hover,
.deck-dark .deck-nav a.active,
.deck-dark .deck-nav a:hover { background: rgba(255, 255, 255, 0.04); }

body.view-worker .autopilot-bar,
body.view-worker .deck-pipeline,
body.view-worker .deck-stage,
body.view-worker .queue-strip,
body.view-roles .autopilot-bar,
body.view-roles .deck-pipeline,
body.view-roles .deck-stage,
body.view-roles .queue-strip,
body.view-tasks .autopilot-bar,
body.view-tasks .deck-pipeline,
body.view-tasks .deck-stage,
body.view-tasks .queue-strip,
body.view-connections .autopilot-bar,
body.view-connections .deck-pipeline,
body.view-connections .deck-stage,
body.view-connections .queue-strip { display: none; }

.operations-shell {
  position: fixed;
  z-index: 5;
  top: var(--deck-view-top, 73px);
  bottom: var(--deck-view-bottom, 24px);
  left: 50%;
  width: min(1440px, calc(100vw - 48px));
  margin: 0;
  transform: translateX(-50%);
  display: none;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
}
body.view-worker .operations-shell,
body.view-roles .operations-shell,
body.view-tasks .operations-shell,
body.view-connections .operations-shell { display: grid; }

.operations-shell > .workspace-section {
  display: none;
  height: 100%;
  min-height: 0;
  border-radius: 0 0 var(--deck-radius) var(--deck-radius);
  box-shadow: none;
}
body.view-worker .operations-shell > #worker-section,
body.view-roles .operations-shell > #roles-section,
body.view-tasks .operations-shell > .table-section,
body.view-connections .operations-shell > #connections-section {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.operations-shell .worker-layout,
.operations-shell .role-layout,
.operations-shell .settings-layout {
  height: 100%;
  min-height: 0;
}
.operations-shell .worker-list,
.operations-shell .role-list,
.operations-shell .role-editor,
.operations-shell .asset-board,
.operations-shell .settings-block,
.operations-shell .dashboard-table-wrap {
  min-height: 0;
  overflow: auto;
}
.operations-shell .asset-board { align-content: start; }
.operations-shell .lora-list { max-height: 180px; }
.operations-shell .dashboard-table-wrap { overflow: auto; }
.operations-shell .dashboard-table { min-width: 920px; }

@media (max-width: 1180px) {
  .deck-shell,
  .operations-shell { width: calc(100vw - 24px); }
  body.dashboard-page { padding: 12px 0; }
  .deck-shell { height: calc(100vh - 24px); margin: 0 auto; }
  .deck-stage { grid-template-columns: minmax(0, 1fr) 260px; }
  .connection-panel { display: none; }
  .operations-shell {
    top: var(--deck-view-top, 132px);
    bottom: var(--deck-view-bottom, 12px);
  }
}

@media (max-width: 820px) {
  .deck-shell { height: calc(100vh - 24px); }
  .deck-stage { grid-template-columns: 1fr; }
  .steward-panel { display: none; }
  .operations-shell .worker-layout,
  .operations-shell .role-layout,
  .operations-shell .settings-layout { grid-template-columns: 1fr; }
}
/* Codex single-screen menu override end */

/* Codex compact viewport override start */ @media (max-width: 820px){.deck-topbar{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"brand actions" "nav nav";min-height:0;gap:8px 10px;padding:10px 12px}.deck-brand{grid-area:brand}.deck-brand span{display:none}.deck-top-actions{grid-area:actions;min-width:0;gap:7px;flex-wrap:nowrap}#deck-workspace{display:none}.deck-live-badge{max-width:96px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.deck-nav{grid-area:nav;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;width:100%;overflow:hidden}.deck-nav button,.deck-nav a{justify-content:center;min-width:0;min-height:25px;padding:0 5px;overflow:hidden;text-overflow:ellipsis;font-size:10px}.autopilot-bar{grid-template-columns:1fr;min-height:0}.autopilot-primary{align-items:flex-start;min-height:70px;padding:10px 14px}.autopilot-side,.autopilot-return{display:none}.autopilot-title-row{display:block;margin-top:1px}.autopilot-title-row h1{font-size:17px}.autopilot-title-row p{display:-webkit-box;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical;margin-top:3px;font-size:10px}.deck-pipeline{padding:8px 12px}.pipeline-head{margin-bottom:6px}.pipeline-track{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}.pipeline-step{min-height:36px;grid-template-columns:20px minmax(0,1fr);gap:5px;padding:5px}.step-icon{width:20px;height:20px;font-size:7px}.pipeline-step strong{font-size:8.5px}.pipeline-step small{display:none}.deck-stage{min-height:0}.task-focus-panel{min-height:0;margin:6px;padding:12px}.task-focus-head h2{font-size:18px}.task-context-line{margin-top:8px;max-width:100%}.decision-area{margin-top:10px}.decision-chips{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.decision-chip{min-height:27px;border-radius:7px;padding:0 8px}.decision-chip strong,.decision-chip b{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.task-detail-grid,.queue-strip{display:none}} /* Codex compact viewport override end */
