:root {
  /* Procore：橙 / 黑 / 白 三色主调 */
  --app-bg: #ffffff;
  --rail-bg: #ffffff;
  --rail-active: #fff2eb;
  --rail-hover: #fff2eb;
  --white: #ffffff;
  --ink: #1a1a1a;
  --muted: #676767;
  --grid: #e8e8e8;
  --head-bg: #fafafa;
  --head-fg: #1a1a1a;
  --head-line: #e8e8e8;
  --row-line: #ededed;
  --select: #fff2eb;
  --alt: #ffffff;
  /* Procore Orange 50（品牌主色 / 主按钮）；全站复选框勾选态统一用此色 */
  --accent: #ff5100;
  --accent-hover: #e64900;
  --accent-soft: #fff2eb;
  --accent-tint: #ffdfd0;
  --accent-border: #ffb899;
  --pc-check: var(--accent);
  --nav: #ff5100;
  --icon-ink: #343739;
  --status-bg: #ffffff;
  --status-fg: #343739;
  --status-muted: #676767;
  --status-border: #e8e8e8;
  --ahead-bar: #d8efe4;
  --ahead-ink: #2a8f62;
  --delay-bar: #f5d6d6;
  --delay-ink: #c23b3b;
  --bar-edge: #7d8794;
  --font: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  --tool-sep: #e6e6e6;
  --rail-w: 48px;
  --toolbar-h: 48px;
  --status-h: 26px;
  --header-h: 48px;
  --row-h: 32px;
  --board-font: 13px;
  /* Procore CORE dialog tokens */
  --pc-ink: #1a1a1a;
  --pc-muted: #676767;
  --pc-border: #e8e8e8;
  --pc-border-strong: #d9d9d9;
  --pc-footer: #fafafa;
  --pc-overlay: rgba(26, 26, 26, 0.45);
  /* Cursor-like soft corners: dialogs ~12px, buttons ~8px */
  --pc-radius: 12px;
  --pc-btn-radius: 8px;
  /* 下拉触发框：与顶栏「计划」等 field-box 同圆角；弹出列表直角 */
  --pc-field-radius: var(--pc-btn-radius);
  --pc-pop-radius: 0;
  --pc-shadow: 0 8px 28px rgba(26, 26, 26, 0.18);
  --pc-title: 16px;
  --pc-body: 13px;
  --pc-hint: 12px;
  --pc-btn-h: 32px;
  /* 子窗口标题栏 / 底栏 chrome（配置、资源中心、自动排期、关系图、可开工等） */
  --pc-chrome-header-pad-y: 12px;
  --pc-chrome-header-pad-x: 20px;
  --pc-chrome-footer-pad-y: 12px;
  --pc-chrome-footer-pad-x: 20px;
  /* 12 + 32(按钮/最大化) + 12，标题栏与底栏同高 */
  --pc-chrome-header-h: 56px;
  --pc-chrome-footer-h: 56px;
  --pc-chrome-title-weight: 600;
  --pc-btn-weight: 600;
  /* 配置 / 资源中心 / 任务关系图 / 自动排期 等子页还原态统一尺寸 */
  --pc-subpage-w: min(1040px, calc(100vw - 40px));
  --pc-subpage-h: min(680px, calc(100vh - 40px));
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: var(--app-bg);
  user-select: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: #c9ced6;
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* ToolButton */
.tool-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 10px 0 8px;
  border: 0;
  border-radius: var(--pc-btn-radius);
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  white-space: nowrap;
  flex-shrink: 0;
}
.tool-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e23b3b;
  box-shadow: 0 0 0 1px #fff;
  pointer-events: none;
}
.tool-dot[hidden] {
  display: none !important;
}
.tool-btn:hover:not(:disabled) {
  background: var(--accent-soft);
  color: var(--ink);
}
.tool-btn:active:not(:disabled) {
  background: var(--accent-tint);
}
.tool-btn.danger {
  color: #c23b3b;
}
.tool-btn:disabled,
.tool-btn.disabled {
  opacity: 0.45;
  cursor: default;
}
.tool-btn img {
  display: block;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  object-fit: contain;
  opacity: 0.88;
  /* 统一成近黑色，悬停再染橙 */
  filter: brightness(0) saturate(100%);
  transition: filter 0.15s ease, opacity 0.15s ease;
}
.tool-btn:hover:not(:disabled) img {
  opacity: 1;
  filter: invert(36%) sepia(98%) saturate(2500%) hue-rotate(5deg) brightness(102%) contrast(107%);
}
.tool-btn.danger:hover:not(:disabled) img {
  filter: invert(28%) sepia(70%) saturate(1800%) hue-rotate(340deg) brightness(95%) contrast(95%);
}

/* PageHeader — Procore CORE DetailPage.Header 风格 */
.page-header {
  flex: 0 0 auto;
  margin: 0 0 12px;
  padding: 2px 0 10px;
  border-bottom: 1px solid var(--pc-border, #e6e6e6);
  background: transparent;
  box-sizing: border-box;
}
.page-header-row {
  display: flex;
  align-items: center;
  gap: 10px 12px;
  flex-wrap: wrap;
  min-height: 32px;
}
.page-header-leading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.page-header-title {
  margin: 0;
  flex: 0 0 auto;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--pc-ink, var(--ink));
  letter-spacing: 0;
}
.page-header-rule {
  display: none;
}
.page-header-meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  margin-left: auto;
  min-width: 0;
}
.page-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  margin-left: 0;
}
.page-header-meta + .page-header-actions {
  margin-left: 0;
}
.page-header-row:not(:has(.page-header-meta)) .page-header-actions {
  margin-left: auto;
}
.page-header-chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--pc-border, #e6e6e6);
  border-radius: 4px;
  background: var(--white, #fff);
  color: var(--pc-muted, var(--muted));
  font-size: 12px;
  line-height: 1;
  box-sizing: border-box;
  white-space: nowrap;
}

/* Shared page chrome */
.page {
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 0;
  background: var(--app-bg);
  box-sizing: border-box;
}
.page-pad {
  max-width: 1400px;
}
.empty-block {
  background: var(--white);
  border: 1px solid var(--grid);
  border-radius: 2px;
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
}
.empty-block strong {
  display: block;
  color: var(--ink);
  margin-bottom: 6px;
}
.banner-warn {
  background: #fdecea;
  border: 1px solid #f3c4c0;
  border-radius: 2px;
  padding: 10px 12px;
  margin-bottom: 12px;
  color: #c23b3b;
  font-weight: 700;
  font-size: 13px;
}
.section-title {
  margin: 16px 0 10px;
  font-size: 15px;
  font-weight: 700;
}
.section-title.warn {
  color: #c23b3b;
}
.board-card {
  background: var(--white);
  border: 1px solid var(--grid);
  border-radius: 2px;
  margin-bottom: 10px;
  overflow: hidden;
}
.board-card-head {
  padding: 10px 12px 6px;
  font-weight: 700;
  font-size: 14px;
}
.task-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-top: 1px solid var(--row-line);
}
.task-line:hover {
  background: var(--select);
}
.task-line .name {
  font-size: 13px;
  font-weight: 600;
}
.task-line .meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}
.task-line .right {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.tile {
  background: var(--white);
  border: 1px solid var(--grid);
  border-radius: 2px;
  padding: 10px 12px 12px;
}
.tile .label { color: var(--muted); font-size: 13px; }
.tile .value { margin-top: 2px; font-size: 28px; font-weight: 700; line-height: 1.1; }
.tile .hint { margin-top: 4px; color: var(--muted); font-size: 12px; }
.panel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.panel {
  background: var(--white);
  border: 1px solid var(--grid);
  border-radius: 2px;
  padding: 10px 12px 12px;
  min-height: 180px;
}
.panel h3 { margin: 0 0 10px; font-size: 14px; font-weight: 700; }
.panel.span-2 { grid-column: span 2; }
.work-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.work-card {
  background: var(--white);
  border: 1px solid var(--grid);
  border-radius: 2px;
  padding: 12px;
}
.work-card.warn { border-color: #f3c4c0; background: #fff8f7; }
.work-card .title { font-weight: 700; font-size: 14px; }
.work-card .meta { margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.work-card .progress-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.work-card .progress-row input {
  width: 64px;
  height: 28px;
  border: 1px solid var(--grid);
  border-radius: 6px;
  padding: 0 8px;
  text-align: center;
}
.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}
.cal-toolbar button {
  width: 36px; height: 36px; border: 0; background: transparent; font-size: 22px; color: var(--ink);
}
.cal-toolbar .title {
  min-width: 140px; text-align: center; font-size: 22px; font-weight: 700;
}
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px;
  margin-bottom: 1px; background: var(--grid); border: 1px solid var(--grid);
}
.cal-weekdays span {
  background: var(--head-bg); text-align: center; padding: 8px 0; color: var(--muted); font-size: 12px;
}
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px;
  background: var(--grid); border: 1px solid var(--grid);
}
.cal-cell {
  min-height: 96px; background: var(--white); padding: 8px; border: 0; text-align: left; color: inherit;
}
.cal-cell.out { background: #f7f8fa; color: #a8b3bd; }
.cal-cell.today .daynum { color: var(--accent); font-weight: 700; }
.cal-cell .daynum { font-size: 13px; margin-bottom: 6px; }
.cal-cell .task {
  font-size: 11px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px;
}
.sys-dialog {
  max-width: 560px; background: var(--white); border: 1px solid var(--grid); border-radius: 2px; padding: 4px 0;
}
.sys-row {
  display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: start;
  padding: 14px 18px; border-bottom: 1px solid var(--row-line);
}
.sys-row:last-child { border-bottom: 0; }
.sys-row .label { font-weight: 400; padding-top: 2px; }
.sys-row .body { display: grid; gap: 8px; }
.sys-row .hint { color: var(--muted); font-size: 12px; }
.sys-checks label, .sys-colors label {
  display: inline-flex; align-items: center; gap: 8px; margin-right: 16px; font-size: 13px;
}
.users-split { display: grid; gap: 16px; }
.users-panel {
  background: var(--white); border: 1px solid var(--grid); border-radius: 2px; overflow: hidden;
}
.users-panel h3 {
  margin: 0; padding: 10px 12px; background: var(--head-bg); font-size: 13px; border-bottom: 1px solid var(--head-line);
}
.file-table {
  width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--grid);
}
.file-table th, .file-table td {
  text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--row-line); font-size: 13px;
}
.file-table th { background: var(--head-bg); }
.chat-page {
  height: 100%; display: flex; flex-direction: column; padding: 0; min-height: 0;
}
.chat-layout {
  flex: 1; min-height: 0; display: grid; grid-template-columns: 240px 1fr;
  border: 1px solid var(--grid); background: var(--white); overflow: hidden;
}
.chat-left { border-right: 1px solid var(--grid); overflow: auto; }
.chat-left button {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--row-line);
  background: transparent; padding: 12px; color: var(--ink);
}
.chat-left button.active { background: var(--select); }
.chat-name {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dot-on { width: 8px; height: 8px; border-radius: 50%; background: #2a8f62; flex: 0 0 auto; }
.chat-unread {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.chat-right { display: flex; flex-direction: column; min-height: 0; }
.chat-thread {
  flex: 1; overflow: auto; padding: 16px; display: grid; gap: 8px; align-content: start;
}
.bubble {
  max-width: 70%; padding: 8px 10px; border-radius: 8px; background: #eef1f5; font-size: 13px; line-height: 1.45;
}
.bubble.mine { justify-self: end; background: var(--accent-tint, #ffdfd0); }
.chat-composer {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--grid);
}
.table-lite { width: 100%; border-collapse: collapse; background: var(--white); }
.table-lite th, .table-lite td {
  border-bottom: 1px solid var(--row-line); text-align: left; padding: 8px 10px; font-size: 13px;
}
.table-lite th { background: var(--head-bg); }
.swatch {
  display: inline-block; width: 16px; height: 16px; border-radius: 4px;
  border: 1px solid var(--grid); vertical-align: middle; margin-right: 6px;
}
@media (max-width: 1100px) {
  .tile-grid, .panel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel.span-2 { grid-column: span 2; }
}

/* ========== Procore CORE–aligned dialogs & buttons ========== */
.pc-btn,
.users-btn,
.file-btn,
.sys-btn,
.file-dialog-btn,
.chat-dialog-actions button,
.chat-primary,
.graph-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--pc-btn-h);
  min-width: 72px;
  padding: 0 16px;
  border: 1px solid var(--pc-border-strong);
  border-radius: var(--pc-btn-radius);
  background: var(--white);
  color: var(--pc-ink);
  font-family: var(--font);
  font-size: var(--pc-body);
  font-weight: var(--pc-btn-weight, 600);
  line-height: 1;
  cursor: pointer;
  box-sizing: border-box;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.pc-btn:hover,
.users-btn:hover,
.file-btn:hover,
.sys-btn:hover,
.file-dialog-btn:hover,
.chat-dialog-actions button:hover,
.graph-refresh:hover {
  background: #fafafa;
  border-color: #cfcfcf;
}

.pc-btn:active,
.users-btn:active,
.file-btn:active,
.sys-btn:active,
.file-dialog-btn:active,
.chat-dialog-actions button:active,
.graph-refresh:active {
  background: #f0f0f0;
  border-color: #c5c5c5;
  transform: scale(0.97);
}

.pc-btn:disabled,
.users-btn:disabled,
.file-btn:disabled,
.sys-btn:disabled,
.file-dialog-btn:disabled,
.graph-refresh:disabled {
  opacity: 0.45;
  cursor: default;
}

.pc-btn.primary,
.users-btn.primary,
.file-btn.primary,
.sys-btn.primary,
.file-dialog-btn.primary,
.chat-dialog-actions button.primary,
.chat-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pc-btn.primary:hover,
.users-btn.primary:hover,
.file-btn.primary:hover,
.sys-btn.primary:hover,
.file-dialog-btn.primary:hover,
.chat-dialog-actions button.primary:hover,
.chat-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.pc-btn.primary:active,
.users-btn.primary:active,
.file-btn.primary:active,
.sys-btn.primary:active,
.file-dialog-btn.primary:active,
.chat-dialog-actions button.primary:active,
.chat-primary:active {
  background: #e64900;
  border-color: #e64900;
  color: #fff;
  transform: scale(0.97);
}

.pc-btn.danger,
.users-btn.danger,
.file-btn.danger {
  color: var(--delay-ink);
  border-color: #e8b4b4;
}

.pc-btn.danger:hover,
.users-btn.danger:hover,
.file-btn.danger:hover {
  background: #fff5f5;
}

.pc-btn img,
.users-btn img,
.graph-refresh img {
  display: block;
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.pc-overlay,
.users-modal,
.users-submodal,
.file-modal,
.chat-modal,
.file-dialog-overlay,
.close-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--pc-overlay);
  display: grid;
  place-items: center;
  padding: 20px;
  box-sizing: border-box;
  overflow: auto;
}

.pc-overlay[data-app-dialog] {
  z-index: 200;
}

.users-modal[hidden],
.file-modal[hidden],
.chat-modal[hidden] {
  display: none !important;
}

/* 高于团队选人弹层（.users-submodal z-index:80），便于从选人页打开「添加用户」 */
.users-modal:not([hidden]) {
  z-index: 130;
}

.pc-dialog,
.users-dialog,
.file-box,
.chat-dialog,
.file-dialog,
.close-card {
  width: min(440px, 100%);
  max-height: min(86vh, 640px);
  background: var(--white);
  border: 1px solid var(--pc-border);
  border-radius: var(--pc-radius);
  box-shadow: var(--pc-shadow);
  color: var(--pc-ink);
  font-family: var(--font);
  font-size: var(--pc-body);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  padding: 0;
  margin: auto;
}

.users-dialog.wide,
.file-box.wide,
.pc-dialog.wide,
.dept-dialog,
.appr-dialog {
  width: min(760px, 100%);
  max-height: min(88vh, 720px);
}

.users-dialog.compact {
  width: min(320px, 100%);
}

.pc-dialog-header,
.pc-dialog > h2,
.users-dialog > h2,
.file-box > h2,
.chat-dialog > h2,
.file-dialog-title,
.close-card .close-title {
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  margin: 0;
  min-height: var(--pc-chrome-header-h, 48px);
  padding: var(--pc-chrome-header-pad-y, 12px) var(--pc-chrome-header-pad-x, 20px);
  font-size: var(--pc-title);
  font-weight: var(--pc-chrome-title-weight, 600);
  line-height: 1.25;
  color: var(--pc-ink);
  letter-spacing: 0;
  border-bottom: 1px solid var(--pc-border);
  flex: 0 0 auto;
}

.pc-dialog-body,
.file-dialog-body,
.chat-dialog .chat-dialog-body,
.close-card .close-body {
  padding: 14px 20px 12px;
  overflow: auto;
  min-height: 0;
  flex: 1 1 auto;
  font-size: var(--pc-body);
  line-height: 1.45;
  color: var(--pc-ink);
}

.pc-dialog.ready-dialog > .pc-dialog-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 6px;
}

.users-dialog > *:not(h2):not(.users-dialog-actions),
.file-box > *:not(h2):not(.file-box-actions) {
  margin-left: 20px;
  margin-right: 20px;
}

.users-dialog > h2 + *,
.file-box > h2 + * {
  margin-top: 14px;
}

.users-dialog > .users-dialog-actions + *,
.file-box > .file-box-actions + * {
  margin-top: 0;
}

.file-dialog-section {
  font-size: var(--pc-body);
  font-weight: 700;
  color: var(--pc-ink);
  margin: 12px 0 8px;
}

.file-dialog-body > .file-dialog-section:first-child {
  margin-top: 0;
}

.file-dialog-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--pc-body);
  color: var(--pc-ink);
  margin: 6px 0;
  cursor: pointer;
}

.file-dialog-row select,
.file-dialog-row input[type="text"] {
  flex: 1;
  min-width: 0;
  height: 30px;
  border: 1px solid var(--pc-border-strong);
  border-radius: var(--pc-field-radius, var(--pc-btn-radius));
  background: var(--white);
  padding: 0 8px;
  font: inherit;
  font-size: var(--pc-body);
  color: var(--pc-ink);
}

.file-dialog-tip,
.users-hint,
.close-card .close-text {
  font-size: var(--pc-hint);
  line-height: 1.5;
  color: var(--pc-muted);
  margin: 10px 0 4px;
}

.close-card .close-text {
  margin-top: 0;
  font-size: var(--pc-body);
}

.close-card .close-remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: var(--pc-body);
  color: var(--pc-ink);
  cursor: pointer;
}

.users-form-row input,
.users-form-row select,
.file-form-row input,
.file-form-row select,
.chat-dialog input[type="text"] {
  height: 30px;
  border: 1px solid var(--pc-border-strong);
  border-radius: var(--pc-field-radius, var(--pc-btn-radius));
  background: var(--white);
  padding: 0 8px;
  font: inherit;
  font-size: var(--pc-body);
  color: var(--pc-ink);
  box-sizing: border-box;
}

.chat-dialog input[type="text"] {
  width: 100%;
  outline: none;
  margin-bottom: 10px;
}

.chat-dialog input[type="text"]:focus {
  border-color: var(--accent);
}

.pc-dialog-actions,
.users-dialog-actions,
.file-dialog-actions,
.file-box-actions,
.chat-dialog-actions,
.close-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  box-sizing: border-box;
  margin: 0;
  margin-left: 0 !important;
  margin-right: 0 !important;
  min-height: var(--pc-chrome-footer-h, 56px);
  padding: var(--pc-chrome-footer-pad-y, 12px) var(--pc-chrome-footer-pad-x, 20px);
  background: var(--pc-footer);
  border-top: 1px solid var(--pc-border);
  flex: 0 0 auto;
}

.pc-dialog-actions.with-meta {
  justify-content: space-between;
}

.pc-dialog-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.pc-dialog-footer-meta {
  color: var(--pc-muted);
  font-size: var(--pc-hint);
  line-height: 1.4;
  min-width: 0;
  margin-right: auto;
}

.users-dialog-actions.spread {
  justify-content: space-between;
}

.users-dialog-actions.spread > div {
  display: flex;
  gap: 8px;
}

/* popovers share CORE chrome */
.plan-date-pop {
  border-radius: var(--pc-radius) !important;
  border-color: var(--pc-border) !important;
  box-shadow: var(--pc-shadow) !important;
  color: var(--pc-ink);
  font-size: var(--pc-body);
}

.cal-today {
  height: var(--pc-btn-h) !important;
  border-radius: var(--pc-btn-radius) !important;
  border: 1px solid var(--pc-border-strong) !important;
  font-weight: 600 !important;
  font-size: var(--pc-body) !important;
}

.choice-filter-pop {
  border-radius: var(--pc-pop-radius, 0);
  border-color: var(--pc-border);
  box-shadow: var(--pc-shadow);
  font-size: var(--pc-body);
}

/* 原生复选框 / 单选：勾选色统一为 Procore Orange 50（与主按钮一致） */
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--pc-check, var(--accent, #ff5100));
}

/* 全站表单控件圆角统一（对齐顶栏计划等 field-box = 8px） */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]),
textarea,
select:not([multiple]),
.field-box,
.sys-select,
.sys-input,
.sys-path,
.sys-field-with-btn,
.sys-text-btn,
.sys-cfg-reset,
.hm-weeks,
.plan-combo-search-input,
.task-detail-control,
.task-detail-combo,
.task-detail-action,
.pc-picker-search,
.users-add-row input,
.users-add-row select,
.users-add-pwd,
.dept-card .appr-field select,
.appr-preview select,
.tool-btn,
.icon-btn,
.file-tab,
.auto-save {
  border-radius: var(--pc-field-radius, var(--pc-btn-radius));
}

/* 弹出的选项列表：不倒圆角 */
.choice-filter-pop,
.plan-pick-pop,
.topbar-select-pop,
.plan-combo-pop,
.file-menu,
.user-menu,
.mini-menu,
.gantt-scale-pop,
.appr-pick {
  border-radius: var(--pc-pop-radius, 0) !important;
}

.pc-dialog-lead {
  margin: 0 0 8px;
  font-size: var(--pc-body);
  line-height: 1.45;
  color: var(--pc-ink);
}

.pc-radio-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 10px;
  font-size: var(--pc-body);
  line-height: 1.4;
  color: var(--pc-ink);
  cursor: pointer;
}

.pc-radio-row input {
  margin-top: 2px;
}

.pc-radio-row.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pc-dialog-list {
  border: 1px solid var(--pc-border);
  border-radius: var(--pc-radius);
  background: #fafafa;
  max-height: 280px;
  overflow: auto;
  margin: 0;
}

.pc-dialog-list-row {
  padding: 7px 10px;
  border-bottom: 1px solid var(--pc-border);
  font-size: var(--pc-body);
  line-height: 1.4;
  color: var(--pc-ink);
  word-break: break-all;
}

.pc-dialog-list-row:last-child {
  border-bottom: 0;
}

.pc-dialog.picker-dialog {
  width: min(480px, 100%);
  max-height: min(88vh, 640px);
}

.pc-picker-search {
  width: 100%;
  height: 32px;
  margin: 0 0 10px;
  padding: 0 10px;
  border: 1px solid var(--pc-border-strong);
  border-radius: var(--pc-radius);
  background: var(--white);
  color: var(--pc-ink);
  font: inherit;
  font-size: var(--pc-body);
  outline: none;
  box-sizing: border-box;
}

.pc-picker-search:focus {
  border-color: var(--accent);
}

.pc-picker-hint {
  margin: 0 0 8px;
  font-size: var(--pc-hint);
  color: var(--pc-muted);
}

.pc-picker-list {
  border: 1px solid var(--pc-border);
  border-radius: var(--pc-radius);
  background: var(--white);
  max-height: min(52vh, 420px);
  overflow: auto;
  min-height: 160px;
}

.pc-picker-group {
  padding: 8px 10px 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--pc-muted);
  letter-spacing: 0.04em;
  background: var(--pc-footer);
  border-bottom: 1px solid var(--pc-border);
  position: sticky;
  top: 0;
  z-index: 1;
}

.pc-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid var(--pc-border);
  border-radius: 0;
  background: transparent;
  color: var(--pc-ink);
  font: inherit;
  font-size: var(--pc-body);
  font-weight: 400;
  text-align: left;
  min-width: 0;
  min-height: 36px;
  height: auto;
  cursor: pointer;
  box-sizing: border-box;
}

.pc-picker-item:last-child {
  border-bottom: 0;
}

.pc-picker-item:hover {
  background: #f7f7f7;
}

.pc-picker-item.is-on {
  background: var(--select);
}

.pc-picker-item-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pc-picker-item-mark {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.pc-picker-empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--pc-muted);
  font-size: var(--pc-body);
}

.pc-dialog.review-dialog {
  width: 520px;
  max-width: 92vw;
}

.pc-review-status {
  margin: 0 0 10px;
  font-size: var(--pc-body);
  color: var(--pc-ink);
}

.pc-review-status b {
  font-weight: 600;
}

.pc-review-step {
  padding: 8px 10px;
}

.pc-review-step-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.pc-review-step-title {
  font-weight: 600;
}

.pc-review-step-state {
  font-size: var(--pc-hint);
  color: var(--pc-muted);
  flex: 0 0 auto;
}

.pc-review-step.is-current .pc-review-step-state {
  color: #c47a20;
}

.pc-review-step.is-done .pc-review-step-state {
  color: var(--ahead-ink, #2a8f62);
}

.pc-review-step.is-reject .pc-review-step-state {
  color: var(--delay-ink, #c23b3b);
}

.pc-review-reason {
  margin: 0 0 10px;
  padding: 8px 10px;
  background: #fdecea;
  border: 1px solid #f3c4c0;
  border-radius: var(--pc-radius);
  color: #c23b3b;
  font-size: var(--pc-body);
  line-height: 1.45;
  white-space: pre-wrap;
}

.pc-review-step-people {
  margin-top: 4px;
  color: var(--pc-muted);
  font-size: var(--pc-hint);
}

.pc-review-log-title {
  margin: 12px 0 6px;
  font-size: var(--pc-hint);
  color: var(--pc-muted);
}

.pc-review-backup-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}

.pc-review-backup-head {
  font-size: 12px;
  color: var(--pc-muted, #707070);
}

.pc-review-backup-file {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pc-review-backup-file.muted {
  color: var(--pc-muted, #707070);
  font-size: 12px;
}

.pc-review-backup-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pc-review-backup-file .pc-btn {
  flex: 0 0 auto;
  height: 28px;
  padding: 0 10px;
}

.pc-review-log-row {
  font-size: var(--pc-hint);
  color: var(--pc-ink);
}

.pc-dialog.ready-dialog {
  width: min(720px, calc(100vw - 40px));
  height: auto;
  max-height: var(--pc-subpage-h, min(680px, calc(100vh - 40px)));
  display: flex;
  flex-direction: column;
}

.pc-dialog.ready-dialog > .pc-dialog-header,
.pc-dialog.ready-dialog > .pc-dialog-actions {
  flex: 0 0 auto;
}

.ready-dialog-body {
  border: 1px solid var(--pc-border);
  border-radius: 0;
  background: #fafafa;
  max-height: min(52vh, 420px);
  overflow: auto;
  margin-top: 0;
}

.ready-section {
  padding: 10px 12px 6px;
}

.ready-section-title {
  font-size: var(--pc-body);
  font-weight: 700;
  margin-bottom: 6px;
}

.ready-section-title.ready {
  color: var(--ahead-ink);
}

.ready-section-title.blocked {
  color: var(--delay-ink);
}

.ready-empty {
  padding: 8px 4px 12px;
  font-size: var(--pc-body);
  color: var(--pc-muted);
}

.ready-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border-top: 1px solid var(--pc-border);
  cursor: pointer;
  font-size: var(--pc-body);
  background: var(--white);
}

.ready-row:hover {
  background: #f2f4f7;
}

.ready-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.ready-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--pc-muted);
  font-size: var(--pc-hint);
}

.ready-wait {
  color: var(--delay-ink);
  font-size: var(--pc-hint);
  white-space: nowrap;
}

.pc-dialog.users-app-dialog {
  width: fit-content;
  max-width: min(92vw, 560px);
  min-width: 0;
  height: min(88vh, 720px);
  max-height: min(88vh, 720px);
}

.pc-dialog.users-app-dialog > .users-app-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px 16px 8px;
  min-height: 0;
  flex: 1 1 auto;
}

.pc-dialog.tool-embed-dialog {
  width: var(--pc-subpage-w);
  height: var(--pc-subpage-h);
  max-height: none;
}

/* 子页面「最大化」：仍在主窗口内，铺满整个页面 */
.pc-overlay.is-page-max {
  padding: 0;
  place-items: stretch;
  overflow: hidden;
}

.pc-overlay.is-page-max > .pc-dialog {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
}

.pc-overlay.is-page-max > .pc-dialog > .pc-dialog-header,
.pc-overlay.is-page-max > .pc-dialog > .pc-dialog-actions,
.pc-overlay.is-page-max > .pc-dialog > h2 {
  flex: 0 0 auto;
}

.pc-overlay.is-page-max > .pc-dialog > .pc-dialog-body {
  flex: 1 1 auto;
  min-height: 0;
}

.pc-dialog.tool-embed-dialog.sched-embed > .pc-dialog-header,
.pc-dialog.tool-embed-dialog.sched-embed > .pc-dialog-actions {
  flex: 0 0 auto;
}

.pc-dialog.tool-embed-dialog.sched-embed > .pc-dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.pc-dialog.help-dialog {
  width: var(--pc-subpage-w);
  height: var(--pc-subpage-h);
  max-height: var(--pc-subpage-h);
}

.close-remember {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: var(--pc-body);
  color: var(--pc-ink);
  cursor: pointer;
}

.pc-dialog-header.with-popout {
  /* 与统一标题栏同高、同内边距；右侧留给最大化钮 */
  padding-right: 16px;
}

.pc-dialog-header-title,
.pc-dialog-header.with-popout .pc-dialog-header-title {
  flex: 1;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
  font-size: var(--pc-title);
  font-weight: var(--pc-chrome-title-weight, 600);
  color: var(--pc-ink);
  line-height: 1.25;
}

.pc-dialog-popout {
  flex: 0 0 auto;
  width: var(--pc-btn-h, 32px);
  height: var(--pc-btn-h, 32px);
  border: 0;
  border-radius: var(--pc-btn-radius);
  background: transparent;
  color: var(--pc-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.pc-dialog-popout:hover {
  background: var(--pc-footer);
  color: var(--pc-ink);
}

.pc-dialog-popout:active {
  background: #e8e8e8;
  color: var(--pc-ink);
  transform: scale(0.92);
}

.pc-dialog-popout svg {
  display: block;
}

.pc-dialog.tool-embed-dialog > .pc-dialog-body {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}

.tool-embed-host {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: var(--app-bg);
}

.tool-embed-host .graph-shell,
.tool-embed-host .file-shell {
  height: 100%;
  box-sizing: border-box;
}

.tool-embed-host .file-shell {
  padding: 0;
}

.tool-embed-host .file-body,
.tool-embed-host .file-main {
  min-height: 0;
}

.tool-embed-host .file-modal {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.users-dialog-shell.users-shell {
  height: 100%;
  flex: 1;
  min-height: 0;
  padding: 14px 20px 12px;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.users-dialog-shell .users-layout {
  flex: 1 1 auto;
  min-height: 0;
}

.users-dialog-shell .users-list-box,
.users-dialog-shell .users-admin-box,
.users-dialog-shell .users-head {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.users-dialog-shell .users-toolbar {
  width: 100%;
  min-width: 0;
}

.users-dialog-shell .users-toolbar,
.users-dialog-shell .users-footer {
  flex: 0 0 auto;
}

.pc-overlay[data-users-dialog] > .users-modal {
  z-index: 90;
}

.pc-progress-track {
  height: 8px;
  border-radius: 4px;
  background: var(--pc-border);
  overflow: hidden;
  margin: 12px 0 4px;
}

.pc-progress-track i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.18s linear;
}

/* 等待窗：不确定进度时条带缓缓来回 */
.pc-progress-track.is-indeterminate i {
  width: 36% !important;
  transition: none;
  animation: pc-progress-indeterminate 1.1s ease-in-out infinite;
}

@keyframes pc-progress-indeterminate {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

.person-gone {
  color: #c23b3b;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
