* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

button, input, select { font: inherit; }
button {
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink);
  border-radius: 7px;
  padding: 9px 12px;
  cursor: pointer;
}
button.primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  font-weight: 700;
}
button.ghost { background: var(--panel-soft); }

/* ── top nav ── */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topnav-h);
  background: #101827;
  color: #eef5ff;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 16px;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.topnav .brand { display: flex; align-items: center; gap: 10px; margin-right: 12px; }
.topnav .brand strong { font-size: 14px; white-space: nowrap; }
.topnav .brand .badge {
  background: var(--brand);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}
.topnav .project-select {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 12px;
  margin-right: 16px;
  min-width: 170px;
}
.topnav nav { display: flex; align-items: center; gap: 2px; }
.topnav nav button {
  border: 0;
  background: transparent;
  color: #cdd9e9;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 12px;
  white-space: nowrap;
}
.topnav nav button:hover { background: rgba(255,255,255,0.08); }
.topnav nav button.is-active {
  background: #eaf7f3;
  color: #0f2e2b;
  font-weight: 800;
}
.topnav .topnav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.menu-alias-help {
  position: relative;
}
.menu-alias-help summary {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  color: #cdd9e9;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  list-style: none;
}
.menu-alias-help summary::-webkit-details-marker { display: none; }
.menu-alias-help summary:hover,
.menu-alias-help[open] summary {
  background: #eaf7f3;
  color: #0f2e2b;
}
.menu-alias-popover {
  position: absolute;
  top: 32px;
  right: 0;
  width: 260px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
}
.menu-alias-popover strong { display: block; margin-bottom: 6px; }
.menu-alias-popover p { margin: 3px 0; color: var(--muted); }
.topnav .role-badge {
  font-size: 11px;
  color: #9fb6d1;
  padding: 4px 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
}

/* ── app shell ── */
.app {
  display: grid;
  grid-template-columns: var(--chat-w) minmax(0, 1fr);
  margin-top: var(--topnav-h);
  height: calc(100vh - var(--topnav-h));
}

/* ── chat panel ── */
.chat-panel {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--panel);
  min-height: 0;
}
.chat-threads {
  border-bottom: 1px solid var(--line);
  max-height: 180px;
  overflow-y: auto;
}
.chat-threads h4 {
  margin: 0;
  padding: 10px 14px 6px;
  font-size: 11px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.chat-thread {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  transition: background 0.1s;
}
.chat-thread:hover { background: var(--panel-soft); }
.chat-thread.is-active { background: var(--brand-soft); border-left: 3px solid var(--brand); }
.chat-thread .thread-title { font-weight: 700; margin-bottom: 3px; }
.chat-thread .thread-meta { font-size: 11px; color: var(--muted-2); }

.chat-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
}
.chat-msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.55;
  animation: chatIn 0.2s ease-out;
}
@keyframes chatIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.chat-msg.user {
  align-self: flex-end;
  background: #eaf7f3;
  color: var(--ink);
  border-bottom-right-radius: 2px;
}
.chat-msg.ai {
  align-self: flex-start;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-bottom-left-radius: 2px;
}
.chat-msg.ai .ai-action-btn {
  display: inline-block;
  margin-top: 8px;
  margin-right: 6px;
  font-size: 12px;
  padding: 5px 10px;
}
.chat-msg.ai p { margin: 0 0 6px; }

.ai-guided-action-card {
  margin-top: 10px;
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  background: #f4fbf8;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}
.ai-guided-action-card strong { color: #0f4f47; }
.ai-guided-action-card p { color: var(--muted); font-size: 12px; }
.ai-guided-draft-badge,
.ai-guided-generated-result strong {
  display: inline-flex;
  width: fit-content;
  border: 1px solid #d79d28;
  border-radius: 999px;
  background: #fff7e2;
  color: #815600;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
}
.ai-guided-generated-result {
  margin-top: 8px;
  border: 1px dashed #d79d28;
  border-radius: var(--radius);
  background: #fffaf0;
  padding: 9px 10px;
}
.ai-guided-highlight {
  position: relative;
  z-index: 4;
  outline: 3px solid #ffb238 !important;
  box-shadow: 0 0 0 6px rgba(255,178,56,0.22), 0 10px 26px rgba(255,178,56,0.28) !important;
  animation: aiGuidedPulse 1.3s ease-in-out infinite;
}
.ai-guided-step-label {
  display: inline-flex;
  margin: 6px 0 0 6px;
  border-radius: 999px;
  background: #101827;
  color: #fff;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 800;
}
@keyframes aiGuidedPulse {
  0%, 100% { outline-color: #ffb238; }
  50% { outline-color: #13a38f; }
}

.chat-input-bar {
  border-top: 1px solid var(--line);
  padding: 12px;
}
.chat-input-bar textarea {
  width: 100%;
  min-height: 56px;
  resize: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 10px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
}
.chat-input-bar .input-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  justify-content: space-between;
  align-items: center;
}
.chat-input-bar .input-row .quick-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chat-input-bar .input-row .quick-chips button {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--muted);
}

/* ── content area ── */
.content {
  overflow-y: auto;
  min-width: 0;
}
.content-inner { padding: 20px; min-height: 100%; }

/* ── tab bar ── */
.tab-bar {
  display: flex;
  align-items: center;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  min-height: 40px;
  padding: 0 4px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 13px;
  border-right: 1px solid var(--line);
  cursor: pointer;
  white-space: nowrap;
  background: var(--panel-soft);
  color: var(--muted);
  transition: background 0.1s;
  user-select: none;
  flex-shrink: 0;
}
.tab:hover { background: #eef2f7; }
.tab.is-active {
  background: var(--bg);
  color: var(--ink);
  font-weight: 700;
  border-bottom: 2px solid var(--brand);
  margin-bottom: -1px;
}
.tab .tab-close {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1;
  color: var(--muted-2);
}
.tab .tab-close:hover {
  background: var(--red-soft);
  color: var(--red);
}

/* page panel overrides — within content area */
.page { display: none; animation: pageIn 0.18s ease-out; }
.page.is-active { display: block; }
@keyframes pageIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.titleblock h1 { margin: 0; font-size: 26px; line-height: 1.2; }
.titleblock p { margin: 8px 0 0; color: var(--muted); max-width: 860px; line-height: 1.7; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.grid { display: grid; gap: 14px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  min-width: 0;
}
.panel.flat { box-shadow: none; background: var(--panel-soft); }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 13px;
}
.panel-head h2, .panel-head h3 { margin: 0; font-size: 17px; }
.panel-head p { margin: 5px 0 0; color: var(--muted); line-height: 1.6; font-size: 13px; }

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px;
  min-height: 112px;
}
.metric .label { color: var(--muted); font-size: 13px; font-weight: 700; }
.metric .value { display: block; margin-top: 10px; font-size: 28px; font-weight: 850; }
.metric .hint { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.metric[data-workbench-filter] { cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.metric[data-workbench-filter]:hover,
.metric[data-workbench-filter]:focus-visible,
.metric[data-workbench-filter].is-selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
  outline: none;
}
.metric[data-workbench-filter]:active { transform: translateY(1px); }
.trend-up { color: var(--green); }
.trend-down { color: var(--red); }
.trend-wait { color: var(--amber); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; min-width: 860px; border-collapse: collapse; background: var(--panel); }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 13px; }
th { background: var(--panel-soft); color: var(--muted); font-size: 12px; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }

.tag, .status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.tag { background: var(--panel-soft); color: var(--muted); border: 1px solid var(--line); }
.status.good { background: var(--green-soft); color: var(--green); }
.status.warn { background: var(--amber-soft); color: var(--amber); }
.status.bad { background: var(--red-soft); color: var(--red); }
.status.info { background: var(--blue-soft); color: var(--blue); }
.status.purple { background: var(--purple-soft); color: var(--purple); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.toolbar input, .toolbar select {
  min-width: 150px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
}

.split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr); gap: 14px; }
.worklist { display: grid; gap: 10px; }
.worklist-scroll {
  max-height: 430px;
  overflow-y: auto;
  padding-right: 4px;
}
.workbench-filter-note {
  margin-bottom: 10px;
  border: 1px solid var(--blue-soft);
  border-radius: 7px;
  background: var(--panel-soft);
  color: var(--blue);
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 700;
}
.task {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--panel);
  display: grid;
  gap: 8px;
}
.task-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 800; }
.task p { margin: 0; color: var(--muted); line-height: 1.55; font-size: 13px; }
.task-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.task-actions button { padding: 7px 9px; font-size: 12px; }
.evidence-record--simulated { border-color: var(--blue); }

.prototype-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2000;
  max-width: min(360px, calc(100vw - 32px));
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .18s ease, transform .18s ease;
}
.prototype-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.matrix {
  display: grid;
  grid-template-columns: 180px repeat(5, minmax(105px, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
  background: var(--panel);
}
.matrix div {
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-height: 56px;
  font-size: 13px;
}
.matrix div:nth-child(6n) { border-right: 0; }
.matrix .head { background: var(--panel-soft); color: var(--muted); font-weight: 800; min-height: auto; }

.score {
  display: inline-flex;
  width: 30px; height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-weight: 900;
  margin-right: 7px;
}
.score.s0 { background: var(--red-soft); color: var(--red); }
.score.s1 { background: var(--amber-soft); color: var(--amber); }
.score.s2 { background: var(--blue-soft); color: var(--blue); }
.score.s3, .score.s4 { background: var(--green-soft); color: var(--green); }

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(230px, 1fr));
  gap: 12px;
  overflow-x: auto;
}
.lane {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 310px;
}
.lane h3 { margin: 0 0 10px; font-size: 14px; color: var(--muted); }

.timeline { display: grid; gap: 10px; }
.event { display: grid; grid-template-columns: 86px 1fr; gap: 12px; align-items: start; }
.event time { color: var(--muted); font-size: 12px; font-weight: 800; }
.event div:last-child { border-left: 2px solid var(--line-strong); padding-left: 12px; line-height: 1.55; color: var(--muted); }

.flow { display: flex; gap: 0; margin-bottom: 14px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.flow-step {
  flex: 0 0 118px;
  padding: 12px 10px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  border-right: 1px solid var(--line);
  position: relative;
  line-height: 1.45;
}
.flow-step:last-child { border-right: 0; }
.flow-step .step-num {
  display: inline-flex;
  width: 20px; height: 20px;
  border-radius: 99px;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  background: var(--brand-soft);
  color: var(--brand);
  margin-bottom: 6px;
}
.flow-step strong { display: block; color: var(--ink); margin-bottom: 4px; font-size: 12px; }
.flow-loop {
  flex: 0 0 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--brand);
  font-weight: 800;
  writing-mode: vertical-rl;
  background: var(--brand-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  letter-spacing: 2px;
}

.insight-list { display: grid; gap: 10px; }
.insight {
  border-left: 4px solid var(--brand);
  background: var(--panel-soft);
  padding: 12px;
  border-radius: 0 var(--radius) var(--radius) 0;
  line-height: 1.55;
}
.insight strong { display: block; margin-bottom: 5px; }
.insight p { margin: 0; color: var(--muted); font-size: 13px; }

.empty-note {
  background: #fffdf5;
  border: 1px solid #f6df9f;
  border-radius: var(--radius);
  color: #7c5a08;
  padding: 12px;
  line-height: 1.6;
  font-size: 13px;
}

/* ── diagnosis step wizard ── */
.diag-progress { display: flex; gap: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; }
.diag-progress-step { flex: 1; padding: 14px 10px; text-align: center; font-size: 12px; color: var(--muted-2); border-right: 1px solid var(--line); position: relative; }
.diag-progress-step:last-child { border-right: 0; }
.diag-progress-step .step-num {
  display: inline-flex; width: 22px; height: 22px; border-radius: 99px;
  align-items: center; justify-content: center; font-weight: 800; font-size: 11px;
  background: var(--panel-soft); color: var(--muted-2); margin-bottom: 6px;
}
.diag-progress-step.is-done .step-num { background: var(--green); color: #fff; }
.diag-progress-step.is-current .step-num { background: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--brand-soft); }
.diag-progress-step.is-pending .step-num { background: var(--panel-soft); color: var(--muted-2); }
.diag-progress-step .step-label { display: block; font-weight: 700; color: var(--ink); }
.diag-progress-step .step-status { display: block; margin-top: 3px; font-size: 11px; }

.diag-step { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 14px; overflow: hidden; }
.diag-step-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; }
.diag-step.is-current .diag-step-header { background: var(--brand-soft); border-left: 4px solid var(--brand); }
.diag-step.is-done .diag-step-header { background: var(--green-soft); border-left: 4px solid var(--green); }
.diag-step.is-pending .diag-step-header { border-left: 4px solid var(--line-strong); }
.diag-step-header h3 { margin: 0; font-size: 15px; }
.diag-step-header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.diag-step-body { border-top: 1px solid var(--line); padding: 16px; }

.diag-ai-box { background: #f0f7f6; border: 1px solid #c1e3de; border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.diag-ai-box .ai-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 800; color: var(--brand); text-transform: uppercase; margin-bottom: 10px;
}
.diag-ai-box .ai-label::before {
  content: "AI"; display: inline-grid; place-items: center;
  width: 20px; height: 20px; border-radius: 5px;
  background: var(--brand); color: #fff; font-size: 9px; font-weight: 900;
}
.diag-ai-box p { margin: 0 0 8px; line-height: 1.6; font-size: 13px; }
.diag-ai-box ul { margin: 6px 0; padding-left: 18px; font-size: 13px; line-height: 1.7; }
.diag-ai-box .diag-metric { display: inline-block; background: #fff; border: 1px solid var(--line); border-radius: 7px; padding: 8px 12px; margin: 4px 4px 4px 0; min-width: 100px; }
.diag-ai-box .diag-metric strong { display: block; font-size: 18px; color: var(--ink); }
.diag-ai-box .diag-metric span { font-size: 11px; color: var(--muted); }
.diag-empty { color: var(--muted-2); font-style: italic; padding: 20px 0; text-align: center; }

/* ── responsive ── */
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .chat-panel { display: none; }
  .chat-panel.is-open { display: flex; position: fixed; left: 0; top: var(--topnav-h); width: 100%; height: calc(100vh - var(--topnav-h)); z-index: 50; }
  .topnav nav button { font-size: 11px; padding: 5px 7px; }
}
@media (max-width: 760px) {
  .topnav { padding: 0 8px; overflow-x: auto; }
  .topnav nav { gap: 0; }
  .topnav nav button { font-size: 10px; padding: 4px 6px; }
  .project-select { min-width: 120px; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; }
  .matrix { grid-template-columns: 150px repeat(5, 96px); }
  .chat-panel.is-open .chat-threads { max-height: 120px; }
  .flow-step { flex: 0 0 96px; font-size: 10px; }
  .flow-step strong { font-size: 11px; }
}

/* ── AI Guide Banner ── */
.ai-guide-banner {
  position: fixed; top: var(--topnav-h); left: 0; right: 0; z-index: 100;
  background: linear-gradient(135deg, var(--brand) 0%, #6C5CE7 100%);
  color: #fff; padding: 10px 20px 14px;
  transition: transform 0.3s var(--ease-out-expo, ease-out), opacity 0.3s;
  box-shadow: 0 4px 20px rgba(108,92,231,0.25);
}
.ai-guide-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ai-guide-badge { background: rgba(255,255,255,0.2); padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.ai-guide-progress { font-size: 11px; opacity: 0.85; }
.ai-guide-close { margin-left: auto; background: none; border: none; color: rgba(255,255,255,0.7); cursor: pointer; font-size: 16px; padding: 0 4px; }
.ai-guide-close:hover { color: #fff; }
.ai-guide-body { margin-bottom: 10px; }
.ai-guide-hint { margin: 0; font-size: 13px; line-height: 1.7; opacity: 0.95; }
.ai-guide-actions { display: flex; gap: 8px; }
.ai-guide-actions button { padding: 6px 14px; font-size: 12px; border-radius: var(--radius); border: none; cursor: pointer; }
.ai-guide-actions button.ghost { background: rgba(255,255,255,0.15); color: #fff; }
.ai-guide-actions button.primary { background: #fff; color: var(--brand); font-weight: 600; }
.ai-guide-actions button.ghost:hover { background: rgba(255,255,255,0.25); }
.ai-guide-actions button.primary:hover { background: #f0edff; }

/* ── AI Deploy Demo ── */
.deploy-flow { display: flex; gap: 6px; flex-wrap: wrap; }
.deploy-step {
  flex: 1; min-width: 100px; padding: 10px 12px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line); text-align: center; font-size: 11px;
}
.deploy-step span { display: inline-block; width: 22px; height: 22px; line-height: 22px; border-radius: 50%; background: var(--muted-2); color: #fff; font-size: 11px; font-weight: 600; margin-bottom: 4px; }
.deploy-step strong { display: block; font-size: 11px; margin: 2px 0; }
.deploy-step.done { border-color: var(--green); background: #E8F5E9; }
.deploy-step.done span { background: var(--green); }
.deploy-step.active { border-color: var(--brand); background: #EDE7F6; box-shadow: 0 0 0 2px rgba(108,92,231,0.15); }
.deploy-step.active span { background: var(--brand); }

/* ── AI notification dot ── */
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: 0.6; } }
.ai-notify-dot { animation: pulse 1.5s infinite; }

/* ── AI Guide Toast Bar ── */
@keyframes toastSlideIn { from { transform: translateY(-120%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes toastPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(108,92,231,0.4); } 50% { box-shadow: 0 0 0 8px rgba(108,92,231,0); } }
.ai-guide-toast {
  position: fixed; top: calc(var(--topnav-h) + 8px); left: 50%; transform: translateX(-50%);
  z-index: 200; background: linear-gradient(135deg, #6C5CE7 0%, #a29bfe 100%);
  color: #fff; padding: 10px 18px; border-radius: 24px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  display: flex; align-items: center; gap: 10px;
  animation: toastSlideIn 0.35s var(--ease-out-expo, ease-out), toastPulse 2s infinite;
  box-shadow: 0 4px 24px rgba(108,92,231,0.35);
  cursor: pointer; user-select: none;
}
.ai-guide-toast .toast-arrow { font-size: 14px; }
.ai-guide-toast:hover { background: linear-gradient(135deg, #5a4bd1 0%, #8c7ae6 100%); }
@media (max-width: 760px) {
  .ai-guide-toast { font-size: 11px; padding: 8px 14px; gap: 6px; left: 8px; right: 8px; transform: none; border-radius: 16px; white-space: normal; }
}

/* ── AI Assist Button Highlight ── */
@keyframes rainbowBorder {
  0% { border-color: #FF6B35; box-shadow: 0 0 8px rgba(255,107,53,0.4); }
  25% { border-color: #FFD700; box-shadow: 0 0 12px rgba(255,215,0,0.5); }
  50% { border-color: #00D2FF; box-shadow: 0 0 8px rgba(0,210,255,0.4); }
  75% { border-color: #FF6B6B; box-shadow: 0 0 12px rgba(255,107,107,0.5); }
  100% { border-color: #FF6B35; box-shadow: 0 0 8px rgba(255,107,53,0.4); }
}
@keyframes badgePopIn { from { transform: scale(0); } to { transform: scale(1); } }
.ai-btn-highlight {
  position: relative; z-index: 10;
  border: 3px solid #FF6B35 !important;
  animation: rainbowBorder 2s infinite !important;
  border-radius: var(--radius) !important;
}
.ai-btn-badge {
  position: absolute; top: -12px; right: -12px; z-index: 11;
  background: #FF6B35; color: #fff; font-size: 12px;
  padding: 2px 8px; border-radius: 10px;
  animation: badgePopIn 0.3s var(--ease-out-expo, ease-out);
  white-space: nowrap; pointer-events: none;
}

/* ── Phase 2: Agent suggestion cards ── */
.agent-suggestions { display: grid; gap: 8px; }
.agent-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 11px 13px;
  display: grid;
  gap: 6px;
}
.agent-card .agent-card-head {
  display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px;
}
.agent-card .agent-card-head .ai-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--brand);
}
.agent-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.agent-card .agent-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.agent-card .agent-card-actions button { font-size: 11px; padding: 4px 10px; }

/* ── Phase 2: delegation panel ── */
.delegate-panel { display: grid; gap: 8px; }
.delegate-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); font-size: 13px;
}
.delegate-row .delegate-label { font-weight: 600; }
.delegate-row .delegate-hint { color: var(--muted); font-size: 11px; }
.delegate-row button { font-size: 11px; padding: 5px 12px; white-space: nowrap; }

/* ── Phase 2: report list ── */
.report-list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.report-list-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer;
  font-size: 13px; transition: background 0.1s;
}
.report-list-item:last-child { border-bottom: 0; }
.report-list-item:hover { background: var(--panel-soft); }
.report-list-item.is-active { background: var(--brand-soft); border-left: 3px solid var(--brand); }
.report-list-item .report-item-title { font-weight: 700; }
.report-list-item .report-item-meta { font-size: 11px; color: var(--muted); display: flex; gap: 10px; }

/* ── Phase 2: report preview ── */
.report-preview-pane { display: none; }
.report-preview-pane.is-active { display: block; }
.report-section { margin-bottom: 14px; }
.report-section h3 { font-size: 15px; margin: 0 0 6px; }
.report-section p { margin: 0 0 4px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.report-section .before-after { display: flex; gap: 16px; }
.report-section .before-after .ba-item {
  flex: 1; padding: 8px 12px; border-radius: var(--radius); font-size: 12px;
}
.report-section .before-after .ba-before { background: var(--red-soft); color: var(--red); }
.report-section .before-after .ba-after { background: var(--green-soft); color: var(--green); }
.report-preview-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ── Phase 2: client cockpit modules ── */
.client-module { margin-bottom: 14px; }
.client-module h3 { font-size: 15px; margin: 0 0 8px; display: flex; align-items: center; gap: 6px; }
.client-module .client-module-body { font-size: 13px; line-height: 1.7; color: var(--muted); }
.client-module .client-module-body strong { color: var(--ink); }

/* ── Phase 2: cross-page action bar ── */
.page-action-bar {
  margin-top: 14px; padding: 12px 16px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); display: flex; align-items: center;
  justify-content: space-between; gap: 12px;
}
.page-action-bar .action-bar-label { font-size: 12px; color: var(--muted); }
.page-action-bar button { font-size: 12px; padding: 7px 14px; }

/* ── Phase 2: feedback link card ── */
.feedback-card {
  margin-top: 14px; padding: 10px 14px;
  background: var(--green-soft); border: 1px solid var(--green);
  border-radius: var(--radius); font-size: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.feedback-card .feedback-label { font-weight: 600; color: var(--green); }
.feedback-card button { font-size: 11px; }

/* M9B: GA-backed agent response card */
.ga-agent-card {
  border: 1px solid #b8d8d3;
  background: #f7fbfa;
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 8px;
}
.ga-agent-card-head,
.ga-agent-meta,
.ga-agent-ref-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.ga-agent-card-head { justify-content: space-between; }
.ga-agent-card-head span,
.ga-agent-meta span {
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
  background: #fff;
  color: var(--muted);
}
.ga-agent-ref-group {
  min-width: 180px;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}
.ga-agent-ref-group ul,
.ga-agent-human-gate ul {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  display: grid;
  gap: 5px;
}
.ga-agent-ref-group li,
.ga-agent-human-gate li {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
}
.ga-agent-ref-group code,
.ga-agent-human-gate code,
.ga-agent-blocked code {
  font-size: 11px;
  background: #eef4f2;
  border-radius: 5px;
  padding: 2px 5px;
}
.ga-agent-human-gate,
.ga-agent-blocked {
  border-left: 3px solid #0f766e;
  background: #fff;
  border-radius: 6px;
  padding: 8px;
}
.ga-agent-blocked { border-left-color: #b45309; }
.ga-agent-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ga-agent-safety-note { margin: 0; font-size: 12px; color: var(--muted); }

