:root {
  --bg: #0b0d12;
  --panel: #151922;
  --panel-2: #1c2130;
  --border: #262c39;
  --fg: #e7ebf2;
  --muted: #8a94a6;
  --accent: #4ea1ff;
  --critical: #ff4d4f;
  --warn: #ffa940;
  --info: #4ea1ff;
  --road: #2a3042;
  --road-line: #3a4156;
}
* { box-sizing: border-box; }
html, body { margin:0; padding:0; height:100%; }
body {
  background: var(--bg); color: var(--fg);
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  display: grid;
  grid-template-rows: 52px 1fr 200px;
  height: 100vh;
  overflow: hidden;
}

/* ======== top bar ========= */
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #1a1f2c 0%, var(--panel) 100%);
}
.brand {
  font-weight: 600; font-size: 16px; color: var(--accent);
  letter-spacing: 0.5px;
}
.seg-picker { display:flex; align-items:center; gap:8px; }
.seg-picker label { color: var(--muted); font-size: 12px; }
.seg-picker select {
  background:#0d0f14; color:var(--fg);
  border:1px solid var(--border); border-radius:4px;
  padding:4px 8px; min-width: 240px;
}
.muted { color: var(--muted); font-size: 12px; }

.status {
  margin-left: auto;
  display:flex; align-items:center; gap:18px;
  font-variant-numeric: tabular-nums;
}
.stat { display:flex; align-items:center; gap:6px; }
.stat-k { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.stat-v { font-weight: 600; font-size: 14px; }
#clock, #duration { font-size: 15px; }

/* ======== main ========= */
main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px 380px;
  gap: 8px;
  padding: 8px;
  min-height: 0;
}
/* Camera area: responsive grid of up to N camera cells.
   Each cell has a fixed minimum height; when total content height exceeds
   the viewport the video-area scrolls vertically while player/queue stay
   pinned. */
.video-area {
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;                       /* room for scrollbar */
  display: flex;
  flex-direction: column;
}
/* 2 路：整列不滚动，网格撑满剩余高度，前后两路一屏看完 */
.video-area:has(.grid.mode-fast2) {
  overflow-y: hidden;
}
.video-area .grid.mode-fast2 {
  flex: 1 1 auto;
}
.video-area::-webkit-scrollbar { width: 8px; }
.video-area::-webkit-scrollbar-thumb {
  background: #262c39; border-radius: 4px;
}
.video-area::-webkit-scrollbar-thumb:hover { background: #35415b; }

/* 第一列画面路数切换条 */
.cam-mode-switch {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  flex: 0 0 auto;
}
.cam-mode-btn {
  border: 1px solid #273247;
  background: #0d131d;
  color: var(--muted);
  border-radius: 5px;
  padding: 5px 16px;
  font-size: 13px;
  cursor: pointer;
}
.cam-mode-btn.active {
  background: #1b2638;
  color: #e4eaf4;
  border-color: #35557f;
  font-weight: 700;
}

.sr-scene-panel {
  flex: 0 0 auto;
  margin-bottom: 10px;
  padding: 10px 12px 8px;
  border: 1px solid #1e536d;
  border-radius: 8px;
  background: linear-gradient(145deg, #071522 0%, #0b111c 60%, #10182a 100%);
  box-shadow: inset 0 1px 0 rgba(140,220,255,.08), 0 8px 24px rgba(0,0,0,.18);
}
.sr-scene-head {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  margin-bottom:6px;
}
.sr-scene-title { color:#dff8ff; font-size:14px; font-weight:700; letter-spacing:.3px; }
.sr-scene-subtitle { color:#6c9bb0; font-size:11px; margin-left:8px; }
.sr-scene-meta { display:flex; align-items:center; gap:8px; font-size:11px; font-variant-numeric:tabular-nums; }
.sr-scene-count { color:#83aabd; }
.sr-scene-status { padding:2px 7px; border:1px solid #245b70; border-radius:10px; color:#65d8ff; background:rgba(46,174,218,.1); }
.sr-scene-status[data-mode="hold"] { color:#ffd166; border-color:#785b2e; background:rgba(255,209,102,.1); }
.sr-scene-status[data-mode="gap"], .sr-scene-status[data-mode="waiting"] { color:#9aa7b7; border-color:#354050; background:rgba(130,145,165,.1); }
.sr-scene-viewport { position:relative; height:clamp(165px, 18vw, 215px); overflow:hidden; border-radius:5px; background:#06111e; }
.sr-scene-canvas { position:absolute; left:0; top:0; transform:translateY(-50%); display:block; width:100%; height:clamp(330px, 36vw, 430px); border-radius:5px; background:#06111e; }
.sr-scene-legend { display:flex; flex-wrap:wrap; gap:10px 12px; margin-top:6px; color:#7895a4; font-size:10px; }
.sr-scene-legend span { display:inline-flex; align-items:center; gap:4px; }
.sr-legend-dot { display:inline-block; width:7px; height:7px; border-radius:50%; box-shadow:0 0 7px currentColor; }
.sr-legend-dot.ego { color:#4ea1ff; background:#4ea1ff; }
.sr-legend-dot.vehicle { color:#52d6ff; background:#52d6ff; }
.sr-legend-dot.person { color:#ffd166; background:#ffd166; }
.sr-legend-dot.obstacle { color:#b995ff; background:#b995ff; }
.sr-legend-dot.cipv { color:#ff9f43; background:#ff9f43; }

.grid {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 10px;
  align-content: start;
}
.cell {
  background:#000;
  border-radius:6px;
  overflow:hidden; position:relative;
  border: 1px solid var(--border);
  aspect-ratio: 16 / 10;                    /* matches 1280x1024 / 1920x1080 fairly well */
  min-height: 300px;
  transition: box-shadow .2s, border-color .2s;
}
.cell video { width:100%; height:100%; object-fit:contain; display:block; background:#000; }

/* 2 路：前后两路一屏看完，不滚动。各占可视高度一半，宽度撑满。 */
.grid.mode-fast2 {
  grid-template-columns: 1fr;
  grid-auto-rows: 1fr;
  height: 100%;
}
.grid.mode-fast2 .cell {
  aspect-ratio: auto;
  min-height: 0;
}
/* 宽屏时前后两路并排，更接近"一屏看完"且每路更大 */
@media (min-width: 1100px) {
  .grid.mode-fast2 {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: minmax(0, 1fr);
  }
}
/* 5 路：3 列网格 */
.grid.mode-full6 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.grid.mode-full6 .cell { min-height: 220px; }
/* 11 路：紧凑多列网格 */
.grid.mode-full11 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.grid.mode-full11 .cell { min-height: 160px; aspect-ratio: 16 / 9; }

/* camera label: "#3 · 前左广角 …" */
.cam-label {
  position:absolute; left:8px; top:8px;
  padding:3px 10px; background:rgba(0,0,0,.65);
  color:#e7ebf2; font-size:12px; border-radius:4px;
  pointer-events:none;
  display:flex; align-items:center; gap:6px;
  font-variant-numeric: tabular-nums;
}
.cam-label .cam-no {
  background: var(--accent);
  color:#fff;
  padding: 0 6px;
  border-radius: 3px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .4px;
}

/* When a consumed alert "spotlights" certain cameras, their cells flash. */
.cell.hot {
  border-color: var(--warn);
  box-shadow: 0 0 0 2px rgba(255,169,64,.55), 0 0 18px rgba(255,169,64,.35);
}
.cell.hot.sev-critical {
  border-color: var(--critical);
  box-shadow: 0 0 0 2px rgba(255,77,79,.6), 0 0 20px rgba(255,77,79,.45);
}
.cell.hot.sev-info {
  border-color: var(--info);
  box-shadow: 0 0 0 2px rgba(78,161,255,.55), 0 0 18px rgba(78,161,255,.35);
}
.cell.hot .cam-label .cam-no { background: var(--warn); color:#111; }
.cell.hot.sev-critical .cam-label .cam-no { background: var(--critical); color:#fff; }
.cell.hot.sev-info     .cam-label .cam-no { background: var(--info);     color:#fff; }

/* ======== queue (right) ========= */
.queue-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  display:flex; flex-direction:column;
  min-height: 0;
}
.vision-sampling-select { display:flex; align-items:center; gap:6px; margin:8px 12px; font-size:12px; color:var(--muted); }
.vision-sampling-select select { flex:1; min-width:0; background:var(--panel-2); color:var(--text); border:1px solid var(--border); border-radius:4px; padding:5px 6px; }

/* ── 第三列：运行日志面板 ── */
.log-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}
.log-head {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
  background: var(--panel-2);
}
.log-title {
  font-weight: 600; font-size: 13px; letter-spacing: .4px;
}
.log-count {
  font-size: 11px; color: var(--muted);
  background: #262a33; padding: 1px 7px; border-radius: 10px;
  margin-right: auto;
}
.log-copy, .log-ghost {
  font-size: 12px; padding: 3px 9px; border-radius: 4px; cursor: pointer;
}
.log-copy {
  background: #26344a; color: #d9e9ff; border: 1px solid #35557f;
}
.log-copy:hover { background: #30415d; }
.log-copy.copied { background: #1f4d34; border-color: #2f7d52; color: #c8f5d8; }
.log-ghost {
  background: transparent; color: var(--muted); border: 1px solid var(--border);
}
.log-ghost:hover { color: #d9e9ff; border-color: #35557f; }
.log-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  padding: 8px;
  display: flex; flex-direction: column; gap: 4px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.log-scroll::-webkit-scrollbar { width: 8px; }
.log-scroll::-webkit-scrollbar-thumb { background: #262c39; border-radius: 4px; }
.log-empty { color: var(--muted); padding: 16px 8px; text-align: center; font-size: 12px; }
.log-row {
  padding: 4px 7px;
  border-radius: 4px;
  background: #141a24;
  color: #cfd6e3;
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  border-left: 2px solid transparent;
}
.log-row .log-ts { color: #6b7689; margin-right: 6px; }
.log-row.cat-speak   { border-left-color: #3aa0ff; }   /* 播报决策 */
.log-row.cat-display { border-left-color: #c08bff; }   /* 展示判定 */
.log-row.cat-net     { border-left-color: #4ad6a0; }   /* 请求链路 */
.log-row.cat-warn    { border-left-color: #ffb84d; background:#241d12; }
.log-row.cat-error   { border-left-color: #ff6b6b; background:#2a1518; color:#ffd5d5; }
.log-row.cat-probe   { border-left-color: #888; color:#aeb6c4; }
/* 详情块:完整注入 prompt / AI 回复全文。点击行折叠/展开,带"展开"提示。 */
.log-row.has-detail { cursor: pointer; }
.log-row.has-detail > .log-detail {
  margin-top: 5px;
  padding: 6px 8px;
  background: #0d1119;
  border: 1px solid #232a38;
  border-radius: 4px;
  color: #9fb0c8;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow: auto;
}
.log-row.has-detail.collapsed > .log-detail { display: none; }
.log-row.has-detail::after {
  content: "▼ 详情(点击折叠)";
  display: inline-block;
  margin-left: 8px;
  font-size: 10px;
  color: #5a677d;
}
.log-row.has-detail.collapsed::after { content: "▶ 展开完整 prompt"; }
.log-autoscroll-hint {
  position: absolute;
  left: 50%; bottom: 12px; transform: translateX(-50%);
  background: #26344a; color: #d9e9ff;
  border: 1px solid #35557f; border-radius: 14px;
  padding: 4px 12px; font-size: 11px; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
}
.log-autoscroll-hint:hover { background: #30415d; }
.queue-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  display:flex; align-items:center; gap:10px;
  background: var(--panel-2);
}
.queue-title {
  margin-right:auto;
  font-weight: 600; font-size: 13px;
  letter-spacing: .4px;
}
.tts-test {
  background:#26344a;
  color:#d9e9ff;
  border:1px solid #35557f;
  border-radius:4px;
  padding:3px 8px;
  font-size:12px;
  cursor:pointer;
}
.tts-test:hover { background:#30415d; }
.auto-scroll { font-size: 12px; color: var(--muted); cursor:pointer; user-select:none; }
.queue-counts {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  display:flex; flex-wrap:wrap; gap:6px;
  font-size: 11px;
}
.queue-counts span {
  background:#262a33; padding:2px 6px; border-radius:3px;
}
.live-ai-panel {
  margin: 8px;
  padding: 10px;
  border: 1px solid #30415d;
  border-radius: 6px;
  background: #101621;
}
.live-ai-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.live-ai-title {
  font-weight: 700;
  font-size: 13px;
}
.live-ai-status {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 10px;
  background: #242a36;
  color: var(--muted);
  font-size: 11px;
}
.live-ai-status.ready {
  background: rgba(78,161,255,.18);
  color: #9fcbff;
}
.live-ai-status.talking {
  background: rgba(77,214,124,.16);
  color: #9be8b6;
}
.live-ai-status.error {
  background: rgba(255,77,79,.16);
  color: #ffb4b6;
}
.live-ai-actions {
  display: grid;
  grid-template-columns: 1fr 58px;
  gap: 6px;
}
.live-ai-actions button {
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.live-ai-primary {
  background: #2d6cdf;
  border: 1px solid #3d7df0;
  color: #fff;
}
.live-ai-secondary {
  background:#26344a;
  color:#d9e9ff;
  border:1px solid #35557f;
}
.live-ai-actions button:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.frame-mode-switch {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.frame-mode-btn {
  min-height: 30px;
  border-radius: 4px;
  border: 1px solid #31415c;
  background: #172234;
  color: #d8e6f7;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  padding: 6px 8px;
  cursor: pointer;
  white-space: normal;
}
.frame-mode-btn.active {
  border-color: #3d7df0;
  background: rgba(45, 108, 223, .22);
  color: #fff;
}
.live-ai-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.live-ai-metrics {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 6px;
}
.live-ai-metrics div {
  border: 1px solid #273247;
  background: #0d131d;
  border-radius: 4px;
  padding: 6px 7px;
  min-width: 0;
}
.live-ai-metrics span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.live-ai-metrics strong {
  display: block;
  margin-top: 2px;
  color: #dce7f7;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-ai-tabs {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 3px;
  border: 1px solid #273247;
  border-radius: 5px;
  background: #0d131d;
}
.live-ai-tab {
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  padding: 6px 4px;
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
}
.live-ai-tab.active {
  background: #1b2638;
  color: #e4eaf4;
  font-weight: 700;
}
.live-ai-tab-pane {
  display: none;
}
.live-ai-tab-pane.active {
  display: block;
}
.live-ai-conversation {
  margin-top: 8px;
  min-height: 320px;
  max-height: calc(100vh - 360px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.live-ai-conversation::-webkit-scrollbar { width: 8px; }
.live-ai-conversation::-webkit-scrollbar-thumb { background: #262c39; border-radius: 4px; }
.conversation-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}
.conversation-divider::before,
.conversation-divider::after {
  content: "";
  height: 1px;
  background: #273247;
  flex: 1;
}
.conversation-divider span {
  color: #9fcbff;
  font-weight: 700;
  white-space: nowrap;
}
.conversation-divider em {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
}
.conversation-empty,
.conversation-row,
.record-empty,
.record-row {
  border-radius: 5px;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.4;
}
.conversation-empty,
.record-empty {
  color: var(--muted);
  background: #171d29;
}
.conversation-row {
  max-width: 88%;
}
.conversation-row.user {
  align-self: flex-end;
  background: rgba(78,161,255,.14);
  border: 1px solid rgba(78,161,255,.24);
}
.conversation-row.ai {
  align-self: flex-start;
  background: rgba(77,214,124,.12);
  border: 1px solid rgba(77,214,124,.22);
}
/* 四类 AI 话来源配色：实时对话=绿，规则安全=红，规则陪练=橙，巡检观察=青 */
.conversation-row.ai-dialog {
  background: rgba(77,214,124,.12);
  border: 1px solid rgba(77,214,124,.22);
}
.conversation-row.ai-rule-safety {
  background: rgba(255,99,99,.16);
  border: 1px solid rgba(255,99,99,.34);
}
.conversation-row.ai-rule-coach {
  background: rgba(255,176,77,.14);
  border: 1px solid rgba(255,176,77,.30);
}
.conversation-row.ai-vision {
  background: rgba(77,196,255,.13);
  border: 1px solid rgba(77,196,255,.26);
}
.conversation-interrupt {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 3px;
  font-size: 10px;
  color: #fff;
  background: #e0484d;
  vertical-align: middle;
}
.conversation-role {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 11px;
}
.conversation-text {
  color: #e4eaf4;
  word-break: break-word;
}
.conversation-snapshot {
  display: block;
  width: 100%;
  max-width: 320px;
  margin-top: 6px;
  border-radius: 5px;
  border: 1px solid #273247;
  background: #0d131d;
  cursor: zoom-in;
}
/* 可点击放大的缩略图统一手势 */
.conversation-snapshot, .vx-thumb img { cursor: zoom-in; }

/* 图片放大遮罩 */
.img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 24px;
}
.img-lightbox img {
  max-width: 96vw;
  max-height: 92vh;
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0,0,0,.6);
}
/* 图片巡检：多路画面缩略图横向排列 */
.conversation-row.vx-input { max-width: 96%; }
.vx-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.vx-thumb {
  margin: 0;
  width: 120px;
  max-width: 46%;
}
.vx-thumb img {
  display: block;
  width: 100%;
  border-radius: 5px;
  border: 1px solid #273247;
  background: #0d131d;
}
.vx-thumb figcaption {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vx-context {
  margin-top: 6px;
  color: #aeb6c4;
  font-size: 11px;
}
.conversation-row.vx-output { max-width: 96%; }
.conversation-shot-meta,
.record-meta,
.record-detail {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.live-ai-records {
  margin-top: 8px;
  min-height: 176px;
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.record-row {
  background: #171d29;
  border: 1px solid #273247;
}
.record-row.vision {
  border-color: rgba(77,196,255,.28);
  background: rgba(77,196,255,.10);
}
.record-row.rule {
  border-color: rgba(255,176,77,.28);
  background: rgba(255,176,77,.10);
}
.record-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #e4eaf4;
  font-size: 12px;
  font-weight: 700;
}
.record-title span:last-child {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.record-text {
  margin-top: 4px;
  color: #e4eaf4;
  word-break: break-word;
}
.live-ai-evidence {
  margin-top: 8px;
  max-height: 132px;
  overflow-y: auto;
  border: 1px solid #273247;
  border-radius: 5px;
  background: #0d131d;
  padding: 7px;
}
.evidence-empty {
  color: var(--muted);
  font-size: 12px;
}
.evidence-line {
  color: #cfd6e3;
  font-size: 12px;
  line-height: 1.45;
}
.evidence-line + .evidence-line {
  margin-top: 5px;
}
.evidence-line b {
  color: #9fcbff;
  font-weight: 700;
}
.live-ai-log {
  margin-top: 5px;
  max-height: 96px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.live-ai-log-title {
  margin-top: 8px;
  color: #9fcbff;
  font-size: 11px;
  font-weight: 700;
}
.live-ai-log div {
  padding: 5px 7px;
  border-radius: 4px;
  background: #171d29;
  color: #cfd6e3;
  font-size: 12px;
  line-height: 1.35;
}
.trace-toolbar { display:flex; gap:8px; align-items:center; color:var(--muted); font-size:11px; padding:6px 8px; }
.trace-toolbar button { background:#202a3b; color:#dbe8ff; border:1px solid #385278; border-radius:4px; padding:4px 7px; cursor:pointer; }
.live-ai-traces { max-height:430px; overflow:auto; padding:6px; }
.trace-card { border:1px solid var(--border); border-radius:5px; margin-bottom:6px; background:#111722; }
.trace-card summary { cursor:pointer; padding:7px; color:#b9d7ff; font-size:12px; }
.trace-card pre { white-space:pre-wrap; word-break:break-word; margin:0; padding:8px; border-top:1px solid var(--border); color:#cbd5e1; font-size:11px; line-height:1.4; max-height:260px; overflow:auto; }
.queue-scroll { flex:1 1 auto; overflow-y:auto; min-height:0; }
.queue-list { list-style:none; margin:0; padding:8px; display:flex; flex-direction:column; gap:6px; }

.queue-empty {
  color: var(--muted);
  padding: 20px 10px;
  text-align:center;
  font-size: 12px;
}

.qitem {
  position: relative;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: 4px;
  padding: 6px 10px 6px 10px;
  background: #181c26;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 6px;
  transition: opacity .2s;
  animation: flyIn .28s ease-out;
}
@keyframes flyIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}
.qitem.fresh {
  box-shadow: 0 0 0 1px rgba(78,161,255,.25), 0 0 10px rgba(78,161,255,.15);
}
.qitem.stale { opacity: 0.62; }
.qitem.active { outline: 1px solid rgba(78,161,255,.55); background: #1d2331; }
.qitem.upcoming { outline: 1px solid rgba(78,161,255,.7); background: #1a2942; }
.qitem.upcoming::before { content: "即将发生"; float: right; color: #78b7ff; font-size: 10px; }
.qitem.sev-critical { border-left-color: var(--critical); }
.qitem.sev-warn     { border-left-color: var(--warn); }
.qitem.sev-info     { border-left-color: var(--info); }

.qitem .qhead {
  display:flex; gap:6px; align-items:baseline;
  grid-column: 1 / -1;
}
.qitem .qkind {
  font-size: 11px; letter-spacing: .3px;
  text-transform: uppercase; font-weight: 600;
}
.qitem.sev-critical .qkind { color: var(--critical); }
.qitem.sev-warn     .qkind { color: var(--warn); }
.qitem.sev-info     .qkind { color: var(--info); }
.qitem .qtime {
  margin-left: auto; color: var(--muted);
  font-size: 11px; font-variant-numeric: tabular-nums;
}
.qitem .qmsg {
  font-size: 13px; line-height: 1.4;
  color: var(--fg);
  word-break: break-word;
  grid-column: 1 / -1;
}
.qitem .qevidence {
  grid-column: 1 / -1;
  font-size: 11px; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 4px 8px;
}
.qitem .qevidence code {
  background: #0f1115; padding: 0 4px; border-radius: 3px;
}
.qitem .qcams {
  grid-column: 1 / -1;
  font-size: 11px; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 4px;
  align-items: center;
}
.qitem .qcams .cam-chip {
  background: #1f2635;
  border: 1px solid #2a3040;
  color: #c9d0dd;
  padding: 1px 7px; border-radius: 10px;
  font-weight: 600; letter-spacing: .3px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.qitem .qcams .cam-chip:hover {
  background: var(--accent); color:#fff; border-color: var(--accent);
}
.qitem.sev-critical .qcams .cam-chip { border-color: rgba(255,77,79,.35); }
.qitem.sev-warn     .qcams .cam-chip { border-color: rgba(255,169,64,.35); }

/* ======== player / track (footer) ========= */
.player {
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel-2) 0%, #0f1218 100%);
  padding: 8px 14px 10px;
  display: grid;
  grid-template-rows: 30px 1fr auto;
  gap: 6px;
}
.player-ctrls {
  display:flex; align-items:center; gap:8px;
  font-size: 12px;
}
.player-ctrls button {
  background:#0d0f14; color:var(--fg);
  border:1px solid var(--border);
  padding:4px 10px; border-radius:4px; cursor:pointer;
  min-width: 36px; font-size: 13px;
}
.player-ctrls button:hover { border-color: var(--accent); }
.player-ctrls .play-btn {
  background: var(--accent); color: #fff; border-color: var(--accent);
  width: 44px;
}
.player-ctrls .play-btn:hover { background:#6ab5ff; }
.player-ctrls select {
  background:#0d0f14; color:var(--fg);
  border:1px solid var(--border); border-radius:4px; padding: 3px 4px;
}
.player-ctrls .sep {
  width:1px; height:20px; background: var(--border); margin: 0 4px;
}
.player-ctrls .active-alert {
  margin-left:auto;
  padding:3px 10px; border-radius:12px;
  background:#0d0f14; color: var(--muted);
  font-size: 12px; max-width: 560px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.player-ctrls .active-alert.sev-critical { background: var(--critical); color:#fff; }
.player-ctrls .active-alert.sev-warn     { background: var(--warn);     color:#111; }
.player-ctrls .active-alert.sev-info     { background: var(--info);     color:#111; }

/* ---- the road/track ---- */
.track {
  position: relative;
  height: 100px;
  background: linear-gradient(180deg, #10151e 0%, #0a0d14 100%);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
}
.track-bg { position:absolute; inset:0; width:100%; height:100%; }

/* 跑道底色：深色沥青 + 两条黄色边线 + 中间白色虚线 */
.track-road {
  position:absolute; left:0; right:0;
  top: 42%; height: 36%;
  background: var(--road);
  border-top: 2px solid rgba(255,216,74,.35);
  border-bottom: 2px solid rgba(255,216,74,.35);
  pointer-events:none;
}
.track-road::before {
  content:"";
  position:absolute; left:0; right:0; top:50%;
  height: 2px;
  margin-top:-1px;
  background-image: linear-gradient(to right, #e6e6e6 50%, transparent 50%);
  background-size: 22px 2px;
  opacity: 0.55;
}

/* 标尺：每 5s 长刻度，1s 短刻度 */
.track-ruler { position:absolute; inset:auto 0 0 0; height:14px; pointer-events:none; }
.track-ruler .tick {
  position:absolute; bottom:0; width:1px;
  background: var(--muted);
}
.track-ruler .tick.minor { height:4px; opacity: .45; }
.track-ruler .tick.major { height:8px; opacity: .8; }
.track-ruler .label {
  position:absolute; bottom: 9px; transform: translateX(-50%);
  color: var(--muted); font-size: 10px;
  font-variant-numeric: tabular-nums;
}

/* 路旗 pin */
.track-pins { position:absolute; inset:0; pointer-events:none; }
.pin {
  position:absolute; bottom: 14px;
  pointer-events: auto;
  cursor: pointer;
  width: 14px; height: 44px;
  margin-left: -7px;
  display: flex; flex-direction: column; align-items: center;
  filter: grayscale(0.3) brightness(0.7);
  transition: filter .2s, transform .15s;
}
.pin:hover { filter:none; transform: translateY(-2px) scale(1.08); z-index:5; }
.pin.passed { filter: none; }
.pin.active { filter: drop-shadow(0 0 6px #fff) brightness(1.1); transform: translateY(-2px) scale(1.12); }
.pin .flag {
  width: 12px; height: 10px;
  border-radius: 2px 0 0 2px;
  margin-left: -10px;
  transform-origin: right center;
}
.pin .pole {
  width: 2px; flex: 1;
  background: #c8cbd3;
}
.pin.sev-critical .flag { background: var(--critical); }
.pin.sev-warn     .flag { background: var(--warn); }
.pin.sev-info     .flag { background: var(--info); }

.pin .tooltip {
  position: absolute;
  bottom: 46px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f1115; color: var(--fg);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 5px 8px; font-size: 11px; line-height:1.4;
  white-space: nowrap; z-index: 10;
  display: none;
  pointer-events: none;
  box-shadow: 0 6px 16px rgba(0,0,0,.5);
}
.pin:hover .tooltip { display: block; }
.pin .tooltip b { color: var(--accent); }

/* 小车 */
.car-layer {
  position: absolute;
  left: 0; top: 34%;
  height: 40%;
  width: 52px;
  margin-left: -26px;
  pointer-events: none;
  transition: left 90ms linear;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.6));
  z-index: 4;
}
.car-layer .car { width: 100%; height: 100%; }

/* playhead */
.playhead {
  position:absolute; top:0; bottom:0;
  width: 2px;
  background: rgba(255,255,255,.85);
  pointer-events:none;
  box-shadow: 0 0 6px rgba(255,255,255,.7);
  z-index: 3;
  transition: left 90ms linear;
}

/* scrub overlay — catches click/drag anywhere on the track */
.track-scrub { position:absolute; inset:0; z-index: 6; }

/* filter bar */
.filter-bar {
  display:flex; align-items:center; gap:14px;
  font-size: 12px;
  padding-top: 4px;
}
.filter-bar label { cursor: pointer; user-select:none; display:inline-flex; align-items:center; gap:4px; }
.filter-bar .dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:2px; }
.filter-bar .dot.critical { background: var(--critical); }
.filter-bar .dot.warn     { background: var(--warn); }
.filter-bar .dot.info     { background: var(--info); }
.filter-bar .ghost {
  background: transparent; color: var(--muted);
  border:1px solid var(--border);
  padding: 3px 10px; border-radius: 4px; cursor:pointer;
  margin-left: auto;
}
.filter-bar .ghost:hover { color: var(--fg); border-color: var(--accent); }

/* ══════════════════ Pipeline — redesigned ══════════════════ */

/* ── Topbar button ── */
.pipeline-btn {
  margin-left: 8px;
  padding: 5px 14px;
  background: var(--accent);
  color: #fff; border: none;
  border-radius: 5px; font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, box-shadow .15s;
}
.pipeline-btn:hover { background: #6ab5ff; box-shadow: 0 0 12px rgba(78,161,255,.5); }

/* ── Overlay ── */
.pd-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 90; backdrop-filter: blur(4px);
}
.pd-overlay.open { display: block; }

/* ── Drawer — KEY FIX: visibility:hidden prevents content flash on load ── */
.pd-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(460px, 95vw);
  background: #11141b;
  border-left: 1px solid #1c2234;
  box-shadow: -16px 0 64px rgba(0,0,0,.8);
  z-index: 100;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .3s cubic-bezier(0.4,0,0.2,1), visibility 0s linear .3s;
}
.pd-drawer.open {
  transform: none; visibility: visible;
  transition: transform .3s cubic-bezier(0.4,0,0.2,1), visibility 0s linear 0s;
}

/* ── Drawer header ── */
.pd-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid #1c2234;
  background: #0d1018; flex-shrink: 0;
}
.pd-head-left  { display: flex; align-items: center; gap: 12px; }
.pd-head-icon  { font-size: 22px; line-height: 1; }
.pd-head-title { font-size: 15px; font-weight: 700; color: var(--fg); }
.pd-head-sub   { font-size: 11px; color: var(--muted); margin-top: 1px; }
.pd-close {
  background: none; border: none; color: var(--muted);
  font-size: 18px; cursor: pointer;
  padding: 4px 8px; border-radius: 5px; line-height: 1;
  transition: color .12s, background .12s;
}
.pd-close:hover { color: var(--fg); background: rgba(255,255,255,.07); }

/* ── Drawer body ── */
.pd-body {
  flex: 1 1 auto; overflow-y: auto;
  padding: 20px 20px 28px;
  display: flex; flex-direction: column; gap: 22px;
}
.pd-body::-webkit-scrollbar { width: 5px; }
.pd-body::-webkit-scrollbar-thumb { background: #1c2234; border-radius: 3px; }

/* ── Sections ── */
.pd-sec { display: flex; flex-direction: column; gap: 12px; }
.pd-sec-hd {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: #5a6480;
}
.pd-badge {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── Local-only processing note ── */
.pd-local-note {
  padding: 9px 11px;
  border: 1px solid #233a52;
  border-left: 3px solid var(--accent);
  border-radius: 7px;
  background: rgba(78,161,255,.05);
  color: #8fa3bd;
  font-size: 12px;
  line-height: 1.55;
}
.pd-local-note strong { color: #c5d6e8; }
.pd-scan-state {
  min-height: 18px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.pd-scan-state.error { color: #ff8f8f; }
.pd-scan-state.ok { color: #7fe0a6; }
.file-src {
  padding: 2px 6px; border-radius: 4px;
  font-size: 10px; font-weight: 700; line-height: 1.2;
}
.file-src.local { color: #7fe0a6; background: rgba(52,199,123,.12); }
.file-src.upload { color: #ffb36b; background: rgba(255,179,107,.12); }

/* ── Drop zone ── */
.pd-drop {
  border: 2px dashed #1c2234; border-radius: 10px;
  padding: 24px 16px 20px; text-align: center;
  transition: border-color .15s, background .15s;
  background: #0d1018;
}
.pd-drop.drag-over { border-color: var(--accent); background: rgba(78,161,255,.06); }
.pd-drop-svg {
  width: 44px; height: 44px; margin: 0 auto 10px;
  color: #2e3a52; display: block;
}
.pd-drop-hint { font-size: 12px; color: #4a5570; margin-bottom: 14px; line-height: 1.5; }
.pd-drop-btns { display: flex; gap: 10px; justify-content: center; }
.pd-btn-primary {
  padding: 8px 18px; border-radius: 7px;
  font-size: 13px; font-weight: 600; cursor: pointer; border: none;
  background: var(--accent); color: #fff;
  transition: background .15s, box-shadow .15s, transform .1s;
}
.pd-btn-primary:hover { background: #6ab5ff; box-shadow: 0 4px 16px rgba(78,161,255,.45); transform: translateY(-1px); }
.pd-btn-ghost {
  padding: 8px 18px; border-radius: 7px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  background: #181e2c; color: #8a94a6;
  border: 1px solid #262d3e;
  transition: border-color .15s, color .15s;
}
.pd-btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ── Path + scan row ── */
.pd-path-row { display: flex; gap: 8px; }
.pd-path-input {
  flex: 1; background: #0a0d14; color: var(--fg);
  border: 1px solid #1c2234; border-radius: 7px;
  padding: 8px 10px; font-size: 12px; outline: none;
  font-family: "SFMono-Regular", Consolas, monospace;
  transition: border-color .15s;
}
.pd-path-input:focus { border-color: var(--accent); }
.pd-path-input::placeholder { color: #2e3a52; }
.pd-scan-btn {
  padding: 8px 14px; background: #181e2c; color: var(--muted);
  border: 1px solid #262d3e; border-radius: 7px;
  font-size: 12px; cursor: pointer; white-space: nowrap;
  transition: border-color .15s, color .15s;
}
.pd-scan-btn:hover { border-color: var(--accent); color: var(--accent); }
.pd-scan-btn:disabled { opacity: .5; cursor: default; }

/* ── Found files list ── */
.pd-found {
  background: #0a0d14; border: 1px solid #1c2234;
  border-radius: 8px; overflow: hidden;
}
.pd-found-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 13px; background: #111520;
  border-bottom: 1px solid #1c2234;
}
.pd-found-count { font-size: 11px; color: var(--muted); }
.pd-chk-all {
  display: flex; align-items: center; gap: 5px;
  cursor: pointer; color: var(--muted); font-size: 11px; user-select: none;
}
.pd-chk-all:hover { color: var(--fg); }
.pd-found-list {
  list-style: none; margin: 0; padding: 4px 0;
  max-height: 180px; overflow-y: auto;
}
.pd-found-list::-webkit-scrollbar { width: 4px; }
.pd-found-list::-webkit-scrollbar-thumb { background: #1c2234; border-radius: 2px; }
.pd-found-list li label {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 13px; cursor: pointer; font-size: 12px;
  transition: background .1s;
}
.pd-found-list li label:hover { background: rgba(255,255,255,.03); }
.pd-found-list .file-name {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: "SFMono-Regular", Consolas, monospace;
  color: var(--accent); font-size: 11px;
}
.pd-found-list .file-size { color: var(--muted); font-size: 11px; flex-shrink: 0; }

/* ── Upload list ── */
.pd-uploads { display: flex; flex-direction: column; gap: 5px; }
.pd-upload-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  background: rgba(78,161,255,.06); border: 1px solid rgba(78,161,255,.18);
  border-radius: 6px; font-size: 12px; color: var(--fg);
}
.pd-upload-item .uname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-upload-item .usize { color: var(--muted); flex-shrink: 0; }
.pd-upload-item .ust-ok  { color: #52c41a; font-weight: 600; }
.pd-upload-item .ust-err { color: var(--critical); font-weight: 600; }

/* ── Segment options ── */
.pd-seg-opts { display: flex; flex-direction: column; gap: 10px; }
.pd-opt {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; cursor: pointer; user-select: none; color: var(--fg);
}
.pd-opt input[type="radio"] { accent-color: var(--accent); }
.pd-num-input {
  background: #0a0d14; color: var(--fg);
  border: 1px solid #1c2234; border-radius: 5px;
  padding: 4px 8px; font-size: 12px; width: 100px;
  outline: none; transition: border-color .15s;
}
.pd-num-input:not(:disabled):focus { border-color: var(--accent); }
.pd-num-input:disabled { opacity: .35; cursor: not-allowed; }

/* ── Run button ── */
.pd-action-row {
  display: flex;
  gap: 10px;
}
.pd-run-btn {
  flex: 1;
  padding: 13px;
  background: linear-gradient(135deg, #4ea1ff 0%, #2d6ccf 100%);
  color: #fff; border: none; border-radius: 9px;
  font-size: 14px; font-weight: 700; letter-spacing: .4px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(78,161,255,.3);
  transition: opacity .15s, box-shadow .15s, transform .1s;
}
.pd-run-btn:not(:disabled):hover {
  opacity: .9; transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(78,161,255,.5);
}
.pd-run-btn:not(:disabled):active { transform: none; }
.pd-run-btn:disabled {
  opacity: .3; cursor: not-allowed; box-shadow: none;
  background: #1c2234; color: #3a4568;
}
.pd-cancel-btn {
  padding: 13px 16px;
  background: #21151a;
  color: #ff7b9b;
  border: 1px solid rgba(255, 123, 155, .35);
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.pd-cancel-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* ── Progress panel ── */
.pd-progress {
  background: #0a0d14; border: 1px solid #1c2234;
  border-radius: 10px; overflow: hidden;
}
.pd-prog-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 15px; background: #111520;
  border-bottom: 1px solid #1c2234;
}
.pd-prog-status { font-size: 13px; font-weight: 600; color: var(--fg); }
.pd-prog-status.s-running { color: var(--accent); }
.pd-prog-status.s-done    { color: #52c41a; }
.pd-prog-status.s-error   { color: var(--critical); }
.pd-prog-status.s-cancelled { color: var(--muted); }
.pd-prog-id { font-size: 10px; color: var(--muted); font-family: monospace; }

/* ── Pipeline stages ── */
.pd-pipeline {
  padding: 16px 16px 10px;
  display: flex; flex-direction: column; gap: 12px;
}
.pd-pipe-stage {
  display: grid; grid-template-columns: 14px 1fr;
  gap: 12px; align-items: center;
}
.pd-pipe-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: #1c2234; box-shadow: 0 0 0 2px #111520;
  transition: background .25s, box-shadow .25s;
  flex-shrink: 0;
}
.pd-pipe-stage.s-active .pd-pipe-dot {
  background: var(--accent); box-shadow: 0 0 0 2px #111520, 0 0 10px rgba(78,161,255,.8);
}
.pd-pipe-stage.s-done  .pd-pipe-dot { background: #52c41a; box-shadow: 0 0 0 2px #111520; }
.pd-pipe-stage.s-error .pd-pipe-dot { background: var(--critical); box-shadow: 0 0 0 2px #111520; }
.pd-pipe-right { display: flex; flex-direction: column; gap: 5px; }
.pd-pipe-name {
  font-size: 11px; color: #3a4568;
  font-family: "SFMono-Regular", Consolas, monospace; letter-spacing: .3px;
  transition: color .2s;
}
.pd-pipe-stage.s-active .pd-pipe-name { color: var(--fg); }
.pd-pipe-stage.s-done   .pd-pipe-name { color: #52c41a; }
.pd-pipe-stage.s-error  .pd-pipe-name { color: var(--critical); }
.pd-pipe-bar  { height: 3px; background: #1a2030; border-radius: 2px; overflow: hidden; }
.pd-pipe-fill {
  height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), #6ab5ff);
  transition: width .4s ease;
}
.pd-pipe-stage.s-done  .pd-pipe-fill { background: #52c41a; }
.pd-pipe-stage.s-error .pd-pipe-fill { background: var(--critical); }

/* ── Log ── */
.pd-log {
  margin: 0 15px 14px;
  max-height: 360px; overflow-y: auto;
  background: #07090d; border: 1px solid #131a24;
  border-radius: 5px; padding: 9px 11px;
  font-family: "SFMono-Regular", Consolas, "Courier New", monospace;
  font-size: 12px; line-height: 1.7; color: #6a7e99;
  white-space: pre-wrap; word-break: break-all;
}
.pd-log::-webkit-scrollbar { width: 4px; }
.pd-log::-webkit-scrollbar-thumb { background: #1c2234; border-radius: 2px; }

/* ── 行程评分看板（topbar）───────────────────────────────── */
.stat-score { margin-left: 8px; }
.score-val  { font-size: 1.15em; font-weight: 700; }
.stat-grade { font-size: 0.72em; color: #aab; margin-left: 4px; }

/* ── 行程总结卡片 ─────────────────────────────────────────── */
.trip-summary-card {
  margin: 8px 0;
  background: linear-gradient(135deg, #1a1f2e 0%, #161a27 100%);
  border: 1px solid #2e3650;
  border-radius: 10px;
  padding: 12px 14px;
  flex-shrink: 0;
}
.tsc-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.tsc-icon  { font-size: 1.1em; }
.tsc-title { font-size: 0.8em; color: #8899bb; font-weight: 600;
             letter-spacing: 0.04em; text-transform: uppercase; }
.tsc-score-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
.tsc-score { font-size: 2em; font-weight: 800; line-height: 1; }
.tsc-grade { font-size: 0.85em; color: #aab; }
.tsc-issues-hd {
  font-size: 0.72em;
  color: #667;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.tsc-issue-row {
  font-size: 0.8em;
  color: #cc9955;
  line-height: 1.6;
}
.tsc-tip {
  margin-top: 8px;
  font-size: 0.78em;
  color: #7a9;
  line-height: 1.5;
  border-top: 1px solid #2a3040;
  padding-top: 6px;
}

/* ======== speech state in queue ========= */
.qitem .qspeech {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.35;
}
.qspeech-badge {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.qspeech-text { color: #d9e4f2; }
.qspeech.will-speak {
  background: rgba(78,161,255,.10);
  border: 1px solid rgba(78,161,255,.22);
}
.qspeech.will-speak .qspeech-badge {
  color: #d9ecff;
  background: rgba(78,161,255,.35);
}
.qspeech.spoken {
  background: rgba(75,205,138,.10);
  border: 1px solid rgba(75,205,138,.28);
}
.qspeech.spoken .qspeech-badge {
  color: #ddffe9;
  background: rgba(75,205,138,.35);
}
.qspeech.silent,
.qspeech.skipped {
  background: rgba(120,130,150,.08);
  border: 1px dashed rgba(120,130,150,.25);
}
.qspeech.silent .qspeech-badge,
.qspeech.skipped .qspeech-badge {
  color: #c4c9d4;
  background: rgba(120,130,150,.22);
}
.qspeech.skipped .qspeech-text,
.qspeech.silent .qspeech-text { color: #98a2b5; }

/* ======== multimodal shadow judgment in queue ========= */
.qitem .qmm {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding: 6px 7px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.4;
  background: rgba(75,205,138,.08);
  border: 1px solid rgba(75,205,138,.22);
}
.qmm.pending {
  background: rgba(120,130,150,.08);
  border: 1px dashed rgba(120,130,150,.24);
}
.qmm-head {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
}
.qmm-badge {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #ddffe9;
  background: rgba(75,205,138,.35);
}
.qmm.pending .qmm-badge {
  color: #c4c9d4;
  background: rgba(120,130,150,.22);
}
.qmm-meta {
  color: #98a2b5;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qmm-speech {
  margin-top: 4px;
  color: #e8f5ee;
  word-break: break-word;
}
.qmm-sub {
  margin-top: 3px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: #98a2b5;
  font-size: 11px;
}
.qmm-evi,
.qmm-error {
  margin-top: 3px;
  color: #b8c2d4;
  font-size: 11px;
  word-break: break-word;
}
.qmm-error { color: #ff9b9d; }

/* ======== lightweight completion toast ========= */
.app-toast {
  position: fixed;
  left: 50%;
  top: 18px;
  transform: translate(-50%, -20px);
  opacity: 0;
  pointer-events: none;
  z-index: 30;
  background: rgba(18, 28, 42, .96);
  color: #e6f7ff;
  border: 1px solid rgba(78,161,255,.35);
  border-radius: 999px;
  padding: 8px 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.28);
  font-size: 13px;
  transition: opacity .18s ease, transform .18s ease;
}
.app-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
