/* 阶段 10（task/16）：工作台视觉对齐原型 opencad-workbench-prototype.html。
 * 浅色工作台 + 白色功能面板 + 中央深色 CAD 画布 + 白色卡片式 AI 助手。
 *
 * Q10 L1 门控：所有规则都限定在 body[data-shell="dom"] 作用域内。
 * 门控关闭（?shell=off）时不设置该属性，本文件对页面零影响，原有 iced 外壳原样恢复。
 *
 * 助手卡片是浮在画布上的绝对定位层（原型 .assistant）：画布容器占满左栏以右
 * 的全部宽度，卡片只拦截自身矩形内的鼠标，其余画布区域交互不受影响。
 */

body[data-shell="dom"] {
  --hms-bg: #f4f6fa;
  --hms-panel: #fff;
  --hms-ink: #17233c;
  --hms-muted: #75819a;
  --hms-line: #e7ebf2;
  --hms-blue: #315fe8;
  --hms-blue2: #edf2ff;
  --hms-green: #1caa78;
  --hms-left: 258px;
  --hms-left-collapsed: 42px;
  --hms-topbar: 58px;
  --hms-assistant: min(490px, 44vw);
  --hms-gap: 18px;
  overflow: hidden;
}

body[data-shell="dom"] .app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--hms-bg);
  color: var(--hms-ink);
  font: 14px/1.45 "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

body[data-shell="dom"] button {
  font: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}

/* ---- 顶栏 ---------------------------------------------------------------- */
body[data-shell="dom"] .topbar {
  flex: none;
  height: var(--hms-topbar);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  border-bottom: 1px solid var(--hms-line);
  background: var(--hms-panel);
  z-index: 5;
}

body[data-shell="dom"] .topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 205px;
}

body[data-shell="dom"] .topbar .logo {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #203d79;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
}

body[data-shell="dom"] .topbar .brand-text b {
  display: block;
  font-size: 14px;
  font-weight: 750;
  color: var(--hms-ink);
}

body[data-shell="dom"] .topbar .brand-text small {
  display: block;
  color: var(--hms-muted);
  font-size: 10px;
  font-weight: 500;
}

body[data-shell="dom"] .topbar .filemeta {
  border-left: 1px solid var(--hms-line);
  padding-left: 18px;
  line-height: 1.25;
  min-width: 0;
}

body[data-shell="dom"] .topbar .filemeta b {
  display: block;
  font-size: 13px;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-shell="dom"] .topbar .filemeta small {
  display: block;
  font-size: 11px;
  margin-top: 3px;
  color: var(--hms-muted);
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-shell="dom"] .topbar .filemeta small[data-tone="ok"] { color: #19a475; }
body[data-shell="dom"] .topbar .filemeta small[data-tone="warn"] { color: #b7791f; }

body[data-shell="dom"] .topbar .top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

body[data-shell="dom"] .topbar .file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

body[data-shell="dom"] .toolbtn {
  box-sizing: border-box;
  background: var(--hms-panel);
  border: 1px solid var(--hms-line);
  padding: 8px 12px;
  border-radius: 8px;
  color: #45516a;
  font-size: 12px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body[data-shell="dom"] .toolbtn .toolbtn-icon { width: 13px; height: 13px; flex: none; }

body[data-shell="dom"] .toolbtn:hover { background: #f7f9fc; }

body[data-shell="dom"] .toolbtn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* ---- 工作区三栏 ---------------------------------------------------------- */
body[data-shell="dom"] .workspace {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  overflow: hidden;
}

body[data-shell="dom"] .left-rail {
  flex: none;
  box-sizing: border-box;
  width: var(--hms-left);
  border-right: 1px solid var(--hms-line);
  background: var(--hms-panel);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width .22s ease;
  z-index: 2;
}

body[data-shell="dom"][data-left="collapsed"] .left-rail {
  width: var(--hms-left-collapsed);
}

body[data-shell="dom"] .left-head {
  flex: none;
  height: 54px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f0f2f6;
  white-space: nowrap;
}

body[data-shell="dom"] .left-head b { font-size: 13px; }

body[data-shell="dom"] .collapse-left {
  width: 25px;
  height: 25px;
  border-radius: 7px;
  background: #f5f7fb;
  color: #68748b;
  font-size: 13px;
}

body[data-shell="dom"][data-left="collapsed"] .left-head {
  padding: 0;
  justify-content: center;
}

body[data-shell="dom"][data-left="collapsed"] .left-head b { display: none; }

body[data-shell="dom"] .canvas-host {
  flex: 1;
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: #191c23;
}

/* iced/WASM 动态创建的 canvas 被挂进 .canvas-host 后，绝对定位填满容器。
   winit 仍按窗口尺寸设置 drawing buffer；CSS 显示尺寸由容器决定。 */
body[data-shell="dom"] .canvas-host > canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* 原型 .canvas-status：左下选择状态条（真实选择集投影） */
body[data-shell="dom"] .canvas-status {
  position: absolute;
  left: 16px;
  bottom: 17px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  padding: 7px 10px;
  border: 1px solid #3a414f;
  border-radius: 7px;
  background: #252a34;
  color: #c3cad6;
  font-size: 11px;
}

body[data-shell="dom"] .canvas-status[hidden] { display: none; }

body[data-shell="dom"] .canvas-status button {
  background: none;
  border: 0;
  padding: 0;
  color: #8ab4ff;
  font-size: 11px;
}

/* ---- 助手卡片（原型 .assistant：画布上的浮层） --------------------------- */
body[data-shell="dom"] .assistant-host {
  position: absolute;
  top: 16px;
  right: var(--hms-gap);
  bottom: 16px;
  box-sizing: border-box;
  width: var(--hms-assistant);
  min-width: 360px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--hms-line);
  border-radius: 16px;
  background: var(--hms-panel);
  box-shadow: 0 18px 55px #1c2d501f;
  z-index: 4;
  overflow: hidden;
}

body[data-shell="dom"][data-assistant="collapsed"] .assistant-host {
  display: none;
}

body[data-shell="dom"] .assistant-head {
  flex: none;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--hms-line);
}

body[data-shell="dom"] .ai-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #213d78;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 17px;
}

body[data-shell="dom"] .ai-title { font-weight: 750; font-size: 14px; }

body[data-shell="dom"] .ai-sub {
  font-size: 10px;
  color: #8994a7;
  margin-top: 2px;
}

body[data-shell="dom"] .ai-sub[data-tone="ok"] { color: #19a475; }
body[data-shell="dom"] .ai-sub[data-tone="warn"] { color: #c18a3a; }

body[data-shell="dom"] .head-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

body[data-shell="dom"] .iconbtn {
  height: 30px;
  min-width: 30px;
  border-radius: 7px;
  background: #f5f7fb;
  color: #65728a;
  font-size: 14px;
}

body[data-shell="dom"] .iconbtn:hover {
  background: #eaf0ff;
  color: var(--hms-blue);
}

body[data-shell="dom"] .floating-launch {
  position: absolute;
  right: 20px;
  bottom: 22px;
  z-index: 4;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 16px;
  border: 0;
  border-radius: 14px;
  background: #203d79;
  color: #fff;
  font-size: 12px;
  box-shadow: 0 12px 30px #152a573d;
}

body[data-shell="dom"][data-assistant="expanded"] .floating-launch {
  display: none;
}

/* 左栏在未打开图纸时不可展开：视觉上弱化，点击给出提示。 */
body[data-shell="dom"][data-left-locked="true"][data-left="collapsed"] .collapse-left {
  color: #aab2c2;
  cursor: not-allowed;
}

/* 轻量提示气泡（如「请先打开图纸」），不承载业务状态。 */
body[data-shell="dom"] .shell-toast {
  position: fixed;
  left: 50%;
  bottom: 76px;
  transform: translateX(-50%);
  z-index: 30;
  max-width: 70vw;
  box-sizing: border-box;
  padding: 9px 16px;
  border-radius: 8px;
  background: #17233ceb;
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
  box-shadow: 0 10px 26px #0d17303d;
}

body[data-shell="dom"] .shell-toast[hidden] { display: none; }

/* ---- 手机配对弹层（DOM/SVG 二维码，替代画布内 iced 弹窗） ---------------- */
body[data-shell="dom"] .mobile-pair-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b101673;
}

body[data-shell="dom"] .mobile-pair-modal[hidden] { display: none; }

body[data-shell="dom"] .mobile-pair-card {
  width: 300px;
  box-sizing: border-box;
  padding: 18px;
  border: 1px solid var(--hms-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 70px #16264745;
  text-align: center;
}

body[data-shell="dom"] .mobile-pair-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

body[data-shell="dom"] .mobile-pair-head b { font-size: 14px; }

body[data-shell="dom"] .mobile-pair-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: #f5f7fb;
  color: #65728a;
  font-size: 16px;
  cursor: pointer;
}

body[data-shell="dom"] .mobile-pair-qr {
  width: 188px;
  height: 188px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border: 1px solid var(--hms-line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

body[data-shell="dom"] .mobile-pair-qr svg {
  display: block;
  width: 168px;
  height: 168px;
}

body[data-shell="dom"] .mobile-pair-status {
  margin: 0 0 6px;
  font-size: 12px;
  color: #65728a;
}

body[data-shell="dom"] .mobile-pair-status[data-tone="ok"] { color: #19a475; }
body[data-shell="dom"] .mobile-pair-status[data-tone="warn"] { color: #c18a3a; }

body[data-shell="dom"] .mobile-pair-url {
  margin: 0 0 14px;
  font-size: 10px;
  color: #8994a7;
  word-break: break-all;
}

body[data-shell="dom"] .mobile-pair-actions { display: flex; justify-content: center; }

body[data-shell="dom"] .mobile-pair-disconnect {
  padding: 8px 16px;
  border: 1px solid var(--hms-line);
  border-radius: 9px;
  background: #fff;
  color: #65728a;
  font-size: 12px;
  cursor: pointer;
}

/* ---- 左栏工作面板 -------------------------------------------------------- */
body[data-shell="dom"] .left-rail .left-panel-slot {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  overflow: hidden;
}

body[data-shell="dom"][data-left="collapsed"] .left-rail .left-panel-slot {
  display: none;
}

body[data-shell="dom"] .left-panel {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 12px;
  overflow: hidden;
}

body[data-shell="dom"] .left-panel .object-search {
  flex: none;
  box-sizing: border-box;
  width: 100%;
  height: 34px;
  margin-bottom: 13px;
  padding: 0 10px;
  border: 1px solid var(--hms-line);
  border-radius: 8px;
  background: var(--hms-panel);
  color: var(--hms-ink);
  font-size: 11px;
  outline: none;
}

body[data-shell="dom"] .left-panel .object-search::placeholder { color: #8b95a8; }
body[data-shell="dom"] .left-panel .object-search:focus { border-color: #b9c9ff; }

body[data-shell="dom"] .left-panel .object-tabs {
  flex: none;
  display: flex;
  gap: 14px;
  margin: 0 0 14px;
  font-size: 11px;
  color: #8490a4;
}

body[data-shell="dom"] .left-panel .object-tabs button {
  padding: 0;
  font-size: 11px;
  color: #8490a4;
}

body[data-shell="dom"] .left-panel .object-tabs button.active {
  color: var(--hms-blue);
  font-weight: 700;
}

body[data-shell="dom"] .left-panel .object-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

body[data-shell="dom"] .left-panel .layer-group { margin-bottom: 16px; }

body[data-shell="dom"] .left-panel .layer-title {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 11px;
  color: #8b96aa;
}

body[data-shell="dom"] .left-panel .object-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 7px;
  border-radius: 7px;
  font-size: 11px;
  color: #536079;
  text-align: left;
}

body[data-shell="dom"] .left-panel .object-item:hover { background: #f5f7fb; }

body[data-shell="dom"] .left-panel .object-item.active {
  background: var(--hms-blue2);
  color: var(--hms-blue);
}

body[data-shell="dom"] .left-panel .object-icon {
  flex: none;
  width: 22px;
  height: 22px;
  border: 1px solid #e4e9f1;
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-size: 10px;
  color: #68748b;
}

body[data-shell="dom"] .left-panel .object-item.active .object-icon {
  border-color: #c9d6ff;
  color: var(--hms-blue);
}

body[data-shell="dom"] .left-panel .object-name {
  min-width: 0;
  line-height: 1.4;
}

body[data-shell="dom"] .left-panel .object-name small {
  display: block;
  color: #a0a9b7;
  font-size: 10px;
}

body[data-shell="dom"] .left-panel .object-item.active .object-name small { color: #7f91c3; }

body[data-shell="dom"] .left-panel .panel-empty {
  margin: 0;
  font-size: 12px;
  color: #8a94a8;
}

body[data-shell="dom"] .left-panel .panel-note {
  margin: 0;
  padding-top: 8px;
  font-size: 10px;
  line-height: 1.6;
  color: #9aa4b5;
}

/* 选中对象详情卡片（原型 .object-card） */
body[data-shell="dom"] .left-panel .object-card {
  flex: none;
  margin-top: 12px;
  border: 1px solid var(--hms-line);
  border-radius: 10px;
  padding: 11px;
  font-size: 11px;
  color: #7c879a;
  max-height: 45%;
  overflow-y: auto;
}

body[data-shell="dom"] .left-panel .object-card b {
  display: block;
  color: #263653;
  margin-bottom: 8px;
}

body[data-shell="dom"] .left-panel .object-card .metric-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 0;
  font-size: 10px;
}

body[data-shell="dom"] .left-panel .object-card .metric-row strong {
  color: #34415b;
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}

body[data-shell="dom"] .left-panel .object-card .card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

body[data-shell="dom"] .left-panel .object-card .card-actions .toolbtn {
  flex: 1;
  padding: 7px 8px;
  font-size: 11px;
}

/* 文档级真实快照（折叠在详情区下方，只读） */
body[data-shell="dom"] .left-panel .doc-meta {
  flex: none;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #f0f2f6;
}

body[data-shell="dom"] .left-panel .doc-meta summary {
  cursor: pointer;
  font-size: 10px;
  color: #9aa4b5;
}

body[data-shell="dom"] .left-panel .property-list { margin: 6px 0 0; }

body[data-shell="dom"] .left-panel .property-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
  font-size: 10px;
}

body[data-shell="dom"] .left-panel .property-key { color: #9a9a9a; white-space: nowrap; }

body[data-shell="dom"] .left-panel .property-value {
  margin: 0;
  color: #536079;
  text-align: right;
  overflow-wrap: anywhere;
}

/* ---- 助手面板内部 -------------------------------------------------------- */
body[data-shell="dom"] .assistant-host .assistant-panel-slot {
  flex: 1;
  min-height: 0;
  display: flex;
}

body[data-shell="dom"] .assistant-panel {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* 诊断状态条仅供读屏与诊断读取，不作为用户可见的默认界面内容（原型无此条）。 */
body[data-shell="dom"] .assistant-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

body[data-shell="dom"] .assistant-log {
  flex: 1;
  min-height: 0;
  box-sizing: border-box;
  overflow-y: auto;
  padding: 18px 17px 12px;
  background: linear-gradient(#fff, #fcfdff);
  font-size: 12px;
  line-height: 1.7;
}

body[data-shell="dom"] .assistant-log .date-label {
  text-align: center;
  color: #a0a9b8;
  font-size: 10px;
  margin: 0 0 17px;
}

body[data-shell="dom"] .assistant-log .msg {
  display: flex;
  gap: 9px;
  margin-bottom: 17px;
  align-items: flex-start;
}

body[data-shell="dom"] .assistant-log .avatar {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #eaf0ff;
  color: var(--hms-blue);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}

body[data-shell="dom"] .assistant-log .bubble {
  max-width: calc(100% - 36px);
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
  color: #34415b;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

body[data-shell="dom"] .assistant-log .user-msg { justify-content: flex-end; }

body[data-shell="dom"] .assistant-log .msg-user {
  background: var(--hms-blue2);
  border-radius: 12px 3px 12px 12px;
  padding: 9px 12px;
  color: #30446e;
}

body[data-shell="dom"] .assistant-log .msg-tool,
body[data-shell="dom"] .assistant-log .msg-system {
  display: block;
  margin: 0 0 10px 35px;
  padding: 8px 10px;
  border: 1px solid #e8edf5;
  border-radius: 8px;
  background: #fff;
  color: #78849a;
  font-size: 10px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

body[data-shell="dom"] .assistant-log .msg-verified {
  border-color: #bfe6d6;
  background: #f2fbf7;
  color: #177a58;
}

/* 欢迎 / 上下文卡片 / 快捷操作（产品引导，非模型输出） */
body[data-shell="dom"] .assistant-log .ai-card {
  border: 1px solid #e8edf5;
  border-radius: 10px;
  padding: 11px;
  margin-top: 9px;
  background: #fff;
}

body[data-shell="dom"] .assistant-log .card-title {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 7px;
  color: #263956;
}

body[data-shell="dom"] .assistant-log .metric-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #78849a;
  font-size: 10px;
  padding: 3px 0;
}

body[data-shell="dom"] .assistant-log .metric-row strong {
  color: #34415b;
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}

body[data-shell="dom"] .assistant-log .status-line {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  color: #6f7c91;
  margin-top: 8px;
}

body[data-shell="dom"] .assistant-log .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #19b47e;
}

body[data-shell="dom"] .assistant-log .suggestions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}

body[data-shell="dom"] .assistant-log .suggestion {
  border: 1px solid #e8edf5;
  border-radius: 9px;
  padding: 10px;
  text-align: left;
  background: #fff;
  color: #41506b;
  font-size: 10px;
  line-height: 1.45;
}

body[data-shell="dom"] .assistant-log .suggestion b {
  display: block;
  color: #263956;
  font-size: 11px;
  margin-bottom: 4px;
}

body[data-shell="dom"] .assistant-log .suggestion:hover {
  border-color: #b9c9ff;
  background: #f8faff;
}

/* 未登录游客态：能力宣传（不显示连接状态 / 上下文卡片） */
body[data-shell="dom"] .assistant-log .msg[hidden],
body[data-shell="dom"] .assistant-log .date-label[hidden],
body[data-shell="dom"] .assistant-log .ai-card[hidden] { display: none; }

body[data-shell="dom"] .assistant-log .assistant-promo {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin: 4px 0 12px;
}

body[data-shell="dom"] .assistant-log .assistant-promo[hidden] { display: none; }

body[data-shell="dom"] .assistant-log .assistant-promo .promo-title {
  margin: 10px 0 6px;
  color: #263956;
  font-size: 11px;
  font-weight: 600;
}

body[data-shell="dom"] .assistant-log .promo-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

body[data-shell="dom"] .assistant-log .promo-item {
  border: 1px solid #e8edf5;
  border-radius: 9px;
  padding: 9px 10px;
  background: #fff;
  color: #5a6880;
  font-size: 10px;
  line-height: 1.45;
}

body[data-shell="dom"] .assistant-log .promo-item b {
  display: block;
  color: #263956;
  font-size: 11px;
  margin-bottom: 3px;
}

/* ---- 底部固定输入区（原型 .composer） ------------------------------------ */
body[data-shell="dom"] .assistant-composer {
  flex: none;
  border-top: 1px solid var(--hms-line);
  padding: 12px 13px 13px;
  background: #fff;
}

body[data-shell="dom"] .composer-hint {
  display: flex;
  justify-content: space-between;
  color: #9aa4b5;
  font-size: 10px;
  margin-bottom: 7px;
}

body[data-shell="dom"] .inputbox {
  border: 1px solid #dfe5ef;
  border-radius: 12px;
  padding: 10px 10px 8px;
  box-shadow: 0 2px 8px #1c2d5008;
}

body[data-shell="dom"] .assistant-draft {
  display: block;
  width: 100%;
  box-sizing: border-box;
  height: 45px;
  resize: none;
  border: 0;
  outline: 0;
  padding: 0;
  background: transparent;
  color: #33415c;
  font: 12px/1.5 "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

body[data-shell="dom"] .assistant-draft::placeholder { color: #a1aabb; }

body[data-shell="dom"] .compose-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
}

body[data-shell="dom"] .assistant-pair {
  box-sizing: border-box;
  height: 29px;
  padding: 0 9px;
  border: 1px solid #e1e9ff;
  border-radius: 7px;
  background: #f1f5ff;
  color: var(--hms-blue);
  font-size: 10px;
  white-space: nowrap;
}

body[data-shell="dom"] .assistant-pair:disabled {
  opacity: .5;
  cursor: not-allowed;
}

body[data-shell="dom"] .compose-note {
  font-size: 10px;
  color: #9ba5b5;
}

body[data-shell="dom"] .assistant-send {
  margin-left: auto;
  box-sizing: border-box;
  height: 31px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: var(--hms-blue);
  color: #fff;
  font-size: 11px;
}

body[data-shell="dom"] .assistant-send:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* 停止本轮：与发送同位置，红色描边；停止中禁用。 */
body[data-shell="dom"] .assistant-stop {
  background: #e5484d;
}

body[data-shell="dom"] .assistant-stop:disabled {
  opacity: .55;
}

/* 断连恢复条：不抢眼，但明确给「重新连接」入口（不刷新页面）。 */
body[data-shell="dom"] .assistant-conn {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px 8px;
  padding: 7px 10px;
  border: 1px solid rgba(229, 72, 77, 0.28);
  border-radius: 8px;
  background: rgba(229, 72, 77, 0.08);
  color: #b4453f;
  font-size: 11px;
}

body[data-shell="dom"] .assistant-conn[hidden] {
  display: none;
}

body[data-shell="dom"] .assistant-reconnect {
  margin-left: auto;
  padding: 4px 10px;
  border: 1px solid rgba(229, 72, 77, 0.45);
  border-radius: 6px;
  background: #fff;
  color: #b4453f;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}

body[data-shell="dom"] .assistant-reconnect:disabled {
  opacity: .6;
  cursor: default;
}

/* 「思考中」状态行：仅在无输出期间显示，出现文本/工具即撤。 */
body[data-shell="dom"] .assistant-thinking {
  margin: 6px 0 2px 30px;
  font-size: 11px;
  color: #8b94a6;
  letter-spacing: .2px;
}

body[data-shell="dom"] .assistant-thinking::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 2px;
  margin-left: 6px;
  vertical-align: middle;
  background: currentColor;
  animation: hms-thinking 1.1s ease-in-out infinite;
}

@keyframes hms-thinking {
  0%, 100% { opacity: .25; transform: scaleX(.4); }
  50% { opacity: 1; transform: scaleX(1); }
}

body[data-shell="dom"] .composer-note {
  font-size: 9px;
  color: #a3acbb;
  margin-top: 7px;
  text-align: right;
}

/* ---- 未登录 / 无权益占位：输入区整块不渲染，只给状态与登录入口 ---------- */
body[data-shell="dom"] .assistant-gate {
  flex: none;
  border-top: 1px solid var(--hms-line);
  padding: 16px 16px 18px;
  background: #fff;
  text-align: center;
}

body[data-shell="dom"] .assistant-gate[hidden] { display: none; }

body[data-shell="dom"] .assistant-gate-text {
  margin: 0 0 10px;
  color: #6b7a90;
  font-size: 12px;
  line-height: 1.6;
}

body[data-shell="dom"] .assistant-gate-login {
  color: var(--hms-blue);
  font-size: 12px;
  margin-left: 4px;
  text-decoration: underline;
}

body[data-shell="dom"] .assistant-gate-login[hidden] { display: none; }

body[data-shell="dom"] .assistant-gate.is-login { cursor: pointer; }

body[data-shell="dom"] .assistant-gate:focus-visible {
  outline: 2px solid var(--hms-blue);
  outline-offset: -2px;
}

/* ---- 窄窗口降级（原型 @media 1100px / 760px / 430px） --------------------
   与原型的一处有意偏差：窄窗口仍保留 打开/保存/导出 按钮（纯鼠标可达硬规则）。 */
@media (max-width: 1100px) {
  body[data-shell="dom"] {
    --hms-left: 220px;
    --hms-assistant: min(440px, 48vw);
  }
  body[data-shell="dom"] .assistant-host { min-width: 340px; }
  body[data-shell="dom"] .topbar { gap: 10px; padding: 0 12px; }
  body[data-shell="dom"] .topbar .brand { min-width: 170px; }
}

@media (max-width: 760px) {
  body[data-shell="dom"] { --hms-topbar: 52px; --hms-left-collapsed: 36px; }
  body[data-shell="dom"] .topbar .brand { min-width: 0; }
  body[data-shell="dom"] .topbar .brand-text { display: none; }
  body[data-shell="dom"] .topbar .filemeta { padding-left: 10px; }
  body[data-shell="dom"] .left-rail {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 6;
    box-shadow: 8px 0 25px #101a2c12;
  }
  body[data-shell="dom"][data-left="collapsed"] .left-rail { box-shadow: none; }
  body[data-shell="dom"] .assistant-host {
    top: 8px;
    right: 8px;
    bottom: 8px;
    width: min(470px, calc(100% - 54px));
    min-width: 0;
  }
  body[data-shell="dom"] .assistant-head { height: 56px; }
  body[data-shell="dom"] .floating-launch { right: 12px; bottom: 12px; }
  body[data-shell="dom"] .user-switch { font-size: 10px; padding: 6px; }
}

@media (max-width: 430px) {
  body[data-shell="dom"] .topbar .filemeta b { font-size: 11px; }
  body[data-shell="dom"] .topbar .filemeta small { font-size: 9px; }
  body[data-shell="dom"] .assistant-host { width: calc(100% - 52px); }
}

/* ---- 顶栏账户入口与账户弹层（原型 .user-switch） ------------------------- */
body[data-shell="dom"] .account-slot {
  flex: none;
  position: relative;
  display: flex;
  align-items: center;
}

/* 账户入口按用户指示（2026-11-27）：不做按钮样式，链接化并显示当前用户名。 */
body[data-shell="dom"] .user-switch {
  border: 0;
  border-radius: 6px;
  padding: 6px 4px;
  background: none;
  color: #35425d;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
}

body[data-shell="dom"] .user-switch:hover {
  background: none;
  color: var(--hms-blue);
  text-decoration-color: var(--hms-blue);
}

body[data-shell="dom"] .user-switch:focus-visible {
  outline: 2px solid var(--hms-blue);
  outline-offset: 2px;
}

body[data-shell="dom"] .account-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  box-sizing: border-box;
  background: var(--hms-panel);
  border: 1px solid var(--hms-line);
  border-radius: 12px;
  box-shadow: 0 18px 55px #1c2d501f;
  padding: 14px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

body[data-shell="dom"] .account-pop[hidden] { display: none; }

body[data-shell="dom"] .account-pop b { font-size: 13px; }

body[data-shell="dom"] .account-pop .account-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--hms-muted);
  font-size: 11px;
}

body[data-shell="dom"] .account-pop .account-line span:last-child {
  color: var(--hms-ink);
  text-align: right;
}

body[data-shell="dom"] .account-pop label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--hms-muted);
  font-size: 11px;
}

body[data-shell="dom"] .account-pop input {
  height: 32px;
  box-sizing: border-box;
  border: 1px solid var(--hms-line);
  border-radius: 8px;
  padding: 0 9px;
  font: 12px/1.4 inherit;
  color: var(--hms-ink);
  background: #fff;
}

body[data-shell="dom"] .account-pop .account-error {
  color: #b4232a;
  font-size: 11px;
  min-height: 15px;
}

body[data-shell="dom"] .account-pop .account-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

body[data-shell="dom"] .account-pop .account-primary {
  flex: 1;
  height: 32px;
  border-radius: 8px;
  background: var(--hms-blue);
  color: #fff;
  font-size: 12px;
}

body[data-shell="dom"] .account-pop .account-primary:disabled { opacity: .45; }

body[data-shell="dom"] .account-pop .account-link {
  background: none;
  color: var(--hms-blue);
  font-size: 11px;
  padding: 0;
}

body[data-shell="dom"] .account-pop .account-note {
  color: #a3acbb;
  font-size: 10px;
  line-height: 1.6;
}

/* ---- 登录冲突确认框 -------------------------------------------------------- */
/* 独立于登录弹层（挂 body、fixed 遮罩居中）：登录弹层无论被什么途径关掉或
   重绘，这个「强制登录 / 取消登录」决策框都一定可见可点。 */
body[data-shell="dom"] .account-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #0f172a73;
  display: flex;
  align-items: center;
  justify-content: center;
}

body[data-shell="dom"] .account-confirm {
  width: min(340px, 88vw);
  box-sizing: border-box;
  background: var(--hms-panel);
  border: 1px solid var(--hms-line);
  border-radius: 12px;
  box-shadow: 0 24px 70px #1c2d5033;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body[data-shell="dom"] .account-confirm b { font-size: 13px; }

body[data-shell="dom"] .account-confirm .account-error {
  color: #b4232a;
  font-size: 11px;
  line-height: 1.6;
}

body[data-shell="dom"] .account-confirm .account-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

body[data-shell="dom"] .account-confirm .account-primary {
  flex: 1;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: var(--hms-blue);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}

body[data-shell="dom"] .account-confirm .account-primary:disabled { opacity: .45; }

body[data-shell="dom"] .account-confirm .account-link {
  border: 0;
  background: none;
  color: var(--hms-blue);
  font-size: 11px;
  padding: 0;
  cursor: pointer;
}

/* ---- P4-A 起点页覆盖层（零内核依赖） -------------------------------------- */
/* 覆盖 .canvas-host 全部区域：canvas 保持挂载（不 display:none，避免 winit
   尺寸重算），仅被本层遮挡。z-index 3：画布(0)/状态条(1) 之上，助手卡(4) 之下
   ——与原型一致：起点页上助手卡片仍然可见可点。 */
body[data-shell="dom"] .home-page {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: var(--hms-bg);
  overflow: auto;
  display: block;
}

/* 品牌区兼作返回首页入口。 */
body[data-shell="dom"] .brand {
  cursor: pointer;
}

body[data-shell="dom"] .brand:hover .brand-text b {
  color: var(--hms-blue);
}

/* 覆盖层模式（图纸打开时回到首页）：右上角返回图纸。 */
body[data-shell="dom"] .home-back {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 2;
  display: none;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1px solid var(--hms-line);
  border-radius: 8px;
  background: #fff;
  color: var(--hms-text);
  font-size: 12px;
  cursor: pointer;
}

body[data-shell="dom"] .home-page[data-overlay="1"] .home-back {
  display: inline-flex;
}

body[data-shell="dom"] .home-back:hover {
  border-color: var(--hms-blue);
  color: var(--hms-blue);
}

body[data-shell="dom"] .home-page[hidden] { display: none; }

body[data-shell="dom"] .home-inner {
  max-width: 660px;
  margin: 0 auto;
  padding: 72px 24px 48px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

body[data-shell="dom"] .home-eyebrow {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--hms-blue2);
  color: var(--hms-blue);
  font-size: 11px;
}

body[data-shell="dom"] .home-headline {
  margin: 16px 0 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--hms-ink);
  letter-spacing: .2px;
}

body[data-shell="dom"] .home-sub {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--hms-muted);
}

body[data-shell="dom"] .home-hero {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
}

body[data-shell="dom"] .home-hero .btn-primary {
  height: 40px;
  padding: 0 20px;
  border-radius: 9px;
  background: var(--hms-blue);
  color: #fff;
  font-size: 13px;
}

body[data-shell="dom"] .home-hero .btn-primary:hover { background: #234dc4; }
body[data-shell="dom"] .home-hero .btn-primary:disabled { opacity: .55; cursor: default; }

body[data-shell="dom"] .home-hero .btn-secondary {
  height: 40px;
  padding: 0 20px;
  border-radius: 9px;
  background: var(--hms-panel);
  border: 1px solid var(--hms-line);
  color: var(--hms-ink);
  font-size: 13px;
}

body[data-shell="dom"] .home-hero .btn-secondary:disabled {
  opacity: .5;
  cursor: not-allowed;
}

body[data-shell="dom"] .home-hero .hero-note {
  margin-left: 4px;
  font-size: 11px;
  color: var(--hms-muted);
}

body[data-shell="dom"] .home-recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 44px 0 12px;
}

body[data-shell="dom"] .home-recent-head b { font-size: 13px; }
body[data-shell="dom"] .home-recent-head small { font-size: 11px; color: var(--hms-muted); }

body[data-shell="dom"] .home-recent {
  width: 100%;
  background: var(--hms-panel);
  border: 1px solid var(--hms-line);
  border-radius: 12px;
  overflow: hidden;
}

body[data-shell="dom"] .home-recent .recent-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--hms-line);
}

body[data-shell="dom"] .home-recent .recent-row:last-child { border-bottom: 0; }
body[data-shell="dom"] .home-recent .recent-row:hover { background: #f7f9fc; }
body[data-shell="dom"] .home-recent .recent-row:disabled { opacity: .55; cursor: default; }

body[data-shell="dom"] .home-recent .recent-badge {
  flex: none;
  padding: 2px 8px;
  border-radius: 6px;
  background: #eef1f6;
  color: #5a667e;
  font-size: 10px;
  letter-spacing: .5px;
}

body[data-shell="dom"] .home-recent .recent-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

body[data-shell="dom"] .home-recent .recent-meta b {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--hms-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-shell="dom"] .home-recent .recent-meta small {
  font-size: 10.5px;
  color: var(--hms-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-shell="dom"] .home-recent .recent-arrow {
  margin-left: auto;
  color: #a6b0c2;
  font-size: 16px;
}

body[data-shell="dom"] .home-recent .home-empty {
  padding: 34px 16px;
  text-align: center;
}

body[data-shell="dom"] .home-recent .home-empty-title { font-size: 13px; color: var(--hms-ink); }
body[data-shell="dom"] .home-recent .home-empty-sub {
  margin-top: 8px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--hms-muted);
}

/* ---- 历史会话抽屉（只读） ------------------------------------------------ */
body[data-shell="dom"] .assistant-panel { position: relative; }

body[data-shell="dom"] .assistant-history-bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid #d8e5ff;
  background: #f2f6ff;
  color: #3b5b9c;
  font-size: 10.5px;
}
body[data-shell="dom"] .assistant-history-bar[hidden] { display: none; }

body[data-shell="dom"] .history-back {
  border: 1px solid #b9c9ff;
  border-radius: 7px;
  background: #fff;
  color: var(--hms-blue);
  padding: 4px 8px;
  font-size: 10px;
  white-space: nowrap;
}

body[data-shell="dom"] .assistant-history {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 0 0 14px 14px;
}
body[data-shell="dom"] .assistant-history[hidden] { display: none; }

body[data-shell="dom"] .history-top {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 46px;
  padding: 0 14px;
  border-bottom: 1px solid var(--hms-line);
  font-size: 13px;
  font-weight: 700;
}

body[data-shell="dom"] .history-search {
  flex: none;
  box-sizing: border-box;
  margin: 12px 14px 8px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid #dfe5ef;
  border-radius: 9px;
  font: 11.5px/1.4 inherit;
  color: var(--hms-ink);
  background: #f9fbff;
}

body[data-shell="dom"] .history-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 14px 10px;
}

body[data-shell="dom"] .history-current {
  margin: 4px 0 10px;
  padding: 9px 11px;
  border: 1px solid #d8eadf;
  border-radius: 9px;
  background: #f4fbf7;
  font-size: 11px;
  color: #2f6851;
}
body[data-shell="dom"] .history-current small {
  display: block;
  margin-top: 3px;
  color: #7b9a8c;
  font-size: 10px;
}

body[data-shell="dom"] .history-item {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  padding: 10px 11px;
  margin-bottom: 8px;
  border: 1px solid #e8edf5;
  border-radius: 10px;
  background: #fff;
}
body[data-shell="dom"] .history-item:hover { border-color: #b9c9ff; background: #f8faff; }
body[data-shell="dom"] .history-item b {
  display: block;
  color: #263956;
  font-size: 11.5px;
}
body[data-shell="dom"] .history-item small {
  display: block;
  margin-top: 4px;
  color: #96a1b3;
  font-size: 10px;
}
body[data-shell="dom"] .history-tag {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 5px;
  border: 1px solid #d8e5ff;
  border-radius: 4px;
  color: #4a6fb5;
  font-size: 9px;
  font-weight: 500;
}

body[data-shell="dom"] .history-status {
  flex: none;
  margin: 0;
  padding: 0 14px 6px;
  color: #b4232a;
  font-size: 10.5px;
}
body[data-shell="dom"] .history-status[hidden] { display: none; }

body[data-shell="dom"] .history-foot {
  flex: none;
  border-top: 1px solid var(--hms-line);
  padding: 11px 14px;
}
body[data-shell="dom"] .history-new {
  width: 100%;
  height: 32px;
  border: 1px solid #cbd7f3;
  border-radius: 8px;
  background: #fff;
  color: var(--hms-blue);
  font-size: 11px;
}
body[data-shell="dom"] .history-new:hover { background: #f4f7ff; }

/* ---------------------------------------------------------------------------
   统一任务进度遮罩（原型 reff_code/图纸加载进度-交互原型.html）
   内核加载 / 打开图纸 / 导入 PDF 共用一个 .hms-ov + 状态机，不再出现
   「卡片 93%、状态栏 94%」两个数据源。半透明 + 8px 毛玻璃，底层可见。
   --------------------------------------------------------------------------- */

body[data-shell="dom"] .hms-hairline {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 300;
  background: transparent; opacity: 0; transition: opacity .2s ease;
  pointer-events: none;
}
body[data-shell="dom"] .hms-hairline.show { opacity: 1; }
body[data-shell="dom"] .hms-hairline i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #2563EB, #60A5FA);
  box-shadow: 0 0 12px rgba(37, 99, 235, .55);
  transition: width .1s linear;
}
body[data-shell="dom"] .hms-hairline i.is-indeterminate {
  animation: hms-progress-slide 1.4s ease-in-out infinite;
}
@keyframes hms-progress-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(300%); }
}

body[data-shell="dom"] .hms-ov {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  opacity: 0; pointer-events: none; transition: opacity .22s ease;
}
body[data-shell="dom"] .hms-ov.show { opacity: 1; pointer-events: auto; }
body[data-shell="dom"] .hms-scrim {
  position: absolute; inset: 0; background: rgba(15, 23, 42, .40);
  -webkit-backdrop-filter: blur(8px) saturate(1.05);
  backdrop-filter: blur(8px) saturate(1.05);
}
body[data-shell="dom"] .hms-panel {
  position: relative; width: 468px; max-width: calc(100vw - 40px);
  background: #fff; border-radius: 20px; padding: 26px 28px 20px;
  box-shadow: 0 32px 80px rgba(15, 23, 42, .34), 0 2px 8px rgba(15, 23, 42, .08);
  transform: translateY(10px) scale(.985);
  transition: transform .26s cubic-bezier(.2, .8, .2, 1);
}
body[data-shell="dom"] .hms-ov.show .hms-panel { transform: none; }

body[data-shell="dom"] .hms-p-head {
  display: flex; align-items: flex-start; gap: 14px;
}
body[data-shell="dom"] .hms-p-icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: #EEF4FF; color: #2563EB;
  display: grid; place-items: center; flex: 0 0 auto;
  transition: background .2s, color .2s;
}
body[data-shell="dom"] .hms-p-icon svg { width: 21px; height: 21px; }
body[data-shell="dom"] .hms-p-title {
  flex: 1; min-width: 0; padding-top: 9px;
  font-size: 16.5px; font-weight: 600; letter-spacing: -.01em; line-height: 1.35;
}
body[data-shell="dom"] .hms-p-sub {
  margin-top: 10px; font-size: 12.5px; color: #94A3B8; line-height: 1.55;
}
body[data-shell="dom"] .hms-p-pct {
  margin-left: auto; font-size: 36px; font-weight: 700; line-height: .95;
  letter-spacing: -.035em; font-variant-numeric: tabular-nums; color: #0F172A;
  flex: 0 0 auto;
}
body[data-shell="dom"] .hms-p-pct i {
  font-style: normal; font-size: 15px; font-weight: 600;
  color: #94A3B8; margin-left: 1px;
}
body[data-shell="dom"] .hms-p-bar {
  margin-top: 22px; height: 8px; border-radius: 999px;
  background: #EDF1F7; overflow: hidden; position: relative;
}
body[data-shell="dom"] .hms-p-fill {
  height: 100%; width: 0%; border-radius: 999px; position: relative;
  background: linear-gradient(90deg, #2563EB, #3B82F6);
  transition: width .12s linear, background .25s;
}
body[data-shell="dom"] .hms-p-fill::after {
  content: ""; position: absolute; inset: 0; border-radius: 999px;
  background-image: linear-gradient(115deg,
    rgba(255,255,255,0) 0 42%, rgba(255,255,255,.34) 50%, rgba(255,255,255,0) 58% 100%);
  background-size: 220% 100%;
  animation: hms-progress-shimmer 1.7s linear infinite;
}
body[data-shell="dom"] .hms-ov.is-indeterminate .hms-p-fill { width: 35% !important; }
@keyframes hms-progress-shimmer {
  from { background-position: 220% 0; }
  to { background-position: -220% 0; }
}
body[data-shell="dom"] .hms-p-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 13px; font-size: 12.5px; color: #475569;
  font-variant-numeric: tabular-nums;
}
body[data-shell="dom"] .hms-p-stage {
  display: inline-flex; align-items: center; gap: 7px;
}
body[data-shell="dom"] .hms-p-stage::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: #2563EB;
  animation: hms-progress-pulse 1.5s ease-in-out infinite; flex: 0 0 auto;
}
@keyframes hms-progress-pulse {
  0%, 100% { opacity: .3; transform: scale(.75); }
  50% { opacity: 1; transform: scale(1); }
}
body[data-shell="dom"] .hms-p-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; padding-top: 13px; border-top: 1px solid #E7EBF1;
  font-size: 11.5px; color: #94A3B8;
}
body[data-shell="dom"] .hms-p-actions {
  display: flex; align-items: center; gap: 14px;
}
body[data-shell="dom"] .hms-p-link {
  background: none; border: 0; padding: 0; color: #475569;
  font-size: 11.5px; cursor: pointer; transition: color .15s;
}
body[data-shell="dom"] .hms-p-link:hover { color: #2563EB; }
body[data-shell="dom"] .hms-p-link[hidden] { display: none; }
body[data-shell="dom"] .hms-p-btn {
  height: 30px; padding: 0 16px; border-radius: 9px; border: 0;
  background: #2563EB; color: #fff; font-size: 12px; font-weight: 500;
  cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center;
}
body[data-shell="dom"] .hms-p-btn:hover { background: #1D4ED8; }
body[data-shell="dom"] .hms-p-btn[hidden] { display: none; }

body[data-shell="dom"] .hms-ov.is-done .hms-p-icon { background: #ECFDF5; color: #059669; }
body[data-shell="dom"] .hms-ov.is-done .hms-p-fill { background: linear-gradient(90deg, #059669, #10B981); }
body[data-shell="dom"] .hms-ov.is-done .hms-p-fill::after { animation: none; opacity: 0; }
body[data-shell="dom"] .hms-ov.is-done .hms-p-stage::before {
  background: #059669; animation: none; opacity: 1; transform: none;
}
body[data-shell="dom"] .hms-ov.is-done .hms-p-foot { display: none; }

body[data-shell="dom"] .hms-ov.is-error .hms-p-icon { background: #FEF2F2; color: #DC2626; }
body[data-shell="dom"] .hms-ov.is-error .hms-p-fill { background: linear-gradient(90deg, #EF4444, #F87171); }
body[data-shell="dom"] .hms-ov.is-error .hms-p-fill::after { animation: none; opacity: 0; }
body[data-shell="dom"] .hms-ov.is-error .hms-p-stage::before {
  background: #DC2626; animation: none; opacity: 1; transform: none;
}

body[data-shell="dom"] .hms-statusbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: 32px; z-index: 120;
  background: #FAFBFC; border-top: 1px solid #E7EBF1;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; font-size: 11.5px; color: #94A3B8;
}
body[data-shell="dom"] .hms-sb-left {
  display: flex; align-items: center; gap: 8px;
}
body[data-shell="dom"] .hms-sb-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #CBD5E1; flex: 0 0 auto;
}
body[data-shell="dom"] .hms-sb-dot.is-loading {
  background: #2563EB; animation: hms-progress-pulse 1.4s ease-in-out infinite;
}
body[data-shell="dom"] .hms-sb-dot.is-done { background: #059669; }
body[data-shell="dom"] .hms-sb-dot.is-error { background: #DC2626; }
body[data-shell="dom"] .hms-sb-bar {
  width: 72px; height: 5px; border-radius: 999px; background: #E2E8F0;
  overflow: hidden; display: none;
}
body[data-shell="dom"] .hms-sb-bar.show { display: inline-block; }
body[data-shell="dom"] .hms-sb-bar i {
  display: block; height: 100%; width: 0%; background: #2563EB;
  border-radius: 999px; transition: width .1s linear;
}
body[data-shell="dom"] .hms-sb-bar i.is-indeterminate {
  animation: hms-progress-slide 1.4s ease-in-out infinite;
}
body[data-shell="dom"] .hms-statusbar.clickable { cursor: pointer; }
body[data-shell="dom"] .hms-statusbar.clickable:hover { background: #F2F5F9; }

body[data-shell="dom"] .hms-toast {
  position: fixed; left: 50%; bottom: 56px; transform: translate(-50%, 8px);
  background: #0F172A; color: #fff; font-size: 12.5px; padding: 9px 16px;
  border-radius: 10px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 400;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .28); white-space: nowrap;
}
body[data-shell="dom"] .hms-toast.show { opacity: 1; transform: translate(-50%, 0); }
body.hms-task-locked { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  body[data-shell="dom"] .hms-p-fill,
  body[data-shell="dom"] .hms-hairline i,
  body[data-shell="dom"] .hms-sb-bar i,
  body[data-shell="dom"] .hms-p-fill::after,
  body[data-shell="dom"] .hms-p-stage::before,
  body[data-shell="dom"] .hms-sb-dot.is-loading,
  body[data-shell="dom"] .hms-hairline i.is-indeterminate,
  body[data-shell="dom"] .hms-sb-bar i.is-indeterminate { transition: none; animation: none; }
}
