:root {
  --bg: #eef5fb;
  --panel: #ffffff;
  --panel-soft: #f6fafe;
  --text: #142536;
  --muted: #637889;
  --line: #d4e2ec;
  --primary: #2f6fa8;
  --primary-dark: #245b8c;
  --primary-soft: #eaf4ff;
  --accent: #087f73;
  --accent-soft: #e4f4f1;
  --danger: #cf3a42;
  --warning: #c59a21;
  --shadow: 0 18px 42px rgba(46, 85, 120, 0.09);
  --soft-shadow: 0 8px 22px rgba(46, 85, 120, 0.055);
}

/* v650 管理后台：员工、业务组、角色权限统一工作台 */
.admin-page > .page-card {
  width: 100%;
  max-width: none;
  padding: 0;
  overflow: hidden;
  background: #f5f9fd;
  border-color: #cbddea;
  border-radius: 12px;
}

.admin-super-banner {
  margin: 16px 18px 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #286498;
  background: #eef7ff;
  border: 1px solid #c7def0;
  border-radius: 8px;
  font-size: 12px;
}

.admin-super-banner strong {
  font-size: 12px;
}

.admin-super-banner span {
  color: #6b8194;
}

.admin-page .admin-subtabs {
  width: 100%;
  margin: 0;
  padding: 0 20px;
  display: flex;
  gap: 30px;
  overflow-x: auto;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #d8e5ee;
  border-radius: 0;
}

.admin-page .admin-subtab {
  min-height: 54px;
  padding: 0 2px;
  position: relative;
  flex: 0 0 auto;
  color: #536b7f;
  background: transparent;
  border: 0;
  font-size: 14px;
  font-weight: 800;
}

.admin-page .admin-subtab::after {
  content: "";
  height: 3px;
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  background: transparent;
  border-radius: 3px 3px 0 0;
}

.admin-page .admin-subtab.active {
  color: #1d66a8;
  background: transparent;
}

.admin-page .admin-subtab.active::after {
  background: #2f79ba;
}

.admin-page .admin-subpanel {
  padding: 18px;
}

.admin-workspace-head {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.admin-workspace-head h2 {
  margin: 1px 0 3px;
  color: #142b3e;
  font-size: 22px;
}

.admin-workspace-head span {
  color: #6a8194;
  font-size: 12px;
}

.admin-new-user-panel,
.business-group-create {
  margin-bottom: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid #ccddea;
  border-radius: 9px;
}

.admin-new-user-panel[hidden],
.business-group-create[hidden],
.role-create-panel[hidden] {
  display: none !important;
}

.admin-page .admin-create-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
  gap: 9px;
  align-items: end;
}

.admin-page .admin-create-panel label,
.role-create-panel label,
.business-group-create label {
  display: grid;
  gap: 4px;
  color: #647c90;
  font-size: 11px;
  font-weight: 800;
}

.admin-employee-toolbar {
  margin-bottom: 10px;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(120px, 0.75fr)) auto;
  gap: 8px;
  background: #fff;
  border: 1px solid #ccddea;
  border-radius: 9px;
}

.admin-employee-toolbar input,
.admin-employee-toolbar select,
.admin-page .admin-create-panel input,
.admin-page .admin-create-panel select,
.business-group-create input,
.business-group-create select {
  min-height: 36px;
  padding: 0 10px;
  background: #fff;
  border: 1px solid #c8d9e6;
  border-radius: 7px;
  color: #1d3548;
  font-size: 12px;
}

.admin-inline-status {
  min-height: 22px;
  color: #60788b;
  font-size: 12px;
  text-align: right;
}

.admin-inline-status[data-type="saving"] { color: #2f6fa8; }
.admin-inline-status[data-type="success"] { color: #087f73; }
.admin-inline-status[data-type="error"] { color: #c73640; }

.admin-employee-count {
  margin: 0 0 6px;
  color: #60778a;
  font-size: 12px;
}

.admin-page .user-table {
  width: 100%;
  min-width: 1180px;
  max-height: 70vh;
  overflow: auto;
  border: 1px solid #cbddea;
  border-radius: 9px;
  box-shadow: 0 6px 20px rgba(48, 83, 114, 0.04);
}

.admin-page .user-table-head,
.admin-page .user-table-row {
  grid-template-columns: minmax(190px, 1.35fr) 88px 130px 126px 126px 94px minmax(130px, 0.8fr) minmax(210px, 1.3fr);
  min-height: 54px;
  padding: 7px 10px;
  gap: 8px;
  font-size: 12px;
}

.admin-page .user-table-head {
  min-height: 38px;
  color: #49667e;
  background: #edf5fb;
}

.admin-page .user-table-row:hover {
  background: #f8fcff;
}

.admin-page .user-table-row select {
  width: 100%;
  min-height: 32px;
  color: #25445c;
  background: #fbfdff;
  border-color: #cbddea;
}

.admin-page .user-table-row select:focus {
  border-color: #2f79ba;
  box-shadow: 0 0 0 2px rgba(47, 121, 186, 0.12);
}

.admin-user-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.admin-user-identity > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.admin-user-identity strong,
.admin-user-identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-identity small {
  color: #7a8f9f;
  font-size: 10px;
}

.admin-user-avatar {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  color: #fff;
  background: #2f79ba;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 900;
}

.admin-permission-summary {
  min-width: 0;
  padding: 4px 8px;
  display: grid;
  justify-items: start;
  color: #235f94;
  background: #eef7ff;
  border: 1px solid #cae0f0;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.admin-permission-summary small {
  color: #73899a;
  font-size: 9px;
  font-weight: 600;
}

.admin-permission-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 12px;
}

.admin-role-sidebar,
.admin-permission-main,
.business-group-sidebar,
.business-group-main {
  background: #fff;
  border: 1px solid #cadce9;
  border-radius: 9px;
}

.admin-role-sidebar {
  padding: 12px;
}

.admin-role-sidebar-head,
.business-group-sidebar-title {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.role-create-panel {
  margin-bottom: 9px;
  padding: 8px;
  display: grid;
  gap: 7px;
  background: #f2f8fd;
  border: 1px solid #d2e2ed;
  border-radius: 8px;
}

#roleTemplateList {
  display: grid;
  gap: 7px;
}

.role-template-card {
  width: 100%;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 10px;
  color: #213c52;
  background: #fff;
  border: 1px solid #d1e0eb;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
}

.role-template-card strong { font-size: 13px; }
.role-template-card span { grid-column: 1 / -1; color: #718798; font-size: 10px; }
.role-template-card small { grid-column: 2; grid-row: 1; color: #8497a6; font-size: 9px; }
.role-template-card.active { color: #1f69aa; background: #f0f7fd; border-color: #6da7d4; box-shadow: inset 3px 0 0 #2f79ba; }

.admin-permission-main {
  overflow: hidden;
}

.permission-template-head {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #d7e4ed;
}

.permission-template-head h2 { margin: 1px 0 3px; color: #153049; font-size: 22px; }
.permission-template-head span { color: #74899a; font-size: 11px; }
.permission-scope { display: flex; align-items: end; gap: 10px; }
.permission-scope label { display: grid; gap: 4px; color: #60788c; font-size: 10px; font-weight: 800; }
.permission-scope select { min-width: 190px; min-height: 34px; }
.permission-save-indicator { color: #087f73 !important; }

.permission-protected-note {
  margin: 12px 18px 0;
  padding: 9px 12px;
  color: #286498;
  background: #eef7ff;
  border: 1px solid #c9e0f1;
  border-radius: 7px;
  font-size: 11px;
}

.permission-groups {
  padding: 12px 18px 18px;
  display: grid;
  gap: 10px;
}

.permission-group-section {
  overflow: hidden;
  border: 1px solid #cfdeea;
  border-radius: 8px;
}

.permission-group-section > header {
  padding: 10px 12px;
  background: #f8fbfe;
  border-bottom: 1px solid #d8e5ee;
}

.permission-group-section > header > div { display: flex; align-items: center; gap: 8px; }
.permission-group-section > header strong { color: #1f3d55; font-size: 13px; }
.permission-group-section > header span { color: #8294a3; font-size: 10px; }

.permission-setting-row {
  min-height: 48px;
  padding: 7px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 9px;
  align-items: center;
  border-bottom: 1px solid #e4edf3;
  cursor: pointer;
}

.permission-setting-row:last-child { border-bottom: 0; }
.permission-setting-row > input { position: absolute; opacity: 0; pointer-events: none; }
.permission-setting-copy { display: grid; gap: 2px; }
.permission-setting-copy strong { color: #27455d; font-size: 12px; }
.permission-setting-copy small { color: #7c8f9e; font-size: 10px; }
.permission-switch { width: 34px; height: 19px; position: relative; background: #cbd7e0; border-radius: 999px; transition: 0.2s ease; }
.permission-switch::after { content: ""; width: 15px; height: 15px; position: absolute; top: 2px; left: 2px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(25, 52, 75, 0.25); transition: 0.2s ease; }
.permission-setting-row > input:checked ~ .permission-switch { background: #0b8b79; }
.permission-setting-row > input:checked ~ .permission-switch::after { transform: translateX(15px); }
.permission-setting-row > input:focus-visible ~ .permission-switch { outline: 2px solid #2f79ba; outline-offset: 2px; }
.permission-setting-row:has(input:disabled) { cursor: not-allowed; opacity: 0.82; }

.personal-permission-section {
  margin: 0 18px 18px;
  padding: 13px;
  background: #f8fbfe;
  border: 1px solid #cfdfeb;
  border-radius: 8px;
}

.personal-permission-head {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.personal-permission-head h3 { margin: 0 0 2px; color: #203d54; font-size: 14px; }
.personal-permission-head span { color: #7c8f9e; font-size: 10px; }
.personal-permission-head select { min-width: 220px; min-height: 34px; }
.personal-permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
.personal-permission-grid label { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 8px; align-items: center; color: #49657a; font-size: 10px; }
.personal-permission-grid select { min-height: 30px; font-size: 10px; }
.permission-delete-role { margin: 0 18px 18px; }

.business-group-create {
  grid-template-columns: minmax(220px, 1fr) 150px auto;
  gap: 8px;
}

.business-group-create:not([hidden]) { display: grid; }
.business-group-workspace { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 12px; }
.business-group-sidebar { padding: 12px; }
.business-group-sidebar-title span { color: #7a8f9f; font-size: 10px; }
.business-group-card { width: 100%; margin-top: 7px; padding: 12px; display: grid; gap: 4px; color: #29465c; background: #fff; border: 1px solid #d0dfeb; border-radius: 8px; text-align: left; cursor: pointer; }
.business-group-card strong { font-size: 14px; }
.business-group-card span, .business-group-card small { color: #74899a; font-size: 10px; }
.business-group-card.active { background: #f0f7fd; border-color: #6da7d4; box-shadow: inset 3px 0 0 #2f79ba; }
.business-group-main { padding: 14px; min-width: 0; }
.business-group-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.business-group-title-row h3 { margin: 0 0 3px; color: #16324a; font-size: 20px; }
.business-group-title-row span { color: #718798; font-size: 11px; }
.business-group-title-actions { display: flex; gap: 7px; }
.business-group-title-actions select { min-width: 210px; }
.business-group-manager-card { margin: 13px 0; padding: 11px 13px; display: flex; align-items: center; gap: 10px; background: #f7fbfe; border: 1px solid #d0e0eb; border-radius: 8px; }
.business-group-manager-card > div { display: grid; gap: 2px; }
.business-group-manager-card small, .business-group-manager-card span { color: #728899; font-size: 10px; }
.business-group-manager-card strong { color: #24465f; font-size: 13px; }
.business-group-toolbar { margin-bottom: 9px; padding: 8px; display: flex; align-items: end; gap: 7px; flex-wrap: wrap; background: #f4f9fd; border: 1px solid #d2e2ed; border-radius: 8px; }
.business-group-toolbar label { display: grid; gap: 3px; color: #6c8191; font-size: 9px; }
.business-group-toolbar select { min-width: 160px; min-height: 32px; }
.business-group-selection { margin-left: auto; color: #2b689b; font-size: 10px; font-weight: 800; }
.business-group-member-table { overflow-x: auto; border: 1px solid #d0dfeb; border-radius: 8px; }
.business-group-member-head, .business-group-member-row { min-width: 780px; display: grid; grid-template-columns: 42px minmax(170px, 1.25fr) 120px 120px 100px 190px; gap: 8px; align-items: center; padding: 7px 10px; border-bottom: 1px solid #e0eaf1; font-size: 11px; }
.business-group-member-head { color: #557086; background: #edf5fb; font-weight: 800; }
.business-group-member-row:last-child { border-bottom: 0; }
.team-role-badge { width: fit-content; padding: 3px 7px; color: #607789; background: #edf2f6; border-radius: 999px; font-size: 9px; font-weight: 800; }
.team-role-badge.manager { color: #0b7669; background: #e5f5f1; }
.admin-system-grid { grid-template-columns: minmax(320px, 0.8fr) minmax(520px, 1.2fr); }

@media (max-width: 1100px) {
  .admin-page .admin-create-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-employee-toolbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-employee-toolbar input { grid-column: span 2; }
  .admin-permission-layout, .business-group-workspace { grid-template-columns: 250px minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .admin-super-banner { margin: 10px; align-items: flex-start; flex-wrap: wrap; }
  .admin-page .admin-subtabs { padding: 0 12px; gap: 20px; }
  .admin-page .admin-subtab { min-height: 46px; font-size: 12px; }
  .admin-page .admin-subpanel { padding: 12px; }
  .admin-workspace-head, .permission-template-head, .personal-permission-head, .business-group-title-row { align-items: stretch; flex-direction: column; }
  .admin-page .admin-create-panel, .admin-employee-toolbar, .business-group-create:not([hidden]), .admin-system-grid { grid-template-columns: 1fr; }
  .admin-employee-toolbar input { grid-column: auto; }
  .admin-permission-layout, .business-group-workspace { grid-template-columns: 1fr; }
  .admin-role-sidebar, .business-group-sidebar { max-height: 310px; overflow-y: auto; }
  .permission-scope, .business-group-title-actions { align-items: stretch; flex-direction: column; }
  .permission-scope select, .personal-permission-head select, .business-group-title-actions select { width: 100%; min-width: 0; }
  .personal-permission-grid { grid-template-columns: 1fr; }
  .business-group-selection { margin-left: 0; width: 100%; }
}

/* v640 block moved to the end so it wins the existing compatibility cascade.
.home-dashboard {
  gap: 12px;
}

.home-profile-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  min-height: 82px;
  padding: 14px 16px;
  color: #12283b;
  background: #fff;
  border: 1px solid #d5e2eb;
  border-left: 4px solid #0f806f;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(42, 83, 113, 0.06);
  overflow: hidden;
}

.home-profile-card::after {
  content: none;
}

.home-profile-card > div,
.home-avatar {
  position: static;
  min-width: 0;
}

.home-avatar {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  color: #fff;
  background-color: #1f6f91;
  border: 2px solid #d7e7ef;
  border-radius: 8px;
  box-shadow: none;
  font-size: 21px;
}

.home-profile-card .eyebrow {
  color: #607789;
}

.home-profile-card h2 {
  margin: 2px 0 5px;
  color: #12283b;
  font-size: 22px;
}

.home-profile-card .home-profile-copy p:last-child {
  min-height: 24px;
  padding: 0;
  color: #557086;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 13px;
  font-weight: 800;
}

.home-profile-guide {
  display: grid;
  gap: 3px;
  margin-left: auto;
  padding-left: 18px;
  border-left: 1px solid #dce8ef;
  text-align: right;
}

.home-profile-guide strong {
  color: #173e58;
  font-size: 14px;
}

.home-profile-guide span {
  color: #6a7f8f;
  font-size: 12px;
  font-weight: 700;
}

.home-metric-grid {
  gap: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d5e2eb;
  border-radius: 8px;
}

.home-metric-grid article,
.home-metric-grid article:nth-child(1),
.home-metric-grid article:nth-child(2),
.home-metric-grid article:nth-child(3) {
  min-height: 58px;
  padding: 10px 12px;
  background: #fff;
  border: 0;
  border-top: 0;
  border-right: 1px solid #e0eaf0;
  border-radius: 0;
  box-shadow: none;
}

.home-metric-grid article:last-child {
  border-right: 0;
}

.home-metric-grid strong {
  font-size: 20px;
}

.home-primary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.85fr);
  gap: 12px;
  align-items: start;
}

.home-side-stack {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.home-panel {
  padding: 14px;
  box-shadow: 0 8px 18px rgba(42, 83, 113, 0.05);
}

.home-panel .section-title-row {
  margin-bottom: 10px;
  padding-bottom: 10px;
}

.home-panel .section-title-row h3 {
  font-size: 17px;
}

.home-action-list,
.home-opportunity-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.home-opportunity-list {
  grid-template-columns: 1fr;
}

.home-action-card {
  min-height: 72px;
  padding: 10px 12px;
  background: #fff;
  border-color: #e0e9ef;
}

.home-action-card span {
  min-height: 20px;
  padding: 2px 7px;
}

.home-action-card strong {
  font-size: 14px;
}

.home-action-card em {
  font-size: 12px;
}

.home-quick-grid {
  gap: 8px;
}

.home-quick-button {
  min-height: 44px;
  padding: 8px 11px;
  background: #f3f8fa;
}

.home-task-list,
.home-notice-list {
  gap: 0;
}

.home-task-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.home-task-card {
  min-height: 64px;
  padding: 10px 12px;
  background: #fff;
}

.home-task-card strong,
.home-notice-item strong {
  font-size: 14px;
}

.home-task-card span,
.home-notice-item span {
  margin-top: 4px;
}

.home-notice-item {
  padding: 10px 2px;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #e2ebf0;
  border-radius: 0;
}

.home-notice-item:last-child {
  border-bottom: 0;
}

.home-notice-item p {
  display: -webkit-box;
  margin: 5px 0 0;
  overflow: hidden;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.deep-community-overview-table {
  min-width: 1260px;
}

.deep-community-overview-head,
.deep-community-overview-row {
  grid-template-columns: minmax(190px, 1.35fr) minmax(100px, 0.8fr) 72px 70px 70px 70px 70px 70px 70px 84px minmax(190px, 1.25fr) minmax(310px, 1.65fr);
}

.deep-community-row-actions {
  flex-wrap: nowrap;
  gap: 6px;
  white-space: nowrap;
}

.deep-community-row-actions .ghost-button.small {
  flex: 0 0 auto;
}

.deep-current-building-pill {
  background: #edf3f7;
  color: #31536b;
}

.deep-unit-tabs .ghost-button.small.active,
.deep-unit-tabs .ghost-button.small[aria-pressed="true"] {
  color: #fff;
  background: #087f72;
  border-color: #087f72;
  box-shadow: 0 0 0 3px rgba(8, 127, 114, 0.16), 0 6px 14px rgba(8, 127, 114, 0.16);
}

.deep-unit-tabs .ghost-button.small.active:hover,
.deep-unit-tabs .ghost-button.small[aria-pressed="true"]:hover {
  color: #fff;
  background: #066b61;
  border-color: #066b61;
}

@media (max-width: 1100px) {
  .home-primary-grid {
    grid-template-columns: 1fr;
  }

  .home-side-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* v690 AI 文档工作室：双卡网页预览、下载图片与打印版共用同一排版 */
.ai-document-attachment-shell > .ai-document-attachment-box {
  animation: none;
}

.ai-document-attachment-trigger {
  transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.ai-document-attachment-trigger:hover,
.ai-document-attachment-shell.expanded .ai-document-attachment-trigger {
  box-shadow: none;
}

.ai-document-attachment-trigger:focus-visible {
  outline: 2px solid rgba(10, 131, 117, 0.22);
  outline-offset: 2px;
  box-shadow: none;
}

.ai-buyer-dual-output-note {
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 7px;
}

.ai-buyer-dual-output-note > span {
  width: fit-content;
}

.ai-buyer-dual-output-note > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.ai-buyer-dual-output-note > div > strong {
  min-width: 0;
  color: #294d62;
  font-size: 10px;
  line-height: 1.5;
  word-break: keep-all;
}

.ai-buyer-dual-output-note > small {
  max-width: none;
  line-height: 1.5;
  text-align: left;
}

.ai-document-command-history {
  min-width: 0;
  display: grid;
  gap: 0;
  overflow: hidden;
  background: #f8fbfc;
  border: 1px solid #d7e4e9;
  border-radius: 9px;
}

.ai-document-command-history > button {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  color: #31556a;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.ai-document-command-history > button:hover,
.ai-document-command-history > button:focus-visible {
  color: #08776d;
  background: #f1f8f7;
  outline: none;
}

.ai-document-command-history > button > span {
  font-size: 9px;
  font-weight: 900;
}

.ai-document-command-history > button > small {
  color: #7b8f9c;
  font-size: 8px;
}

.ai-document-command-history > button > em {
  color: #69818f;
  font-size: 8px;
  font-style: normal;
}

.ai-document-command-history > div {
  max-height: 300px;
  padding: 0 9px 9px;
  display: grid;
  gap: 6px;
  overflow: auto;
}

.ai-document-command-history article {
  min-width: 0;
  padding: 8px 9px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #dce7eb;
  border-radius: 7px;
}

.ai-document-command-history article > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ai-document-command-history article span {
  color: #0a8073;
  font-size: 7px;
  font-weight: 900;
}

.ai-document-command-history article strong,
.ai-document-command-history article small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-document-command-history article strong {
  color: #294a60;
  font-size: 9px;
}

.ai-document-command-history article small,
.ai-document-command-history > div > p,
.ai-document-command-history > p {
  margin: 0;
  color: #788d99;
  font-size: 8px;
  line-height: 1.55;
}

.ai-document-command-history article > button {
  min-height: 28px;
  padding: 5px 8px;
  color: #08776d;
  background: #f2faf8;
  border: 1px solid #b7d9d2;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 8px;
  font-weight: 900;
}

.ai-document-command-history > p {
  padding: 0 12px 9px;
}

.ai-document-command-history.expanded > button {
  border-bottom: 1px solid #e1eaee;
}

@media (max-width: 760px) {
  .ai-buyer-dual-output-note {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-document-command-history article {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-document-command-history article > button {
    justify-self: start;
  }
}

/* v672 AI 文档工作室：Kimi 图文、表格、PDF 与 PPT 提案草稿 */
.ai-document-studio-shell {
  min-width: 0;
  padding: 20px;
  color: #183247;
  background: #eef4f6;
}

.ai-document-hero {
  min-width: 0;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  background: #fff;
  border: 1px solid #cfdee5;
  border-top: 4px solid #111b29;
  box-shadow: 0 10px 28px rgba(22, 48, 67, 0.06);
}

.ai-document-hero-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.ai-document-monogram {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #111b29;
  font-family: "Songti SC", "STSong", serif;
  font-size: 28px;
  font-weight: 900;
}

.ai-document-hero-copy .eyebrow,
.ai-document-hero-copy h2,
.ai-document-hero-copy p {
  margin: 0;
}

.ai-document-hero-copy .eyebrow {
  color: #087f73;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.ai-document-hero-copy h2 {
  margin-top: 3px;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(24px, 2.2vw, 34px);
  line-height: 1.2;
}

.ai-document-hero-copy p:last-child {
  margin-top: 6px;
  color: #667f8d;
  font-size: 12px;
}

.ai-document-engine {
  min-width: 260px;
  padding: 11px 13px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  background: #f6f8fa;
  border: 1px solid #d6e1e7;
}

.ai-document-engine.ready {
  background: #f0faf7;
  border-color: #abd9d0;
}

.ai-document-engine .ai-provider-brand-icon {
  width: 40px;
  height: 40px;
}

.ai-document-engine > span {
  min-width: 0;
  display: grid;
}

.ai-document-engine small,
.ai-document-engine em {
  overflow: hidden;
  color: #748a96;
  font-size: 9px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-document-engine strong {
  color: #152d41;
  font-size: 13px;
}

.ai-document-engine > b {
  padding: 4px 7px;
  color: #8b4750;
  background: #fff0f1;
  font-size: 9px;
  white-space: nowrap;
}

.ai-document-engine.ready > b {
  color: #08796e;
  background: #dcf3ed;
}

.ai-document-template-rail {
  min-width: 0;
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  background: #fff;
  border: 1px solid #cfdee5;
}

.ai-document-template-rail > button {
  min-width: 0;
  min-height: 142px;
  padding: 15px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto 1fr;
  gap: 5px 9px;
  color: #233f52;
  text-align: left;
  background: #fff;
  border: 0;
  border-right: 1px solid #dde6ea;
  cursor: pointer;
}

.ai-document-template-rail > button:last-child {
  border-right: 0;
}

.ai-document-template-rail > button:hover {
  background: #f6faf9;
}

.ai-document-template-rail > button.active {
  color: #0a776d;
  background: #eaf7f3;
  box-shadow: inset 0 -4px #0a897b;
}

.ai-document-template-rail button > span {
  width: 34px;
  height: 34px;
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  color: #fff;
  background: #243c52;
  font-size: 10px;
  font-weight: 900;
}

.ai-document-template-rail button.active > span {
  background: #0a897b;
}

.ai-document-template-rail button > small {
  color: #78909d;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.ai-document-template-rail button > strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-document-template-rail button > p {
  min-width: 0;
  margin: 6px 0 0;
  grid-column: 1 / -1;
  color: #69808d;
  font-size: 10px;
  line-height: 1.6;
}

.ai-document-workspace {
  min-width: 0;
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(300px, 0.78fr) minmax(0, 1.55fr);
  border: 1px solid #cfdee5;
  background: #fff;
}

.ai-document-settings,
.ai-document-output {
  min-width: 0;
  padding: 20px;
}

.ai-document-settings {
  background: #f8fbfc;
  border-right: 1px solid #d7e2e7;
}

.ai-document-settings > header {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.ai-document-settings > header > span {
  min-width: 36px;
  padding: 6px 8px;
  color: #08796e;
  text-align: center;
  background: #dff3ee;
  font-size: 9px;
  font-weight: 900;
}

.ai-document-settings header h3,
.ai-document-settings header p {
  margin: 0;
}

.ai-document-settings header h3 {
  font-size: 18px;
}

.ai-document-settings header p {
  margin-top: 4px;
  color: #708692;
  font-size: 10px;
  line-height: 1.6;
}

.ai-document-input-modes {
  min-width: 0;
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid #d2e0e6;
  background: #fff;
}

.ai-document-input-modes button {
  min-width: 0;
  min-height: 86px;
  padding: 10px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: 3px 8px;
  color: #496474;
  text-align: left;
  background: #fff;
  border: 0;
  border-right: 1px solid #dce6ea;
  cursor: pointer;
}

.ai-document-input-modes button:last-child {
  border-right: 0;
}

.ai-document-input-modes button:hover {
  background: #f4faf8;
}

.ai-document-input-modes button.active {
  color: #0a766c;
  background: #e9f7f3;
  box-shadow: inset 0 -3px #0a897b;
}

.ai-document-input-modes button > span {
  width: 28px;
  height: 28px;
  grid-row: 1 / -1;
  display: grid;
  place-items: center;
  color: #fff;
  background: #29475b;
  font-size: 9px;
  font-weight: 900;
}

.ai-document-input-modes button.active > span {
  background: #0a897b;
}

.ai-document-input-modes button > strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-document-input-modes button > small {
  color: #78909c;
  font-size: 8px;
  line-height: 1.45;
}

.ai-document-form {
  min-width: 0;
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ai-document-form label {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.ai-document-form label.wide {
  grid-column: 1 / -1;
}

.ai-document-form label > span {
  color: #58717f;
  font-size: 10px;
  font-weight: 900;
}

.ai-document-form select,
.ai-document-form textarea {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  color: #1f3b4e;
  background: #fff;
  border: 1px solid #cbdce4;
  border-radius: 5px;
  font: inherit;
  font-size: 11px;
  outline: 0;
}

.ai-document-form select {
  min-height: 42px;
}

.ai-document-form textarea {
  resize: vertical;
  line-height: 1.6;
}

.ai-document-form input[type="file"] {
  width: 100%;
  min-width: 0;
  padding: 9px;
  color: #385568;
  background: #fff;
  border: 1px dashed #afc8d3;
  border-radius: 5px;
  font: inherit;
  font-size: 10px;
}

.ai-document-media-picker em {
  color: #738995;
  font-size: 9px;
  font-style: normal;
  line-height: 1.5;
}

.ai-document-form select:focus,
.ai-document-form textarea:focus {
  border-color: #0a897b;
  box-shadow: 0 0 0 3px rgba(10, 137, 123, 0.09);
}

.ai-document-source-card {
  min-width: 0;
  margin-top: 14px;
  padding: 12px;
  display: grid;
  gap: 3px;
  background: #fff;
  border-left: 4px solid #1e4058;
  box-shadow: inset 0 0 0 1px #d7e3e8;
}

.ai-document-source-card > span {
  color: #0a8276;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.ai-document-source-card > strong,
.ai-document-source-card > small,
.ai-document-source-card > p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-document-source-card > strong {
  font-size: 12px;
}

.ai-document-source-card > small,
.ai-document-source-card > p {
  margin: 0;
  color: #718792;
  font-size: 9px;
}

.ai-document-generate {
  width: 100%;
  min-height: 52px;
  margin-top: 14px;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #fff;
  text-align: left;
  background: #0a8779;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
}

.ai-document-generate:disabled {
  cursor: wait;
  opacity: 0.58;
}

.ai-document-generate span {
  font-size: 13px;
  font-weight: 900;
}

.ai-document-generate small {
  color: #d8f1ec;
  font-size: 9px;
}

.ai-document-error {
  margin-top: 10px;
  padding: 10px 12px;
  display: grid;
  gap: 2px;
  color: #93454c;
  background: #fff1f2;
  border: 1px solid #efc5c8;
  font-size: 10px;
}

.ai-document-output {
  min-height: 590px;
  background:
    linear-gradient(#eff4f6 1px, transparent 1px),
    #fff;
  background-size: 100% 28px;
}

.ai-document-output > header {
  min-width: 0;
  padding-bottom: 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  background: #fff;
  border-bottom: 2px solid #203b50;
}

.ai-document-output header span {
  color: #0a8376;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.ai-document-output header h3 {
  margin: 3px 0 0;
  font-size: 16px;
}

.ai-document-actions {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.ai-document-actions button {
  min-height: 32px;
  padding: 6px 9px;
  color: #315168;
  background: #fff;
  border: 1px solid #bed1db;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 900;
  cursor: pointer;
}

.ai-document-actions button:hover,
.ai-document-actions button.primary {
  color: #fff;
  background: #0a8779;
  border-color: #0a8779;
}

.ai-document-paper {
  min-width: 0;
  margin-top: 18px;
  padding: 24px;
  background: #fff;
  border: 1px solid #d6e1e6;
  box-shadow: 0 12px 30px rgba(20, 46, 64, 0.08);
}

.ai-document-paper-head {
  min-width: 0;
  padding-bottom: 14px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid #dce5e9;
}

.ai-document-paper-head > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #111b29;
  font-size: 9px;
}

.ai-document-paper-head > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.ai-document-paper-head strong,
.ai-document-paper-head small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-document-paper-head strong {
  font-family: "Songti SC", "STSong", serif;
  font-size: 16px;
}

.ai-document-paper-head small,
.ai-document-paper-head em {
  color: #718793;
  font-size: 9px;
  font-style: normal;
}

.ai-document-paper-head em {
  text-align: right;
}

.ai-document-paper pre {
  margin: 20px 0 0;
  overflow: visible;
  color: #284659;
  white-space: pre-wrap;
  word-break: break-word;
  font: 11px/1.9 "PingFang SC", "Microsoft YaHei", sans-serif;
}

.ai-document-output > footer {
  margin-top: 12px;
  color: #718895;
  font-size: 9px;
}

.ai-document-empty,
.ai-document-generating {
  min-height: 430px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  text-align: center;
  background: rgba(255, 255, 255, 0.88);
}

.ai-document-empty > span {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #1d3b50;
  font-family: "Songti SC", "STSong", serif;
  font-size: 20px;
  font-weight: 900;
}

.ai-document-empty > strong,
.ai-document-generating > strong {
  font-size: 15px;
}

.ai-document-empty > p,
.ai-document-generating > small {
  max-width: 420px;
  margin: 0;
  color: #718793;
  font-size: 10px;
  line-height: 1.6;
}

.ai-document-generating > span {
  display: flex;
  gap: 6px;
}

.ai-document-generating i {
  width: 7px;
  height: 7px;
  background: #0a887a;
  border-radius: 50%;
  animation: ai-model-dot 1.1s ease-in-out infinite;
}

.ai-document-generating i:nth-child(2) {
  animation-delay: 0.14s;
}

.ai-document-generating i:nth-child(3) {
  animation-delay: 0.28s;
}

.ai-document-output .ai-report-citations {
  margin-top: 14px;
}

@media (max-width: 1280px) {
  .ai-document-template-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ai-document-template-rail > button:nth-child(3) {
    border-right: 0;
  }

  .ai-document-template-rail > button:nth-child(-n + 3) {
    border-bottom: 1px solid #dde6ea;
  }
}

@media (max-width: 960px) {
  .ai-document-studio-shell {
    padding: 12px;
  }

  .ai-document-hero,
  .ai-document-output > header {
    align-items: flex-start;
    flex-direction: column;
  }

  .ai-document-engine {
    width: 100%;
  }

  .ai-document-workspace {
    grid-template-columns: 1fr;
  }

  .ai-document-settings {
    border-right: 0;
    border-bottom: 1px solid #d7e2e7;
  }

  .ai-document-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .ai-document-hero {
    padding: 16px;
  }

  .ai-document-hero-copy {
    align-items: flex-start;
  }

  .ai-document-template-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-document-template-rail > button {
    border-right: 1px solid #dde6ea !important;
    border-bottom: 1px solid #dde6ea;
  }

  .ai-document-template-rail > button:nth-child(2n) {
    border-right: 0 !important;
  }

  .ai-document-form {
    grid-template-columns: 1fr;
  }

  .ai-document-input-modes {
    grid-template-columns: 1fr;
  }

  .ai-document-input-modes button {
    min-height: 64px;
    border-right: 0;
    border-bottom: 1px solid #dce6ea;
  }

  .ai-document-input-modes button:last-child {
    border-bottom: 0;
  }

  .ai-document-form label.wide {
    grid-column: auto;
  }

  .ai-document-paper {
    padding: 15px;
  }

  .ai-document-paper-head {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .ai-document-paper-head > span {
    width: 36px;
    height: 36px;
  }

  .ai-document-paper-head em {
    grid-column: 2;
    text-align: left;
  }
}

/* v670 AI 报告工作室、Kimi / DeepSeek 品牌标识与文件夹上传 */
.ai-provider-brand-icon {
  width: 34px;
  height: 34px;
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 34px;
  overflow: hidden;
  border: 1px solid #d5e2ea;
  border-radius: 9px;
  font-style: normal;
  font-weight: 900;
}

.ai-provider-brand-icon.compact {
  width: 26px;
  height: 26px;
  flex-basis: 26px;
  border-radius: 7px;
}

.ai-provider-brand-icon.deepseek {
  color: #315dff;
  background: #eef3ff;
  border-color: #cbd7ff;
}

.ai-provider-brand-icon.deepseek svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.ai-provider-brand-icon.deepseek.compact svg {
  width: 22px;
  height: 22px;
}

.ai-provider-brand-icon.kimi {
  color: #fff;
  background: #0a0b0d;
  border-color: #0a0b0d;
  box-shadow: inset 0 -8px 12px rgba(255, 255, 255, 0.08);
  font-family: Arial, sans-serif;
}

.ai-provider-brand-icon.kimi b {
  font-size: 20px;
  line-height: 1;
}

.ai-provider-brand-icon.kimi.compact b {
  font-size: 15px;
}

.ai-provider-brand-icon.kimi i {
  width: 6px;
  height: 6px;
  position: absolute;
  top: 5px;
  right: 5px;
  background: #177bf2;
  border-radius: 50%;
}

.ai-provider-brand-icon.kimi.compact i {
  width: 5px;
  height: 5px;
  top: 3px;
  right: 3px;
}

.ai-provider-brand-icon.custom {
  color: #fff;
  background: #2f6fa8;
  border-color: #2f6fa8;
  font-size: 10px;
}

.ai-provider-editor-title,
.ai-route-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-provider-editor-title > div,
.ai-route-heading > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ai-provider-editor-title > div > span {
  color: #0c8074;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.ai-route-heading > span > em {
  color: #8395a3;
  overflow: hidden;
  font-size: 8px;
  font-style: normal;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.ai-route-heading > span > strong {
  color: #1b3a52;
  font-size: 11px;
}

.ai-knowledge-files-head button.primary.subtle {
  color: #08776c;
  background: #edf8f5;
  border-color: #afd7cf;
}

.ai-report-shell,
.ai-report-shell > div {
  width: 100%;
  min-width: 0;
}

.ai-report-shell > div {
  display: grid;
  gap: 12px;
}

.ai-report-hero {
  min-height: 124px;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #183249;
  background: #fff;
  border: 1px solid #ccdde7;
  border-top: 4px solid #0a8375;
  border-radius: 11px;
  box-shadow: 0 10px 25px rgba(38, 72, 96, 0.05);
}

.ai-report-hero-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 15px;
}

.ai-report-hero-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  flex: 0 0 56px;
  color: #fff;
  background: #0a8375;
  border: 6px solid #e6f3f0;
  border-radius: 14px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 19px;
  font-weight: 900;
}

.ai-report-hero-copy > div {
  min-width: 0;
}

.ai-report-hero .eyebrow {
  margin: 0 0 3px;
  color: #0a8375;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.ai-report-hero h2 {
  margin: 0 0 5px;
  color: #173047;
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: 23px;
  line-height: 1.18;
}

.ai-report-hero-copy p:last-child {
  max-width: 720px;
  margin: 0;
  color: #687f90;
  font-size: 11px;
  line-height: 1.6;
}

.ai-report-route {
  min-width: 220px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f6f8fa;
  border: 1px solid #d5e0e7;
  border-radius: 9px;
}

.ai-report-route.ready {
  background: #eef8f5;
  border-color: #b8dbd4;
}

.ai-report-route > span:last-child {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.ai-report-route small,
.ai-report-route em {
  color: #7b909e;
  overflow: hidden;
  font-size: 8px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-report-route strong {
  color: #24445b;
  font-size: 11px;
}

.ai-report-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ai-report-type-grid button {
  min-width: 0;
  min-height: 92px;
  padding: 14px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 3px 12px;
  align-items: center;
  color: #28475d;
  background: #fff;
  border: 1px solid #d1dfe8;
  border-left: 4px solid #b7cbd7;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
}

.ai-report-type-grid button:hover {
  border-color: #8fbdca;
}

.ai-report-type-grid button.active {
  background: #f1f9f7;
  border-color: #82beb4;
  border-left-color: #0a8375;
  box-shadow: 0 7px 18px rgba(28, 111, 101, 0.08);
}

.ai-report-type-grid button > span {
  width: 42px;
  height: 42px;
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  color: #0a8375;
  background: #e5f3f0;
  border-radius: 9px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 16px;
  font-weight: 900;
}

.ai-report-type-grid strong {
  align-self: end;
  color: #173047;
  font-size: 14px;
}

.ai-report-type-grid small {
  align-self: start;
  color: #6d8393;
  font-size: 9px;
  line-height: 1.45;
}

.ai-report-workspace {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(520px, 1.28fr);
  gap: 12px;
  align-items: start;
}

.ai-report-config,
.ai-report-preview {
  min-width: 0;
  background: #fff;
  border: 1px solid #cedee8;
  border-radius: 11px;
  box-shadow: 0 10px 25px rgba(38, 72, 96, 0.045);
}

.ai-report-config {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.ai-report-section-title > span,
.ai-report-preview > header span {
  color: #0a8375;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.ai-report-section-title h3,
.ai-report-preview > header h3 {
  margin: 3px 0 4px;
  color: #18334a;
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: 20px;
}

.ai-report-section-title p {
  margin: 0;
  color: #708595;
  font-size: 10px;
  line-height: 1.55;
}

.ai-report-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ai-report-form label {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.ai-report-form label.wide {
  grid-column: 1 / -1;
}

.ai-report-form label > span {
  color: #5d7588;
  font-size: 9px;
  font-weight: 900;
}

.ai-report-form select,
.ai-report-form textarea {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  color: #1e3b51;
  background: #fbfdfe;
  border: 1px solid #c9dbe6;
  border-radius: 7px;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
  outline: none;
}

.ai-report-form select {
  min-height: 40px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-report-form textarea {
  min-height: 96px;
  resize: vertical;
}

.ai-report-form select:focus,
.ai-report-form textarea:focus {
  border-color: #4b9c90;
  box-shadow: 0 0 0 3px rgba(10, 131, 117, 0.1);
}

.ai-report-evidence-preview {
  padding: 12px;
  display: grid;
  gap: 3px;
  background: #f5f9fb;
  border: 1px solid #d6e3ea;
  border-radius: 8px;
}

.ai-report-evidence-preview > span {
  color: #708797;
  font-size: 8px;
  font-weight: 900;
}

.ai-report-evidence-preview > strong {
  color: #18364d;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-report-evidence-preview > small {
  color: #78909f;
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-report-evidence-preview ul {
  margin: 7px 0 0;
  padding: 8px 0 0 17px;
  display: grid;
  gap: 3px;
  color: #5e7789;
  border-top: 1px solid #dce6eb;
  font-size: 9px;
}

.ai-report-generate {
  min-height: 54px;
  padding: 9px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #fff;
  background: #0a8375;
  border: 1px solid #0a8375;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
}

.ai-report-generate span {
  font-size: 12px;
  font-weight: 900;
}

.ai-report-generate small {
  max-width: 54%;
  color: #d9f2ed;
  overflow: hidden;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-report-generate:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.ai-report-error {
  padding: 10px 12px;
  display: grid;
  gap: 3px;
  color: #a63b44;
  background: #fff2f3;
  border: 1px solid #efc8cb;
  border-radius: 8px;
  font-size: 9px;
}

.ai-report-preview {
  min-height: 580px;
  overflow: hidden;
}

.ai-report-preview > header {
  min-height: 72px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f8fbfc;
  border-bottom: 1px solid #d9e4ea;
}

.ai-report-preview > header > div:first-child {
  min-width: 0;
}

.ai-report-preview > header h3 {
  max-width: 620px;
  overflow: hidden;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-report-preview > header > div:last-child {
  display: flex;
  gap: 7px;
}

.ai-report-preview > header button {
  min-height: 34px;
  padding: 0 11px;
  color: #315a77;
  background: #fff;
  border: 1px solid #c6d9e5;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 900;
  cursor: pointer;
}

.ai-report-preview > header button.primary {
  color: #fff;
  background: #0a8375;
  border-color: #0a8375;
}

.ai-report-empty,
.ai-report-generating {
  min-height: 500px;
  padding: 30px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: #748a99;
  text-align: center;
}

.ai-report-empty > span {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: #0a8375;
  background: #e7f4f1;
  border: 1px solid #c5e0da;
  border-radius: 50%;
  font: 900 20px Georgia, serif;
}

.ai-report-empty strong,
.ai-report-generating strong {
  color: #2b4a60;
  font-size: 13px;
}

.ai-report-empty p,
.ai-report-generating small {
  max-width: 360px;
  margin: 0;
  font-size: 10px;
  line-height: 1.6;
}

.ai-report-generating > span {
  display: flex;
  gap: 5px;
}

.ai-report-generating i {
  width: 7px;
  height: 7px;
  background: #0a8375;
  border-radius: 50%;
  animation: ai-model-dot 1.2s infinite ease-in-out;
}

.ai-report-generating i:nth-child(2) {
  animation-delay: 0.15s;
}

.ai-report-generating i:nth-child(3) {
  animation-delay: 0.3s;
}

.ai-report-paper {
  margin: 16px;
  padding: 25px 28px;
  color: #20394d;
  background: #fff;
  border: 1px solid #d6e0e6;
  border-top: 5px solid #0a8375;
  box-shadow: 0 9px 25px rgba(30, 66, 90, 0.07);
}

.ai-report-paper-head {
  padding-bottom: 15px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid #dce5ea;
}

.ai-report-paper-head > span {
  color: #0a8375;
  font-size: 11px;
  font-weight: 900;
}

.ai-report-paper-head > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ai-report-paper-head strong {
  overflow: hidden;
  color: #183047;
  font-family: Georgia, "Songti SC", serif;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-report-paper-head small,
.ai-report-paper-head em {
  color: #768b99;
  font-size: 8px;
  font-style: normal;
}

.ai-report-paper-head em {
  text-align: right;
}

.ai-report-paper pre {
  margin: 20px 0 0;
  color: #243e51;
  white-space: pre-wrap;
  word-break: break-word;
  font: 10.5px/1.85 "PingFang SC", "Microsoft YaHei", sans-serif;
}

.ai-report-citations {
  margin: 0 16px 16px;
  padding: 13px;
  display: grid;
  gap: 7px;
  background: #f4f9f8;
  border: 1px solid #cde1dd;
  border-radius: 8px;
}

.ai-report-citations > span {
  color: #0a8375;
  font-size: 9px;
  font-weight: 900;
}

.ai-report-citations button {
  min-width: 0;
  min-height: 46px;
  padding: 7px 9px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  color: #25495d;
  background: #fff;
  border: 1px solid #d2e1e5;
  border-radius: 7px;
  text-align: left;
  cursor: pointer;
}

.ai-report-citations em {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #0a8375;
  background: #e4f3ef;
  border-radius: 6px;
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
}

.ai-report-citations button > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ai-report-citations strong,
.ai-report-citations small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-report-citations strong {
  font-size: 10px;
}

.ai-report-citations small {
  color: #788d9a;
  font-size: 8px;
}

.ai-report-citations b {
  color: #0a8375;
  font-size: 8px;
  white-space: nowrap;
}

.ai-report-no-source,
.ai-report-disclaimer {
  margin: 0 16px 16px;
  padding: 10px 12px;
  color: #708593;
  background: #f7fafb;
  border: 1px solid #dbe5ea;
  border-radius: 7px;
  font-size: 8px;
  line-height: 1.55;
}

@media (max-width: 1180px) {
  .ai-report-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-report-preview {
    min-height: 520px;
  }
}

@media (max-width: 760px) {
  .ai-report-hero,
  .ai-report-preview > header {
    align-items: stretch;
    flex-direction: column;
  }

  .ai-report-route {
    width: 100%;
  }

  .ai-report-type-grid,
  .ai-report-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-report-form label.wide {
    grid-column: auto;
  }

  .ai-report-paper {
    margin: 10px;
    padding: 18px;
  }

  .ai-report-paper-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-report-paper-head em {
    text-align: left;
  }
}

/* AI 知识库 v665：服务器存储、全文检索与引用 */
.ai-local-draft-badge[data-state="ready"] {
  color: #087265;
  background: #e9f8f4;
  border-color: #a9dacf;
}

.ai-local-draft-badge[data-state="loading"] {
  color: #276b92;
  background: #edf7fd;
  border-color: #b9d9eb;
}

.ai-local-draft-badge[data-state="warning"] {
  color: #7a6320;
  background: #fff8dc;
  border-color: #ead58b;
}

.ai-local-draft-badge[data-state="error"] {
  color: #a03e3e;
  background: #fff0f0;
  border-color: #efb9b9;
}

.ai-knowledge-search-results {
  margin-top: 13px;
  padding: 22px;
  background: #fff;
  border: 1px solid #d5e1e8;
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(42, 75, 95, 0.05);
}

.ai-knowledge-search-results > header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 13px;
  border-bottom: 1px solid #e4edf2;
}

.ai-knowledge-search-results > header div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.ai-knowledge-search-results > header span,
.ai-knowledge-search-results > header small {
  color: #718792;
  font-size: 10px;
  font-weight: 800;
}

.ai-knowledge-search-results > header strong {
  color: #1b3b4e;
  font-size: 15px;
}

.ai-knowledge-search-results > div {
  display: grid;
}

.ai-search-result-card {
  width: 100%;
  min-width: 0;
  padding: 14px 2px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  color: #1d394a;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #e7eef2;
  cursor: pointer;
}

.ai-search-result-card:last-child {
  border-bottom: 0;
}

.ai-search-result-card:hover {
  padding-right: 10px;
  padding-left: 10px;
  background: #f4faf9;
}

.ai-search-result-type {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #0b8073;
  background: #e6f5f1;
  border: 1px solid #bee1d8;
  border-radius: 8px;
  font-weight: 900;
}

.ai-search-result-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.ai-search-result-copy strong,
.ai-search-result-copy small,
.ai-search-result-copy p {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-search-result-copy strong {
  color: #17384b;
  font-size: 13px;
  white-space: nowrap;
}

.ai-search-result-copy small {
  color: #7b8f9a;
  font-size: 10px;
  white-space: nowrap;
}

.ai-search-result-copy p {
  margin: 3px 0 0;
  color: #536b78;
  font-size: 11px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ai-search-result-citation {
  padding: 5px 8px;
  color: #166f65;
  background: #edf8f5;
  border: 1px solid #c8e4dd;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}

.ai-search-result-empty {
  min-height: 108px;
  display: grid;
  place-content: center;
  gap: 4px;
  color: #7a8d97;
  text-align: center;
}

.ai-search-result-empty strong {
  color: #3a5869;
}

.ai-search-result-empty span {
  font-size: 11px;
}

.ai-search-result-empty.error strong {
  color: #a04242;
}

.ai-document-preview-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 7px;
}

.ai-document-preview-actions button.primary {
  color: #fff;
  background: #0b8779;
  border-color: #08786c;
}

.ai-document-preview-actions button.danger {
  color: #b24242;
  background: #fff5f5;
  border-color: #efc2c2;
}

.ai-dialog-form fieldset > small {
  display: block;
  margin-top: 7px;
  color: #7b8d97;
  font-size: 10px;
}

.ai-dialog-option-empty {
  color: #7b8d97;
  font-size: 11px;
}

.ai-document-excerpt {
  margin: 0 0 13px;
  padding: 11px;
  background: #fff;
  border: 1px solid #d7e7e3;
  border-radius: 7px;
}

.ai-document-excerpt > span {
  display: block;
  margin-bottom: 6px;
  color: #6d837d;
  font-size: 9px;
  font-weight: 900;
}

.ai-document-excerpt pre {
  max-height: 230px;
  margin: 0;
  overflow: auto;
  color: #36564f;
  font: 11px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .ai-knowledge-search-results {
    padding: 14px;
  }

  .ai-knowledge-search-results > header {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .ai-search-result-card {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .ai-search-result-citation {
    grid-column: 2;
    justify-self: start;
  }

  .ai-document-preview header {
    align-items: stretch;
    flex-direction: column;
  }

  .ai-document-preview-actions {
    width: 100%;
  }

  .ai-document-preview-actions button {
    flex: 1 1 0;
  }
}

/* AI 业务指挥台：本地试验版 */
.ai-assistant-page {
  min-height: calc(100vh - 112px);
  padding: 18px;
  overflow-x: hidden;
  background: #edf4f8;
}

.ai-command-shell {
  width: min(1540px, 100%);
  margin: 0 auto;
}

.ai-command-hero {
  min-height: 112px;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #f7fbfd;
  background: #142d3e;
  border: 1px solid #24465d;
  border-radius: 14px;
  box-shadow: 0 18px 42px rgba(24, 53, 73, 0.16);
}

.ai-command-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 17px;
}

.ai-command-mark {
  width: 60px;
  height: 60px;
  flex: 0 0 60px;
  display: grid;
  place-items: center;
  background: #0a887a;
  border: 1px solid #36aa9e;
  border-radius: 13px;
}

.ai-command-mark svg {
  width: 32px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-command-identity .eyebrow {
  margin: 0 0 4px;
  color: #88c7c0;
  font-size: 11px;
  letter-spacing: 0.12em;
}

.ai-command-identity h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(24px, 2.2vw, 34px);
  letter-spacing: 0.015em;
}

.ai-command-identity p:last-child {
  margin: 5px 0 0;
  color: #b8c9d4;
  font-size: 13px;
}

.ai-command-status {
  min-width: 210px;
  padding-left: 22px;
  display: grid;
  gap: 3px;
  border-left: 1px solid #365367;
}

.ai-command-status > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #9ddbd4;
  font-size: 11px;
  font-weight: 800;
}

.ai-command-status > span i {
  width: 7px;
  height: 7px;
  background: #35c5a7;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(53, 197, 167, 0.13);
}

.ai-command-status strong {
  color: #fff;
  font-size: 14px;
}

.ai-command-status small {
  color: #829aaa;
  font-size: 11px;
}

.ai-command-layout {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(280px, 0.75fr);
  gap: 14px;
  align-items: start;
}

.ai-conversation-panel,
.ai-radar-panel,
.ai-guardrail-panel,
.ai-pending-panel {
  min-width: 0;
  background: #fff;
  border: 1px solid #cfdee8;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(43, 79, 103, 0.065);
}

.ai-conversation-panel {
  min-height: 640px;
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.ai-panel-heading {
  min-height: 48px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ai-panel-heading.compact {
  min-height: 40px;
}

.ai-panel-heading span,
.ai-guardrail-panel > span {
  color: #708695;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ai-panel-heading h3,
.ai-guardrail-panel h3 {
  margin: 3px 0 0;
  color: #183347;
  font-size: 19px;
}

.ai-panel-heading em {
  color: #69818f;
  font-size: 11px;
  font-style: normal;
}

.ai-connection-pill {
  padding: 5px 9px;
  color: #725f2a !important;
  background: #fff8dc;
  border: 1px solid #eedb91;
  border-radius: 5px;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.ai-quick-commands {
  margin: 10px 0 13px;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.ai-quick-commands button {
  min-height: 32px;
  padding: 0 11px;
  flex: 0 0 auto;
  color: #365a70;
  background: #f5f9fc;
  border: 1px solid #cedee8;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.ai-quick-commands button:hover {
  color: #086f66;
  background: #edf9f6;
  border-color: #8fc9c1;
}

.ai-conversation-stream {
  min-height: 360px;
  max-height: 58vh;
  padding: 12px;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #f4f8fb;
  border: 1px solid #d7e4ec;
  border-radius: 9px;
}

.ai-welcome-card {
  min-height: 310px;
  padding: 34px max(22px, 7%);
  display: flex;
  align-items: center;
  gap: 18px;
  color: #5e7585;
}

.ai-welcome-card .ai-answer-mark {
  width: 50px;
  height: 50px;
  flex-basis: 50px;
  font-size: 15px;
}

.ai-welcome-card h3 {
  margin: 3px 0 8px;
  color: #19374a;
  font-size: clamp(20px, 2vw, 28px);
}

.ai-welcome-card p:last-child {
  max-width: 620px;
  margin: 0;
  line-height: 1.75;
}

.ai-conversation-turn + .ai-conversation-turn {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #dbe6ed;
}

.ai-user-query {
  margin: 0 0 10px auto;
  width: fit-content;
  max-width: min(78%, 720px);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px;
}

.ai-user-query > span {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  order: 2;
  display: grid;
  place-items: center;
  color: #fff;
  background: #2f6fa8;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 900;
}

.ai-user-query p {
  margin: 0;
  padding: 8px 11px;
  color: #214055;
  background: #e8f2fa;
  border: 1px solid #c5dae9;
  border-radius: 8px 2px 8px 8px;
  line-height: 1.55;
}

.ai-system-answer > header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.ai-answer-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #087f73;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.ai-system-answer > header strong {
  color: #16364a;
  font-size: 15px;
}

.ai-system-answer > header p {
  margin: 4px 0 0;
  color: #637a89;
  font-size: 12px;
  line-height: 1.6;
}

.ai-result-list {
  margin: 12px 0 0 44px;
  display: grid;
  gap: 7px;
}

.ai-result-card {
  min-width: 0;
  padding: 10px 11px 10px 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  background: #fff;
  border: 1px solid #d5e2ea;
  border-left: 3px solid #7f9cad;
  border-radius: 7px;
}

.ai-result-card.tone-teal { border-left-color: #0b8b7d; }
.ai-result-card.tone-blue { border-left-color: #367db4; }
.ai-result-card.tone-amber { border-left-color: #d19b25; }
.ai-result-card.tone-red { border-left-color: #d44a4f; }
.ai-result-card.tone-purple { border-left-color: #735db2; }

.ai-result-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.ai-result-copy > span {
  display: block;
  color: #6d8493;
  font-size: 10px;
  font-weight: 800;
}

.ai-result-copy > strong {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: #17364a;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-result-copy > p {
  margin: 3px 0 0;
  color: #405f72;
  font-size: 11px;
}

.ai-result-copy > small {
  margin-top: 2px;
  display: -webkit-box;
  overflow: hidden;
  color: #7a8d99;
  font-size: 10px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.ai-result-card > button {
  min-height: 30px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  color: #17685f;
  background: #eef8f6;
  border: 1px solid #a9d4ce;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.ai-result-card > button svg {
  width: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-command-composer {
  margin-top: 12px;
}

.ai-command-composer > label {
  display: block;
  margin-bottom: 5px;
  color: #5d7484;
  font-size: 11px;
  font-weight: 900;
}

.ai-command-composer > div {
  padding: 6px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  background: #fff;
  border: 1px solid #aac4d4;
  border-radius: 9px;
  box-shadow: 0 0 0 3px rgba(47, 111, 168, 0.05);
}

.ai-command-composer textarea {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  max-height: 120px;
  padding: 8px 10px;
  resize: vertical;
  color: #18364a;
  background: transparent;
  border: 0;
  outline: 0;
  line-height: 1.5;
}

.ai-command-submit {
  min-width: 112px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #fff;
  background: #087f73;
  border: 1px solid #087469;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.ai-command-submit:hover {
  background: #066f65;
}

.ai-command-submit svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-command-composer > p {
  margin: 5px 2px 0;
  color: #83939d;
  font-size: 10px;
}

.ai-command-sidebar {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.ai-radar-panel,
.ai-guardrail-panel,
.ai-pending-panel {
  padding: 15px;
}

.ai-radar-grid {
  margin-top: 11px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.ai-radar-grid article {
  min-width: 0;
  min-height: 92px;
  padding: 11px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #f6f9fb;
  border: 1px solid #d6e2e9;
  border-radius: 7px;
}

.ai-radar-grid article.tone-red {
  background: #fff6f4;
  border-color: #efc9c4;
}

.ai-radar-grid article.tone-purple {
  background: #f7f5fb;
  border-color: #d9d1ec;
}

.ai-radar-grid span {
  color: #6f8492;
  font-size: 10px;
  font-weight: 800;
}

.ai-radar-grid strong {
  color: #17364a;
  font-size: 24px;
  line-height: 1;
}

.ai-radar-grid small {
  overflow: hidden;
  color: #82929c;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-guardrail-panel {
  color: #dbe7ed;
  background: #193648;
  border-color: #294b60;
}

.ai-guardrail-panel > span {
  color: #72c6bd;
}

.ai-guardrail-panel h3 {
  color: #fff;
}

.ai-guardrail-panel ul {
  margin: 13px 0 0;
  padding: 0;
  display: grid;
  gap: 11px;
  list-style: none;
}

.ai-guardrail-panel li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
}

.ai-guardrail-panel li > i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #78cfc5;
  border: 1px solid #3c6871;
  border-radius: 6px;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
}

.ai-guardrail-panel li span {
  color: #9fb1bc;
  font-size: 10px;
  line-height: 1.55;
}

.ai-guardrail-panel li strong {
  display: block;
  color: #e8f1f5;
  font-size: 11px;
}

.ai-pending-empty {
  min-height: 88px;
  margin-top: 9px;
  padding: 14px;
  display: grid;
  place-content: center start;
  gap: 3px;
  color: #84959f;
  background: #f7f9fb;
  border: 1px dashed #ccdce5;
  border-radius: 7px;
}

.ai-pending-empty strong {
  color: #526d7d;
  font-size: 12px;
}

.ai-pending-empty span {
  font-size: 10px;
}

.ai-pending-card {
  margin-top: 9px;
  padding: 12px;
  display: grid;
  gap: 3px;
  background: #f7f5fb;
  border: 1px solid #d9d1ec;
  border-left: 3px solid #735db2;
  border-radius: 7px;
}

.ai-pending-card > span,
.ai-pending-card > small {
  color: #7e7498;
  font-size: 10px;
}

.ai-pending-card > strong {
  color: #3f345d;
  font-size: 13px;
}

.ai-pending-card > button {
  min-height: 31px;
  margin-top: 7px;
  color: #fff;
  background: #67529f;
  border: 1px solid #5c488f;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.side-navigation .ai-main-nav .nav-icon svg {
  stroke-width: 1.65;
}

@media (max-width: 1120px) {
  .ai-command-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-command-sidebar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
  }
}

@media (max-width: 760px) {
  .ai-assistant-page {
    padding: 10px;
  }

  .ai-command-hero {
    padding: 16px;
    align-items: flex-start;
    flex-direction: column;
  }

  .ai-command-mark {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }

  .ai-command-status {
    width: 100%;
    padding: 10px 0 0;
    border-top: 1px solid #365367;
    border-left: 0;
  }

  .ai-conversation-panel {
    min-height: 0;
    padding: 12px;
  }

  .ai-conversation-stream {
    max-height: none;
  }

  .ai-command-sidebar {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-user-query {
    max-width: 92%;
  }

  .ai-result-list {
    margin-left: 0;
  }

  .ai-result-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .ai-result-card > button {
    width: 100%;
    justify-content: center;
  }

  .ai-command-composer > div {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-command-submit {
    min-height: 42px;
  }
}

@media (max-width: 760px) {
  .home-profile-guide {
    display: none;
  }

  .home-primary-grid,
  .home-side-stack,
  .home-task-list {
    grid-template-columns: 1fr;
  }

.home-action-list {
    grid-template-columns: 1fr;
  }
}

管理工作台最终层：覆盖早期兼容样式
.admin-page > .page-card {
  max-width: none;
  padding: 0;
  overflow: hidden;
}

.admin-page .admin-system-grid {
  grid-template-columns: minmax(320px, 0.8fr) minmax(520px, 1.2fr);
}

.admin-page .permission-table {
  width: 100%;
  max-width: none;
}

@media (max-width: 760px) {
  .admin-page .admin-system-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

*/

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(180deg, #f8fbff 0, var(--bg) 210px, #f6f9fc 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body.auth-locked {
  overflow: hidden;
  background: #eaf5ff;
}

body.auth-booting {
  overflow: hidden;
  background: #eaf5ff;
}

body.auth-booting .auth-page,
body.auth-booting .app-shell {
  display: none;
}

body.auth-locked .app-shell {
  display: none;
}

body.auth-ready .auth-page {
  display: none;
}

.auth-page {
  min-height: 100vh;
  padding: 36px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #e8f5ff 0%, #f7fbff 58%, #dcefff 100%);
}

.auth-hero {
  width: min(430px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  justify-items: center;
}

.auth-card {
  width: 100%;
  display: grid;
  gap: 16px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #c7dfea;
  border-radius: 12px;
  box-shadow: 0 22px 52px rgba(45, 88, 124, 0.16);
}

.auth-card-brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-width: 0;
  flex-wrap: nowrap;
}

.auth-card-brand img {
  width: min(235px, 60%);
  flex: 0 1 min(235px, 60%);
  max-height: 70px;
  display: block;
  object-fit: contain;
  object-position: left center;
}

.auth-card-brand strong {
  flex: 0 0 auto;
  color: #102438;
  font-size: 20px;
  font-weight: 950;
  white-space: nowrap;
}

.auth-login-heading {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  background: #f2f8fd;
  border: 1px solid #c7dfea;
  border-radius: 8px;
}

.auth-login-heading strong {
  color: #153753;
  font-size: 18px;
  font-weight: 950;
}

.auth-login-heading span {
  color: #70879a;
  font-size: 13px;
  font-weight: 750;
}

.auth-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid #c7dfea;
  border-radius: 8px;
  overflow: hidden;
}

.auth-switch-button {
  min-height: 44px;
  border: 0;
  background: #f3f8fc;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}

.auth-switch-button.active {
  background: var(--primary);
  color: #fff;
}

.auth-form {
  display: none;
  gap: 12px;
}

.auth-form.active {
  display: grid;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 900;
}

.auth-form input,
.auth-form select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: var(--text);
  background: #fbfdff;
  border: 1px solid #cbddea;
  border-radius: 8px;
  font-weight: 800;
}

.auth-message {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-weight: 800;
  line-height: 1.5;
}

.auth-message[data-type="success"] {
  color: var(--accent);
}

.auth-forgot-button {
  width: 100%;
}

body.auth-ready .role-select {
  display: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  --side-nav-width: 118px;
}

.side-navigation,
.workspace-nav,
.app-page,
.app-page > .page-card {
  box-sizing: border-box;
}

.topbar {
  display: none;
}

.sync-status-bar {
  position: fixed;
  right: 10px;
  bottom: 8px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: min(260px, calc(100vw - 20px));
  min-height: 26px;
  padding: 5px 8px;
  border: 1px solid #d8e5ec;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.9);
  color: #173044;
  box-shadow: 0 6px 16px rgba(16, 53, 74, 0.12);
  pointer-events: none;
}

.sync-status-bar span {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #7a8b96;
}

.sync-status-bar strong {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-status-bar.saving span {
  background: #d79a22;
}

.sync-status-bar.success span {
  background: #078a78;
}

.sync-status-bar.error {
  border-color: #f1b5b5;
  background: #fff5f5;
  color: #a51f1f;
}

.sync-status-bar.error span {
  background: #d43f3f;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-block;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.92) 0 18%, transparent 18%),
    linear-gradient(145deg, #2f79ba, #245b8c);
  box-shadow: 0 12px 26px rgba(43, 104, 162, 0.24);
  position: relative;
}

.brand-mark::after {
  content: "3D";
  position: absolute;
  right: 6px;
  bottom: 5px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  justify-content: center;
  min-width: 0;
}

.side-navigation {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 45;
  width: var(--side-nav-width);
  padding: 10px 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(180deg, #23364f 0%, #1b2b42 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 12px 0 28px rgba(31, 55, 79, 0.12);
}

.side-nav-title {
  padding: 0 8px 4px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 800;
}

.side-nav-logo {
  position: relative;
  min-height: 48px;
  padding: 2px 0 10px;
  display: flex;
  align-items: center;
}

.side-nav-logo img {
  position: relative;
  z-index: 2;
  width: auto;
  height: 38px;
  max-width: 100%;
  max-height: 48px;
  display: block;
  object-fit: contain;
  object-position: left center;
}

.side-nav-logo img[src=""],
.side-nav-logo img:not([src]),
.side-nav-logo.logo-image-failed img {
  display: none;
}

.side-nav-logo-text {
  position: absolute;
  z-index: 1;
  left: 2px;
  top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #eaf6ff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.side-nav-logo.logo-image-loaded .side-nav-logo-text {
  display: none;
}

.side-nav-logo-text strong {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fff;
  background: #f2213a;
  border-radius: 9px;
  font-size: 17px;
}

.side-navigation .main-nav {
  width: 100%;
  flex: 0 0 auto;
  display: grid;
  grid-auto-rows: max-content;
  gap: 10px;
  justify-content: start;
  align-content: start;
  align-items: start;
  overflow: visible;
}

.side-navigation .nav-button {
  width: 102px;
  max-width: 102px;
  min-height: 36px;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 8px;
  color: #d9e9f5;
  background: transparent;
  border-color: transparent;
  border-radius: 6px;
  box-shadow: none;
  font-size: 13px;
  line-height: 1.15;
  white-space: normal;
  text-align: left;
}

.side-navigation .nav-icon {
  width: 17px;
  height: 17px;
  opacity: 0.95;
}

.side-navigation .nav-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
  transform: none;
}

.side-navigation .nav-button.active {
  color: #fff;
  background: #2f6fa8;
  border-color: #2f6fa8;
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.18);
}

.workspace-nav {
  position: sticky;
  top: 0;
  z-index: 38;
  margin-left: var(--side-nav-width);
  display: grid;
  gap: 0;
  background: rgba(248, 251, 255, 0.96);
  border-bottom: 1px solid #cbdce9;
  box-shadow: 0 8px 22px rgba(42, 82, 118, 0.06);
  backdrop-filter: blur(10px);
}

.workspace-tabs-row {
  min-height: 44px;
  display: flex;
  align-items: stretch;
  min-width: 0;
  background: linear-gradient(180deg, #23364f 0%, #1b2b42 100%);
}

.open-page-tabs {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  background: transparent;
}

.open-page-tab {
  min-width: 142px;
  max-width: 228px;
  min-height: 44px;
  padding: 0 8px 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: rgba(255, 255, 255, 0.86);
  background: #2a4059;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.open-page-tab:hover {
  background: #31517a;
}

.open-page-tab.active {
  color: var(--text);
  background: #fff;
}

.open-page-tab span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.open-page-close {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 50%;
  font-size: 16px;
  font-family: Arial, "Helvetica Neue", sans-serif;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.open-page-close:hover {
  background: rgba(20, 37, 54, 0.1);
}

.module-subnav {
  min-height: 48px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  background: rgba(255, 255, 255, 0.76);
}

.module-subnav.is-centered {
  justify-content: center;
}

.module-subnav-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-right: 8px;
  border-right: 1px solid #d6e3ed;
}

.module-subnav-group:last-child {
  border-right: 0;
}

.module-subnav-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.module-subnav-button {
  min-height: 32px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #314b63;
  background: #f5fafe;
  border: 1px solid #c8dcea;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.module-subnav-button.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.app-page > .page-card > .community-tabs,
.app-page > .page-card > .listing-tabs,
.app-page > .page-card > .opportunity-tabs,
.app-page > .page-card > .task-tabs,
.app-page > .page-card > .trend-tabs,
.app-page > .page-card > .score-tabs,
.app-page > .page-card > .admin-subtabs,
.task-publish-subtabs {
  display: none;
}

.module-subnav-label,
.app-page > .page-card > .section-title-row:first-child > div:first-child {
  display: none;
}

.nav-button {
  min-height: 34px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #26445c;
  background: linear-gradient(180deg, #fafdff, #edf6fd);
  border: 1px solid #c8dcea;
  border-radius: 9px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 5px 16px rgba(46, 85, 120, 0.06);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
}

.nav-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  color: currentColor;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-button:hover {
  background: #e9f4ff;
  border-color: #aac9df;
  transform: translateY(-1px);
}

.nav-button.active,
.nav-group.active .nav-group-button {
  color: #fff;
  background: linear-gradient(135deg, #2f6fa8, #22598c);
  border-color: #22598c;
  box-shadow: 0 10px 22px rgba(47, 111, 168, 0.22);
}

.nav-group {
  position: relative;
  display: inline-flex;
}

.nav-group-button::after {
  content: "";
  width: 0;
  height: 0;
  margin-left: 6px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  display: inline-block;
  vertical-align: middle;
}

.nav-submenu {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  z-index: 50;
  min-width: 124px;
  display: none;
  padding: 6px;
  background: rgba(255,255,255,0.98);
  border: 1px solid #c8dcea;
  border-radius: 9px;
  box-shadow: 0 16px 32px rgba(46, 85, 120, 0.15);
}

.nav-group:hover .nav-submenu,
.nav-group:focus-within .nav-submenu {
  display: grid;
  gap: 5px;
}

.nav-subbutton {
  min-height: 32px;
  padding: 0 12px;
  color: #26445c;
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}

.nav-subbutton:hover {
  background: #edf6fd;
}

.nav-subbutton.active {
  color: #fff;
  background: #2f6fa8;
}

.eyebrow {
  margin: 0 0 4px;
  color: #6d7f8a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-eyebrow {
  font-size: 14px;
  font-weight: 800;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 23px;
  color: #122430;
}

h2 {
  font-size: 17px;
}

h3 {
  font-size: 15px;
}

.top-actions,
.button-row,
.view-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.top-actions {
  flex: 0 0 auto;
  padding-left: 6px;
  border-left: 1px solid #d5e4ee;
}

.workspace-tabs-row .top-actions {
  min-height: 44px;
  padding: 4px 8px;
  gap: 8px;
  background: #1b2b42;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.workspace-tabs-row .profile-chip {
  min-height: 34px;
  max-width: 190px;
  padding: 4px 10px 4px 4px;
  border-radius: 6px;
  box-shadow: none;
}

.workspace-tabs-row .profile-avatar {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  font-size: 15px;
}

.workspace-tabs-row .profile-avatar img {
  border-radius: 6px;
}

.workspace-tabs-row .profile-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-tabs-row .logout-button {
  min-height: 34px;
  padding: 0 12px;
  color: #10263a;
  background: #f8fbfd;
  border-color: #c8dcea;
  box-shadow: none;
}

.role-select {
  width: 230px;
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.role-select select {
  min-height: 34px;
}

.profile-button {
  align-self: end;
  min-height: 34px;
  white-space: nowrap;
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 5px 12px 5px 6px;
  color: #10263a;
  background: #f8fbfd;
  border: 1px solid #c8dcea;
  border-radius: 10px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(42, 91, 132, 0.08);
}

.profile-avatar,
.employee-profile-avatar,
.public-contact-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: linear-gradient(135deg, #2f74ad, #0f8a76);
  background-position: center;
  background-size: cover;
  border-radius: 12px;
  font-weight: 900;
}

.profile-avatar {
  width: 42px;
  height: 42px;
  font-size: 18px;
}

.profile-chip-name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.management-hint-strip,
.model-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.management-hint-strip {
  padding: 10px 12px;
  color: #31536c;
  background: #f4f9fd;
  border: 1px solid #cfdeea;
  border-radius: 8px;
  font-size: 13px;
}

.management-hint-strip strong {
  color: #173247;
}

.management-hint-strip span {
  color: var(--muted);
}

.model-action-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 10px 0 12px;
}

.model-action-bar .small {
  width: 100%;
  min-height: 34px;
}

button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary-button,
.ghost-button,
.danger-button,
.mini-button,
.tool-button {
  min-height: 36px;
  padding: 0 14px;
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #0c7468);
  box-shadow: 0 10px 22px rgba(8, 127, 115, 0.2);
}

.primary-button:hover {
  background: linear-gradient(135deg, #0a746a, #075e57);
}

.ghost-button,
.tool-button,
.mini-button {
  color: var(--text);
  background: #f7fbfe;
  border: 1px solid #cddde9;
  box-shadow: 0 5px 14px rgba(46, 85, 120, 0.045);
}

.danger-button {
  color: #fff;
  background: linear-gradient(135deg, var(--danger), #b72f37);
}

.small {
  min-height: 32px;
  padding: 0 12px;
}

.mini-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.app-page {
  display: none;
  margin-left: var(--side-nav-width);
}

.app-page.active {
  display: block;
}

.workspace.active {
  flex: 0 0 calc(100vh - 82px);
  height: calc(100vh - 82px);
  max-height: calc(100vh - 82px);
  display: grid;
  grid-template-columns: 340px minmax(720px, 1fr);
  gap: 14px;
  padding: 14px;
  min-height: 0;
  overflow: hidden;
}

.client-view-page,
.registration-page {
  margin-left: 0;
}

.community-page,
.admin-page,
.client-view-page {
  height: calc(100vh - 82px);
  overflow: auto;
  padding: 18px;
}

.client-view-page {
  overflow: hidden;
}

.client-fullscreen-mode .topbar {
  display: none;
}

.client-fullscreen-mode .side-navigation,
.client-fullscreen-mode .workspace-nav {
  display: none;
}

.client-fullscreen-mode .client-view-page.active {
  position: fixed;
  inset: 0;
  margin-left: 0;
  z-index: 1000;
  height: 100vh;
  padding: 0;
  background: #0f1e2b;
}

.client-fullscreen-mode .client-sandbox {
  height: 100vh;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.client-fullscreen-mode .preview-toolbar {
  height: 64px;
}

.client-fullscreen-mode .client-canvas-wrap {
  min-height: calc(100vh - 64px);
}

.client-sandbox {
  height: calc(100vh - 118px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.client-canvas-wrap {
  flex: 1;
}

.page-card {
  min-height: calc(100vh - 118px);
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,253,255,0.98));
  border: 1px solid #ccdde9;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.home-page .page-card {
  padding: 18px;
  background: #f4f8fb;
  border-color: #d6e3ec;
  box-shadow: 0 18px 45px rgba(33, 60, 84, 0.12);
}

.home-dashboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.home-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
}

.home-profile-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  min-height: 124px;
  padding: 18px 22px;
  color: #fff;
  background:
    linear-gradient(135deg, #173551 0%, #214d72 58%, #0f806f 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  box-shadow: 0 18px 38px rgba(17, 48, 75, 0.2);
  overflow: hidden;
}

.home-profile-card::after {
  content: "";
  position: absolute;
  inset: auto 22px 18px auto;
  width: 148px;
  height: 148px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  opacity: 0.45;
}

.home-profile-card > div,
.home-avatar {
  position: relative;
  z-index: 1;
}

.home-avatar {
  display: inline-grid;
  place-items: center;
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  color: #fff;
  background: #2f74ad;
  background-position: center;
  background-size: cover;
  border: 3px solid rgba(255, 255, 255, 0.88);
  border-radius: 8px;
  box-shadow: 0 14px 28px rgba(8, 24, 38, 0.25);
  font-size: 28px;
  font-weight: 900;
}

.home-profile-card .eyebrow {
  color: rgba(255, 255, 255, 0.78);
}

.home-profile-card h2 {
  margin: 5px 0 9px;
  color: #fff;
  font-size: 30px;
  line-height: 1.12;
  letter-spacing: 0;
}

.home-profile-card p:last-child {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin: 0;
  padding: 0 12px;
  color: #dff8f3;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  font-weight: 900;
}

.home-reminder-grid,
.home-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.home-metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.home-reminder-grid article,
.home-overview-grid article,
.home-metric-grid article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #d5e2eb;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(42, 83, 113, 0.07);
}

.home-reminder-grid article:nth-child(1),
.home-metric-grid article:nth-child(1) {
  border-top: 4px solid #2f74ad;
}

.home-reminder-grid article:nth-child(2),
.home-metric-grid article:nth-child(2) {
  border-top: 4px solid #0f8a76;
}

.home-reminder-grid article:nth-child(3),
.home-metric-grid article:nth-child(3) {
  border-top: 4px solid #b7791f;
}

.home-reminder-grid span,
.home-overview-grid span,
.home-metric-grid span {
  display: block;
  margin-bottom: 0;
  color: #63798b;
  font-weight: 900;
  font-size: 13px;
}

.home-reminder-grid strong,
.home-overview-grid strong,
.home-metric-grid strong {
  display: block;
  color: #1f5d91;
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.home-reminder-grid strong {
  font-size: 24px;
}

.home-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 14px;
}

.home-content-grid.compact {
  grid-template-columns: 1fr;
}

.home-panel {
  padding: 18px;
  background: #fff;
  border: 1px solid #d5e2eb;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(42, 83, 113, 0.07);
}

.home-panel .section-title-row {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf3f7;
}

.home-panel .section-title-row h3 {
  margin: 3px 0 0;
  font-size: 19px;
}

.home-work-panel {
  display: grid;
  gap: 12px;
}

.home-score-progress {
  display: grid;
  gap: 7px;
  min-width: 180px;
  color: #557086;
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}

.home-score-progress i {
  display: block;
  width: 180px;
  height: 8px;
  overflow: hidden;
  background: #e8f0f5;
  border-radius: 999px;
}

.home-score-progress b {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0f8a76, #2f74ad);
  border-radius: inherit;
}

.home-action-list,
.home-opportunity-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.home-action-card {
  display: grid;
  gap: 7px;
  min-height: 96px;
  padding: 14px 15px;
  text-align: left;
  background: #f8fbfd;
  border: 1px solid #d8e6ee;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.home-action-card:hover {
  background: #fff;
  border-color: #86b6d6;
  transform: translateY(-1px);
}

.home-action-card span {
  justify-self: start;
  min-height: 24px;
  padding: 3px 9px;
  color: #0b7767;
  background: #e6f6f2;
  border: 1px solid #c9ece4;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.home-action-card strong {
  color: #12283b;
  font-size: 16px;
  line-height: 1.35;
}

.home-action-card em {
  color: #63798b;
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.home-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.home-quick-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 10px 13px;
  background: #eef7fb;
  border: 1px solid #cfe1eb;
  border-radius: 8px;
  color: #12283b;
  cursor: pointer;
}

.home-quick-button:hover {
  background: #fff;
  border-color: #8dbbd4;
}

.home-quick-button strong {
  font-size: 15px;
  font-weight: 900;
}

.home-quick-button span {
  color: #63798b;
  font-size: 12px;
  font-weight: 900;
}

.home-task-list,
.home-notice-list {
  display: grid;
  gap: 10px;
}

.home-task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 70px;
  padding: 14px 16px;
  background: #f8fbfd;
  border: 1px solid #dde8ef;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.home-task-card:hover {
  background: #fff;
  border-color: #9ebfd6;
  transform: translateY(-1px);
}

.home-task-card strong,
.home-notice-item strong {
  display: block;
  color: #12283b;
  font-size: 16px;
  line-height: 1.3;
}

.home-task-card span,
.home-notice-item span {
  display: block;
  margin-top: 6px;
  color: #657b8d;
  font-size: 13px;
  font-weight: 800;
}

.home-task-card em {
  min-height: 30px;
  padding: 5px 10px;
  color: #057865;
  background: #e7f6f2;
  border: 1px solid #c8ebe2;
  border-radius: 999px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.home-notice-item {
  padding: 14px 16px;
  background: #f8fbfd;
  border: 1px solid #dde8ef;
  border-radius: 8px;
}

.home-notice-item p {
  margin: 8px 0 0;
  color: #294154;
  line-height: 1.55;
}

.home-notice-form {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(360px, 1.4fr) 150px;
  gap: 10px;
  align-items: stretch;
}

.home-notice-form input,
.home-notice-form textarea {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  color: #12283b;
  background: #f8fbfd;
  border: 1px solid #cbdcea;
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
  outline: none;
}

.home-notice-form textarea {
  min-height: 56px;
  padding-top: 14px;
  resize: vertical;
}

.home-notice-form input:focus,
.home-notice-form textarea:focus {
  border-color: #6fa7cc;
  box-shadow: 0 0 0 3px rgba(47, 116, 173, 0.13);
}

.home-notice-form .primary-button {
  min-height: 56px;
  border-radius: 8px;
}

.community-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.directory-filters {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  width: min(620px, 100%);
  max-width: 100%;
  min-width: 0;
}

.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
}

.listing-filters {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(220px, 1.45fr) repeat(auto-fit, minmax(120px, 0.85fr));
  gap: 10px;
  width: min(1120px, 100%);
  max-width: 100%;
  min-width: 0;
}

.directory-filters > *,
.listing-filters > *,
.task-toolbar > *,
.task-publish-form > *,
.lead-source-settings > * {
  min-width: 0;
  max-width: 100%;
}

.listing-table-wrap {
  margin-top: 14px;
  max-height: calc(100vh - 230px);
  overflow: auto;
  border: 1px solid #cfdeea;
  border-radius: 10px;
  box-shadow: var(--soft-shadow);
}

.listing-table {
  min-width: 1260px;
  background: #fff;
}

.listing-table-head,
.listing-table-row {
  display: grid;
  grid-template-columns: 120px 150px 165px 70px 95px 115px 90px minmax(130px, 1fr) 110px 150px;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.listing-table-head {
  position: sticky;
  top: 0;
  z-index: 8;
  color: #173247;
  background: #edf6fd;
  font-weight: 800;
}

.listing-table-head span:last-child,
.listing-table-row .listing-actions {
  position: sticky;
  right: 0;
  z-index: 9;
  padding-left: 8px;
  background: inherit;
  box-shadow: -10px 0 14px rgba(255, 255, 255, 0.85);
}

.listing-table-head span:last-child {
  background: #edf6fd;
}

.listing-table-row .listing-actions {
  background: #fff;
}

.listing-view-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
}

.public-listing-wrap {
  margin-top: 12px;
}

.sold-listing-wrap {
  margin-top: 12px;
}

.public-listing-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.public-listing-card {
  overflow: hidden;
  background: #fff;
  border: 1px solid #c8dcea;
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.public-listing-media {
  display: grid;
  place-items: center;
  height: 150px;
  color: #6a8092;
  background: #edf6fd;
  background-position: center;
  background-size: cover;
  font-weight: 900;
}

.public-listing-body {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.public-listing-title,
.public-contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.public-listing-title strong {
  min-width: 0;
  overflow: hidden;
  color: #10263a;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-listing-title span {
  color: #0f7f6d;
  font-weight: 900;
  white-space: nowrap;
}

.public-listing-body p,
.public-wechat {
  margin: 0;
  color: #60798d;
  font-size: 12px;
  font-weight: 800;
}

.public-wechat-thumb {
  width: 42px;
  height: 42px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #d4e3ee;
  border-radius: 6px;
}

.public-wechat-qr {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px;
  background: #fff;
  border: 1px solid #d7e6f0;
  border-radius: 8px;
}

.public-wechat-qr img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 6px;
}

.public-wechat-qr span {
  color: #60798d;
  font-size: 12px;
  font-weight: 900;
}

.public-image-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.public-image-strip span {
  display: grid;
  place-items: end start;
  min-height: 72px;
  padding: 6px;
  color: #fff;
  background-color: #e8f2f8;
  background-position: center;
  background-size: cover;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.public-contact {
  justify-content: flex-start;
  padding: 8px;
  background: #f8fbfd;
  border: 1px solid #d7e6f0;
  border-radius: 8px;
}

.public-contact-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  font-size: 17px;
}

.public-contact div {
  display: grid;
  gap: 2px;
}

.public-contact strong {
  color: #10263a;
}

.public-contact span {
  color: #60798d;
  font-size: 12px;
  font-weight: 800;
}

.public-listing-list {
  overflow: hidden;
  max-width: 1180px;
  background: #fff;
  border: 1px solid #cfdeea;
  border-radius: 10px;
}

.public-listing-list-head,
.public-listing-list-row {
  display: grid;
  grid-template-columns: 130px 80px 90px 160px 100px 120px minmax(140px, 1fr) 90px;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid #d8e6f0;
  font-size: 12px;
}

.public-listing-list-head {
  color: #173247;
  background: #edf6fd;
  font-weight: 900;
}

.public-listing-list-row span,
.public-listing-list-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sold-community-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.sold-community-card,
.sold-community-section {
  background: #fff;
  border: 1px solid #c8dcea;
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.sold-community-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.sold-community-actions,
.sold-community-row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.sold-community-actions {
  flex-wrap: wrap;
}

.sold-community-actions button {
  flex: 1 1 150px;
}

.sold-community-row-actions {
  flex-wrap: nowrap;
}

.sold-community-card-head,
.sold-community-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sold-community-card-head strong,
.sold-community-title strong {
  min-width: 0;
  overflow: hidden;
  color: #10263a;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sold-community-card-head span,
.sold-community-title span {
  color: #0f7f6d;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.sold-community-summary {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px 10px;
  color: #60798d;
  font-size: 13px;
  font-weight: 800;
}

.sold-community-summary strong {
  min-width: 0;
  overflow: hidden;
  color: #10263a;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sold-community-list,
.sold-community-detail,
.sold-community-section {
  overflow: hidden;
  background: #fff;
  border: 1px solid #c8dcea;
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.sold-community-title {
  padding: 10px 12px;
  background: #f8fbfd;
  border-bottom: 1px solid #d7e6f0;
}

.sold-community-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: #f8fbfd;
  border-bottom: 1px solid #d7e6f0;
}

.sold-community-detail-head h3 {
  margin: 2px 0 0;
}

.sold-community-list {
  overflow-x: auto;
}

.sold-community-list-head,
.sold-community-list-row {
  min-width: 980px;
  display: grid;
  grid-template-columns: 170px 90px 90px 90px minmax(160px, 1fr) minmax(180px, 1fr) 180px;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border-bottom: 1px solid #d8e6f0;
  font-size: 12px;
}

.sold-community-list-head {
  color: #173247;
  background: #edf6fd;
  font-weight: 900;
}

.sold-community-list-row span,
.sold-community-list-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sold-listing-list {
  overflow: auto;
}

.sold-listing-list-head,
.sold-listing-list-row {
  min-width: 1320px;
  display: grid;
  grid-template-columns: 130px 140px 170px 80px 100px 110px 90px minmax(150px, 1fr) minmax(160px, 1fr) 190px;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid #d8e6f0;
  font-size: 12px;
}

.sold-listing-list-head {
  color: #173247;
  background: #edf6fd;
  font-weight: 900;
}

.sold-listing-list-row span,
.sold-listing-list-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sold-listing-list-row select {
  min-height: 28px;
  padding: 0 6px;
  border: 1px solid #cbd9e2;
  border-radius: 6px;
  background: #fff;
}

.maintenance-pool {
  margin-top: 18px;
  padding: 14px;
  background: #f8fbfd;
  border: 1px solid #cfdeea;
  border-radius: 8px;
}

.maintenance-table {
  margin-top: 10px;
  max-height: calc(100vh - 230px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.maintenance-table-head,
.maintenance-table-row {
  min-width: 1120px;
  display: grid;
  grid-template-columns: 120px 150px 170px 110px 90px 120px minmax(220px, 1fr) 150px;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.maintenance-table-head {
  position: sticky;
  top: 0;
  z-index: 8;
  color: #173247;
  background: #edf6fd;
  font-weight: 800;
}

.maintenance-table-row:last-child {
  border-bottom: 0;
}

.listing-table-row:last-child {
  border-bottom: 0;
}

.listing-table-row select {
  min-height: 28px;
  padding: 0 6px;
  border: 1px solid #cbd9e2;
  border-radius: 6px;
  background: #fff;
}

.listing-actions {
  display: flex;
  gap: 4px;
}

.listing-actions .small {
  min-width: 34px;
  height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.listing-actions .small:first-child {
  min-width: 52px;
}

.opportunity-tabs,
.listing-tabs,
.task-tabs,
.trend-tabs {
  margin-top: 16px;
  display: inline-flex;
  overflow: hidden;
  border: 1px solid #cbdde9;
  border-radius: 8px;
  background: #f6fbfe;
}

.opportunity-tab,
.listing-tab,
.task-tab,
.trend-tab {
  min-height: 36px;
  padding: 0 18px;
  color: var(--muted);
  background: transparent;
  border-radius: 0;
  font-weight: 800;
}

.opportunity-tab.active,
.listing-tab.active,
.task-tab.active,
.trend-tab.active {
  color: #fff;
  background: #2f6fa8;
}

.trends-page .trend-tabs {
  width: 730px;
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tasks-page .task-tabs {
  width: fit-content;
  margin: 6px 0 0;
  border-color: #c7ddec;
  border-radius: 8px;
  background: #f4f9fd;
}

.tasks-page .task-tab {
  min-height: 36px;
  min-width: 112px;
  padding: 0 16px;
  border-right: 1px solid #c7ddec;
  color: #5f7486;
  font-size: 15px;
  font-weight: 900;
}

.tasks-page .task-tab:last-child {
  border-right: 0;
}

.tasks-page .task-tab.active {
  color: #fff;
  background: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.22);
}

.task-subtabs {
  display: inline-flex;
  gap: 6px;
  margin-bottom: 10px;
  padding: 4px;
  background: #f4f9fd;
  border: 1px solid #c7ddec;
  border-radius: 8px;
}

.task-subtab {
  min-height: 30px;
  padding: 0 12px;
  color: #557187;
  background: transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 900;
}

.task-subtab.active {
  color: #fff;
  background: #2f6fa8;
}

.opportunity-panel,
.listing-panel,
.task-panel,
.trend-panel {
  display: none;
  margin-top: 16px;
}

.trend-panel.active {
  display: grid;
  gap: 10px;
}

.tasks-page .task-panel {
  margin-top: 8px;
}

.opportunity-panel.active,
.listing-panel.active,
.task-panel.active {
  display: block;
}

.opportunities-page .opportunity-panel.active {
  margin-top: 0;
}

.customer-panel-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
}

.opportunity-form,
.opportunity-filters,
.lead-source-settings {
  margin-top: 12px;
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.customer-form {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}

.lead-form {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.lead-quick-create-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #c9dce8;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  background: #f8fcfd;
}

.lead-quick-create-panel[hidden] {
  display: none;
}

.lead-quick-create-panel .section-title-row {
  margin-bottom: 4px;
}

.lead-quick-create-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.opportunity-filters {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  max-width: 100%;
}

.customer-level-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.customer-level-filter .ghost-button {
  flex: 1 1 56px;
  min-height: 34px;
  padding: 0 10px;
}

.customer-level-filter .ghost-button.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

#customerSystemPanel .opportunity-filters {
  margin-top: 0;
  grid-template-columns: minmax(180px, 1.2fr) minmax(170px, 1.05fr) minmax(112px, 0.55fr) minmax(145px, 0.8fr) minmax(145px, 0.9fr) minmax(145px, 0.9fr) minmax(145px, 0.9fr) minmax(145px, 0.9fr);
  gap: 8px;
  align-items: center;
}

#customerSystemPanel .opportunity-filters input,
#customerSystemPanel .opportunity-filters select {
  min-height: 38px;
  height: 38px;
  padding-top: 0;
  padding-bottom: 0;
}

#leadSystemPanel .opportunity-filters {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  max-width: 100%;
  align-items: center;
}

.lead-source-settings {
  align-items: end;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  padding: 10px;
  background: #f8fbfd;
  border: 1px solid #cfdeea;
  border-radius: 8px;
}

.lead-source-settings label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.opportunity-form input,
.opportunity-form select,
.opportunity-filters input,
.opportunity-filters select,
.lead-source-settings select {
  min-height: 34px;
  padding: 0 10px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.opportunity-table-wrap {
  margin-top: 14px;
  max-height: calc(100vh - 230px);
  overflow: auto;
  border: 1px solid #cfdeea;
  border-radius: 10px;
  box-shadow: var(--soft-shadow);
}

.opportunity-log-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.opportunity-log-filters label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.opportunity-log-filters input {
  min-height: 36px;
  padding: 0 10px;
}

.opportunity-log-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.opportunity-log-stats article,
.opportunity-log-card,
.opportunity-log-section {
  border: 1px solid #cfdeea;
  border-radius: 8px;
  background: #fff;
}

.opportunity-log-stats article {
  padding: 10px;
}

.opportunity-log-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.opportunity-log-stats strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 22px;
}

.opportunity-log-section {
  margin-top: 12px;
  padding: 12px;
}

.opportunity-log-table {
  overflow: auto;
  border: 1px solid #dbe7ef;
  border-radius: 8px;
  max-height: 880px;
}

.opportunity-log-table-head,
.opportunity-log-table-row {
  display: grid;
  grid-template-columns: minmax(100px, 1.2fr) repeat(7, minmax(66px, 0.8fr));
  gap: 8px;
  align-items: center;
  min-width: 760px;
  padding: 9px 10px;
  border-bottom: 1px solid #dbe7ef;
}

.opportunity-log-table-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eaf4fb;
  color: var(--text);
  font-weight: 900;
  box-shadow: 0 1px 0 #dbe7ef;
}

.opportunity-log-table-row:last-child {
  border-bottom: 0;
}

.opportunity-log-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.opportunity-log-card {
  min-height: 240px;
  overflow: hidden;
}

.opportunity-log-card h4 {
  margin: 0;
  padding: 10px 12px;
  background: #eaf4fb;
  color: var(--text);
  font-size: 15px;
}

.opportunity-log-card > div {
  max-height: 360px;
  overflow: auto;
}

.opportunity-log-item {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid #e0ebf2;
}

.opportunity-log-item:last-child {
  border-bottom: 0;
}

.opportunity-log-item strong,
.opportunity-log-item span,
.opportunity-log-item p {
  min-width: 0;
  overflow-wrap: anywhere;
}

.opportunity-log-item span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.opportunity-log-item p {
  margin: 0;
  color: var(--text);
  line-height: 1.45;
}

@media (max-width: 1100px) {
  .opportunity-log-detail-grid {
    grid-template-columns: 1fr;
  }
}

#leadDetailBoard .opportunity-table-wrap {
  width: 100%;
  min-width: 0;
  max-width: none;
  max-height: calc(38px + 60 * 42px);
  overflow-y: auto;
  overflow-x: auto;
}

.customer-table,
.lead-table,
.customer-pool-table {
  background: #fff;
}

.customer-table {
  min-width: 1430px;
}

.lead-table {
  width: 100%;
  min-width: 1420px;
  max-width: 100%;
}

.customer-pool-panel {
  margin-top: 0;
}

.task-dashboard {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: calc(100vh - 118px);
}

.tasks-page .page-card {
  padding-top: 18px;
}

.tasks-page .section-title-row {
  margin-bottom: 2px;
}

.tasks-page .section-title-row h2 {
  font-size: 20px;
}

.tasks-page .section-title-row .eyebrow {
  margin-bottom: 2px;
}

.task-toolbar,
.task-publish-form {
  display: grid;
  gap: 10px;
}

.task-toolbar {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  width: min(980px, 100%);
  max-width: 100%;
  min-width: 0;
  margin-bottom: 10px;
}

.task-publish-form {
  width: 100%;
  max-width: 900px;
  min-width: 0;
}

.task-publish-subtabs {
  margin-bottom: 0;
}

.task-scope-field {
  display: none;
}

.task-publish-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: #fbfdff;
  border: 1px solid #c8dcea;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(46, 85, 120, 0.08);
}

.task-publish-card-head,
.task-publish-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.task-publish-card-head h3 {
  margin: 0;
  color: #10263a;
  font-size: 22px;
}

.task-publish-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 180px 180px;
  gap: 12px;
}

.task-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.task-field.wide {
  grid-column: span 2;
}

.task-field.full {
  grid-column: 1 / -1;
}

.task-field input,
.task-field select,
.task-field textarea {
  width: 100%;
  min-width: 0;
  color: #10263a;
  font-size: 14px;
}

.task-field textarea {
  resize: vertical;
  min-height: 120px;
}

.task-publish-actions {
  padding-top: 4px;
  border-top: 1px solid #e2edf5;
}

.task-publish-actions span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.task-publish-form .primary-button {
  min-width: 150px;
}

.task-stat-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px;
  margin: 0 0 4px;
}

.task-stat-pill {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  min-height: 32px;
  padding: 0 10px;
  color: #245b8c;
  background: #f5faff;
  border: 1px solid #c8dcea;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.task-stat-pill strong {
  color: #112b40;
  font-size: 18px;
  line-height: 1;
}

.task-stat-pill em {
  font-style: normal;
  color: #245b8c;
}

.task-featured-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.task-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
}

.task-board.list-mode {
  display: block;
  max-width: 1220px;
}

.task-view-switch {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.task-view-switch .small {
  min-height: 34px;
  padding: 0 12px;
}

.task-view-switch .active {
  color: #fff;
  background: #2f6fa8;
  border-color: #2f6fa8;
}

.task-card {
  display: grid;
  gap: 7px;
  padding: 10px 10px 10px 11px;
  background: #fff;
  border: 1px solid #cfdeea;
  border-left: 3px solid #8fbce1;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(46, 85, 120, 0.05);
  cursor: pointer;
}

.task-card.active {
  border-color: #2f6fa8;
  box-shadow: 0 0 0 2px rgba(47, 111, 168, 0.16), 0 8px 20px rgba(46, 85, 120, 0.08);
}

.task-card.status-open {
  border-left-color: #2f6fa8;
}

.task-card.status-pending,
.task-card.status-reviewed {
  border-left-color: #c59a21;
}

.task-card.status-paid {
  border-left-color: #087f73;
}

.task-card.status-cancelled {
  border-left-color: #9ba7ad;
  opacity: 0.78;
}

.task-card.featured {
  border-color: #8fbce1;
  border-left-color: #087f73;
  background: linear-gradient(180deg, #f8fcff, #fff);
}

.task-card-head,
.task-card-meta,
.task-card-rewards,
.task-card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.task-card-head {
  justify-content: space-between;
}

.task-card-head-pills {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
}

.task-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.86) 0 18%, transparent 18%),
    linear-gradient(145deg, #2f79ba, #087f73);
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(207, 222, 234, 0.95);
  border-radius: 8px;
  box-shadow: 0 5px 12px rgba(46, 85, 120, 0.12);
  font-size: 14px;
  font-weight: 950;
  line-height: 1;
}

.task-avatar.has-image {
  color: transparent;
  background-color: #edf5fb;
}

.task-avatar.small {
  width: 22px;
  height: 22px;
  flex-basis: 22px;
  border-radius: 6px;
  font-size: 11px;
}

.task-avatar.inline {
  margin-left: 6px;
  vertical-align: -5px;
}

.task-owner-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.task-card h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
}

.task-card p {
  margin: 0;
  color: #263d4f;
  line-height: 1.45;
  font-size: 13px;
}

.task-card-meta {
  color: var(--muted);
  font-size: 12px;
}

.task-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  background: #edf6fd;
  border: 1px solid #cfdeea;
  border-radius: 6px;
  color: #1f5c8d;
  font-size: 12px;
  font-weight: 800;
}

.task-pill.reward {
  background: #fff7d9;
  border-color: #ead28a;
  color: #8a6811;
}

.task-pill.split {
  background: #e9f7f2;
  border-color: #aadcc9;
  color: #087f73;
}

.task-pill.featured {
  background: #e9f7f2;
  border-color: #aadcc9;
  color: #087f73;
}

.task-pill.status {
  color: #173247;
  background: #f5f9fc;
}

.task-list {
  border: 1px solid #cfdeea;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.task-list-head,
.task-list-row {
  display: grid;
  grid-template-columns: minmax(230px, 1.1fr) minmax(280px, 1.3fr) 110px 90px 110px 180px;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}

.task-list-head {
  color: #173247;
  background: #edf6fd;
  font-weight: 900;
}

.task-list-row {
  cursor: pointer;
}

.task-list-row:hover,
.task-list-row.active {
  background: #f7fbff;
}

.task-list-row:last-child {
  border-bottom: 0;
}

.task-list-row p,
.task-list-title em {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-list-row p {
  color: #40566a;
}

.task-list-title {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 30px;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.task-list-title strong {
  display: block;
  overflow: hidden;
  color: #10263a;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-list-title em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.task-type-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
}

.task-type-icon.type-find { background: #2f6fa8; }
.task-type-icon.type-sale { background: #d8a11c; }
.task-type-icon.type-negotiate { background: #0b8a70; }
.task-type-icon.type-red { background: #c94b4b; }
.task-type-icon.type-orange { background: #d06f23; }
.task-type-icon.type-teal { background: #178b8f; }
.task-type-icon.type-cyan { background: #2186a6; }
.task-type-icon.type-indigo { background: #4269a8; }

.task-card-actions {
  padding-top: 4px;
  border-top: 1px solid #e3edf4;
}

.task-card-actions .small {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.task-participants {
  display: grid;
  gap: 5px;
  max-height: 92px;
  overflow: auto;
  padding: 6px;
  background: #f8fbfd;
  border: 1px solid #d9e6ef;
  border-radius: 6px;
  font-size: 12px;
}

.task-participants span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-ranking {
  max-width: 860px;
  border: 1px solid #cfdeea;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.task-ranking-head,
.task-ranking-row {
  display: grid;
  grid-template-columns: 80px 150px 140px 140px 1fr;
  gap: 8px;
  align-items: center;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}

.task-ranking-head {
  background: #edf6fd;
  color: #173247;
  font-weight: 800;
}

.task-ranking-row:last-child {
  border-bottom: 0;
}

.task-rules-panel {
  display: grid;
  gap: 10px;
  max-width: 980px;
  padding: 10px;
  background: #f8fbfd;
  border: 1px solid #cfdeea;
  border-radius: 8px;
}

.task-rules-panel .section-title-row {
  margin-bottom: 0;
}

.task-rule-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 140px 96px 110px 130px;
  gap: 7px;
  align-items: center;
}

.task-rule-table {
  border: 1px solid #cfdeea;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.task-rule-head,
.task-rule-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 140px 96px 110px 95px 160px;
  gap: 7px;
  align-items: center;
  min-height: 38px;
  padding: 6px 9px;
  border-bottom: 1px solid var(--line);
}

.task-rule-head {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #173247;
  background: #edf6fd;
  font-weight: 900;
}

.task-rule-row:last-child {
  border-bottom: 0;
}

.task-rule-row input,
.task-rule-row select {
  min-height: 30px;
  padding: 0 9px;
  font-size: 13px;
}

.task-rule-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.task-rule-actions .small {
  min-height: 30px;
  padding: 0 9px;
}

.industry-rule-title {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #d8e7f0;
}

.industry-rule-head,
.industry-rule-row {
  grid-template-columns: 1fr 1fr 1fr 0.8fr 0.8fr 1.2fr;
}

.industry-user-head,
.industry-user-row {
  grid-template-columns: 1fr 1fr 0.9fr 1fr 0.75fr 0.9fr 1.15fr;
}

.task-detail-board {
  margin-top: 12px;
}

.task-detail-card {
  display: grid;
  gap: 12px;
  max-width: 1180px;
  padding: 14px;
  background: #fff;
  border: 1px solid #c8dcea;
  border-left: 4px solid #2f6fa8;
  border-radius: 10px;
  box-shadow: 0 10px 26px rgba(46, 85, 120, 0.08);
}

.task-detail-meta,
.task-detail-grid {
  display: grid;
  gap: 10px;
}

.task-detail-meta {
  grid-template-columns: repeat(4, max-content);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.task-detail-description {
  margin: 0;
  color: #183144;
  line-height: 1.55;
}

.task-detail-grid {
  grid-template-columns: minmax(420px, 1.1fr) minmax(360px, 0.9fr);
  align-items: start;
}

.task-detail-grid h4,
.task-change-log h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.task-follow-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.task-follow-row {
  display: grid;
  gap: 6px;
  padding: 9px;
  background: #f8fbfd;
  border: 1px solid #d9e6ef;
  border-radius: 8px;
}

.task-follow-row header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.task-follow-row header strong {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.task-follow-row p {
  margin: 0;
  color: #183144;
  line-height: 1.45;
}

.task-submit-box,
.task-status-editor {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.task-extra-reward-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 8px;
}

.task-submit-box textarea {
  resize: vertical;
}

.task-status-editor {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.task-inline-message {
  margin: 0;
  color: #ba2d34;
  font-size: 12px;
  font-weight: 800;
}

.task-permission-note {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.task-award-selector {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px;
  background: #fffaf0;
  border: 1px solid #ead28a;
  border-radius: 8px;
}

.task-award-selector h4,
.task-award-selector p {
  margin: 0;
}

.task-award-selector p {
  color: #806318;
  font-size: 12px;
  font-weight: 800;
}

.task-award-candidates {
  display: grid;
  gap: 7px;
  max-height: 220px;
  overflow: auto;
}

.task-award-candidate {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px;
  background: #fff;
  border: 1px solid #ead28a;
  border-radius: 7px;
}

.task-award-candidate span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.task-award-candidate em,
.task-award-candidate small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
}

.task-award-candidate strong {
  color: #10263a;
}

.task-award-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.task-proof-preview {
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 10px;
  background: #f8fbfd;
  border: 1px solid #d9e6ef;
  border-radius: 8px;
}

.task-proof-preview img {
  max-width: 420px;
  max-height: 420px;
  object-fit: contain;
  border: 1px solid #cfdeea;
  border-radius: 8px;
}

.task-change-log .follow-timeline {
  max-height: 180px;
  overflow: auto;
}

.customer-pool-tools {
  display: grid;
  grid-template-columns: 220px 120px auto auto minmax(260px, 1fr);
  gap: 10px;
  align-items: end;
  margin-top: 0;
  padding: 12px;
  background: #f8fbfd;
  border: 1px solid #cfdeea;
  border-radius: 8px;
}

.customer-pool-tools label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.customer-pool-tools select {
  min-height: 36px;
  padding: 0 10px;
}

.customer-pool-tools span {
  color: #5f7486;
  font-size: 12px;
  font-weight: 800;
}

.customer-pool-pager {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.row-check {
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.lead-community-board,
.lead-detail-board {
  margin-top: 14px;
}

#leadSystemPanel .lead-community-board {
  margin-top: 0;
}

#customerOtherPanel .opportunity-filters,
#opportunityLogPanel .opportunity-log-filters {
  margin-top: 0;
}

.lead-list-actions {
  gap: 12px;
}

.lead-import-button,
.lead-back-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.lead-import-button {
  box-shadow: 0 8px 18px rgba(8, 127, 115, 0.16);
}

.lead-back-button {
  color: #fff;
  background: linear-gradient(135deg, #2f6fa8, #245b8c);
  border-color: #245b8c;
  box-shadow: 0 8px 18px rgba(47, 111, 168, 0.18);
}

.lead-back-button:hover {
  background: linear-gradient(135deg, #286399, #1f507d);
}

.lead-detail-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.lead-detail-stats span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  color: #1f5c8d;
  background: #eef7fd;
  border: 1px solid #cfdeea;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.lead-detail-stats strong {
  color: #0f2437;
  font-size: 16px;
}

.lead-erp-toolbar {
  display: grid;
  grid-template-columns: 260px 170px 74px max-content max-content minmax(180px, 1fr);
  gap: 10px;
  align-items: end;
  margin-top: 12px;
  padding: 10px;
  background: #f8fbfd;
  border: 1px solid #cfdeea;
  border-radius: 8px;
}

.lead-erp-toolbar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.lead-erp-toolbar select,
.lead-erp-toolbar input {
  min-height: 34px;
  padding: 0 10px;
}

.lead-erp-toolbar span {
  color: #5f7486;
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.lead-community-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.lead-community-toolbar {
  margin: 10px 0;
}

.lead-community-toolbar input {
  width: min(100%, 760px);
  min-height: 40px;
  padding: 0 14px;
  font-size: 14px;
}

.lead-community-grid.list-mode {
  display: block;
}

.lead-source-badge {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  border-radius: 999px;
  color: transparent;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  font-size: 0;
  line-height: 0;
  overflow: hidden;
  text-indent: 999px;
  white-space: nowrap;
  vertical-align: middle;
}

.lead-source-badge.public {
  background-image: url("./assets/lead-badge-public.png");
}

.lead-source-badge.private {
  background-image: url("./assets/lead-badge-private.png");
}

.lead-community-card {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  aspect-ratio: 1 / 1;
  min-height: 0;
  padding: 18px 112px 56px 20px;
  background: linear-gradient(145deg, #ffffff 0%, #fbfdff 58%, #f6fbff 100%);
  border: 1px solid #cfdeea;
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(28, 66, 96, 0.06);
}

.lead-card-badges {
  position: absolute;
  top: 14px;
  right: 18px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.lead-card-badges .lead-source-badge {
  width: 36px;
  height: 36px;
  margin-left: 0;
  filter: drop-shadow(0 8px 16px rgba(15, 36, 55, 0.12));
}

.lead-community-card > .lead-community-actions {
  position: absolute;
  right: 14px;
  bottom: 14px;
}

.lead-community-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.lead-community-actions .small {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  box-shadow: none;
}

.lead-community-actions .ghost-button.small {
  color: #27506b;
  background: #f8fbfd;
  border-color: #c9deef;
}

.lead-community-actions .danger-button.small {
  color: #b6333b;
  background: #fff4f4;
  border: 1px solid #efc5c8;
}

.lead-community-list {
  overflow: hidden;
  border: 1px solid #cfdeea;
  border-radius: 8px;
  background: #fff;
}

.lead-community-list-head,
.lead-community-list-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) 120px 84px 84px minmax(240px, 1.4fr) minmax(180px, 1fr) 104px;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.lead-community-list-head {
  color: #173247;
  background: #edf6fd;
  font-weight: 900;
}

.lead-community-list-row {
  cursor: pointer;
}

.lead-community-list-row:hover {
  background: #f8fbfd;
}

.lead-community-list-row:last-child {
  border-bottom: 0;
}

.lead-community-list-row > * {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-community-inline-actions {
  overflow: visible;
  white-space: normal;
}

.lead-community-inline-actions .lead-community-actions {
  justify-content: flex-start;
}

.lead-community-card:hover {
  border-color: #6fa8d6;
  background: #f8fbfd;
}

.lead-community-card strong,
.lead-community-card span {
  display: block;
}

.lead-community-card strong {
  color: #0f2437;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-community-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.lead-community-card dl {
  display: grid;
  gap: 6px;
  min-height: 0;
  margin: 0;
  overflow: hidden;
}

.lead-community-card dl div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-width: 0;
}

.lead-community-card dl .lead-community-follow-row {
  width: calc(100% + 88px);
  max-width: calc(100% + 88px);
}

.lead-community-follow-row dd {
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 4;
}

.lead-community-card dt {
  color: var(--muted);
  font-weight: 800;
}

.lead-community-card dd {
  margin: 0;
  color: #173247;
  overflow: hidden;
  word-break: break-all;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.lead-export-panel {
  margin-top: 10px;
  padding: 8px 10px;
  background: #f8fbfd;
  border: 1px solid #cfdeea;
  border-radius: 8px;
}

.lead-export-panel[hidden] {
  display: none;
}

.lead-export-panel .section-title-row {
  margin-bottom: 6px;
}

.lead-export-requests {
  display: grid;
  gap: 6px;
}

.lead-export-request {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px 9px;
  background: #fff;
  border: 1px solid #cfdeea;
  border-radius: 8px;
}

.lead-export-request.pending {
  border-color: #f2c94c;
}

.lead-export-request.approved {
  border-color: #4bbf73;
}

.lead-export-request.rejected {
  border-color: #d96a6a;
  opacity: 0.82;
}

.lead-export-request strong,
.lead-export-request span,
.lead-export-request em {
  display: block;
}

.lead-export-request strong {
  font-size: 13px;
}

.lead-export-request span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.lead-export-request em {
  margin-top: 2px;
  color: #8aa0b2;
  font-size: 11px;
  font-style: normal;
}

.customer-table-head,
.customer-table-row,
.customer-pool-head,
.customer-pool-row,
.lead-table-head,
.lead-table-row {
  display: grid;
  gap: 10px;
  align-items: center;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.customer-table-head,
.customer-pool-head,
.lead-table-head {
  position: sticky;
  top: 0;
  z-index: 8;
  color: #173247;
  background: #edf6fd;
  font-weight: 800;
}

.customer-table-row:last-child,
.customer-pool-row:last-child,
.lead-table-row:last-child {
  border-bottom: 0;
}

.customer-table-head,
.customer-table-row {
  grid-template-columns: 34px 64px minmax(104px, 0.78fr) 64px 100px 74px minmax(170px, 1.45fr) 66px minmax(136px, 1fr) minmax(104px, 0.72fr) 116px 166px;
  gap: 6px;
}

.customer-table-row {
  cursor: pointer;
}

#customerSystemPanel .opportunity-table-wrap {
  margin-top: 8px;
  max-height: calc(100vh - 188px);
  overflow-x: auto;
}

#customerSystemPanel .customer-table {
  width: 100%;
  min-width: 1580px;
}

#customerSystemPanel .customer-table .customer-table-head,
#customerSystemPanel .customer-table .customer-table-row {
  min-width: 0;
}

#customerSystemPanel .customer-table .customer-table-head > span,
#customerSystemPanel .customer-table .customer-table-row > span,
#customerSystemPanel .customer-table .customer-table-row > strong {
  min-width: 0;
}

#customerSystemPanel .customer-table .customer-table-head > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#customerSystemPanel .customer-table,
#customerSystemPanel .customer-table-footer,
#customerDetailDrawer .side-drawer {
  font-size: calc(16px * var(--customer-ui-scale, 1));
}

#customerSystemPanel .customer-table .customer-table-head,
#customerSystemPanel .customer-table .customer-table-row {
  font-size: calc(12px * var(--customer-ui-scale, 1));
}

#customerSystemPanel .customer-table input,
#customerSystemPanel .customer-table select,
#customerSystemPanel .customer-table button,
#customerSystemPanel .customer-table-footer select,
#customerSystemPanel .customer-table-footer button,
#customerDetailDrawer input,
#customerDetailDrawer select,
#customerDetailDrawer textarea,
#customerDetailDrawer button {
  font-size: inherit;
}

.customer-zoom-controls {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.customer-table-row.customer-level-a {
  background: #c7efd5;
}

.customer-table-row.customer-level-b {
  background: #d9ecff;
}

.customer-table-row.customer-level-c {
  background: #fff9d8;
}

.customer-table-row.customer-level-d {
  background: #ead8c6;
}

.customer-level-pill {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 24px;
  margin-right: 8px;
  padding: 0 8px;
  color: #102438;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(28, 66, 96, 0.16);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
}

.customer-level-cell {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.customer-level-cell > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-name-cell {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: normal;
}

.customer-area-cell {
  color: #24445d;
  font-weight: 900;
}

.customer-row-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  align-items: center;
}

.customer-row-actions .ghost-button,
.customer-row-actions .danger-button {
  min-height: 28px;
  padding: 0 7px;
  white-space: nowrap;
}

.customer-owner-cell {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  align-items: center;
  min-width: 0;
}

.customer-owner-name,
.customer-partner-name,
.customer-visibility-control {
  min-width: 0;
}

.customer-owner-name,
.customer-partner-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-partner-name::before {
  content: "/";
  margin-right: 4px;
  color: #7d92a1;
  font-weight: 800;
}

.customer-visibility-control {
  display: block;
}

.customer-visibility-control select {
  width: 112px;
  max-width: 100%;
  min-height: 28px;
  padding: 0 8px;
}

.customer-owner-note {
  display: none;
  color: #5f7486;
  font-size: 11px;
  font-weight: 800;
}

.customer-inline-follow-row {
  padding: 10px;
  background: #f8fbfd;
  border-bottom: 1px solid var(--line);
}

.customer-inline-follow-card {
  display: grid;
  grid-template-columns: minmax(150px, 0.35fr) minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: #fff;
  border: 1px solid #cbddea;
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(40, 73, 96, 0.08);
}

.customer-inline-follow-card strong,
.customer-inline-follow-card span {
  display: block;
}

.customer-inline-follow-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.customer-inline-follow-card textarea {
  width: 100%;
  min-height: 54px;
  padding: 8px 10px;
  resize: vertical;
}

.customer-inline-phone-card input {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
}

.customer-inline-follow-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.customer-table-footer,
.lead-table-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

#customerSystemPanel .customer-table-footer {
  justify-content: flex-start;
  padding-right: 110px;
}

#customerSystemPanel .customer-pager {
  margin-left: auto;
}

.customer-bottom-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
  justify-content: flex-start;
  margin-top: 6px;
  padding-right: 110px;
  color: #627789;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}

.opportunity-bottom-summary {
  min-height: 0;
}

.customer-bottom-summary span {
  color: #627789;
}

.customer-bottom-summary strong {
  color: #536b7e;
  font-size: 12px;
}

.customer-bottom-summary b {
  color: #102438;
  font-size: 13px;
}

.customer-bottom-summary em {
  color: #6f8392;
  font-style: normal;
  font-size: 12px;
}

.customer-page-size,
.customer-pager {
  display: flex;
  gap: 8px;
  align-items: center;
}

.customer-page-size select,
.customer-pager select {
  min-height: 34px;
  padding: 0 10px;
  color: var(--text);
  background: #fbfdff;
  border: 1px solid #cbddea;
  border-radius: 8px;
  font-weight: 800;
}

.customer-pager-muted {
  color: #5f7688;
}

.customer-level-select {
  flex: 0 0 72px;
  min-width: 72px;
  height: 28px;
  padding: 0 8px;
  color: #102438;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(28, 66, 96, 0.18);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
}

.customer-pool-head,
.customer-pool-row {
  grid-template-columns: 46px 110px 130px minmax(220px, 1fr) minmax(220px, 1fr) 110px 250px;
}

.customer-pool-head.no-select,
.customer-pool-row.no-select {
  grid-template-columns: 110px 130px minmax(220px, 1fr) minmax(220px, 1fr) 110px 205px;
}

@media (max-width: 1500px) {
  .customer-table-head,
  .customer-table-row {
    grid-template-columns: 32px 56px minmax(92px, 0.7fr) 56px 86px 64px minmax(150px, 1.4fr) 54px minmax(132px, 1fr) minmax(94px, 0.72fr) 112px 152px;
    gap: 4px;
    padding: 6px 8px;
  }

  #customerSystemPanel .customer-table .customer-table-head,
  #customerSystemPanel .customer-table .customer-table-row {
    font-size: calc(11px * var(--customer-ui-scale, 1));
  }

  .customer-row-actions {
    gap: 4px;
  }

  .customer-row-actions .ghost-button,
  .customer-row-actions .danger-button {
    min-height: 26px;
    padding: 0 5px;
  }

  .customer-level-select {
    min-width: 58px;
    padding: 0 5px;
  }
}

@media (max-width: 1500px) {
  #customerSystemPanel .opportunity-filters {
    grid-template-columns: minmax(150px, 1fr) minmax(140px, 0.9fr) minmax(96px, 0.5fr) repeat(5, minmax(118px, 0.82fr));
    gap: 6px;
  }

  #customerSystemPanel .opportunity-filters input,
  #customerSystemPanel .opportunity-filters select {
    min-height: 34px;
    height: 34px;
    padding-left: 8px;
    padding-right: 8px;
  }
}

.lead-table-head,
.lead-table-row {
  gap: 4px;
  grid-template-columns: 34px 92px 88px 120px minmax(210px, 1.35fr) 70px 128px 116px 96px minmax(250px, 1.7fr) 100px 150px;
  grid-auto-flow: column;
  padding: 7px 6px;
  min-height: 42px;
}

.lead-table-head > :nth-child(1),
.lead-table-row > :nth-child(1) { grid-column: 1; }
.lead-table-head > :nth-child(2),
.lead-table-row > :nth-child(2) { grid-column: 2; }
.lead-table-head > :nth-child(3),
.lead-table-row > :nth-child(3) { grid-column: 3; }
.lead-table-head > :nth-child(4),
.lead-table-row > :nth-child(4) { grid-column: 4; }
.lead-table-head > :nth-child(5),
.lead-table-row > :nth-child(5) { grid-column: 5; }
.lead-table-head > :nth-child(6),
.lead-table-row > :nth-child(6) { grid-column: 6; }
.lead-table-head > :nth-child(7),
.lead-table-row > :nth-child(7) { grid-column: 7; }
.lead-table-head > :nth-child(8),
.lead-table-row > :nth-child(8) { grid-column: 8; }
.lead-table-head > :nth-child(9),
.lead-table-row > :nth-child(9) { grid-column: 9; }
.lead-table-head > :nth-child(10),
.lead-table-row > :nth-child(10) { grid-column: 10; }
.lead-table-head > :nth-child(11),
.lead-table-row > :nth-child(11) { grid-column: 11; }
.lead-table-head > :nth-child(12),
.lead-table-row > :nth-child(12) { grid-column: 12; }
.lead-table-head > :nth-child(13),
.lead-table-row > :nth-child(13) { grid-column: 13; }

.table-enhanced-head > * {
  position: relative;
  min-width: 0;
  padding-right: 14px;
  cursor: pointer;
  user-select: none;
}

.table-enhanced-head > *.is-sort-asc::after,
.table-enhanced-head > *.is-sort-desc::after {
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  font-size: 11px;
  font-weight: 950;
}

.table-enhanced-head > *.is-sort-asc::after {
  content: "↑";
}

.table-enhanced-head > *.is-sort-desc::after {
  content: "↓";
}

.table-resize-handle {
  position: absolute;
  top: 5px;
  right: -5px;
  bottom: 5px;
  width: 10px;
  cursor: col-resize;
  touch-action: none;
  z-index: 2;
}

.table-resize-handle::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 4px;
  width: 1px;
  background: rgba(47, 111, 168, 0.28);
}

body.table-resizing {
  cursor: col-resize;
  user-select: none;
}

.lead-table-head > *,
.lead-table-row > * {
  min-width: 0;
}

.lead-select-cell {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.lead-select-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lead-select-cell input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
}

.lead-table-row > span,
.lead-table-row > strong,
.lead-table-head > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-table-head {
  z-index: 4;
  box-shadow: 0 1px 0 var(--line);
}

.lead-table-row > span,
.lead-table-row > strong {
  line-height: 1.35;
}

.lead-table-row > strong {
  font-size: 12px;
}

.lead-follow-cell {
  overflow: visible !important;
  white-space: normal !important;
}

.lead-follow-summary {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.lead-follow-summary strong,
.lead-follow-summary small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-follow-summary strong {
  color: var(--text);
  font-size: 12px;
}

.lead-follow-summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.lead-table-row .listing-actions {
  display: flex;
  justify-content: flex-start;
  gap: 3px;
  white-space: nowrap;
}

.lead-table-row .listing-actions .small {
  min-height: 28px;
  min-width: 34px;
  padding: 0 6px;
  border-radius: 7px;
  font-size: 12px;
}

.lead-phone-link {
  min-height: 28px;
  padding: 0;
  color: var(--text);
  font: inherit;
  font-weight: 900;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.lead-phone-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.lead-phone-follow-backdrop {
  z-index: 95;
}

.lead-phone-follow-panel {
  width: min(560px, 100%);
}

.lead-phone-follow-info {
  display: grid;
  gap: 8px;
  margin: 12px 0 14px;
}

.lead-phone-follow-info div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  background: #f6fafc;
  border: 1px solid #d6e4ed;
  border-radius: 8px;
}

.lead-phone-follow-info dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.lead-phone-follow-info dd {
  margin: 0;
  color: var(--text);
  font-weight: 900;
}

.lead-phone-follow-number {
  font-size: 22px;
  letter-spacing: 0;
}

.lead-phone-follow-field {
  margin-top: 8px;
}

.lead-follow-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 7px 0 8px;
}

.lead-follow-quick .ghost-button.small {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.lead-phone-follow-field textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
}

.lead-phone-follow-warning {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.lead-phone-follow-warning[data-type="error"] {
  color: #c9353f;
  font-weight: 900;
}

.lead-phone-follow-warning[data-type="success"] {
  color: #087f68;
  font-weight: 900;
}

.lead-follow-cell {
  min-width: 0;
}

.lead-inline-follow {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto auto;
  gap: 5px;
  align-items: center;
}

.lead-inline-follow input {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.lead-inline-follow .small {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.lead-table-row.duplicate {
  background: #fff8ec;
}

.lead-table-row.lead-tag-intent {
  background: #ddf5e6;
}

.lead-table-row.lead-tag-listed {
  background: #fff5c9;
}

.lead-table-row.lead-tag-sold {
  background: #ffe1df;
}

.lead-table-row.lead-tag-renting {
  background: #dcebfb;
}

.lead-table-row.duplicate.lead-tag-intent,
.lead-table-row.duplicate.lead-tag-listed,
.lead-table-row.duplicate.lead-tag-renting,
.lead-table-row.duplicate.lead-tag-sold {
  box-shadow: inset 4px 0 0 #d49b2a;
}

.customer-table-row select,
.lead-table-row select {
  min-height: 28px;
  padding: 0 6px;
  border-radius: 6px;
}

.empty-table-state {
  padding: 18px;
  color: var(--muted);
  font-size: 13px;
}

.deal-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.deal-cell > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deal-cell .small {
  height: 26px;
  padding: 0 7px;
  font-size: 12px;
}

.listing-detail-panel {
  width: min(1480px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  overflow-x: hidden;
}

.listing-detail-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 14px;
}

.listing-detail-main,
.listing-follow-panel {
  padding: 14px;
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-radius: 10px;
  min-width: 0;
  overflow: hidden;
}

.listing-detail-main .status-pill {
  margin-bottom: 10px;
  display: inline-flex;
}

.listing-detail-main .detail-list {
  margin-top: 2px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
}

.listing-detail-main .detail-list > div {
  display: grid;
  grid-template-columns: minmax(76px, 94px) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 9px;
  background: #fff;
  border: 1px solid #dbe9f3;
  border-radius: 8px;
}

.listing-detail-main .detail-list dt {
  color: #5d7488;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
}

.listing-detail-main .detail-list dd {
  min-width: 0;
  margin: 0;
}

.detail-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-detail-input {
  width: 100%;
  min-height: 34px;
  padding: 5px 8px;
  font: inherit;
  font-weight: 700;
}

.listing-detail-main .detail-list .listing-wechat-row,
.listing-detail-main .detail-list .detail-wide-row {
  grid-column: 1 / -1;
  grid-template-columns: minmax(76px, 94px) minmax(0, 1fr);
}

.listing-detail-main .detail-list .listing-wechat-row {
  align-items: start;
}

.listing-wechat-uploader {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  max-width: 100%;
}

.listing-follow-panel textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.listing-follow-panel,
.listing-follow-panel * {
  overflow-wrap: anywhere;
}

.listing-wechat-upload-button {
  position: relative;
  overflow: hidden;
}

.listing-wechat-upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.listing-wechat-preview {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  margin-top: 8px;
  color: #71879a;
  background: #fff;
  border: 1px dashed #b8cfdf;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 900;
}

.listing-wechat-preview.has-image {
  padding: 6px;
  border-style: solid;
  border-color: #c6dae8;
}

.listing-wechat-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.listing-wechat-cropper {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-top: 10px;
  padding: 12px;
  background: #fff;
  border: 1px solid #d2e2ee;
  border-radius: 10px;
}

.listing-wechat-cropper[hidden] {
  display: none;
}

.listing-wechat-crop-stage {
  position: relative;
  width: 220px;
  height: 220px;
  overflow: hidden;
  background: #dceaf3;
  border: 1px solid #bad2e4;
  border-radius: 10px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.listing-wechat-crop-stage:active {
  cursor: grabbing;
}

.listing-wechat-crop-stage img {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: none;
  transform: translate(-50%, -50%);
  transform-origin: center;
  pointer-events: none;
}

.listing-wechat-crop-frame {
  position: absolute;
  inset: 12px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  box-shadow:
    0 0 0 999px rgba(16, 38, 58, 0.34),
    0 10px 26px rgba(16, 38, 58, 0.18);
  pointer-events: none;
}

.listing-wechat-crop-controls {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.listing-wechat-crop-controls label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.listing-wechat-crop-controls input[type="range"] {
  width: 100%;
  min-height: 24px;
  padding: 0;
}

.listing-wechat-crop-message {
  grid-column: 2;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.listing-wechat-crop-message.is-error {
  color: #b42318;
}

.listing-wechat-crop-actions {
  grid-column: 2;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.listing-follow-panel {
  display: grid;
  align-content: start;
  gap: 10px;
}

.listing-follow-panel h3 {
  margin: 0;
  font-size: 18px;
}

.follow-timeline {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.follow-timeline li {
  padding: 10px;
  background: #fff;
  border: 1px solid #dce7ea;
  border-radius: 8px;
}

.follow-timeline strong {
  display: block;
  font-size: 12px;
  color: var(--primary-dark);
}

.follow-timeline span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.follow-timeline p {
  margin: 6px 0 0;
  color: var(--text);
  line-height: 1.55;
  font-size: 13px;
}

.side-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  justify-content: flex-end;
  background: rgba(18, 32, 43, 0.22);
}

.side-drawer-backdrop.visible {
  display: flex;
}

.side-drawer {
  width: min(520px, 100%);
  height: 100%;
  overflow: auto;
  padding: 20px;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 50px rgba(18, 32, 43, 0.18);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.drawer-header h2 {
  margin: 2px 0 0;
  font-size: 22px;
}

.drawer-section {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.drawer-section h3 {
  margin: 0;
  font-size: 16px;
}

.drawer-section textarea {
  width: 100%;
  resize: vertical;
}

.drawer-inline-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.customer-detail-form {
  grid-template-columns: 1fr 1fr;
}

.customer-detail-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.customer-detail-form input,
.customer-detail-form select,
.customer-detail-form textarea {
  min-height: 34px;
  padding: 8px 10px;
}

.customer-detail-form .drawer-wide-field,
.customer-detail-form .primary-button {
  grid-column: 1 / -1;
}

.customer-drawer-follow-box {
  display: grid;
  gap: 8px;
}

.customer-drawer-follow-box textarea {
  width: 100%;
  min-height: 86px;
  padding: 10px;
  resize: vertical;
}

.customer-drawer-follow-box .primary-button {
  width: 100%;
}

.partner-search-field {
  position: relative;
}

.partner-suggestions {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: grid;
  gap: 4px;
  padding: 6px;
  background: #fff;
  border: 1px solid #c8dceb;
  border-radius: 8px;
  box-shadow: 0 14px 32px rgba(15, 38, 58, 0.16);
}

.partner-suggestion {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.partner-suggestion strong {
  font-size: 14px;
}

.partner-suggestion span,
.partner-suggestion-empty {
  color: var(--muted);
  font-size: 12px;
}

.partner-suggestion.active,
.partner-suggestion:hover {
  background: #eaf4fb;
}

.partner-suggestion.clear {
  color: #9b2c2c;
}

.partner-suggestion-empty {
  padding: 8px 10px;
}

input,
select {
  color: var(--text);
  background: #fbfdff;
  border: 1px solid #cbdde9;
  border-radius: 8px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #74a9d4;
  box-shadow: 0 0 0 3px rgba(47, 111, 168, 0.13);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(18, 32, 43, 0.34);
}

.modal-backdrop.visible {
  display: flex;
}

.modal-panel {
  width: min(880px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 28px 70px rgba(18, 32, 43, 0.22);
}

.lead-import-preview-panel {
  width: min(960px, 100%);
}

.lead-import-summary,
.lead-import-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.lead-import-summary span,
.lead-import-fields span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  background: #eef7fd;
  border: 1px solid #cfdeea;
  border-radius: 999px;
  color: #1f5c8d;
  font-size: 12px;
  font-weight: 800;
}

.lead-import-summary strong,
.lead-import-fields strong {
  color: #0f2437;
  font-size: 16px;
}

.lead-import-fields .missing {
  color: #8b4b2f;
  background: #fff4e8;
  border-color: #e8c8aa;
}

.lead-import-meta {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 10px;
  background: #f8fbfd;
  border: 1px solid #cfdeea;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.lead-import-sample {
  margin-top: 14px;
}

.lead-import-sample h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.lead-import-sample-table {
  overflow: auto;
  border: 1px solid #cfdeea;
  border-radius: 8px;
}

.lead-import-sample-head,
.lead-import-sample-row {
  display: grid;
  grid-template-columns: 140px minmax(220px, 1fr) 90px 140px minmax(220px, 1fr);
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.lead-import-sample-head {
  color: #173247;
  background: #edf6fd;
  font-weight: 800;
}

.lead-import-sample-row:last-child {
  border-bottom: 0;
}

.listing-create-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.listing-create-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.plain-location-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(76px, 112px));
  gap: 6px;
  align-content: start;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.plain-location-group > span {
  grid-column: 1 / -1;
}

.plain-location-group label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px;
  align-items: center;
}

.plain-location-group em {
  color: var(--text);
  font-style: normal;
  font-weight: 900;
}

.listing-create-grid input,
.listing-create-grid select,
.listing-create-grid textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
}

.listing-create-grid textarea {
  resize: vertical;
  min-height: 82px;
  color: var(--text);
  background: #fbfdfe;
  border: 1px solid #d2dee6;
  border-radius: 8px;
  outline: none;
}

.wide-field {
  grid-column: span 3;
}

.modal-actions {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.trend-dashboard {
  display: grid;
  gap: 10px;
  width: min(760px, 100%);
  margin-inline: auto;
}

.upload-button {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.trend-import-panel {
  display: grid;
  grid-template-columns: minmax(190px, 0.85fr) minmax(280px, 1.15fr) 126px;
  gap: 8px;
  align-items: center;
  width: 730px;
  max-width: 100%;
  min-height: 0;
  padding: 9px 10px;
  background: linear-gradient(135deg, #f8fcff, #edf7ff);
  border: 1px solid #cfdeea;
  border-radius: 8px;
}

.trend-import-panel h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.trend-import-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 12px;
}

.trend-import-panel textarea {
  width: 100%;
  min-height: 42px;
  padding: 7px 9px;
  color: var(--text);
  background: #fff;
  border: 1px solid #d2dee6;
  border-radius: 8px;
  resize: vertical;
}

.trend-import-actions {
  display: grid;
  gap: 5px;
}

.trend-batch-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 730px;
  max-width: 100%;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #cfdeea;
  border-radius: 8px;
}

.trend-batch-panel h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
}

.trend-batch-panel span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.trend-batch-list {
  display: grid;
  gap: 8px;
  width: 730px;
  max-width: 100%;
}

.trend-batch-row {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) 96px 128px;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  background: #fff;
  border: 1px solid #cfdeea;
  border-radius: 8px;
}

.trend-batch-row strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}

.trend-batch-row span,
.trend-batch-row p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.trend-batch-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-start;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.district-section {
  margin-top: 14px;
  padding: 12px;
  background: #f8fcff;
  border: 1px solid #cfdeea;
  border-radius: 8px;
}

.district-create-panel {
  display: grid;
  grid-template-columns: minmax(220px, 360px) auto;
  gap: 8px;
  align-items: center;
}

.admin-tool-card .district-create-panel {
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 6px;
}

.district-list {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.district-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 7px 4px 9px;
  color: var(--primary-dark);
  font-weight: 800;
  background: #eef7ff;
  border: 1px solid #c8ddeb;
  border-radius: 999px;
  font-size: 13px;
}

.district-pill button {
  width: 22px;
  height: 22px;
  padding: 0;
  color: #bf2f38;
  background: #fff;
  border: 1px solid #e2a2a7;
  border-radius: 999px;
  cursor: pointer;
}

.trend-filters {
  display: grid;
  grid-template-columns: minmax(150px, 1.25fr) 76px minmax(112px, 0.85fr) minmax(150px, 1.2fr) minmax(112px, 0.85fr);
  gap: 7px;
  width: 730px;
  max-width: 100%;
}

.trend-search-box {
  position: relative;
}

.trend-search-matches {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  display: none;
  max-height: 240px;
  overflow: auto;
  padding: 6px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #c9ddeb;
  border-radius: 8px;
  box-shadow: 0 16px 32px rgba(31, 78, 115, 0.14);
}

.trend-search-matches.visible {
  display: grid;
  gap: 4px;
}

.trend-search-matches button {
  padding: 7px 9px;
  color: var(--text);
  text-align: left;
  background: #f7fbff;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
}

.trend-search-matches button:hover {
  color: var(--primary-dark);
  background: #edf7ff;
  border-color: #c8ddeb;
}

.trend-hero {
  width: 730px;
  max-width: 100%;
  padding: 10px 14px 8px;
  background:
    linear-gradient(180deg, #ffffff, #f8fcff);
  border: 1px solid #cfdeea;
  border-radius: 8px;
  box-shadow: 0 18px 38px rgba(31, 78, 115, 0.1);
}

.trend-title-block {
  margin-bottom: 2px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.trend-title-block p,
.trend-title-block h3 {
  margin: 0;
}

.trend-title-block p {
  color: var(--muted);
  font-weight: 700;
}

.trend-title-block h3 {
  font-size: 20px;
}

.trend-title-block span {
  color: var(--muted);
  font-size: 13px;
}

.trend-report-summary {
  margin: 8px 0 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trend-report-summary span {
  padding: 4px 8px;
  color: #245a84;
  font-size: 12px;
  font-weight: 800;
  background: #eef7ff;
  border: 1px solid #cce0ef;
  border-radius: 999px;
}

#trendChart {
  width: 100%;
  height: 350px;
  display: block;
}

.trend-stat-grid {
  width: 730px;
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.trend-stat-card {
  padding: 10px 12px;
  background:
    linear-gradient(180deg, #ffffff, #f9fcff);
  border: 1px solid #cfdeea;
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.trend-stat-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.trend-stat-card strong {
  margin-top: 6px;
  display: block;
  color: var(--primary-dark);
  font-size: 22px;
}

.trend-stat-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.trend-table-wrap {
  width: 730px;
  max-width: 100%;
  max-height: 590px;
  overflow: auto;
  border: 1px solid #cfdeea;
  border-radius: 8px;
  background: #fff;
}

.trend-table {
  min-width: 700px;
}

.trend-table-head,
.trend-table-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.trend-table-head {
  position: sticky;
  top: 0;
  z-index: 8;
  color: #101b20;
  background: #edf6fd;
  font-weight: 800;
}

.trend-table-row:last-child {
  border-bottom: 0;
}

.trend-detail-panel {
  width: min(1180px, 100%);
  max-width: 100%;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #cfdeea;
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.trend-detail-list {
  display: none;
  width: 100%;
  max-width: 100%;
  max-height: min(480px, calc(44px + 10 * 43px));
  overflow: auto;
  border-top: 1px solid var(--line);
}

.trend-detail-panel.expanded .trend-detail-list {
  display: block;
}

.trend-detail-row {
  display: grid;
  grid-template-columns: 118px minmax(150px, 240px) 96px 96px 116px minmax(360px, 1fr);
  gap: 14px;
  align-items: start;
  padding: 9px 0;
  min-width: 920px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.45;
}

.trend-detail-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding-top: 10px;
  color: #173247;
  background: #fff;
  font-weight: 800;
}

.trend-detail-row strong {
  display: block;
  color: var(--primary-dark);
}

.trend-detail-row span {
  display: block;
  color: var(--muted);
  min-width: 0;
}

.trend-detail-row .trend-extra-info {
  color: var(--text);
  line-height: 1.45;
  white-space: normal;
  word-break: break-word;
}

.client-report .trend-import-panel,
.client-report .upload-button,
.client-report #clearTrendData,
.client-report #trendDetailPanel {
  display: none;
}

.client-report .trend-dashboard {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 250, 255, 0.98));
}

.client-report .trend-hero {
  background:
    linear-gradient(180deg, #ffffff 0%, #f6fbff 58%, #eef7ff 100%);
}

.new-community-panel {
  margin-top: 16px;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px 140px minmax(220px, 1fr);
  gap: 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.admin-create-panel,
.role-create-panel {
  display: grid;
  gap: 8px;
  align-content: start;
}

.admin-create-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.registered-client-create label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.new-community-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.role-create-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.new-community-panel input,
.new-community-panel select,
.admin-create-panel input,
.admin-create-panel select,
.role-create-panel input {
  min-height: 38px;
}

.community-card,
.user-card {
  padding: 16px;
  background:
    linear-gradient(180deg, #ffffff, #f8fbfe);
  border: 1px solid #cfdeea;
  border-radius: 10px;
  box-shadow: var(--soft-shadow);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.community-card:hover,
.user-card:hover {
  border-color: #a9c8dd;
  box-shadow: 0 16px 34px rgba(46, 85, 120, 0.11);
  transform: translateY(-1px);
}

.community-card {
  display: grid;
  gap: 12px;
}

.community-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.community-card h3,
.user-card h3 {
  margin-bottom: 0;
}

.community-card dl {
  margin: 0;
  display: grid;
  gap: 8px;
}

.community-card div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.community-grid.list-mode {
  display: block;
}

.community-list-table {
  overflow: hidden;
  border: 1px solid #cfdeea;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.community-list-head,
.community-list-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) 92px 72px 90px 100px minmax(130px, 0.8fr) minmax(230px, 1.1fr);
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}

.community-list-head {
  color: #173247;
  background: #edf6fd;
  font-weight: 900;
}

.community-list-row:last-child {
  border-bottom: 0;
}

.community-list-row > * {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-list-row strong {
  color: #10263a;
}

.community-list-row .card-actions {
  overflow: visible;
  white-space: normal;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
}

.status-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  color: #0a6d64;
  background: #e6f6f3;
  border: 1px solid #bfe4dd;
  border-radius: 999px;
  font-size: 12px;
}

.admin-layout {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(680px, 1.35fr) minmax(300px, 0.65fr);
  gap: 12px;
}

.user-list {
  margin-top: 8px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--soft-shadow);
}

.user-card {
  display: grid;
  gap: 10px;
}

.user-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.user-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.user-card select {
  min-height: 34px;
}

.permission-tags {
  max-height: 58px;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  overflow: auto;
}

.permission-tags span {
  padding: 2px 6px;
  color: #0d6c61;
  background: var(--accent-soft);
  border-radius: 999px;
  font-size: 10px;
  line-height: 1.35;
  white-space: nowrap;
}

.permission-table {
  margin-top: 6px;
  display: grid;
  gap: 6px;
}

.permission-role {
  padding: 8px 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.permission-role header {
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.permission-role header strong {
  font-size: 14px;
}

.permission-role div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 4px 8px;
}

.permission-check {
  min-height: 24px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.permission-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 16px;
  accent-color: var(--primary);
}

.admin-page .page-card {
  padding: 12px;
}

.admin-page .section-title-row {
  margin-bottom: 8px;
}

.admin-subtabs {
  display: inline-flex;
  overflow: hidden;
  margin: 0 0 12px;
  border: 1px solid #c8dcea;
  border-radius: 8px;
  background: #f5faff;
}

.admin-subtab {
  min-height: 38px;
  padding: 0 22px;
  color: #657b8c;
  background: transparent;
  border: 0;
  border-right: 1px solid #c8dcea;
  font-weight: 900;
  cursor: pointer;
}

.admin-subtab:last-child {
  border-right: 0;
}

.admin-subtab.active {
  color: #fff;
  background: #2f6fa8;
}

.admin-subpanel {
  display: none;
}

.admin-subpanel.active {
  display: block;
}

.admin-quick-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.25fr) minmax(220px, 0.7fr) minmax(260px, 0.8fr) minmax(280px, 0.9fr);
  gap: 10px;
  align-items: stretch;
  margin-top: 8px;
}

.admin-tool-card {
  min-width: 0;
  padding: 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: none;
}

.admin-tool-card .section-title-row {
  margin-bottom: 6px;
}

.admin-tool-card-title {
  display: grid;
  gap: 1px;
  margin-bottom: 2px;
}

.admin-tool-card-title h3 {
  font-size: 14px;
}

.admin-create-panel {
  grid-template-columns: minmax(130px, 1fr) minmax(130px, 1fr) minmax(170px, 1fr) minmax(110px, 0.7fr);
  align-items: end;
}

.admin-create-panel .wide {
  grid-column: span 2;
}

.role-create-panel {
  grid-template-columns: minmax(120px, 1fr) auto;
  align-items: end;
}

.admin-page .district-section,
.admin-page .data-center-section {
  max-width: 1120px;
}

.admin-page .district-section,
.approval-section {
  margin-top: 0;
  max-width: none;
}

.data-center-section {
  margin-top: 10px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--soft-shadow);
}

.data-center-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
}

.data-table-card {
  padding: 10px;
  display: grid;
  gap: 2px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.data-table-card strong {
  color: var(--primary);
  font-size: 20px;
  line-height: 1.1;
}

.data-table-card span {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.data-table-card em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.approval-list {
  display: grid;
  gap: 6px;
  max-height: 150px;
  overflow-y: auto;
}

.approval-item {
  padding: 10px;
  display: grid;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.approval-item header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.approval-item header span {
  padding: 3px 7px;
  color: #0d6c61;
  background: var(--accent-soft);
  border-radius: 999px;
  font-size: 11px;
}

.approval-item dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 6px 12px;
}

.approval-item div {
  min-width: 0;
}

.approval-item dt {
  font-size: 11px;
}

.approval-item dd {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-create-panel input,
.admin-create-panel select,
.role-create-panel input,
.registered-client-create input,
.registered-client-create select {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 12px;
}

.user-table {
  min-width: 1180px;
  max-height: 2200px;
  overflow: auto;
  background: #fff;
}

.user-table-head,
.user-table-row {
  display: grid;
  grid-template-columns: 36px 112px 86px 92px 104px 116px 86px minmax(190px, 1fr) 250px;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.user-table-head {
  position: sticky;
  top: 0;
  z-index: 8;
  color: #101b20;
  background: #eef4f8;
  font-weight: 700;
}

.user-table-row:last-child {
  border-bottom: 0;
}

.user-table-row select,
.user-table-row input {
  min-height: 28px;
  padding: 0 7px;
  border: 1px solid #cbd9e2;
  border-radius: 6px;
  background: #fff;
  min-width: 0;
}

.user-system-number {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.row-actions .small {
  min-height: 26px;
  padding: 0 7px;
  font-size: 11px;
}

.user-table-row-editing {
  background: #f0f8ff;
  box-shadow: inset 3px 0 0 var(--primary);
}

.fixed-admin-lock {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 7px;
  color: #0d6c61;
  background: var(--accent-soft);
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.registered-client-grid {
  display: grid;
  grid-template-columns: 420px minmax(560px, 760px);
  gap: 8px;
  align-items: start;
  justify-content: start;
}

.registered-client-create {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 8px;
  padding: 8px;
}

.registered-client-create .admin-tool-card-title,
.registered-client-create .wide,
.registered-client-create .primary-button {
  grid-column: 1 / -1;
}

.client-permission-panel {
  display: grid;
  gap: 8px;
  padding: 8px;
}

.client-policy-options,
.client-permission-columns {
  display: grid;
  gap: 8px;
}

.client-policy-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.client-policy-options label,
.client-permission-check {
  display: flex;
  gap: 6px;
  align-items: center;
  color: #173247;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.client-policy-options input[type="checkbox"],
.client-permission-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
  flex: 0 0 16px;
  accent-color: var(--primary);
}

.client-permission-check input:disabled + span {
  color: var(--muted);
}

.client-permission-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.client-permission-columns section {
  display: grid;
  gap: 6px;
  padding: 8px;
  background: #fff;
  border: 1px solid #d9e6ef;
  border-radius: 8px;
}

.client-permission-columns h4 {
  font-size: 14px;
}

.client-permission-columns h4,
.client-permission-columns p {
  margin: 0;
}

.client-permission-columns p {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.registered-client-table-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.registered-client-filters {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 180px 180px;
  gap: 8px;
}

.registered-client-table {
  border: 1px solid #cfdeea;
  border-radius: 8px;
  max-height: calc(100vh - 230px);
  overflow: auto;
  background: #fff;
}

.registered-client-head,
.registered-client-row {
  display: grid;
  grid-template-columns: 130px 110px 130px 120px 150px 150px minmax(180px, 1fr) 230px;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.registered-client-row > span,
.registered-client-row > strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.registered-client-head {
  position: sticky;
  top: 0;
  z-index: 8;
  color: #173247;
  background: #edf6fd;
  font-weight: 900;
}

.registered-client-row:last-child {
  border-bottom: 0;
}

.registered-client-row select,
.registered-client-row input {
  min-height: 32px;
  padding: 0 8px;
  font-size: 13px;
  min-width: 0;
}

.registered-client-pager {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 800;
}

.employee-info-panel {
  width: min(760px, 100%);
}

.employee-profile-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 10px;
  padding: 14px;
  background: #f8fbfd;
  border: 1px solid #d2e2ee;
  border-radius: 10px;
}

.employee-profile-avatar {
  width: 92px;
  height: 92px;
  border-radius: 16px;
  font-size: 34px;
  box-shadow: 0 12px 26px rgba(28, 74, 110, 0.15);
}

.employee-profile-hero strong {
  display: block;
  margin-bottom: 10px;
  color: #10263a;
  font-size: 22px;
}

.avatar-upload-button {
  position: relative;
  overflow: hidden;
}

.avatar-upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.avatar-cropper {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin-top: 12px;
  padding: 14px;
  background: #f8fbfd;
  border: 1px solid #d2e2ee;
  border-radius: 10px;
}

.avatar-cropper[hidden] {
  display: none;
}

.avatar-crop-stage {
  position: relative;
  width: 240px;
  height: 240px;
  overflow: hidden;
  background: #dceaf3;
  border: 1px solid #bad2e4;
  border-radius: 16px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.avatar-crop-stage:active {
  cursor: grabbing;
}

.avatar-crop-stage img {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: none;
  transform: translate(-50%, -50%);
  transform-origin: center;
  pointer-events: none;
}

.avatar-crop-frame {
  position: absolute;
  inset: 18px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  box-shadow:
    0 0 0 999px rgba(16, 38, 58, 0.36),
    0 10px 28px rgba(16, 38, 58, 0.18);
  pointer-events: none;
}

.avatar-crop-controls {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.avatar-crop-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.avatar-crop-controls input[type="range"] {
  width: 100%;
  min-height: 24px;
  padding: 0;
}

.avatar-crop-actions {
  grid-column: 2;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.avatar-crop-actions > div {
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
}

.avatar-crop-message {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.avatar-crop-message.is-error {
  color: #b42318;
}

.employee-info-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.employee-info-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.employee-info-grid input,
.employee-info-grid select {
  min-height: 36px;
}

.employee-password-panel {
  margin-top: 12px;
  padding: 12px;
  background: #f7fbff;
  border: 1px solid #d4e2ec;
  border-radius: 8px;
}

.employee-password-panel h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.employee-password-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.employee-password-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.employee-password-grid input {
  min-height: 36px;
}

.employee-password-actions {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.employee-password-actions .data-note[data-type="success"] {
  color: var(--accent);
}

.employee-password-actions .data-note[data-type="error"] {
  color: var(--danger);
}

@media (max-width: 760px) {
  .avatar-cropper {
    grid-template-columns: 1fr;
  }

  .employee-password-grid {
    grid-template-columns: 1fr;
  }

  .employee-password-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .avatar-crop-stage {
    width: min(240px, 100%);
    height: auto;
    aspect-ratio: 1;
    margin: 0 auto;
  }

  .avatar-crop-actions {
    grid-column: 1;
    align-items: stretch;
    flex-direction: column;
  }

  .avatar-crop-actions > div {
    justify-content: flex-end;
  }

  .listing-wechat-cropper {
    grid-template-columns: 1fr;
  }

  .listing-wechat-crop-stage {
    width: min(220px, 100%);
    height: auto;
    aspect-ratio: 1;
    margin: 0 auto;
  }

  .listing-wechat-crop-message,
  .listing-wechat-crop-actions {
    grid-column: 1;
  }
}

.employee-info-wide {
  grid-column: span 3;
}

@media (max-width: 980px) {
  .new-community-panel,
  .admin-create-panel,
  .role-create-panel {
    grid-template-columns: 1fr 1fr;
  }

  .admin-quick-grid {
    grid-template-columns: 1fr;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .registered-client-grid,
  .client-permission-columns,
  .registered-client-filters {
    grid-template-columns: 1fr;
  }
}

.editor-panel,
.preview-panel {
  min-height: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.editor-panel {
  overflow: auto;
}

.panel-section {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-section.compact {
  padding-bottom: 12px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title-row span {
  color: var(--muted);
  font-size: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.field-label-row strong {
  min-width: 54px;
  padding: 2px 7px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
  background: #eef7ff;
  border: 1px solid #c8ddeb;
  border-radius: 999px;
}

.field-label-row strong.manual-range-value {
  cursor: text;
  user-select: none;
}

.field-label-row strong.manual-range-value:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(20, 115, 230, 0.1);
}

.field-label-row strong.manual-range-value.editing {
  min-width: 70px;
  padding: 1px 5px;
}

.manual-range-input {
  width: 62px;
  min-height: 22px;
  padding: 0 4px;
  color: var(--primary-dark);
  font: inherit;
  font-weight: 800;
  text-align: right;
  background: #fff;
  border: 0;
  border-radius: 999px;
  outline: none;
}

.range-stepper {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 7px;
}

.range-nudge {
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--primary-dark);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  background: #eef7ff;
  border: 1px solid #c8ddeb;
  border-radius: 8px;
  cursor: pointer;
}

.range-nudge:hover {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

input,
select {
  width: 100%;
  min-height: 36px;
  color: var(--text);
  background: #fbfdfe;
  border: 1px solid #d2dee6;
  border-radius: 8px;
  padding: 6px 9px;
}

input[type="range"] {
  padding: 0;
  accent-color: var(--primary);
  cursor: pointer;
  touch-action: pan-y;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.check-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 64px;
}

.check-field input {
  width: 22px;
  min-height: 22px;
  accent-color: var(--primary);
}

.compact-grid {
  margin-top: 10px;
  gap: 8px;
}

.wide-field {
  grid-column: 1 / -1;
}

.unit-homes-editor {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
}

.unit-homes-editor.is-hidden {
  display: none;
}

.unit-homes-editor label {
  margin: 0;
}

.wide-file {
  margin-top: 10px;
  width: 100%;
}

.building-search-row {
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.media-upload-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.upload-card {
  min-height: 118px;
  padding: 10px;
  display: grid;
  gap: 8px;
  color: var(--muted);
  background: #f8fbfd;
  border: 1px dashed #b8cbd8;
  border-radius: 10px;
  cursor: pointer;
}

.upload-card input {
  display: none;
}

.upload-card span {
  min-height: 78px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #7d8d98;
  background: #eef4f8;
  border-radius: 8px;
  font-size: 12px;
}

.upload-card img,
.detail-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.button-row {
  margin-top: 14px;
}

.amenity-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.amenity-toolbar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.history-editor {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.stat-card {
  min-height: 58px;
  padding: 9px;
  background: linear-gradient(180deg, #f8fbfd, #eef5f8);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat-card strong {
  display: block;
  color: var(--primary);
  font-size: 18px;
  line-height: 1.2;
}

.stat-card span {
  color: var(--muted);
  font-size: 12px;
}

.data-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.file-button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: #f5f8fa;
  border: 1px solid #d3dee6;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}

.file-button input {
  display: none;
}

.data-note {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 12px;
}

.building-list {
  display: grid;
  gap: 8px;
}

.building-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.building-item strong {
  font-size: 14px;
}

.building-item span {
  color: var(--muted);
  font-size: 12px;
}

.building-item.active {
  border-color: var(--primary);
  background: #edf5fb;
  box-shadow: inset 3px 0 0 var(--primary);
}

.unit-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  max-height: 310px;
  overflow: auto;
  padding-right: 4px;
}

.unit-chip {
  min-height: 34px;
  padding: 5px;
  color: #203137;
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
}

.unit-chip.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(40, 89, 143, 0.12);
}

.unit-chip.onsale { background: rgba(40, 189, 117, 0.16); }
.unit-chip.sold { background: rgba(225, 72, 72, 0.16); }
.unit-chip.featured { background: rgba(244, 197, 66, 0.22); }
.unit-chip.hidden { background: rgba(155, 167, 173, 0.2); }
.unit-chip.empty { color: #7a888d; }

.preview-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.preview-toolbar {
  height: 72px;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, #ffffff, #f7fafc);
  border-bottom: 1px solid var(--line);
}

.tool-button {
  min-width: 38px;
}

.tool-button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #3370ad);
  border-color: var(--primary);
}

.canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #dcebf1;
  overflow: hidden;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.legend {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(210, 222, 230, 0.95);
  border-radius: 8px;
}

.client-filter-panel {
  position: absolute;
  left: 16px;
  top: 58px;
  z-index: 4;
  width: 180px;
  padding: 12px;
  display: grid;
  gap: 8px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(210, 222, 230, 0.95);
  border-radius: 10px;
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(8px);
}

.client-filter-panel.collapsed {
  display: none;
}

.client-filter-toggle {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 5;
  min-height: 34px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(210, 222, 230, 0.95);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(8px);
}

.client-filter-toggle.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.client-filter-panel strong {
  font-size: 13px;
}

.client-filter-panel select {
  min-height: 30px;
  font-size: 12px;
}

.client-filter-panel span {
  color: var(--muted);
  font-size: 12px;
}

.presentation-mode .client-filter-panel {
  display: none;
}

.presentation-mode .client-filter-toggle {
  display: none;
}

.presentation-mode .legend {
  left: auto;
  right: 16px;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.legend i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.compass {
  display: none;
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 4;
  width: 74px;
  height: 74px;
  color: #25343a;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(203, 217, 220, 0.95);
  border-radius: 50%;
  box-shadow: 0 12px 30px rgba(22, 36, 42, 0.14);
  backdrop-filter: blur(6px);
  pointer-events: none;
}

.compass i {
  position: absolute;
  left: 35px;
  top: 12px;
  width: 4px;
  height: 50px;
  background: linear-gradient(#d94141 0 48%, #2f6070 48% 100%);
  border-radius: 999px;
  transform-origin: 50% 50%;
}

.compass i::before,
.compass i::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
}

.compass i::before {
  top: -5px;
  border-bottom: 10px solid #d94141;
}

.compass i::after {
  bottom: -5px;
  border-top: 10px solid #2f6070;
}

.compass span {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 700;
}

.compass .north {
  top: 4px;
  color: #d94141;
}

.compass .south {
  bottom: 4px;
  color: #2f6070;
}

.onsale { background: #28bd75; }
.sold { background: #e14848; }

.finance-page .page-card {
  display: grid;
  align-content: start;
  min-height: 0;
  padding: 10px 14px 16px;
  gap: 10px;
}

.finance-page .page-card > .section-title-row:first-child {
  display: none;
  min-height: 0;
  margin: 0;
  padding: 0 2px;
  justify-content: flex-start;
}

.finance-page.active {
  height: calc(100vh - 82px);
  overflow: auto;
  padding: 8px 14px 14px;
}

.finance-workspace {
  display: grid;
  align-content: start;
  gap: 10px;
}

.finance-page #financeSummary {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 10px;
  border: 1px solid #cfe1ee;
  border-radius: 999px;
  background: #f6fbff;
  color: #5a7082;
  font-weight: 800;
  font-size: 12px;
}

.finance-workspace[hidden],
.finance-lock-panel[hidden] {
  display: none;
}

.finance-panel {
  display: none;
}

.finance-panel.active {
  display: grid;
  align-content: start;
  gap: 10px;
}

.finance-lock-card,
.finance-form-card {
  background: #fff;
  border: 1px solid #d9e1e7;
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 8px 22px rgba(20, 39, 64, 0.06);
}

.finance-lock-card {
  max-width: 520px;
  display: grid;
  gap: 12px;
}

.finance-lock-card h3,
.finance-form-card h3 {
  margin: 0;
}

.finance-lock-card p,
.finance-inline-message,
.finance-empty {
  margin: 0;
  color: #65717b;
}

.finance-lock-card label,
.finance-form-card label,
.finance-rate-list label {
  display: grid;
  gap: 6px;
  color: #4f5962;
  font-weight: 700;
}

.finance-toolbar,
.finance-actions,
.finance-mini-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.finance-toolbar {
  justify-content: space-between;
  align-items: flex-end;
}

.finance-toolbar h3 {
  margin: 0;
}

.finance-toolbar h3 small {
  margin-left: 10px;
  color: #6a7681;
  font-size: 13px;
  font-weight: 800;
}

.finance-settlement-tools {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 760px;
}

.finance-settlement-tools label {
  display: grid;
  gap: 4px;
  color: #667989;
  font-size: 12px;
  font-weight: 900;
}

.finance-settlement-tools input {
  width: 150px;
  min-height: 36px;
  border: 1px solid #cfd9e1;
  border-radius: 6px;
  padding: 7px 10px;
  background: #fff;
  font: inherit;
}

.finance-settlement-tools .batch input {
  width: 190px;
}

.finance-settlement-tool-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.finance-filter-card {
  padding: 10px 12px;
}

.finance-combobox {
  position: relative;
  flex: 2 1 300px;
  min-width: 260px;
}

.finance-combobox input[type="text"],
.finance-combobox input:not([type]) {
  width: 100%;
}

.finance-suggestion-list {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.finance-income-deal-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 12;
  max-height: 260px;
  overflow: auto;
  padding: 8px;
  border: 1px solid #d5e3ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(20, 39, 64, 0.14);
}

.finance-income-deal-suggestions button {
  width: 100%;
}

.finance-suggestion-list button {
  border: 1px solid #cfe0ee;
  border-radius: 8px;
  background: #f8fbfd;
  color: #17324a;
  padding: 7px 10px;
  display: grid;
  gap: 2px;
  text-align: left;
  cursor: pointer;
}

.finance-suggestion-list span {
  color: #667989;
  font-size: 12px;
}

.finance-bill-flow {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.finance-bill-flow span {
  min-height: 28px;
  padding: 3px 10px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #d6e5f0;
  border-radius: 999px;
  background: #f8fbfd;
  color: #647687;
  font-size: 12px;
  font-weight: 900;
}

.finance-bill-flow span.active {
  border-color: #9fd3c8;
  background: #e9f8f4;
  color: #087f73;
}

.finance-settlement-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
}

.finance-settlement-summary span {
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #d7e5ef;
  border-radius: 8px;
  background: #f7fbff;
  display: grid;
  align-content: center;
  gap: 3px;
}

.finance-settlement-summary b {
  color: #13283a;
  font-size: 18px;
}

.finance-settlement-summary small {
  color: #637789;
  font-weight: 800;
}

.finance-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 8px;
}

.finance-overview-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 8px;
}

.finance-stat-grid article {
  background: #fff;
  border: 1px solid #dde5eb;
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 8px;
}

.finance-overview-grid article {
  background: #f7fbff;
  border: 1px solid #cfe2f3;
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 6px;
}

.finance-stat-grid span {
  color: #64727d;
  font-size: 13px;
}

.finance-overview-grid span {
  color: #5f7180;
  font-size: 12px;
  font-weight: 800;
}

.finance-stat-grid strong {
  font-size: 24px;
  color: #1b2b38;
}

.finance-overview-grid strong {
  color: #17324a;
  font-size: 20px;
}

.finance-anomaly-panel,
.finance-detail-card {
  padding: 12px;
  display: grid;
  gap: 8px;
  background: #fff;
  border: 1px solid #d9e1e7;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(20, 39, 64, 0.05);
}

.finance-anomaly-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.finance-anomaly-list {
  display: grid;
  gap: 8px;
  max-height: 460px;
  overflow-y: auto;
  padding-right: 2px;
}

.finance-anomaly-panel.collapsed {
  gap: 0;
}

.finance-anomaly-panel.collapsed .finance-anomaly-list {
  display: none;
}

.finance-anomaly-panel article {
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #f2d6a6;
  border-radius: 6px;
  background: #fff8ea;
  color: #664a12;
  font-size: 13px;
}

.finance-anomaly-panel article.danger {
  border-color: #f0b5b8;
  background: #fff0f1;
  color: #84272d;
}

.finance-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.finance-detail-head h3,
.finance-detail-columns h4 {
  margin: 0;
}

.finance-detail-grid,
.finance-my-bill-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.finance-detail-grid span,
.finance-my-bill-row span {
  padding: 9px 10px;
  display: grid;
  gap: 3px;
  border: 1px solid #dbe7ef;
  border-radius: 6px;
  background: #f8fbfd;
}

.finance-detail-grid b,
.finance-my-bill-row small {
  color: #637789;
  font-size: 12px;
}

.finance-detail-grid .finance-detail-note {
  grid-column: 1 / -1;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.finance-detail-columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
}

.finance-detail-columns > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid #e1e9ef;
  border-radius: 8px;
  background: #fbfdff;
}

.finance-detail-columns p {
  margin: 6px 0 0;
  color: #506373;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.finance-detail-log {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid #dbe7f0;
  border-radius: 8px;
  background: #fbfdff;
}

.finance-detail-log p {
  margin: 8px 0 0;
  color: #506373;
  overflow-wrap: anywhere;
}

.finance-two-column {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1.1fr);
  gap: 16px;
  align-items: start;
}

.finance-settings-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.finance-settings-tabs button:not(.ghost-button) {
  min-height: 38px;
  border: 1px solid #c7d9e8;
  border-radius: 6px;
  background: #f7fbff;
  color: #31536d;
  padding: 7px 14px;
  font-weight: 900;
  cursor: pointer;
}

.finance-settings-tabs button.active {
  background: #2c76ad;
  border-color: #2c76ad;
  color: #fff;
}

.finance-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.finance-form-grid .wide {
  grid-column: 1 / -1;
}

.finance-cooperation-editor {
  width: min(100%, 1120px);
  grid-template-columns: minmax(0, 680px) minmax(280px, 360px);
  gap: 14px;
}

.finance-cooperation-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.finance-cooperation-form-grid .span-2 {
  grid-column: span 2;
}

.finance-cooperation-form-grid label {
  min-width: 0;
}

.finance-cooperation-form-grid input,
.finance-cooperation-form-grid select {
  min-height: 32px;
  padding: 6px 9px;
}

.finance-cooperation-form-grid textarea {
  min-height: 68px;
}

.finance-cooperation-split-card .finance-cooperation-form-grid {
  grid-template-columns: 1fr;
}

.finance-coop-split-editor {
  display: grid;
  gap: 10px;
}

.finance-coop-split-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 8px;
  align-items: center;
  max-width: 100%;
  padding: 8px;
  border: 1px solid #dbe7ef;
  border-radius: 8px;
  background: #fbfdff;
}

.finance-coop-split-row select,
.finance-coop-split-row input {
  min-width: 0;
}

.finance-coop-split-row button {
  justify-self: stretch;
  min-width: 0;
}

.finance-coop-external-editor {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

.finance-coop-external-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
  align-items: center;
  max-width: 100%;
  padding: 8px;
  border: 1px solid #dbe7ef;
  border-radius: 8px;
  background: #fbfdff;
}

.finance-coop-external-row input,
.finance-coop-external-row select {
  min-width: 0;
}

.finance-coop-external-row button {
  justify-self: stretch;
  min-width: 0;
}

.finance-cooperation-filter-form {
  max-width: 920px;
}

.finance-cooperation-filter-form input {
  flex: 0 0 180px;
}

.finance-cooperation-filter-form #financeCooperationSearch {
  flex-basis: 360px;
}

.finance-form-grid input,
.finance-form-grid select,
.finance-form-grid textarea,
.finance-mini-form input,
.finance-mini-form select,
.finance-lock-card input,
.finance-toolbar input,
.finance-toolbar select,
.finance-rate-list input,
.finance-table-row input,
.finance-split-row select {
  min-height: 38px;
  border: 1px solid #cfd9e1;
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  font: inherit;
}

.finance-mini-form input,
.finance-mini-form select {
  flex: 1 1 130px;
}

.finance-table {
  background: #fff;
  border: 1px solid #d9e1e7;
  border-radius: 8px;
  overflow: visible;
}

.finance-table-head,
.finance-table-row {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 1fr 0.9fr 0.9fr;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.finance-deal-list .finance-table-head,
.finance-deal-list .finance-table-row {
  grid-template-columns: 1.3fr 0.95fr 0.95fr 0.85fr 0.8fr 0.65fr 1.05fr;
}

.finance-income-record-table .finance-table-head,
.finance-income-record-table .finance-table-row {
  grid-template-columns: 1.35fr 1fr 0.75fr 0.75fr 0.9fr 1fr 1fr;
}

.finance-income-inline-form {
  display: grid;
  gap: 10px;
  padding: 12px 14px 14px;
  border-top: 1px solid #d9e1e7;
  background: #f7fbfd;
}

.finance-income-inline-mini-form {
  align-items: stretch;
}

.finance-income-inline-source {
  flex: 2 1 320px;
  min-height: 42px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 8px 12px;
  border: 1px solid #d9e1e7;
  border-radius: 8px;
  background: #fff;
}

.finance-income-inline-source strong,
.finance-income-inline-source small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-income-inline-source small {
  color: #5d6f7c;
  font-weight: 800;
}

.finance-income-inline-summary {
  margin-top: 0;
}

.finance-cooperation-table .finance-table-head,
.finance-cooperation-table .finance-table-row,
.finance-cooperation-income-table .finance-table-head,
.finance-cooperation-income-table .finance-table-row {
  grid-template-columns: 1.2fr 0.9fr 0.82fr 1.12fr 0.72fr 1.24fr;
}

.finance-payroll-table .finance-table-head,
.finance-payroll-table .finance-table-row {
  grid-template-columns: 1fr 0.95fr 0.85fr 1.15fr 0.9fr 0.9fr 1.5fr;
}

.finance-settlement-head,
.finance-settlement-row {
  grid-template-columns: 1fr 2.4fr 0.95fr 0.7fr 0.7fr 0.7fr;
}

.finance-settlement-row {
  cursor: pointer;
}

.finance-settlement-row.active {
  background: #eef7ff;
}

.finance-settlement-detail-card {
  margin-top: 16px;
  border: 1px solid #c8dbea;
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.finance-settlement-detail-table {
  margin-top: 14px;
}

.finance-settlement-detail-table.compact {
  margin-top: 12px;
}

.finance-settlement-detail-table .finance-table-head,
.finance-settlement-detail-table .finance-table-row {
  grid-template-columns: 0.8fr 1.45fr 1fr 0.75fr 0.9fr;
}

.finance-detail-source strong {
  display: block;
}

.finance-detail-source small {
  color: #6f7f8d;
  font-size: 12px;
  font-weight: 700;
}

.finance-table-head {
  position: sticky;
  top: 0;
  z-index: 12;
  background: #f4f7f9;
  font-weight: 800;
  color: #1f2933;
  box-shadow: 0 1px 0 #d9e1e7;
}

.finance-table-row {
  border-top: 1px solid #e5ebf0;
  min-height: 58px;
}

.finance-deal-voided {
  position: relative;
  background: #fbfcfd;
}

.finance-deal-voided > span {
  opacity: 0.58;
}

.finance-deal-voided::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 50%;
  border-top: 2px solid rgba(201, 42, 42, 0.78);
  pointer-events: none;
}

.finance-deal-voided::before {
  content: "财务作废";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  padding: 2px 12px;
  border: 1px solid rgba(201, 42, 42, 0.5);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #c92a2a;
  font-size: 13px;
  font-weight: 900;
  pointer-events: none;
}

.finance-table-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.finance-table-row small {
  display: block;
  margin-top: 4px;
  color: #687681;
  font-size: 12px;
}

.finance-table-row .money,
.finance-split-row strong {
  color: #168451;
  font-weight: 900;
}

.finance-table-row mark {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 6px;
  background: #eaf3ff;
  color: #1769d5;
  font-weight: 800;
}

.finance-table-row mark.finance-deal-status-draft {
  background: #eef2f5;
  color: #6a7680;
}

.finance-table-row mark.finance-deal-status-in_progress {
  background: #eaf3ff;
  color: #1769d5;
}

.finance-table-row mark.finance-deal-status-transferable,
.finance-table-row mark.finance-deal-status-deliverable {
  background: #fff4d8;
  color: #9b6200;
}

.finance-table-row mark.finance-deal-status-settling,
.finance-table-row mark.finance-deal-status-rent_received {
  background: #e5f7ed;
  color: #168451;
}

.finance-table-row mark.finance-deal-status-settled {
  background: #dff2e7;
  color: #0b5d37;
}

.finance-table-row mark.warn {
  background: #fff6d6;
  color: #9a6700;
}

.finance-table-row mark.danger {
  background: #ffe6e6;
  color: #c92a2a;
}

.finance-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 10px 0 0;
  color: #687681;
  font-size: 13px;
  font-weight: 800;
}

.finance-segment-filter {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding: 4px;
  border: 1px solid #d9e4eb;
  border-radius: 8px;
  background: #f7fafc;
}

.finance-segment-filter button {
  min-height: 30px;
  padding: 5px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #355165;
  font-weight: 900;
  cursor: pointer;
}

.finance-segment-filter button.active {
  background: #0f766e;
  color: #fff;
  box-shadow: 0 6px 14px rgba(15, 118, 110, 0.16);
}

.finance-inline-detail,
.finance-deal-editor-inline,
.finance-cooperation-editor-inline {
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px;
  border-top: 1px solid #dfe8ee;
  background: #f8fbfd;
}

.finance-inline-detail .finance-detail-card,
.finance-deal-editor-inline .finance-form-card,
.finance-cooperation-editor-inline .finance-form-card {
  margin: 0;
  box-shadow: none;
}

.finance-voided-table .finance-table-head,
.finance-voided-table .finance-table-row {
  grid-template-columns: 0.7fr 1.45fr 0.8fr 0.8fr 0.9fr 0.85fr 0.75fr;
}

.finance-toolbar h3 small {
  margin-left: 12px;
  color: #6f7f8d;
  font-size: 13px;
  font-weight: 700;
}

.finance-subtitle-row {
  margin-top: 10px;
  padding-top: 4px;
}

.finance-subtitle-row h4 {
  margin: 0;
  font-size: 16px;
}

.finance-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.finance-row-actions .ghost-button.small {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 4px 9px;
  font-size: 13px;
}

.finance-row-actions .ghost-button.active {
  border-color: #0f766e;
  background: #e9f8f4;
  color: #087864;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.28);
}

.finance-appeal-action {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px;
}

.finance-appeal-action input,
.finance-appeal-action select {
  width: 100%;
  min-height: 36px;
}

.finance-timeline {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.finance-timeline article {
  display: grid;
  grid-template-columns: 140px 120px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #dbe7f0;
  border-radius: 8px;
  background: #f8fbfd;
}

.finance-timeline article span {
  color: #6c7c88;
  font-size: 13px;
}

.finance-timeline article strong {
  color: #102235;
}

.finance-timeline article p {
  margin: 0;
  color: #425466;
}

.finance-split-list,
.finance-adjustment-list,
.finance-rate-list,
.finance-audit-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.finance-split-row {
  display: grid;
  grid-template-columns: 1fr 1fr 0.7fr 0.9fr 120px auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e2e9ee;
  border-radius: 8px;
  background: #f9fbfc;
}

.finance-split-save-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #d7e4ec;
  border-radius: 8px;
  background: #f7fbfd;
  color: #5d6f7c;
}

.finance-split-save-row button {
  flex: 0 0 auto;
}

.finance-adjustment-list span,
.finance-audit-list span {
  padding: 8px 10px;
  border: 1px solid #e2e9ee;
  border-radius: 6px;
  background: #f9fbfc;
  color: #4f5d68;
}

.finance-rate-list label {
  grid-template-columns: minmax(160px, 1fr) 120px;
  align-items: center;
  border-bottom: 1px solid #edf1f4;
  padding-bottom: 8px;
}

.finance-payroll-settings-list label {
  grid-template-columns: minmax(150px, 1fr) repeat(5, minmax(100px, 0.65fr));
}

.finance-compensation-settings-list label {
  grid-template-columns: 82px minmax(150px, 1.1fr) minmax(100px, 0.65fr) repeat(5, minmax(100px, 0.65fr));
}

.finance-payroll-settings-head {
  color: #627282;
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 980px) {
  .finance-stat-grid,
  .finance-overview-grid,
  .finance-two-column,
  .finance-cooperation-form-grid,
  .finance-form-grid {
    grid-template-columns: 1fr;
  }

  .finance-cooperation-form-grid .span-2 {
    grid-column: auto;
  }

  .finance-coop-external-row {
    grid-template-columns: 1fr;
  }

  .finance-table {
    overflow-x: auto;
  }

  .finance-table-head,
  .finance-table-row,
  .finance-deal-list .finance-table-head,
  .finance-deal-list .finance-table-row,
  .finance-income-record-table .finance-table-head,
  .finance-income-record-table .finance-table-row,
  .finance-cooperation-table .finance-table-head,
  .finance-cooperation-table .finance-table-row,
  .finance-cooperation-income-table .finance-table-head,
  .finance-cooperation-income-table .finance-table-row,
  .finance-payroll-table .finance-table-head,
  .finance-payroll-table .finance-table-row {
    min-width: 900px;
  }

  .finance-payroll-settings-list label {
    min-width: 760px;
  }

  .finance-compensation-settings-list label {
    min-width: 960px;
  }

  .finance-split-row {
    grid-template-columns: 1fr;
  }

  .finance-settlement-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.featured { background: #f4c542; }
.hidden { background: #9ba7ad; }

.hint {
  position: absolute;
  right: 16px;
  bottom: 16px;
  color: #405362;
  background: rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
}

.unit-popover {
  position: absolute;
  z-index: 5;
  width: min(320px, calc(100% - 32px));
  max-height: min(560px, calc(100% - 110px));
  display: none;
  overflow: auto;
  padding: 14px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(207, 221, 224, 0.62);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(22, 36, 42, 0.13);
  backdrop-filter: blur(5px);
}

.unit-popover.visible {
  display: grid;
  gap: 12px;
}

.popover-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

.popover-body {
  display: grid;
  gap: 12px;
}

.unit-popover.collapsed {
  width: max-content;
  min-width: min(210px, calc(100% - 32px));
  max-width: min(430px, calc(100% - 32px));
  max-height: none;
  overflow: visible;
  padding: 0;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.unit-popover.collapsed .popover-body,
.unit-popover.collapsed .status-pill,
.unit-popover.collapsed .eyebrow {
  display: none;
}

.unit-popover.collapsed .popover-head {
  gap: 8px;
  align-items: center;
}

.unit-popover.collapsed h2 {
  max-width: 340px;
  font-size: 16px;
  line-height: 1.35;
  color: #112231;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.92), 0 0 5px rgba(255, 255, 255, 0.78);
}

.unit-popover .mini-button {
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
  background: rgba(247, 251, 254, 0.78);
}

.unit-popover.collapsed .mini-button {
  min-height: 24px;
  padding: 0 7px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 3px 8px rgba(22, 36, 42, 0.08);
}

.unit-popover .status-pill {
  display: none;
}

.status-pill {
  width: fit-content;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  color: #fff;
  background: #9ba7ad;
  border-radius: 999px;
  font-size: 13px;
}

.detail-list {
  margin: 0;
  padding: 0;
}

.detail-list div {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #edf2f3;
}

.detail-media {
  display: block;
}

.plan-thumb-button {
  width: 96px;
  padding: 0;
  display: grid;
  overflow: hidden;
  color: var(--muted);
  background: rgba(238, 244, 248, 0.88);
  border: 1px solid rgba(203, 221, 233, 0.88);
  border-radius: 8px;
}

.plan-thumb-button img {
  width: 96px;
  height: 72px;
  object-fit: cover;
  display: block;
}

.plan-thumb-button span {
  padding: 5px 7px;
  font-size: 11px;
}

.plan-preview-dialog {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(18, 32, 43, 0.25);
}

.plan-preview-dialog::backdrop {
  background: rgba(18, 32, 43, 0.28);
}

.plan-preview-dialog img {
  width: 300px;
  height: 300px;
  object-fit: contain;
  display: block;
  background: #f5f8fa;
  border-radius: 8px;
}

.building-plan-dialog {
  width: min(820px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(18, 32, 43, 0.25);
}

.building-plan-dialog::backdrop {
  background: rgba(18, 32, 43, 0.28);
}

.building-plan-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.building-plan-dialog-head h2 {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 22px;
}

.building-plan-dialog-head .plan-preview-close {
  margin-bottom: 0;
}

.building-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  max-height: 620px;
  overflow: auto;
  padding-right: 2px;
}

.building-plan-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  background: #f7fbfe;
  border: 1px solid #d3e1ea;
  border-radius: 8px;
}

.building-plan-image {
  width: 96px;
  height: 82px;
  padding: 0;
  overflow: hidden;
  background: #edf4f8;
  border: 1px solid #cbdde9;
  border-radius: 8px;
  cursor: pointer;
}

.building-plan-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.building-plan-card section {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.building-plan-card strong,
.building-plan-card span,
.building-plan-card em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.building-plan-card strong {
  color: var(--text);
  font-size: 16px;
}

.building-plan-card span {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.building-plan-card em {
  color: #6b7b86;
  font-size: 12px;
  font-style: normal;
}

.plan-preview-close {
  min-height: 28px;
  margin-bottom: 8px;
  padding: 0 10px;
  color: var(--text);
  background: #f7fbfe;
  border: 1px solid #cddde9;
}

dt {
  color: var(--muted);
  font-size: 13px;
}

dd {
  margin: 0;
  font-size: 14px;
}

.timeline ul {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  padding: 9px 0;
  color: #39494f;
  border-bottom: 1px solid #edf2f3;
  font-size: 13px;
}

.timeline li strong {
  color: var(--text);
}

.timeline li span {
  color: var(--muted);
  font-size: 12px;
}

.role-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}

.publish-card {
  margin-top: 12px;
  display: grid;
  gap: 6px;
  padding: 12px;
  background: #f7fafb;
  border: 1px solid #dce7ea;
  border-radius: 8px;
}

.publish-card strong {
  color: var(--primary-dark);
  font-size: 14px;
}

.publish-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.permission-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 8px 10px;
  align-items: start;
  font-size: 13px;
}

.permission-grid span {
  color: var(--muted);
}

.permission-grid strong {
  font-weight: 600;
  line-height: 1.45;
}

.score-tabs {
  width: fit-content;
  margin: 20px auto 18px;
  display: inline-flex;
  overflow: hidden;
  border: 1px solid #c7ddec;
  border-radius: 8px;
  background: #f4f9fd;
}

.score-tab {
  min-height: 36px;
  padding: 0 18px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-right: 1px solid #c7ddec;
  font-weight: 800;
}

.score-tab:last-child {
  border-right: 0;
}

.score-tab.active {
  color: #fff;
  background: var(--primary);
}

.score-panel {
  display: none;
}

.score-panel.active {
  display: grid;
  justify-items: center;
  align-content: start;
  width: 100%;
}

.score-narrow {
  width: min(750px, 100%);
  margin-inline: auto;
}

.score-panel.active > .section-title-row,
.scores-page .section-title-row {
  width: min(750px, 100%);
  margin-inline: auto;
}

.scores-page > .page-card > .section-title-row:first-child,
.scores-page > .page-card > .score-tabs {
  width: fit-content;
}

.score-ranking-wrap,
.score-coin-admin,
.score-panel > .score-stat-grid,
.score-panel > .score-table-wrap {
  width: min(750px, 100%);
  justify-self: center;
  margin-inline: auto;
}

.score-ranking-wrap {
  width: min(820px, 100%);
}

.score-date-row {
  margin: 8px 0 12px;
}

.score-ranking-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.score-action-row {
  margin: 8px 0 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.score-action-row input {
  width: 188px;
  min-height: 38px;
  padding: 0 12px;
  color: var(--text);
  background: #fbfdff;
  border: 1px solid #cbddea;
  border-radius: 8px;
  font-weight: 800;
}

.score-date-filter,
.score-item-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.score-date-filter input,
.score-item-form input,
.score-item-form select {
  width: auto;
  min-height: 38px;
  padding: 0 12px;
  color: var(--text);
  background: #fbfdff;
  border: 1px solid #cbddea;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
}

.score-item-form input::placeholder {
  color: #818b94;
  font-size: 14px;
}

.score-date-filter input {
  width: 180px;
}

.score-item-form input,
.score-item-form select,
.score-item-form button {
  width: 100%;
  min-width: 0;
}

.score-item-form {
  margin: 8px 0 10px;
  padding: 10px;
  display: grid;
  grid-template-columns: auto minmax(130px, 1.1fr) 88px 70px 78px 72px 86px;
  align-items: center;
  gap: 8px;
  background: #f7fbfe;
  border: 1px solid #d7e7f0;
  border-radius: 8px;
}

.score-items-shell {
  display: grid;
  gap: 10px;
}

.score-items-hero {
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #edf3f7;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(42, 61, 78, 0.06);
}

.score-items-hero h3 {
  margin: 0;
  color: #242b32;
  font-size: 18px;
  line-height: 1.2;
}

.score-items-hero h3 span {
  margin-right: 6px;
  font-size: 16px;
}

.score-items-hero p {
  margin: 4px 0 0;
  color: #5e6770;
  font-weight: 700;
  font-size: 12px;
}

.score-item-form h3 {
  margin: 0;
  color: #242b32;
  font-size: 14px;
  white-space: nowrap;
}

.score-item-form .primary-button {
  white-space: nowrap;
  font-size: 13px;
}

#scoreItemName {
  min-width: 0;
}

.score-stat-grid {
  margin: 12px 0 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.score-stat-grid article {
  padding: 12px 14px;
  background: #f7fbfe;
  border: 1px solid #d7e7f0;
  border-radius: 8px;
}

.score-stat-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.score-stat-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--primary-dark);
  font-size: 22px;
}

.score-mine-chart {
  height: 300px;
  margin: 4px 0 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #cbddea;
  border-radius: 8px;
}

.score-mine-chart canvas {
  display: block;
  width: 100%;
  height: 300px;
}

.score-team-tools {
  margin: 8px 0 12px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.score-team-search {
  position: relative;
  min-width: 0;
}

.score-team-tools input[type="search"],
.score-team-tools input[type="date"] {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #cbddea;
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  font-weight: 800;
}

.score-team-tools input[type="search"] {
  width: 100%;
}

.score-date-row.team-mode {
  justify-content: flex-start;
}

.score-date-row.team-mode .score-date-filter {
  display: none;
}

.score-team-suggestions {
  position: absolute;
  z-index: 55;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  gap: 4px;
  max-height: 320px;
  overflow: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid #c8dceb;
  border-radius: 8px;
  box-shadow: 0 18px 36px rgba(15, 38, 58, 0.18);
}

.score-team-suggestion {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 9px 10px;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.score-team-suggestion:hover {
  background: #edf6fb;
}

.score-team-suggestion strong {
  font-size: 15px;
  line-height: 1.25;
}

.score-team-suggestion span {
  color: #65798b;
  font-size: 12px;
  font-weight: 800;
}

.score-sticky-save {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.score-table-wrap {
  max-height: calc(100vh - 230px);
  overflow: auto;
  border: 1px solid #cbddea;
  border-radius: 8px;
}

.score-ranking-wrap {
  width: min(820px, 100%);
  max-height: none;
  overflow: visible;
}

.score-table {
  min-width: 0;
}

.score-table-head,
.score-table-row,
.score-input-head,
.score-input-row,
.score-ranking-head,
.score-ranking-row,
.score-item-head,
.score-item-row,
.score-coin-head,
.score-coin-row {
  display: grid;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid #d7e7f0;
}

.score-table-head,
.score-input-head,
.score-ranking-head,
.score-item-head,
.score-coin-head {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 40px;
  background: #eaf4fb;
  color: var(--text);
  font-weight: 800;
  box-shadow: 0 1px 0 #cbddea;
}

.score-table-row,
.score-input-row,
.score-ranking-row,
.score-item-row,
.score-coin-row {
  background: #fff;
  color: #213648;
  font-size: 14px;
}

.score-table-row:last-child,
.score-input-row:last-child,
.score-ranking-row:last-child,
.score-item-row:last-child,
.score-coin-row:last-child {
  border-bottom: 0;
}

.score-table-head,
.score-table-row {
  grid-template-columns: 104px minmax(210px, 1fr) 70px 70px 130px;
}

.score-input-head,
.score-input-row {
  grid-template-columns: 140px 110px 104px 94px 94px 100px;
  gap: 10px;
  justify-content: start;
}

.score-ranking-head,
.score-ranking-row {
  grid-template-columns: 42px 104px 150px 120px 70px 82px 72px;
  gap: 8px;
  justify-content: start;
}

.score-ranking-head > :nth-child(3),
.score-ranking-row > :nth-child(3) {
  overflow: visible;
  text-overflow: clip;
}

.score-item-head,
.score-item-row {
  grid-template-columns: 32px minmax(110px, 1fr) 68px 54px 68px 54px 48px 174px;
  gap: 5px;
  padding: 0 8px;
  font-size: 12px;
}

.score-coin-head,
.score-coin-row {
  grid-template-columns: 120px minmax(160px, 1fr) 100px 90px 90px minmax(140px, 1fr);
}

.score-ranking-group {
  border-bottom: 1px solid #d7e7f0;
}

.score-ranking-group:last-child {
  border-bottom: 0;
}

.score-ranking-group h4 {
  margin: 0;
  padding: 12px 14px;
  background: #f7fbfe;
  color: var(--primary-dark);
  font-size: 16px;
}

.score-coin-breakdown {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.score-top-reward {
  color: #f04747;
  font-style: normal;
  font-weight: 900;
}

.score-participation {
  color: #9aabba;
  font-weight: 900;
}

.score-participation.ok {
  color: #f04747;
}

.score-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  font-style: normal;
  font-weight: 900;
}

.score-badge.blue {
  color: #fff;
  background: #1671f5;
}

.score-badge.yellow {
  color: #2f2a10;
  background: #ffc21a;
}

.score-badge.green {
  color: #fff;
  background: #178c55;
}

.score-badge.gray {
  color: #fff;
  background: #8795a1;
}

.score-value-blue {
  color: #1671f5;
}

.score-value-yellow {
  color: #b58100;
}

.score-value-green {
  color: #178c55;
}

.score-mine-block {
  border-bottom: 1px solid #d7e7f0;
}

.score-mine-block:last-child {
  border-bottom: 0;
}

.score-mine-block h4 {
  margin: 0;
  padding: 10px 14px;
  color: var(--primary-dark);
  background: #f7fbfe;
  font-size: 14px;
}

.score-summary-head,
.score-summary-row {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) 96px 96px;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 14px;
  border-bottom: 1px solid #d7e7f0;
  font-size: 14px;
}

.score-summary-head {
  position: sticky;
  top: 0;
  z-index: 3;
  color: var(--text);
  background: #eaf4fb;
  font-weight: 800;
  box-shadow: 0 1px 0 #cbddea;
}

.score-team-head,
.score-team-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 112px 120px 82px 72px 92px;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 14px;
  border-bottom: 1px solid #d7e7f0;
  font-size: 14px;
}

.score-team-head {
  position: sticky;
  top: 0;
  z-index: 3;
  color: var(--text);
  background: #eaf4fb;
  font-weight: 800;
  box-shadow: 0 1px 0 #cbddea;
}

.score-team-row > * {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-seven-day-wrap {
  max-height: 880px;
  overflow-y: auto;
}

.score-query-tools {
  margin: 8px 0 12px;
  display: grid;
  grid-template-columns: 132px minmax(180px, 1fr) 180px 180px;
  gap: 10px;
}

.score-query-tools select,
.score-query-tools input {
  min-height: 38px;
  padding: 0 12px;
  color: var(--text);
  background: #fbfdff;
  border: 1px solid #cbddea;
  border-radius: 8px;
  font-weight: 800;
}

.score-query-detail-wrap {
  margin-top: 12px;
  max-height: 720px;
  overflow: auto;
}

.score-query-summary-wrap {
  max-height: 2050px;
  overflow: auto;
}

.score-query-summary-head,
.score-query-summary-row,
.score-query-detail-head,
.score-query-detail-row {
  display: grid;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 12px;
  border-bottom: 1px solid #d7e7f0;
  font-size: 13px;
}

.score-query-summary-head,
.score-query-detail-head {
  position: sticky;
  top: 0;
  z-index: 4;
  color: var(--text);
  background: #eaf4fb;
  font-weight: 800;
  box-shadow: 0 2px 0 #2f78b7;
}

.score-query-summary-head,
.score-query-summary-row {
  grid-template-columns: 110px 92px minmax(160px, 1fr) 84px 84px;
}

.score-query-detail-head,
.score-query-detail-row {
  grid-template-columns: 96px 92px 96px minmax(150px, 1fr) 62px 70px 126px;
}

.score-query-user-divider {
  padding: 9px 12px;
  color: #123657;
  background: #d8ebf8;
  border-top: 3px solid #2f78b7;
  border-bottom: 1px solid #bdd7e8;
  font-size: 14px;
  font-weight: 900;
}

.score-item-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
}

.score-item-actions .small {
  min-height: 26px;
  padding: 0 6px;
  font-size: 12px;
}

.score-coin-admin {
  margin-top: 18px;
  padding: 14px;
  background: #f7fbfe;
  border: 1px solid #d7e7f0;
  border-radius: 8px;
}

.score-coin-rule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.score-coin-rule-grid article {
  padding: 12px;
  display: grid;
  gap: 8px;
  background: #fff;
  border: 1px solid #d7e7f0;
  border-radius: 8px;
}

.score-coin-rule-grid h4 {
  margin: 0 0 2px;
  color: var(--primary-dark);
}

.score-coin-rule-grid label {
  display: grid;
  grid-template-columns: 1fr 96px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.score-coin-rule-grid input {
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid #cbddea;
  border-radius: 7px;
}

.score-coin-admin > .primary-button {
  margin-top: 12px;
}

.score-input-list {
  overflow: auto;
  border: 1px solid #cbddea;
  border-radius: 8px;
}

.score-input-head,
.score-input-row {
  min-width: 0;
}

.score-input-row input {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  color: var(--text);
  background: #fbfdff;
  border: 1px solid #cbddea;
  border-radius: 8px;
  font-weight: 800;
}

.score-input-row.locked {
  color: #8a98a4;
  background: #f5f8fa;
}

.score-fill-group {
  border-bottom: 1px solid #d7e7f0;
  background: #fff;
}

.score-fill-group:last-child {
  border-bottom: 0;
}

.score-fill-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #f7fbfe;
  border-bottom: 1px solid #d7e7f0;
}

.score-fill-group-title h4 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 16px;
}

.score-fill-group-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.score-fill-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 14px;
}

.score-fill-columns article {
  min-width: 0;
  padding: 12px;
  border: 1px solid #d7e7f0;
  border-radius: 8px;
  background: #fbfdff;
}

.score-fill-columns h5 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 14px;
}

.score-fill-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.score-fill-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  max-width: 100%;
  padding: 0 10px;
  border: 1px solid #cbddea;
  border-radius: 8px;
  background: #fff;
  color: var(--primary-dark);
  font-weight: 900;
}

.score-fill-pill em {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-table-row > *,
.score-input-row > *,
.score-ranking-row > *,
.score-item-row > *,
.score-coin-row > * {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.registration-page {
  padding: 22px;
}

.registration-hero {
  min-height: calc(100vh - 118px);
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 420px);
  align-items: center;
  gap: 24px;
  padding: 36px;
  background: linear-gradient(145deg, #eaf6ff, #f7fbff 58%, #dff0ff);
  border: 1px solid #c8dfea;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.registration-brand {
  max-width: 620px;
}

.registration-mark {
  width: 54px;
  height: 54px;
  margin-bottom: 18px;
}

.registration-brand h2 {
  margin: 0 0 12px;
  color: #102438;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: 0;
}

.registration-brand > p:last-child {
  margin: 0;
  color: #497087;
  font-size: 22px;
  font-weight: 800;
}

.registration-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #c8dfea;
  border-radius: 12px;
  box-shadow: 0 18px 42px rgba(57, 103, 145, 0.14);
}

.registration-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.registration-card input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: var(--text);
  background: #fbfdff;
  border: 1px solid #cbddea;
  border-radius: 8px;
  font-weight: 800;
}

.registration-message {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-weight: 800;
}

.registration-message[data-type="success"] {
  color: var(--accent);
}

@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 320px minmax(520px, 1fr);
  }
}

@media (max-width: 760px) {
  *,
  *::before,
  *::after {
    max-width: 100%;
  }

  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  body.auth-locked,
  body.auth-booting {
    overflow-y: auto;
  }

  .auth-page {
    min-height: 100svh;
    padding: 14px;
    align-items: center;
  }

  .auth-hero {
    grid-template-columns: 1fr;
    align-items: center;
    gap: 18px;
    width: min(430px, 100%);
  }

  .auth-card {
    width: 100%;
    padding: 14px;
  }

  .auth-card-brand {
    gap: 10px;
  }

  .auth-card-brand img {
    width: min(210px, 60%);
    flex-basis: min(210px, 60%);
  }

  .auth-card-brand strong {
    font-size: 16px;
  }

  body {
    background: #eef6fd;
  }

  .app-shell {
    width: 100%;
    overflow-x: hidden;
    --side-nav-width: 0px;
  }

  .topbar,
  .preview-toolbar {
    height: auto;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .topbar {
    position: static;
    padding: 10px;
  }

  .brand-lockup h1 {
    font-size: 24px;
    line-height: 1.1;
  }

  .main-nav {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .side-navigation {
    position: sticky;
    top: 0;
    bottom: auto;
    z-index: 42;
    width: 100%;
    padding: 8px 10px;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    background: #20324b;
    box-shadow: 0 8px 18px rgba(31, 55, 79, 0.12);
  }

  .side-nav-title {
    flex: 0 0 auto;
    padding: 0 4px;
    font-size: 12px;
  }

  .side-nav-logo {
    flex: 0 0 118px;
    min-height: 34px;
    padding: 0 4px;
  }

  .side-nav-logo img {
    max-height: 32px;
  }

  .side-navigation .main-nav {
    display: flex;
    width: auto;
    min-width: max-content;
    gap: 6px;
  }

  .side-navigation .nav-button {
    width: auto;
    min-height: 34px;
    justify-content: center;
    padding: 0 10px;
  }

  .side-navigation .nav-icon {
    width: 16px;
    height: 16px;
  }

  .workspace-nav {
    margin-left: 0;
  }

  .workspace-tabs-row {
    min-height: 38px;
  }

  .open-page-tabs {
    min-height: 38px;
  }

  .open-page-tab {
    min-width: 108px;
    min-height: 38px;
    font-size: 12px;
  }

  .module-subnav {
    min-height: 44px;
    padding: 6px 10px;
  }

  .module-subnav-button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }

  .nav-button {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 12px;
    font-size: 14px;
  }

  .top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .workspace-tabs-row .top-actions {
    width: auto;
    display: flex;
    flex: 0 0 auto;
    min-height: 38px;
    padding: 3px 6px;
  }

  .workspace-tabs-row .profile-chip {
    min-height: 32px;
    padding-right: 6px;
  }

  .workspace-tabs-row .profile-avatar {
    width: 28px;
    height: 28px;
  }

  .workspace-tabs-row .logout-button {
    min-height: 32px;
    padding: 0 8px;
  }

  .role-select {
    min-width: 0;
  }

  .role-select select {
    width: 100%;
  }

  .profile-chip {
    min-width: 0;
  }

  .profile-chip-name {
    display: none;
  }

  .register-entry-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .app-page {
    padding: 10px;
    width: 100%;
    overflow-x: hidden;
  }

  .page-card,
  .admin-tool-card,
  .task-publish-card,
  .trend-import-panel,
  .trend-dashboard,
  .score-section,
  .registration-hero {
    max-width: 100%;
    border-radius: 10px;
  }

  .section-title-row,
  .toolbar-row,
  .trend-filters,
  .listing-toolbar,
  .opportunity-filters,
  .listing-filters,
  .directory-filters,
  .customer-search-row,
  .admin-filters,
  .score-date-row,
  .score-query-tools,
  .section-actions,
  .task-toolbar,
  .score-toolbar {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  input,
  select,
  textarea,
  button {
    min-width: 0;
    max-width: 100%;
  }

  .primary-button,
  .ghost-button,
  .tool-button,
  .nav-button,
  .score-tab,
  .listing-tab,
  .task-tab,
  .admin-subtab {
    white-space: normal;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .canvas-wrap {
    min-height: 460px;
  }

  .listing-create-grid {
    grid-template-columns: 1fr;
  }

  .listing-detail-grid {
    grid-template-columns: 1fr;
  }

  .listing-detail-main .detail-list {
    grid-template-columns: 1fr;
  }

  .trend-import-panel,
  .trend-filters,
  .trend-stat-grid {
    grid-template-columns: 1fr;
  }

  .trend-filters,
  .opportunity-filters,
  #leadSystemPanel .opportunity-filters,
  .listing-filters,
  .directory-filters,
  .customer-search-row,
  .admin-filters,
  .score-date-row,
  .score-query-tools,
  .task-toolbar,
  .score-toolbar,
  .customer-form,
  .lead-form,
  .lead-source-settings,
  .listing-create-grid,
  .score-item-form,
  .registered-client-filters,
  .district-create-panel,
  .admin-create-panel,
  .role-create-panel,
  .new-community-panel {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    gap: 8px;
  }

  .customer-level-filter,
  .customer-inline-follow-actions {
    display: flex !important;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .customer-inline-follow-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .trend-filters > *,
  .opportunity-filters > *,
  .listing-filters > *,
  .directory-filters > *,
  .customer-search-row > *,
  .admin-filters > *,
  .score-date-row > *,
  .score-query-tools > *,
  .task-toolbar > *,
  .score-toolbar > *,
  .customer-form > *,
  .lead-form > *,
  .lead-source-settings > *,
  .listing-create-grid > *,
  .score-item-form > *,
  .registered-client-filters > *,
  .new-community-panel > * {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .trend-dashboard,
  .trend-panel,
  .trend-hero,
  .trend-stat-grid,
  .trend-detail-panel,
  .page-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  #trendChart,
  canvas {
    max-width: 100%;
  }

  .listing-table-wrap,
  .opportunity-table-wrap,
  .trend-table-wrap,
  .score-table-wrap,
  .plain-listing-table,
  .maintenance-table,
  .sold-listing-list,
  .task-rule-table,
  .permission-table,
  .user-table,
  .registered-client-table {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #leadDetailBoard .opportunity-table-wrap,
  .trend-detail-list,
  .trend-batch-list,
  .trend-batch-panel,
  .trend-import-panel {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .trend-detail-row {
    min-width: 920px;
    max-width: none;
  }

  .trend-batch-row {
    min-width: 520px;
    max-width: none;
  }

  .listing-table,
  .maintenance-table,
  .sold-listing-list,
  .customer-table,
  .customer-pool-table,
  .lead-table,
  .trend-table,
  .score-table,
  .plain-listing-table,
  .permission-table,
  .user-table,
  .registered-client-table,
  .task-rule-table,
  .score-table-head,
  .score-table-row,
  .score-input-head,
  .score-input-row,
  .score-ranking-head,
  .score-ranking-row,
  .score-item-head,
  .score-item-row {
    max-width: none;
  }

  .score-input-list {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
    border: 1px solid #cbddea;
    border-radius: 8px;
    background: #fff;
  }

  .score-input-head,
  .score-input-row {
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(78px, 1.35fr) minmax(42px, 0.62fr) minmax(44px, 0.62fr) minmax(44px, 0.62fr) minmax(58px, 0.8fr) minmax(48px, 0.68fr);
    gap: 0;
    padding: 0;
  }

  .score-input-head > *,
  .score-input-row > * {
    min-height: 46px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    background: inherit;
    border-right: 1px solid #e3edf4;
    font-size: 12px;
    line-height: 1.18;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .score-input-head {
    position: sticky;
    top: 0;
    z-index: 6;
  }

  .score-input-row > :first-child,
  .score-input-head > :first-child {
    font-size: 13px;
    font-weight: 900;
    word-break: break-word;
  }

  .score-input-head > :nth-child(n + 3),
  .score-input-row > :nth-child(n + 3) {
    justify-content: center;
    text-align: center;
  }

  .score-input-head > :last-child,
  .score-input-row > :last-child {
    border-right: 0;
  }

  .score-input-row input[data-score-item] {
    width: 100% !important;
    min-width: 44px;
    min-height: 34px;
    padding: 0 4px;
    text-align: center;
    font-size: 16px;
    border-radius: 7px;
  }

  .score-input-row .score-badge {
    min-width: 0;
    padding: 3px 5px;
    font-size: 13px;
    line-height: 1;
  }

  .score-team-tools {
    grid-template-columns: 1fr;
  }

  .score-team-tools .score-date-filter {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .score-team-head,
  .score-team-row {
    grid-template-columns: minmax(90px, 1fr) 92px 76px 64px;
  }

  .score-team-head > :nth-child(3),
  .score-team-row > :nth-child(3),
  .score-team-head > :nth-child(5),
  .score-team-row > :nth-child(5) {
    display: none;
  }

  .score-fill-columns {
    grid-template-columns: 1fr;
  }

  .score-fill-group-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .score-action-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    width: 100%;
    gap: 8px;
  }

  .score-action-row input {
    width: 100%;
    min-height: 38px;
  }

  .score-action-row .primary-button {
    min-height: 38px;
    padding: 0 12px;
    white-space: nowrap;
  }

  .score-sticky-save {
    position: sticky;
    bottom: 0;
    z-index: 8;
    margin: 0;
    padding: 8px 0 0;
    justify-content: stretch;
    background: linear-gradient(180deg, rgba(255,255,255,0), #fff 28%);
  }

  .score-sticky-save .primary-button {
    width: 100%;
  }

  .community-grid,
  .listing-card-grid,
  .task-board,
  .admin-grid,
  .score-stat-grid,
  .trend-stat-grid {
    grid-template-columns: 1fr;
  }

  .community-card,
  .listing-card,
  .task-card,
  .admin-tool-card {
    width: 100%;
  }

  .modal-panel,
  .side-drawer {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .client-sandbox,
  .client-canvas-wrap {
    width: 100%;
    min-height: calc(100vh - 180px);
  }

  .client-filter-panel,
  .unit-popover {
    left: 10px;
    right: 10px;
    max-width: none;
  }

  .client-filter-panel {
    top: 72px;
  }

  .unit-popover {
    bottom: 12px;
  }

  .registration-page {
    padding: 10px;
  }

  .registration-hero {
    min-height: calc(100vh - 150px);
    grid-template-columns: 1fr;
    align-items: start;
    gap: 18px;
    padding: 20px;
  }

  .registration-brand h2 {
    font-size: 32px;
  }

  .registration-brand > p:last-child {
    font-size: 18px;
  }

  #trendChart {
    height: 350px;
  }

  .wide-field {
    grid-column: auto;
  }

  .modal-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

body.is-mobile-landscape .app-shell {
  width: 100%;
  overflow-x: hidden;
  --side-nav-width: 108px;
}

body.is-mobile-landscape .side-navigation {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 45;
  width: var(--side-nav-width);
  padding: 8px 7px 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  background: linear-gradient(180deg, #23364f 0%, #1b2b42 100%);
  box-shadow: 12px 0 28px rgba(31, 55, 79, 0.12);
}

body.is-mobile-landscape .side-nav-logo {
  flex: 0 0 auto;
  width: 94px;
  min-height: 34px;
  padding: 0 2px 6px;
}

body.is-mobile-landscape .side-nav-logo img {
  width: auto;
  max-height: 30px;
  object-position: left center;
}

body.is-mobile-landscape .side-nav-logo-text {
  top: 4px;
  font-size: 14px;
}

body.is-mobile-landscape .side-nav-logo-text strong {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  font-size: 14px;
}

body.is-mobile-landscape .side-navigation .main-nav {
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  display: grid;
  grid-auto-rows: max-content;
  gap: 8px;
  justify-content: start;
  align-content: start;
  overflow: visible;
}

body.is-mobile-landscape .side-navigation .nav-button {
  width: 94px;
  max-width: 94px;
  min-height: 32px;
  justify-content: flex-start;
  gap: 6px;
  padding: 0 7px;
  font-size: 12px;
  line-height: 1.15;
  white-space: normal;
  text-align: left;
}

body.is-mobile-landscape .workspace-nav {
  margin-left: var(--side-nav-width);
}

body.is-mobile-landscape .workspace-tabs-row {
  min-height: 36px;
}

body.is-mobile-landscape .module-subnav {
  min-height: 38px;
  padding: 5px 8px;
}

body.is-mobile-landscape .module-subnav-button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

body.is-mobile-landscape .app-page {
  width: calc(100% - var(--side-nav-width));
  margin-left: var(--side-nav-width);
  padding: 8px 10px;
  overflow-x: hidden;
}

body.is-mobile-landscape .page-card {
  min-height: calc(100svh - 86px);
  padding: 12px;
}

body.score-input-editing .side-navigation,
body.score-input-editing .workspace-nav {
  display: none;
}

body.score-input-editing .app-shell {
  --side-nav-width: 0px;
}

body.score-input-editing .app-page {
  width: 100%;
  margin-left: 0;
  padding: 6px;
}

body.score-input-editing #scoresPage .page-card {
  min-height: 100svh;
  padding: 8px;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
}

body.score-input-editing #scoresPage .section-title-row,
body.score-input-editing #scoresPage .score-tabs,
body.score-input-editing #scoreSummary {
  display: none;
}

.deep-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.deep-layout {
  display: grid;
  grid-template-columns: 260px minmax(620px, 980px) 318px;
  gap: 10px;
  align-items: start;
  justify-content: start;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
}

.deep-layout.no-sidebar {
  grid-template-columns: minmax(620px, 1580px);
  width: 100%;
}

.deep-layout.property-leads-mode,
.deep-layout.property-leads-mode.no-sidebar,
.deep-layout.property-leads-mode.detail-open {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-width: none;
  overflow: visible;
}

.deep-layout.no-sidebar .deep-sidebar {
  display: none;
}

.deep-sidebar,
.deep-main,
.deep-detail,
.deep-builder-card,
.deep-dictionary-card,
.deep-summary-band {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.deep-sidebar,
.deep-detail {
  position: sticky;
  top: 128px;
  max-height: calc(100svh - 150px);
  overflow: auto;
  padding: 14px;
  min-width: 0;
}

.deep-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 0;
  background: transparent;
}

.deep-side-head,
.deep-summary-band,
.deep-building-tabs,
.deep-unit-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.deep-current-building-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid #d8e5ec;
  border-radius: 8px;
  background: #f8fbfd;
  color: #0f766e;
  font-weight: 900;
}

.deep-community-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.deep-community-card {
  width: 100%;
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
  color: var(--ink);
}

.deep-community-card-main {
  position: relative;
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.deep-community-card.active {
  border-color: #1f7bb6;
  background: #eef7ff;
}

.deep-community-card-main strong,
.deep-community-card strong {
  font-size: 17px;
}

.deep-sidebar-buildings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #dce9ef;
}

.deep-sidebar-buildings.empty {
  display: block;
  color: #607482;
  font-size: 12px;
  font-weight: 800;
}

.deep-sidebar-buildings button {
  display: grid;
  gap: 2px;
  min-width: 0;
  min-height: 44px;
  padding: 7px 8px;
  border: 1px solid #dce9ef;
  border-radius: 8px;
  background: #f8fbfd;
  color: #173044;
  text-align: left;
  cursor: pointer;
}

.deep-sidebar-buildings button.active {
  border-color: #087f72;
  background: #e8f8f4;
  box-shadow: inset 0 0 0 1px rgba(8, 127, 114, 0.3);
}

.deep-sidebar-buildings strong {
  font-size: 13px;
  line-height: 1.1;
}

.deep-sidebar-buildings span {
  min-width: 0;
  overflow: hidden;
  color: #607482;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deep-community-card span,
.deep-community-card small,
.deep-detail-empty span,
.deep-follow-list span,
.muted {
  color: var(--muted);
}

.deep-summary-band {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(4, minmax(96px, 130px));
  padding: 16px;
}

.deep-summary-band article {
  min-height: 72px;
  padding: 12px;
  border-radius: 8px;
  background: #f3f8fb;
}

.deep-summary-band article span {
  display: block;
  color: var(--muted);
  font-weight: 700;
}

.deep-summary-band article strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.deep-builder-card,
.deep-dictionary-card {
  padding: 16px;
}

.deep-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.deep-form-grid.compact {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.deep-form-grid label,
.deep-detail-form label {
  display: grid;
  gap: 6px;
  font-weight: 800;
  color: var(--muted);
}

.deep-form-grid .wide,
.deep-detail-form .wide {
  grid-column: 1 / -1;
}

.deep-form-grid input,
.deep-form-grid select,
.deep-form-grid textarea,
.deep-detail-form input,
.deep-detail-form select,
.deep-detail-form textarea,
#deepSearchInput,
#deepStatusFilter,
#deepLeadSearchInput,
#deepLeadTypeFilter,
#deepLeadStatusFilter,
.deep-lead-actions input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.deep-communities-overview {
  display: grid;
  gap: 14px;
  padding: 16px;
  width: 100%;
  max-width: none;
}

.deep-community-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(0, 660px));
  justify-content: center;
  gap: 18px;
  width: min(100%, 2700px);
  margin-inline: auto;
}

.deep-overview-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.deep-view-toggle {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(58px, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid #d7e7ef;
  border-radius: 8px;
  background: #f6fbfd;
}

.deep-view-toggle button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.deep-view-toggle button.active {
  color: #fff;
  background: #087f72;
  box-shadow: 0 8px 18px rgba(8, 127, 114, 0.18);
}

.deep-community-overview-table {
  width: 100%;
  min-width: 1180px;
  overflow: hidden;
  border: 1px solid #d7e7ef;
  border-radius: 8px;
  background: #fff;
}

.deep-community-overview-head,
.deep-community-overview-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.35fr) minmax(100px, 0.8fr) 72px 70px 70px 70px 70px 70px 70px 84px minmax(190px, 1.25fr) minmax(240px, 1.4fr);
  align-items: center;
  gap: 0;
}

.deep-community-overview-head {
  position: sticky;
  top: 0;
  z-index: 3;
  color: #31536b;
  background: #eaf5fb;
  font-weight: 900;
}

.deep-community-overview-head > span,
.deep-community-overview-row > span {
  min-height: 54px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  border-right: 1px solid #d7e7ef;
  color: var(--ink);
  font-weight: 850;
}

.deep-community-overview-head > span:last-child,
.deep-community-overview-row > span:last-child {
  border-right: 0;
}

.deep-community-overview-row {
  border-top: 1px solid #d7e7ef;
  cursor: pointer;
}

.deep-community-overview-row:nth-child(odd) {
  background: #fbfdfe;
}

.deep-community-overview-row.active {
  background: #effbf7;
  box-shadow: inset 4px 0 0 #087f72;
}

.deep-store-community-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #d7e7ef;
}

.deep-store-community-heading h3 {
  margin: 3px 0 0;
}

.deep-store-community-heading > small {
  color: var(--muted);
  font-weight: 800;
}

.deep-store-community-table {
  min-width: 900px;
}

.deep-store-community-table .deep-community-overview-head,
.deep-store-community-table .deep-community-overview-row {
  grid-template-columns: minmax(210px, 1.5fr) minmax(110px, 0.9fr) repeat(7, minmax(72px, 0.55fr));
}

.deep-store-community-table .deep-community-overview-row {
  cursor: default;
}

.deep-community-row-title,
.deep-community-row-follow {
  min-width: 0;
  flex-direction: column;
  align-items: flex-start !important;
  justify-content: center;
  gap: 3px;
}

.deep-community-row-title b,
.deep-community-row-follow b {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deep-community-row-title small,
.deep-community-row-follow small {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.deep-community-row-actions {
  flex-wrap: wrap;
  gap: 6px;
}

.deep-community-overview-card {
  position: relative;
  display: grid;
  gap: 14px;
  width: min(660px, 100%);
  padding: 16px;
  border: 1px solid #dce9ef;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.deep-community-overview-card.active {
  border-color: #087f72;
  background: #f1fbf8;
  box-shadow: inset 0 0 0 1px rgba(8, 127, 114, 0.35), 0 14px 28px rgba(8, 127, 114, 0.08);
}

.deep-community-overview-card h3 {
  margin: 4px 0;
  color: var(--ink);
  font-size: 24px;
}

.deep-community-overview-card small {
  color: var(--muted);
  font-weight: 800;
}

.deep-community-overview-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.deep-community-overview-metrics span {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #dce9ef;
  border-radius: 8px;
  background: #f8fbfd;
}

.deep-community-overview-metrics b {
  color: var(--ink);
  font-size: 24px;
}

.deep-community-overview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.deep-community-overview-info {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.deep-community-overview-info span {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #dce9ef;
  border-radius: 8px;
  background: #fbfdfe;
}

.deep-community-overview-info b {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deep-lead-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.deep-lead-metrics article {
  min-height: 78px;
  padding: 12px;
  border: 1px solid #dce9ef;
  border-radius: 8px;
  background: #f7fbfd;
}

.deep-lead-metrics article.danger {
  border-color: #f0b5b5;
  background: #fff5f5;
}

.deep-lead-metrics article.warn {
  border-color: #f2d19a;
  background: #fff9ec;
}

.deep-lead-metrics span,
.deep-lead-metrics small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.deep-lead-metrics strong {
  display: block;
  margin: 6px 0;
  color: var(--ink);
  font-size: 28px;
}

.deep-lead-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 150px 150px;
  gap: 10px;
}

.deep-filter-toolbar {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) 170px;
  gap: 10px;
  align-items: end;
  padding: 12px 14px;
  border: 1px solid #d8e5ec;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(16, 53, 74, 0.07);
}

.deep-filter-toolbar > div {
  min-width: 120px;
}

.deep-filter-toolbar strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
}

.deep-filter-toolbar input,
.deep-filter-toolbar select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.deep-form-grid input:disabled,
.deep-form-grid select:disabled,
.deep-detail-form input:disabled,
.deep-detail-form select:disabled {
  color: #6f7d86;
  background: #edf3f6;
  cursor: not-allowed;
}

.deep-property-leads-panel,
.deep-property-leads-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  width: 100%;
  align-items: start;
}

.deep-property-leads-left,
.deep-property-leads-right {
  min-width: 0;
}

.deep-property-leads-left {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.deep-property-leads-right {
  position: sticky;
  top: 128px;
  min-height: calc(100svh - 150px);
  display: grid;
  align-content: start;
}

.deep-lead-form {
  padding: 14px;
  border: 1px solid #dce9ef;
  border-radius: 8px;
  background: #fbfdfe;
}

.deep-lead-inline-card {
  width: 100%;
  overflow: visible;
}

.deep-lead-side-card {
  width: 100%;
  max-height: calc(100svh - 150px);
  overflow: auto;
}

.deep-lead-side-card .deep-form-grid,
.deep-lead-side-card .deep-lead-maintenance,
.deep-lead-side-card .deep-lead-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.deep-lead-side-card .wide {
  grid-column: 1 / -1;
}

.section-title-row.compact {
  align-items: end;
}

.section-title-row.compact h4 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
}

.deep-lead-table {
  display: grid;
  border: 1px solid #dce9ef;
  border-radius: 8px;
  overflow-x: auto;
  background: #fff;
}

.deep-lead-row-group {
  display: grid;
  min-width: 920px;
}

.deep-lead-head,
.deep-lead-row {
  display: grid;
  grid-template-columns: 108px minmax(220px, 1.4fr) 120px 130px 136px 112px 130px;
  gap: 10px;
  align-items: center;
  min-width: 920px;
}

.deep-lead-head {
  padding: 12px;
  color: #244258;
  background: #eaf5fb;
  font-weight: 900;
}

.deep-lead-row {
  padding: 12px;
  border-top: 1px solid #dce9ef;
  background: #fff;
  cursor: pointer;
}

.deep-lead-row:hover,
.deep-lead-row.active {
  box-shadow: inset 4px 0 0 #087f72;
}

.deep-lead-row.danger {
  background: #fff5f5;
}

.deep-lead-row.warn {
  background: #fff9ec;
}

.deep-lead-row > span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.deep-lead-row strong,
.deep-lead-row b {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deep-lead-row small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deep-lead-row.danger > span:first-child b {
  color: #b4232b;
}

.deep-lead-row.warn > span:first-child b {
  color: #a46405;
}

.deep-lead-row-detail {
  padding: 12px;
  border-top: 1px solid #dce9ef;
  background: #f3fbf8;
}

.deep-lead-actions {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.deep-lead-detail-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #b9dcd5;
  border-radius: 8px;
  background: #f7fcfa;
}

.deep-lead-empty-card {
  min-height: 360px;
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 24px;
  border: 1px dashed #b9d6df;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
}

.deep-lead-empty-card h3,
.deep-lead-empty-card p {
  margin: 0;
}

.deep-lead-empty-card p {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.7;
}

.deep-lead-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.deep-lead-detail-grid article {
  padding: 10px;
  border: 1px solid #dce9ef;
  border-radius: 8px;
  background: #fff;
}

.deep-lead-detail-grid span,
.deep-lead-detail-grid small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.deep-lead-detail-grid strong {
  display: block;
  margin: 5px 0;
  color: var(--ink);
  font-size: 20px;
}

.deep-lead-maintenance {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.deep-lead-maintenance label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 900;
}

.deep-lead-maintenance .wide {
  grid-column: span 2;
}

.deep-lead-maintenance input,
.deep-lead-maintenance select,
.deep-lead-maintenance textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.deep-lead-follow-list {
  display: grid;
  gap: 8px;
}

.deep-lead-follow-list article {
  display: grid;
  grid-template-columns: 100px 150px minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid #dce9ef;
  border-radius: 8px;
  background: #fff;
}

.deep-lead-follow-list p {
  margin: 0;
}

.deep-shell > .section-title-row #deepSearchInput,
.deep-shell > .section-title-row #deepStatusFilter {
  color: #12283a;
  background: #ffffff;
  opacity: 1;
}

.deep-shell > .section-title-row #deepSearchInput::placeholder {
  color: #7a8791;
  opacity: 1;
}

.deep-building-tabs {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.deep-unit-tabs {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-bottom: 10px;
  max-width: 100%;
  overflow-x: auto;
}

.deep-room-board {
  display: grid;
  grid-template-columns: 58px repeat(var(--deep-cols), minmax(112px, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
  max-height: 680px;
}

.deep-floor-label,
.deep-room-head,
.deep-room-cell {
  min-height: 96px;
  border-right: 1px solid #e1edf3;
  border-bottom: 1px solid #e1edf3;
}

.deep-floor-label,
.deep-room-head {
  display: grid;
  place-items: center;
  background: #f5f8fa;
  color: var(--ink);
}

.deep-floor-label small,
.deep-room-head small {
  color: var(--muted);
}

.deep-head {
  min-height: 64px;
}

.deep-room-head {
  min-height: 64px;
  font-weight: 900;
  border: 0;
  border-right: 1px solid #e1edf3;
  border-bottom: 1px solid #e1edf3;
  cursor: pointer;
}

.deep-room-head em {
  display: block;
  font-style: normal;
  color: #607482;
  font-size: 12px;
}

.deep-room-cell {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 3px;
  padding: 10px 8px;
  border: 0;
  border-right: 1px solid #e1edf3;
  border-bottom: 1px solid #e1edf3;
  color: var(--ink);
  cursor: pointer;
  background: #eef4f7;
}

.deep-room-cell.active {
  outline: 3px solid #2278b5;
  outline-offset: -3px;
}

.deep-floor-label.selected,
.deep-room-head.selected {
  background: #d9f3ef;
  color: #075f54;
  box-shadow: inset 0 0 0 2px #078a78;
}

.deep-room-cell.batch-selected {
  box-shadow: inset 0 0 0 3px rgba(7, 138, 120, 0.65);
}

.deep-room-cell.filter-muted {
  opacity: 0.28;
  filter: saturate(0.65);
}

.deep-room-cell mark {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.deep-room-cell strong {
  font-size: 24px;
  line-height: 1;
}

.deep-room-cell span,
.deep-room-cell small {
  color: #526675;
}

.deep-room-cell b {
  color: #d75b22;
  font-size: 18px;
}

.deep-room-cell.onsale {
  background: #dff4ff;
}

.deep-room-cell.focus {
  background: #cbe5ff;
}

.deep-room-cell.renting {
  background: #dff5ef;
}

.deep-room-cell.self {
  background: #fff1c9;
}

.deep-room-cell.vacant {
  background: #f7ecff;
}

.deep-room-cell.sold {
  background: #ffe4e4;
}

.deep-room-cell.unknown {
  background: #f3f5f6;
}

.deep-detail-empty {
  display: grid;
  gap: 8px;
  min-height: 180px;
  align-content: center;
}

.deep-detail-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.deep-detail-form button {
  grid-column: 1 / -1;
}

.deep-follow-box {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.deep-follow-box h4 {
  margin: 0 0 10px;
}

.deep-follow-box textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font: inherit;
}

.deep-follow-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.deep-follow-list article {
  padding: 10px;
  border-radius: 8px;
  background: #f5f8fa;
}

.deep-follow-list article p {
  margin: 6px 0 0;
  line-height: 1.5;
}

.deep-page .page-card {
  background: #f4f7f9;
  border: 0;
}

.deep-shell > .section-title-row {
  min-height: 92px;
  padding: 18px 20px;
  border: 1px solid #d8e5ec;
  border-radius: 8px;
  background: linear-gradient(135deg, #12334a 0%, #1e6e8e 54%, #0f8c74 100%);
  color: #fff;
}

.deep-shell > .section-title-row .eyebrow,
.deep-shell > .section-title-row h2 {
  color: #fff;
}

.deep-shell > .section-title-row h2 {
  margin: 4px 0 0;
  font-size: 30px;
}

.deep-shell > .section-title-row .finance-actions {
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: min(760px, 100%);
}

.deep-shell > .section-title-row input,
.deep-shell > .section-title-row select {
  flex: 1 1 170px;
  min-width: 0;
  max-width: 260px;
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.94);
}

.deep-layout {
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(280px, 340px);
  width: 100%;
  min-width: 0;
}

.deep-sidebar,
.deep-detail,
.deep-builder-card,
.deep-dictionary-card,
.deep-hero-panel,
.deep-status-rail,
.deep-work-card {
  border: 1px solid #d8e5ec;
  box-shadow: 0 10px 26px rgba(16, 53, 74, 0.07);
}

.deep-sidebar,
.deep-detail {
  background: #ffffff;
}

.deep-side-head {
  padding-bottom: 12px;
  border-bottom: 1px solid #e2edf2;
}

.deep-community-card {
  min-height: 96px;
  border-color: #dce9ef;
  background: #fff;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.deep-community-card:hover,
.deep-community-card.active {
  transform: translateY(-1px);
  border-color: #2585a9;
  box-shadow: 0 12px 22px rgba(37, 133, 169, 0.14);
}

.deep-community-card.active {
  background: linear-gradient(180deg, #eef9fc 0%, #ffffff 100%);
}

.deep-hero-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 2.4fr);
  gap: 10px 14px;
  align-items: stretch;
  padding: 14px;
  border-radius: 8px;
  background: #ffffff;
}

.deep-hero-copy {
  display: grid;
  align-content: center;
  gap: 4px;
}

.deep-hero-copy h2 {
  margin: 0;
  font-size: 24px;
}

.deep-hero-copy small {
  color: #6b7d89;
}

.deep-hero-metrics {
  display: grid;
  grid-template-columns: minmax(86px, 104px) repeat(4, minmax(82px, 1fr));
  gap: 8px;
  min-width: 0;
  align-items: start;
}

.deep-hero-panel article,
.deep-hero-meter,
.deep-market-grid article {
  min-height: 46px;
  padding: 6px 10px;
  border: 1px solid #e1edf3;
  border-radius: 8px;
  background: #f7fbfd;
}

.deep-hero-panel article span,
.deep-market-grid article span {
  display: block;
  color: #6b7d89;
  font-size: 12px;
  font-weight: 800;
}

.deep-hero-panel article strong,
.deep-market-grid article strong {
  display: block;
  margin-top: 3px;
  font-size: 18px;
}

.deep-hero-meter {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #ffffff 0 45%, transparent 46%), conic-gradient(#078a78 var(--deep-progress), #d9e7ee 0);
}

.deep-hero-meter span {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
}

.deep-hero-meter strong {
  position: relative;
  font-size: 18px;
}

.deep-hero-meter small {
  position: relative;
  color: #6b7d89;
  font-size: 12px;
  font-weight: 800;
}

.deep-status-rail {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(8, minmax(76px, 1fr));
  gap: 8px;
  padding: 10px 0 0;
  border-top: 1px solid #e2edf2;
  border-radius: 8px;
  background: transparent;
  overflow-x: visible;
  scrollbar-width: thin;
}

.deep-status-rail button {
  display: grid;
  gap: 3px;
  min-height: 54px;
  border: 1px solid #dce9ef;
  border-radius: 8px;
  background: #f8fbfd;
  color: #173044;
  cursor: pointer;
}

.deep-status-rail button.active {
  border-color: #087f72;
  background: #e8f8f4;
}

.deep-status-rail strong {
  font-size: 18px;
}

.deep-status-rail span {
  color: #6b7d89;
  font-weight: 800;
}

.deep-work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

.deep-work-card {
  padding: 14px;
  border-radius: 8px;
  background: #ffffff;
}

.deep-workbench {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d8e5ec;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(16, 53, 74, 0.07);
}

.deep-workbench > .section-title-row > span {
  color: #078a78;
  font-weight: 900;
}

.deep-workbench-metrics,
.deep-workbench-actions,
.deep-quality-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.deep-workbench-metrics article,
.deep-workbench-actions button,
.deep-workbench-actions article,
.deep-quality-grid button,
.deep-quality-grid article {
  min-width: 0;
  min-height: 86px;
  padding: 12px;
  border: 1px solid #e1edf3;
  border-radius: 8px;
  background: #f8fbfd;
  color: #173044;
  text-align: left;
}

.deep-workbench-actions button,
.deep-quality-grid button {
  cursor: pointer;
}

.deep-workbench-actions button:hover,
.deep-quality-grid button:hover {
  border-color: #2585a9;
  background: #f0f8fb;
}

.deep-workbench-metrics span,
.deep-workbench-actions span,
.deep-workbench-actions small,
.deep-quality-grid span,
.deep-quality-grid small {
  display: block;
  color: #607482;
  font-weight: 800;
}

.deep-workbench-metrics strong,
.deep-workbench-actions strong,
.deep-quality-grid strong {
  display: block;
  margin: 7px 0 4px;
  font-size: 24px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.deep-quality-list {
  display: grid;
  gap: 8px;
}

.deep-quality-list button {
  display: grid;
  grid-template-columns: minmax(120px, 0.65fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid #dce9ef;
  border-radius: 8px;
  background: #ffffff;
  color: #173044;
  text-align: left;
  cursor: pointer;
}

.deep-quality-list button:hover {
  border-color: #2585a9;
  background: #f3fafb;
}

.deep-quality-list span {
  color: #607482;
  font-weight: 800;
}

.deep-action-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.deep-action-list button {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #dce9ef;
  border-radius: 8px;
  background: #fbfdfe;
  color: #173044;
  text-align: left;
  cursor: pointer;
}

.deep-action-list button:hover {
  border-color: #2585a9;
  background: #f0f8fb;
}

.deep-action-list mark {
  grid-row: span 2;
  min-width: 42px;
  padding: 5px 7px;
  border-radius: 6px;
  color: #173044;
  font-weight: 900;
  text-align: center;
}

.deep-action-list mark.focus { background: #b7dcff; }
.deep-action-list mark.onsale { background: #cfeeff; }
.deep-action-list mark.vacant { background: #ead4ff; }
.deep-action-list mark.unknown { background: #e4e9ed; }
.deep-action-list mark.renting { background: #bfeadf; }
.deep-action-list mark.self { background: #ffe7a3; }
.deep-action-list mark.sold { background: #ffd3d3; }

.deep-action-list span {
  color: #6b7d89;
}

.deep-action-list.compact button {
  grid-template-columns: 1fr;
}

.deep-market-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.deep-completion-panel,
.deep-admin-board {
  padding: 14px;
  border: 1px solid #d8e5ec;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(16, 53, 74, 0.07);
}

.deep-progress-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.deep-progress-list article {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #e1edf3;
  border-radius: 8px;
  background: #f8fbfd;
}

.deep-progress-list article div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.deep-progress-list span {
  color: #078a78;
  font-weight: 900;
}

.deep-progress-list i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #078a78 var(--deep-rate), #dce9ef 0);
}

.deep-admin-table {
  display: grid;
  margin-top: 10px;
  border: 1px solid #e1edf3;
  border-radius: 8px;
  overflow-x: auto;
}

.deep-admin-head,
.deep-admin-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.5fr) minmax(90px, 1fr) repeat(4, minmax(74px, 0.7fr));
  gap: 8px;
  align-items: center;
  min-width: 680px;
  padding: 10px 12px;
}

.deep-admin-head {
  background: #eef4f7;
  color: #607482;
  font-weight: 900;
}

.deep-admin-row {
  border: 0;
  border-top: 1px solid #e1edf3;
  background: #fff;
  color: #173044;
  text-align: left;
  cursor: pointer;
}

.deep-admin-row:hover {
  background: #f3fafb;
}

.deep-admin-row small {
  display: block;
  color: #607482;
  margin-top: 3px;
}

.deep-dashboard {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d8e5ec;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(16, 53, 74, 0.07);
  min-width: 0;
}

.deep-dashboard > .section-title-row {
  align-items: flex-start;
  gap: 12px;
}

.deep-dashboard > .section-title-row small,
.deep-dashboard > .section-title-row > span {
  color: #607482;
  font-weight: 800;
}

.deep-dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
}

.deep-dashboard-metrics article,
.deep-dashboard-metrics button {
  min-height: 94px;
  padding: 12px;
  border: 1px solid #e1edf3;
  border-radius: 8px;
  background: #f8fbfd;
  color: #173044;
  text-align: left;
}

.deep-dashboard-metrics button {
  cursor: pointer;
}

.deep-dashboard-metrics button:hover {
  border-color: #2585a9;
  background: #f0f8fb;
}

.deep-dashboard-metrics span,
.deep-dashboard-metrics small {
  display: block;
  color: #607482;
  font-weight: 800;
}

.deep-dashboard-metrics strong {
  display: block;
  margin: 7px 0 4px;
  font-size: 28px;
}

.deep-dashboard-table {
  display: grid;
  border: 1px solid #e1edf3;
  border-radius: 8px;
  overflow-x: auto;
  max-width: 100%;
}

.deep-dashboard-head,
.deep-dashboard-row {
  display: grid;
  gap: 8px;
  align-items: center;
  min-width: 820px;
  padding: 10px 12px;
}

.deep-dashboard-table-employee .deep-dashboard-head,
.deep-dashboard-table-employee .deep-dashboard-row,
.deep-dashboard-table-community .deep-dashboard-head,
.deep-dashboard-table-community .deep-dashboard-row {
  grid-template-columns: minmax(150px, 1.4fr) minmax(82px, 0.7fr) minmax(72px, 0.55fr) minmax(78px, 0.65fr) repeat(5, minmax(64px, 0.55fr));
}

.deep-dashboard-head {
  background: #eef4f7;
  color: #607482;
  font-weight: 900;
}

.deep-dashboard-row {
  width: 100%;
  border: 0;
  border-top: 1px solid #e1edf3;
  background: #fff;
  color: #173044;
  text-align: left;
}

button.deep-dashboard-row {
  cursor: pointer;
}

.deep-dashboard-row:hover {
  background: #f3fafb;
}

.deep-dashboard-row strong,
.deep-dashboard-row b {
  font-weight: 900;
}

.deep-dashboard-row small {
  display: block;
  margin-top: 3px;
  color: #607482;
  overflow-wrap: anywhere;
}

.deep-drill-panel {
  border-color: #bee3d8;
  background: #fbfffd;
}

.deep-drill-list,
.deep-phone-log-list {
  display: grid;
  gap: 8px;
}

.deep-drill-list button,
.deep-phone-log-list button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid #dce9ef;
  border-radius: 8px;
  background: #ffffff;
  color: #173044;
  text-align: left;
  cursor: pointer;
}

.deep-phone-log-list button {
  grid-template-columns: minmax(86px, 0.5fr) minmax(0, 1fr);
}

.deep-drill-list button:hover,
.deep-phone-log-list button:hover {
  border-color: #2585a9;
  background: #f3fafb;
}

.deep-drill-list mark {
  grid-row: span 2;
  min-width: 42px;
  padding: 6px 8px;
  border-radius: 6px;
  font-weight: 900;
  text-align: center;
}

.deep-drill-list mark.grade-A {
  background: #ffe1a3;
  color: #7b4100;
}

.deep-drill-list mark.grade-B {
  background: #d9f3ef;
  color: #075f54;
}

.deep-drill-list mark.grade-C,
.deep-drill-list mark.grade-none {
  background: #e4e9ed;
  color: #445867;
}

.deep-drill-list span,
.deep-phone-log-list span,
.deep-phone-log-list small {
  color: #607482;
}

.deep-phone-log-list small {
  grid-column: 2;
}

.deep-audit-list {
  display: grid;
  gap: 8px;
}

.deep-audit-list span {
  padding: 9px 10px;
  border: 1px solid #e1edf3;
  border-radius: 8px;
  background: #f8fbfd;
  color: #607482;
  font-weight: 800;
}

.deep-building-actions button:disabled,
.deep-batch-panel button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.deep-builder-card {
  background: #ffffff;
}

.deep-builder-card .section-title-row {
  padding-bottom: 10px;
  border-bottom: 1px solid #e2edf2;
}

.deep-dictionary-card {
  background: #ffffff;
}

.deep-dictionary-card > .section-title-row {
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.deep-dictionary-card > .section-title-row .deep-building-tabs {
  justify-content: flex-end;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
}

.deep-batch-panel {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
  align-items: end;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid #d8e5ec;
  border-radius: 8px;
  background: #f8fbfd;
}

.deep-batch-panel h4 {
  margin: 2px 0 0;
}

.deep-batch-panel input,
.deep-batch-panel select,
.deep-batch-panel textarea {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid #d8e5ec;
  border-radius: 8px;
  padding: 7px 9px;
  font: inherit;
  background: #fff;
}

.deep-batch-panel textarea {
  grid-column: 1 / -2;
  resize: vertical;
}

.deep-batch-panel button {
  width: 100%;
  min-width: 0;
  white-space: nowrap;
}

.deep-form-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  min-width: 0;
}

.deep-form-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
}

.deep-building-actions {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-self: end;
}

.deep-building-actions button {
  width: 100%;
  min-height: 40px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.deep-unit-layout-editor {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.deep-unit-layout-card {
  display: grid;
  grid-template-columns: minmax(86px, 0.72fr) minmax(0, 1fr);
  gap: 8px;
  align-items: end;
  padding: 9px;
  border: 1px solid #d8e5ec;
  border-radius: 8px;
  background: #f8fbfd;
}

.deep-unit-layout-card strong {
  grid-column: 1 / -1;
  color: var(--ink);
  font-size: 15px;
}

.deep-unit-suffix-preview {
  display: grid;
  gap: 4px;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid #d8e5ec;
  border-radius: 8px;
  background: #fff;
}

.deep-unit-suffix-preview span {
  color: #607482;
  font-size: 12px;
  font-weight: 800;
}

.deep-unit-suffix-preview b {
  color: #173044;
  font-size: 14px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.deep-structure-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #bfded6;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  background: #f2fbf8;
}

.deep-structure-toolbar > div,
.deep-builder-subhead > div,
.deep-build-preview-head > div {
  min-width: 0;
}

.deep-structure-toolbar strong,
.deep-builder-subhead strong,
.deep-build-preview-head strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
}

.deep-structure-toolbar span,
.deep-builder-subhead span,
.deep-build-preview-head span {
  display: block;
  margin-top: 3px;
  color: #607482;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.deep-structure-toolbar.is-locked {
  border-color: #d6c28f;
  border-left-color: #a77820;
  background: #fffaf0;
}

.deep-building-kind-picker {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.deep-building-kind-picker button {
  min-width: 0;
  min-height: 66px;
  padding: 9px;
  text-align: left;
  border: 1px solid #d8e5ec;
  border-radius: 8px;
  background: #fbfdfe;
  cursor: pointer;
}

.deep-building-kind-picker button strong,
.deep-building-kind-picker button span {
  display: block;
}

.deep-building-kind-picker button strong {
  color: var(--ink);
  font-size: 14px;
}

.deep-building-kind-picker button span {
  margin-top: 4px;
  color: #607482;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.deep-building-kind-picker button:hover,
.deep-building-kind-picker button:focus-visible {
  border-color: #75b8a9;
  outline: 2px solid rgba(15, 137, 116, 0.14);
  outline-offset: 1px;
}

.deep-building-kind-picker button.active {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
  background: #eaf8f4;
}

.deep-building-kind-picker button:disabled {
  cursor: default;
  opacity: 0.68;
}

.deep-floor-rule-editor {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid #cddfe8;
  border-radius: 8px;
  background: #f7fbfd;
}

.deep-builder-subhead,
.deep-build-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.deep-builder-subhead mark,
.deep-build-preview-head mark {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 6px;
  color: #406070;
  background: #eaf1f5;
  font-size: 11px;
  font-weight: 900;
}

.deep-floor-rule-form {
  display: grid;
  grid-template-columns: minmax(92px, 0.7fr) repeat(3, minmax(105px, 1fr)) minmax(130px, 1fr);
  gap: 7px;
  align-items: end;
}

.deep-floor-rule-form input,
.deep-floor-rule-form select {
  width: 100%;
  min-height: 34px;
  border: 1px solid #d8e5ec;
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff;
  font: inherit;
}

.deep-floor-rule-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.deep-floor-rule-list > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 5px 6px 5px 9px;
  border: 1px solid #bcded5;
  border-radius: 8px;
  background: #effaf7;
  color: #244858;
}

.deep-floor-rule-list b {
  font-size: 12px;
}

.deep-floor-rule-list em {
  color: #607482;
  font-size: 11px;
  font-style: normal;
}

.deep-floor-rule-list button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: #a33a3a;
  background: #fff;
  font-size: 17px;
  cursor: pointer;
}

.deep-floor-rule-list p {
  margin: 0;
  color: #607482;
  font-size: 12px;
  font-weight: 700;
}

.deep-special-room-presets {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.deep-special-room-presets button {
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid #cbdde7;
  border-radius: 7px;
  color: #335569;
  background: #f5fafc;
  font-weight: 800;
  cursor: pointer;
}

.deep-special-room-preview {
  grid-column: 1 / -1;
  min-height: 42px;
  padding: 8px 9px;
  border: 1px dashed #c4d7e1;
  border-radius: 8px;
  color: #607482;
  background: #f8fbfd;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.deep-special-room-preview.is-ready {
  border-style: solid;
  border-color: #91c9bc;
  background: #effaf7;
}

.deep-special-room-preview strong,
.deep-special-room-preview span {
  display: block;
}

.deep-special-room-preview strong {
  margin-bottom: 3px;
  color: #087865;
}

.deep-build-preview {
  display: grid;
  gap: 9px;
  min-height: 58px;
  padding: 11px;
  border: 1px dashed #bfd1dc;
  border-radius: 8px;
  color: #607482;
  background: #f8fbfd;
}

.deep-build-preview > p {
  margin: 0;
  font-size: 12px;
  font-weight: 750;
}

.deep-build-preview.is-ready {
  border-style: solid;
  border-color: #9fc9bd;
  background: #fbfefd;
}

.deep-build-preview-head mark.is-ok {
  color: #087865;
  background: #dff4ee;
}

.deep-build-preview-head mark.has-error {
  color: #a33a3a;
  background: #fff0f0;
}

.deep-build-preview-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.deep-build-preview-metrics span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #d8e5ec;
  border-radius: 8px;
  background: #fff;
}

.deep-build-preview-metrics b {
  color: var(--ink);
  font-size: 18px;
}

.deep-build-preview-metrics small {
  color: #607482;
  font-size: 11px;
  font-weight: 800;
}

.deep-build-preview-messages {
  display: grid;
  gap: 5px;
}

.deep-build-preview-messages p {
  margin: 0;
  padding: 6px 8px;
  border-left: 3px solid #9bb0bc;
  color: #536c7a;
  background: #f3f7f9;
  font-size: 12px;
  font-weight: 750;
}

.deep-build-preview-messages p.success {
  border-left-color: #198873;
  color: #146d5e;
  background: #edf9f5;
}

.deep-build-preview-messages p.error {
  border-left-color: #cf4f4f;
  color: #9b3535;
  background: #fff2f2;
}

.deep-special-floor-editor {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid #d8e5ec;
  border-radius: 8px;
  background: #f8fbfd;
}

.deep-special-editor-body {
  display: grid;
  gap: 10px;
}

.deep-special-editor-body.is-hidden,
.deep-special-collapsed-note.is-hidden {
  display: none;
}

.deep-special-floor-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  color: var(--ink);
}

.deep-special-floor-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.deep-collapsed-note {
  padding: 9px 11px;
  border: 1px solid #d8e5ec;
  border-radius: 8px;
  background: #f8fbfd;
  color: #607482;
  font-weight: 800;
}

.deep-special-floor-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
  align-items: end;
}

.deep-special-floor-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.deep-special-floor-list span {
  padding: 6px 8px;
  border: 1px solid #d8e5ec;
  border-radius: 8px;
  background: #fff;
  color: #607482;
  font-weight: 800;
}

.deep-special-floor-picker-empty {
  padding: 12px;
  border: 1px dashed #b8ced9;
  border-radius: 8px;
  background: #fff;
  color: #607482;
  font-size: 13px;
  font-weight: 800;
}

.deep-special-floor-room-picker {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid #b9d9d1;
  border-radius: 8px;
  background: #f2fbf8;
}

.deep-special-floor-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.deep-special-floor-picker-head > div:first-child {
  display: grid;
  gap: 2px;
}

.deep-special-floor-picker-head span {
  color: #607482;
  font-size: 12px;
  font-weight: 750;
}

.deep-special-floor-picker-head > div:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.deep-special-floor-picker-floor {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding-top: 8px;
  border-top: 1px solid #d5e8e3;
}

.deep-special-floor-picker-floor > strong {
  padding-top: 9px;
  color: #0c675a;
}

.deep-special-floor-picker-units {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}

.deep-special-floor-picker-units fieldset {
  min-width: 0;
  margin: 0;
  padding: 8px;
  border: 1px solid #cfe1e7;
  border-radius: 8px;
  background: #fff;
}

.deep-special-floor-picker-units legend {
  padding: 0 5px;
  color: #476374;
  font-size: 12px;
  font-weight: 900;
}

.deep-special-floor-picker-units fieldset > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.deep-special-floor-picker-units label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid #d5e4eb;
  border-radius: 7px;
  background: #f8fbfd;
  cursor: pointer;
}

.deep-special-floor-picker-units input {
  width: 16px;
  height: 16px;
  accent-color: #118572;
}

.deep-special-floor-cell.partial {
  min-height: 112px;
  border: 2px solid #70a99c;
}

.deep-special-room-editor {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid #d8e5ec;
}

.deep-special-room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.deep-special-room-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 9px;
  border: 1px solid #d8e5ec;
  border-radius: 8px;
  background: #ffffff;
}

.deep-special-room-card > strong {
  grid-column: 1 / -1;
  color: var(--ink);
  font-size: 15px;
}

.deep-special-room-suffixes {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.deep-special-room-suffixes > span {
  width: 100%;
  color: #607482;
  font-weight: 800;
  font-size: 13px;
}

.deep-special-room-suffix {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid #d8e5ec;
  border-radius: 8px;
  background: #f8fbfd;
  color: var(--ink);
  cursor: pointer;
}

.deep-special-room-suffix input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.deep-special-room-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.deep-special-room-summary em {
  font-style: normal;
  color: #607482;
}

.deep-form-grid input,
.deep-form-grid select,
.deep-form-grid textarea,
.deep-detail-form input,
.deep-detail-form select,
.deep-detail-form textarea,
#deepSearchInput,
#deepStatusFilter {
  border-color: #d8e5ec;
  background: #fbfdfe;
}

.deep-room-board {
  border-color: #d4e3ea;
  background: #edf4f7;
  width: 100%;
  max-width: 100%;
  overflow: auto;
}

.deep-room-board > * {
  min-width: 0;
}

.deep-floor-label,
.deep-room-head {
  background: #eef4f7;
}

.deep-room-cell {
  min-height: 112px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.58);
  transition: transform 0.12s ease, filter 0.12s ease, outline-color 0.12s ease;
}

.deep-room-cell:hover {
  filter: saturate(1.08);
  transform: translateY(-1px);
}

.deep-room-cell strong {
  font-size: 27px;
}

.deep-room-cell mark {
  top: 7px;
  left: 7px;
  color: #173044;
}

.deep-room-cell.onsale { background: linear-gradient(180deg, #d6f1ff 0%, #effbff 100%); }
.deep-room-cell.focus { background: linear-gradient(180deg, #9dd1ff 0%, #d9edff 100%); }
.deep-room-cell.renting { background: linear-gradient(180deg, #cff3e8 0%, #eafff8 100%); }
.deep-room-cell.self { background: linear-gradient(180deg, #ffe4a3 0%, #fff7db 100%); }
.deep-room-cell.vacant { background: linear-gradient(180deg, #ead7ff 0%, #fbf4ff 100%); }
.deep-room-cell.sold { background: linear-gradient(180deg, #ffd6d6 0%, #fff0f0 100%); }
.deep-room-cell.unknown { background: linear-gradient(180deg, #eef2f4 0%, #ffffff 100%); }
.deep-room-cell.special-room {
  border-left: 3px solid #0f8f82;
  border-right: 3px solid #0f8f82;
  box-shadow: inset 0 0 0 1px rgba(15, 143, 130, 0.12);
}

.deep-room-cell.special-room.special-top {
  border-top: 3px solid #0f8f82;
}

.deep-room-cell.special-room.special-bottom {
  border-bottom: 3px solid #0f8f82;
}

.deep-room-cell.special-room.continuation {
  color: transparent;
}

.deep-room-cell.special-room.continuation:hover {
  filter: saturate(1.02);
  transform: none;
}

.deep-room-cell.special-room mark {
  background: rgba(255, 255, 255, 0.9);
  color: #075f54;
}

.deep-room-cell.special-room strong {
  color: #0d3a59;
}

.deep-special-floor-cell {
  min-height: 66px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 3px;
  padding: 8px 10px;
  border-right: 1px solid #e1edf3;
  border-bottom: 1px solid #e1edf3;
  background: linear-gradient(180deg, #e1f2ed 0%, #f7fbf9 100%);
  color: var(--ink);
  text-align: center;
}

.deep-special-floor-cell mark {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #126b5d;
  font-size: 11px;
  font-weight: 900;
}

.deep-special-floor-cell strong {
  font-size: 20px;
  line-height: 1.1;
}

.deep-special-floor-cell span,
.deep-special-floor-cell small {
  color: #607482;
  font-weight: 800;
}

.deep-special-floor-cell.shop { background: linear-gradient(180deg, #ffe9b8 0%, #fff8e8 100%); }
.deep-special-floor-cell.duplex,
.deep-special-floor-cell.merged { background: linear-gradient(180deg, #d9efff 0%, #f3fbff 100%); }
.deep-special-floor-cell.facility { background: linear-gradient(180deg, #e5e8ff 0%, #f7f8ff 100%); }

.deep-room-cell.unavailable {
  display: grid;
  place-items: center;
  min-height: 82px;
  border: 1px dashed #cad8df;
  color: #9aabb4;
  background: #eaf0f3;
  cursor: default;
}

.deep-room-cell.unavailable span {
  font-size: 11px;
  font-weight: 750;
}

@media (max-width: 1180px) {
  .deep-building-kind-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .deep-floor-rule-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .deep-floor-rule-form button {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .deep-structure-toolbar,
  .deep-builder-subhead,
  .deep-build-preview-head {
    align-items: stretch;
    flex-direction: column;
  }

  .deep-building-kind-picker,
  .deep-floor-rule-form,
  .deep-build-preview-metrics {
    grid-template-columns: 1fr;
  }

  .deep-floor-rule-form button {
    grid-column: auto;
  }
}

.deep-detail {
  background: #ffffff;
  min-width: 0;
}

.deep-detail-empty {
  min-height: 260px;
  padding: 20px;
  border-radius: 8px;
  background: #f8fbfd;
}

.deep-room-profile {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: start;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2edf2;
}

.deep-room-profile h3 {
  margin: 2px 0 4px;
  font-size: 22px;
  line-height: 1.08;
}

.deep-room-profile span {
  color: #607482;
  font-weight: 800;
  font-size: 13px;
}

.deep-room-profile mark {
  padding: 6px 9px;
  border-radius: 8px;
  color: #173044;
  font-size: 14px;
  font-weight: 900;
}

.deep-room-profile mark.focus { background: #b7dcff; }
.deep-room-profile mark.onsale { background: #cfeeff; }
.deep-room-profile mark.vacant { background: #ead4ff; }
.deep-room-profile mark.unknown { background: #e4e9ed; }
.deep-room-profile mark.renting { background: #bfeadf; }
.deep-room-profile mark.self { background: #ffe7a3; }
.deep-room-profile mark.sold { background: #ffd3d3; }

.deep-room-close-button {
  border-color: #8ea7b6;
  background: #e7f0f5;
  color: #102b3d;
  font-weight: 900;
}

.deep-room-close-button:hover {
  border-color: #26465c;
  background: #d5e4ec;
  color: #071c2c;
}

.deep-follow-box-priority {
  margin-top: 10px;
}

.deep-room-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
}

.deep-room-stats article,
.deep-phone-card {
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid #e1edf3;
  border-radius: 8px;
  background: #f8fbfd;
  color: #173044;
  text-align: left;
}

.deep-phone-card {
  width: 100%;
  cursor: pointer;
}

.deep-phone-card.has-phone {
  background: #f3fafb;
}

.deep-phone-card.has-phone:hover {
  border-color: #0f8a7a;
  background: #ecfbf6;
}

.deep-phone-card.needs-follow {
  border-color: #f0c36a;
  background: #fff8e6;
}

.deep-phone-card small {
  color: #607482;
  font-size: 11px;
  font-weight: 800;
}

.deep-room-stats span,
.deep-phone-card span {
  color: #607482;
  font-size: 12px;
  font-weight: 800;
}

.deep-room-stats strong,
.deep-phone-card strong {
  font-size: 14px;
  line-height: 1.2;
  word-break: break-all;
}

.deep-save-feedback {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid #bee3d8;
  border-radius: 8px;
  background: #ecfbf6;
  color: #087864;
  font-weight: 900;
}

.deep-phone-gate {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding: 9px;
  border: 1px solid #d8e8ef;
  border-radius: 8px;
  background: #f8fbfd;
}

.deep-phone-gate.urgent {
  border-color: #f0c36a;
  background: #fff8e6;
}

.deep-phone-gate h4 {
  margin: 0;
  font-size: 14px;
}

.deep-phone-gate p {
  margin: 0;
  color: #607482;
  font-size: 12px;
  line-height: 1.4;
}

.deep-phone-gate textarea {
  width: 100%;
  min-height: 58px;
  padding: 7px 8px;
  border: 1px solid #d5e4ec;
  border-radius: 8px;
  background: #fff;
  color: #12283a;
  font: inherit;
  resize: vertical;
}

.deep-phone-gate button {
  width: 100%;
}

.deep-detail-section {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid #e2edf2;
}

.deep-detail-section .section-title-row {
  margin-bottom: 7px;
}

.deep-detail-section h4 {
  margin: 0;
  font-size: 14px;
}

.deep-detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}

.deep-section-card {
  min-width: 0;
}

.deep-import-guide {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 8px;
  background: #ffffff;
}

.deep-import-guide p {
  margin: 0;
  color: #607482;
  line-height: 1.6;
}

.deep-build-wizard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 12px 0 4px;
}

.deep-build-wizard span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #dce9ef;
  border-radius: 8px;
  background: #f8fbfd;
  color: #607482;
  font-weight: 900;
  min-width: 0;
  overflow-wrap: anywhere;
}

.deep-build-wizard b {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #dce9ef;
  color: #173044;
}

.deep-build-wizard .done {
  border-color: #bee3d8;
  background: #ecfbf6;
  color: #087864;
}

.deep-build-wizard .active {
  border-color: #91c3df;
  background: #eff8ff;
  color: #1f6f9e;
}

.deep-build-wizard .disabled {
  opacity: 0.58;
}

.deep-import-report {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #bee3d8;
  border-radius: 8px;
  background: #ecfbf6;
}

.deep-import-report span,
.deep-import-report small {
  color: #607482;
  font-weight: 800;
}

.deep-import-report ul {
  margin: 4px 0 0;
  padding-left: 18px;
  color: #9a5b00;
}

body:has(#deepFarmingPage.active) .module-subnav {
  min-height: 54px;
  padding: 8px 22px;
  background: #f7fbfc;
  border-top: 1px solid #e1edf3;
}

body:has(#deepFarmingPage.active) .module-subnav-group {
  gap: 8px;
  padding: 5px;
  border: 1px solid #d8e6ec;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(16, 53, 74, 0.06);
}

body:has(#deepFarmingPage.active) .module-subnav-label {
  padding: 0 8px;
  color: var(--primary);
}

body:has(#deepFarmingPage.active) .module-subnav-button {
  min-height: 36px;
  padding: 0 14px;
  border-color: transparent;
  background: transparent;
  color: #435c6d;
}

body:has(#deepFarmingPage.active) .module-subnav-button:hover {
  background: #eef6f8;
}

body:has(#deepFarmingPage.active) .module-subnav-button.active {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 22%, transparent);
}

.deep-page .page-card {
  background:
    linear-gradient(180deg, rgba(237, 246, 247, 0.9), rgba(246, 249, 251, 0.92)),
    repeating-linear-gradient(90deg, rgba(18, 52, 74, 0.03) 0 1px, transparent 1px 26px);
}

.deep-shell {
  gap: 12px;
  font-size: 14px;
}

.deep-shell > .section-title-row {
  min-height: 74px;
  padding: 14px 18px;
  border-color: #cfe1e7;
  background:
    linear-gradient(135deg, rgba(11, 56, 74, 0.96) 0%, rgba(16, 112, 116, 0.94) 58%, rgba(10, 135, 101, 0.96) 100%);
  box-shadow: 0 14px 30px rgba(16, 53, 74, 0.14);
}

.deep-shell > .section-title-row h2 {
  font-size: 24px;
}

.deep-shell > .section-title-row .finance-actions {
  display: grid;
  grid-template-columns: minmax(190px, 1.1fr) minmax(160px, 0.8fr) auto;
  gap: 8px;
  align-items: center;
  flex: 1 1 640px;
  max-width: 740px;
}

.deep-shell > .section-title-row input,
.deep-shell > .section-title-row select {
  min-height: 38px;
  max-width: none;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(8, 41, 54, 0.1);
}

.deep-shell > .section-title-row .finance-actions button {
  min-height: 38px;
  white-space: nowrap;
}

.deep-layout {
  grid-template-columns: 258px minmax(620px, 940px) 312px;
  gap: 8px;
  justify-content: start;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
}

.deep-main {
  max-width: min(760px, 100%);
  min-width: 0;
}

.deep-sidebar,
.deep-detail {
  top: 116px;
  padding: 10px;
  border-color: #d5e4eb;
}

.deep-side-head h3 {
  margin: 2px 0 0;
  font-size: 18px;
}

.deep-community-card {
  position: relative;
  gap: 5px;
  min-height: 88px;
  padding: 10px 10px 12px;
  overflow: hidden;
}

.deep-community-card .deep-community-rate {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 7px;
  border-radius: 999px;
  background: #edf8f5;
  color: #087864;
  font-size: 12px;
  font-weight: 900;
}

.deep-community-card strong {
  max-width: calc(100% - 54px);
}

.deep-community-card i {
  display: block;
  height: 5px;
  margin-top: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #0f766e var(--deep-rate), #dce9ef 0);
}

.deep-community-card.active {
  border-color: #0f766e;
  background: #f5fffc;
}

.deep-hero-panel {
  grid-template-columns: minmax(190px, 0.82fr) minmax(0, 2.4fr);
  gap: 8px;
  padding: 10px;
}

.deep-hero-copy h2 {
  font-size: 22px;
}

.deep-hero-panel article,
.deep-hero-meter,
.deep-market-grid article {
  min-height: 46px;
  padding: 6px 10px;
}

.deep-hero-panel article strong,
.deep-market-grid article strong {
  margin-top: 3px;
  font-size: 18px;
}

.deep-hero-meter strong {
  font-size: 18px;
}

.deep-status-rail {
  grid-template-columns: repeat(8, minmax(70px, 1fr));
  gap: 6px;
  padding: 8px 0 0;
}

.deep-status-rail button {
  min-height: 46px;
}

.deep-status-rail strong {
  font-size: 18px;
}

.deep-dictionary-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  overflow: hidden;
}

.deep-builder-card,
.deep-import-guide {
  padding: 12px;
}

.deep-builder-card .section-title-row {
  gap: 10px;
  padding-bottom: 8px;
}

.deep-builder-card .section-title-row h3,
.deep-import-guide h3 {
  margin: 2px 0 0;
  font-size: 18px;
}

.deep-builder-card .finance-actions {
  gap: 6px;
}

.deep-builder-card .finance-actions .small,
.deep-building-actions button {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 13px;
}

.deep-build-wizard {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 0 2px;
}

.deep-build-wizard span {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 13px;
}

.deep-build-wizard b {
  width: 20px;
  height: 20px;
  font-size: 12px;
}

.deep-form-grid,
.deep-form-grid.compact {
  gap: 8px;
  margin-top: 10px;
}

.deep-form-grid label,
.deep-detail-form label {
  gap: 4px;
  font-size: 13px;
}

.deep-form-grid input,
.deep-form-grid select,
.deep-form-grid textarea,
.deep-detail-form input,
.deep-detail-form select,
.deep-detail-form textarea {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 13px;
}

.deep-form-grid textarea,
.deep-detail-form textarea {
  min-height: 56px;
}

.deep-building-actions {
  gap: 6px;
}

.deep-import-guide {
  gap: 6px;
}

.deep-import-guide p {
  font-size: 13px;
  line-height: 1.45;
}

.deep-dictionary-head {
  display: grid;
  grid-template-columns: minmax(150px, 0.48fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2edf2;
}

.deep-dictionary-head h3 {
  margin: 2px 0 3px;
  font-size: 20px;
}

.deep-dictionary-head small {
  color: #607482;
  font-weight: 800;
}

.deep-dictionary-head .deep-building-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
  justify-content: stretch;
  gap: 8px;
  margin: 0;
  padding-bottom: 3px;
  min-width: 0;
  max-width: 100%;
}

.deep-building-pill {
  display: grid;
  gap: 2px;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 6px 9px;
  border: 1px solid #d8e5ec;
  border-radius: 8px;
  background: #f8fbfd;
  color: #173044;
  text-align: left;
  cursor: pointer;
}

.deep-building-pill strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.deep-building-pill span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #607482;
  font-size: 11px;
  font-weight: 800;
}

.deep-building-pill:hover,
.deep-building-pill.active {
  border-color: #0f766e;
  background: #ecfbf6;
}

.deep-building-pill.active {
  box-shadow: inset 0 0 0 1px #0f766e, 0 8px 18px rgba(15, 118, 110, 0.12);
}

.deep-unit-tabs {
  gap: 6px;
  margin-bottom: 0;
  padding: 2px 0;
}

.deep-unit-tabs .ghost-button.small {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 13px;
}

.deep-batch-panel {
  grid-template-columns: minmax(120px, 0.8fr) repeat(5, minmax(72px, 1fr));
  gap: 6px;
  margin: 0;
  padding: 8px;
  background: #f3f8fa;
  min-width: 0;
}

.deep-batch-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.deep-batch-head > div {
  min-width: 0;
}

.deep-batch-head button {
  flex: 0 0 auto;
  width: auto;
  min-width: 64px;
}

.deep-batch-panel > div {
  align-self: center;
}

.deep-batch-panel.collapsed {
  grid-template-columns: 1fr;
}

.deep-batch-panel h4 {
  font-size: 15px;
  line-height: 1.35;
}

.deep-batch-panel input,
.deep-batch-panel select,
.deep-batch-panel textarea {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 13px;
}

.deep-batch-panel textarea {
  grid-column: 1 / -1;
  min-height: 42px;
}

.deep-room-board {
  grid-template-columns: 42px repeat(var(--deep-cols), minmax(78px, 1fr));
  max-height: calc(100svh - 326px);
  min-height: 360px;
  border-radius: 8px;
}

.deep-floor-label,
.deep-room-head {
  position: sticky;
  z-index: 2;
}

.deep-head,
.deep-room-head {
  top: 0;
}

.deep-floor-label {
  left: 0;
}

.deep-head {
  z-index: 3;
}

.deep-room-head,
.deep-head {
  min-height: 46px;
}

.deep-floor-label,
.deep-room-cell {
  min-height: 66px;
}

.deep-room-cell {
  gap: 2px;
  padding: 6px 5px;
}

.deep-room-cell strong {
  font-size: 18px;
}

.deep-room-cell b {
  font-size: 13px;
}

.deep-room-cell mark {
  top: 5px;
  left: 5px;
  padding: 1px 5px;
  font-size: 10px;
}

.deep-room-cell span,
.deep-room-cell small {
  font-size: 12px;
}

.deep-floor-label strong,
.deep-room-head strong {
  font-size: 17px;
}

.deep-floor-label small,
.deep-room-head small,
.deep-room-head em {
  font-size: 11px;
}

.deep-room-cell small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deep-detail-empty {
  min-height: 220px;
  align-content: center;
  padding: 14px;
  border: 1px dashed #cfe0e7;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(248, 251, 253, 0.96)),
    repeating-linear-gradient(135deg, rgba(15, 118, 110, 0.05) 0 1px, transparent 1px 14px);
}

.deep-detail-empty h3 {
  margin: 0;
  font-size: 18px;
}

.deep-room-profile {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  padding-bottom: 8px;
}

.deep-room-profile .ghost-button {
  grid-column: 1 / -1;
  min-height: 32px;
}

.deep-room-stats {
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 8px;
}

.deep-detail-form {
  display: grid;
  gap: 6px;
}

.deep-detail-form label {
  gap: 4px;
  font-size: 12px;
}

.deep-detail-form input,
.deep-detail-form select,
.deep-detail-form textarea {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 13px;
}

.deep-follow-box h4 {
  margin: 0 0 6px;
  font-size: 14px;
}

.deep-follow-box textarea {
  min-height: 58px;
  padding: 7px 8px;
  font-size: 13px;
}

.deep-detail .ghost-button.small,
.deep-detail .primary-button.small {
  min-height: 32px;
  font-size: 13px;
}

@media (min-width: 1281px) {
  .deep-room-stats {
    grid-template-columns: 1fr;
  }
}

.deep-detail-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 1280px) {
  .deep-layout {
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  }

  .deep-detail {
    position: static;
    grid-column: 1 / -1;
    max-height: none;
  }

  .deep-work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deep-hero-panel {
    grid-template-columns: 1fr;
  }

  .deep-hero-copy {
    grid-column: auto;
  }

  .deep-hero-metrics {
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  }

  .deep-status-rail {
    grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  }

  .deep-dictionary-head {
    grid-template-columns: 1fr;
  }

  .deep-dictionary-head .deep-building-tabs {
    justify-content: flex-start;
  }

  .deep-batch-panel {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .deep-batch-panel > div {
    grid-column: 1 / -1;
  }

  .deep-building-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deep-progress-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deep-workbench-metrics,
  .deep-workbench-actions,
  .deep-quality-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 900px) {
  .deep-layout,
  .deep-work-grid,
  .deep-form-grid,
  .deep-form-grid.compact,
  .deep-lead-metrics,
  .deep-lead-toolbar,
  .deep-property-leads-split,
  .deep-community-overview-grid,
  .deep-community-overview-metrics,
  .deep-community-overview-info,
  .deep-lead-detail-grid,
  .deep-lead-maintenance,
  .deep-lead-follow-list article,
  .deep-lead-head,
  .deep-lead-row,
  .deep-batch-panel {
    grid-template-columns: 1fr;
  }

  .deep-sidebar,
  .deep-detail {
    position: static;
    max-height: none;
  }

  .deep-work-grid,
  .deep-market-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deep-hero-panel,
  .deep-hero-metrics {
    grid-template-columns: 1fr;
  }

  .deep-status-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .deep-layout:has(.deep-room-profile) {
    padding-bottom: min(72svh, 620px);
  }

  .deep-detail:has(.deep-room-profile) {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 70;
    max-height: min(72svh, 620px);
    overflow: auto;
    padding: 14px;
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(16, 53, 74, 0.26);
  }

  .deep-room-profile {
    position: sticky;
    top: -14px;
    z-index: 2;
    margin: -14px -14px 12px;
    padding: 14px;
    background: #fff;
  }

.deep-detail-actions {
    position: sticky;
    bottom: -14px;
    margin: 10px -14px -14px;
    padding: 10px 14px 14px;
    background: #fff;
    border-top: 1px solid #e2edf2;
  }
}

.deep-layout {
  grid-template-columns: 258px minmax(620px, 940px);
  align-items: start;
}

.deep-layout.detail-open {
  grid-template-columns: 258px minmax(620px, 940px) minmax(280px, 312px);
}

.deep-sidebar,
.deep-detail {
  top: 8px;
  max-height: calc(100svh - 16px);
}

.deep-detail[hidden] {
  display: none;
}

.deep-detail {
  padding: 10px;
  overflow: auto;
  scrollbar-gutter: stable;
}

.deep-layout.detail-open {
  width: 100%;
  max-width: none;
  grid-template-columns: 258px minmax(0, 1fr);
  padding-right: 324px;
  overflow: visible;
}

.deep-layout.detail-open .deep-detail:has(.deep-room-profile) {
  position: fixed;
  top: 74px;
  right: 0;
  z-index: 55;
  width: 324px;
  max-width: calc(100vw - 10px);
  max-height: calc(100svh - 86px);
  box-shadow: 0 18px 38px rgba(16, 53, 74, 0.18);
}

.deep-main {
  gap: 10px;
}

.deep-batch-panel {
  margin-top: 0;
}

.deep-room-board {
  max-height: calc(100svh - 214px);
}

.deep-room-profile {
  position: sticky;
  top: -10px;
  z-index: 4;
  margin: -10px -10px 8px;
  padding: 9px 10px;
  background: #fff;
  border-bottom: 1px solid #e2edf2;
}

.deep-room-profile h3 {
  font-size: 20px;
  margin: 1px 0 2px;
}

.deep-room-profile span,
.deep-room-stats article span,
.deep-phone-card span {
  font-size: 12px;
}

.deep-room-stats article,
.deep-phone-card,
.deep-phone-gate,
.deep-detail-section,
.deep-follow-box {
  padding: 7px;
  border-radius: 8px;
}

.deep-room-stats.compact {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 6px;
}

.deep-room-stats.compact article,
.deep-room-stats.compact .deep-phone-card {
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
}

.deep-room-stats.compact .deep-phone-card small {
  grid-column: 2;
}

.deep-room-stats.compact strong,
.deep-room-stats.compact .deep-phone-card strong {
  font-size: 15px;
}

.deep-detail-section {
  margin-top: 7px;
  padding-top: 7px;
}

.deep-detail-section .section-title-row {
  margin-bottom: 6px;
}

.deep-detail-section h4,
.deep-follow-box h4 {
  font-size: 14px;
}

.deep-follow-box {
  margin-top: 7px;
}

.deep-follow-list {
  gap: 6px;
}

@media (max-width: 1280px) {
  .deep-layout,
  .deep-layout.detail-open {
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
    padding-right: 0;
  }

  .deep-layout.detail-open .deep-detail {
    grid-column: 1 / -1;
    position: static;
    top: 8px;
    max-height: none;
    width: auto;
  }
}

@media (max-width: 760px) {
  .deep-shell > .section-title-row {
    align-items: flex-start;
  }

  .deep-shell > .section-title-row .finance-actions {
    width: 100%;
    justify-content: stretch;
    grid-template-columns: 1fr;
  }

  .deep-shell > .section-title-row input,
  .deep-shell > .section-title-row select,
  .deep-shell > .section-title-row button {
    max-width: none;
    width: 100%;
  }

  .deep-work-grid,
  .deep-market-grid,
  .deep-lead-metrics,
  .deep-community-overview-grid,
  .deep-lead-detail-grid,
  .deep-community-overview-info {
    grid-template-columns: 1fr;
  }

  .deep-batch-panel textarea {
    grid-column: 1 / -1;
  }

  .deep-building-actions {
    grid-template-columns: 1fr;
  }

  .deep-progress-list {
    grid-template-columns: 1fr;
  }

  .deep-workbench-metrics,
  .deep-workbench-actions,
  .deep-quality-grid,
  .deep-quality-list button {
    grid-template-columns: 1fr;
  }

  .deep-hero-copy {
    grid-column: auto;
  }

  .deep-room-board {
    grid-template-columns: 52px repeat(var(--deep-cols), minmax(104px, 118px));
  }
}

@media (max-width: 640px) {
  .home-page .page-card {
    padding: 12px;
  }

  .home-hero,
  .home-content-grid,
  .home-notice-form {
    grid-template-columns: 1fr;
  }

  .home-reminder-grid,
  .home-overview-grid,
  .home-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-task-card {
    grid-template-columns: 1fr;
  }

  .home-task-card em {
    white-space: normal;
  }

  .home-profile-card {
    align-items: flex-start;
    min-height: 0;
    padding: 18px;
  }

  .home-profile-card h2 {
    font-size: 24px;
  }

  .home-avatar {
    width: 64px;
    height: 64px;
    flex-basis: 64px;
  }

  .home-reminder-grid article,
  .home-overview-grid article,
  .home-metric-grid article {
    min-height: 68px;
  }

  .home-reminder-grid strong,
  .home-overview-grid strong,
  .home-metric-grid strong {
    font-size: 24px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }
}

/* v555 deep farming refinements */
.deep-layout {
  grid-template-columns: 258px minmax(620px, 760px);
  gap: 8px;
  justify-content: start;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
}

.deep-layout.detail-open {
  grid-template-columns: 258px minmax(620px, 760px) minmax(300px, 340px);
}

.deep-layout.no-sidebar,
.deep-layout.no-sidebar.detail-open {
  grid-template-columns: minmax(620px, 1580px);
  width: 100%;
}

.deep-page.deep-communities-active .page-card {
  width: 100%;
  max-width: none;
}

.deep-layout.communities-mode,
.deep-layout.communities-mode.no-sidebar {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-width: none;
  overflow: visible;
}

.deep-layout.communities-mode .deep-main {
  width: 100%;
  max-width: none;
}

.deep-page.deep-property-leads-active .page-card {
  width: 100%;
  max-width: none;
}

.deep-layout.property-leads-mode,
.deep-layout.property-leads-mode.no-sidebar,
.deep-layout.property-leads-mode.detail-open {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-width: none;
  overflow: visible;
}

.deep-layout.property-leads-mode .deep-main {
  width: 100%;
  max-width: none;
}

.deep-layout.property-leads-mode .deep-property-leads-split {
  grid-template-columns: minmax(0, 1fr);
}

.deep-sidebar,
.deep-detail {
  top: 12px;
}

.deep-sidebar-building-label {
  grid-column: 1 / -1;
  color: #607482;
  font-size: 11px;
  font-weight: 900;
}

.deep-community-card-main span {
  display: block;
}

.deep-room-profile h3 {
  font-size: 24px;
}

.deep-room-profile span,
.deep-room-stats span,
.deep-phone-card span,
.deep-room-stats small,
.deep-phone-card small {
  font-size: 12px;
}

.deep-room-stats article,
.deep-phone-card,
.deep-detail-section,
.deep-follow-box {
  padding: 8px;
}

.ghost-button.danger {
  color: #d93a36;
  border-color: #ffc4c1;
  background: #fff8f7;
}

.deep-delete-notice,
.deep-delete-request-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid #ffd4d2;
  border-radius: 8px;
  background: #fffafa;
}

.deep-delete-notice strong,
.deep-delete-request-list strong {
  display: block;
  color: #173044;
}

.deep-delete-notice span,
.deep-delete-request-list span {
  display: block;
  color: #607482;
  font-size: 12px;
  font-weight: 800;
}

.deep-delete-request-list {
  display: grid;
  gap: 8px;
}

.deep-onsale-panel {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.deep-onsale-panel .section-title-row {
  align-items: end;
}

.deep-onsale-panel input {
  width: min(320px, 100%);
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #d6e4eb;
  border-radius: 8px;
  font-size: 13px;
}

.deep-onsale-list {
  display: grid;
  gap: 8px;
}

.deep-onsale-row {
  display: grid;
  grid-template-columns: minmax(110px, 1.1fr) minmax(76px, 0.8fr) minmax(128px, 1fr) minmax(76px, auto) minmax(92px, auto) minmax(150px, 1.2fr);
  gap: 8px;
  align-items: center;
  min-height: 54px;
  padding: 9px 10px;
  border: 1px solid #d9e7ed;
  border-radius: 8px;
  background: #fff;
  color: #173044;
  text-align: left;
  cursor: pointer;
}

.deep-onsale-row:hover,
.deep-onsale-row.active {
  border-color: #0f766e;
  background: #f1fffa;
}

.deep-onsale-row span,
.deep-onsale-row small {
  color: #607482;
  font-size: 12px;
  font-weight: 800;
}

.deep-onsale-row b {
  color: #0f766e;
}

/* v730: 在售列表新增「房源编号」「单价」两列，长编号单行省略防撑破布局。 */
.deep-onsale-row .deep-onsale-code,
.deep-onsale-row .deep-onsale-unit-price {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* v731: 在售列表可排序表头——吸顶（top 同侧栏/详情卡的 116px），三态排序 ↑↓，窄屏隐藏。 */
.deep-onsale-head {
  display: grid;
  grid-template-columns: minmax(110px, 1.1fr) minmax(76px, 0.8fr) minmax(128px, 1fr) minmax(76px, auto) minmax(92px, auto) minmax(150px, 1.2fr);
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  position: sticky;
  top: 116px;
  z-index: 6;
  border: 1px solid #d9e7ed;
  border-radius: 8px;
  background: linear-gradient(180deg, #edf6f7, #f4f9fb);
}

.deep-onsale-th {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: #526c7a;
  font-size: 11px;
  font-weight: 850;
  text-align: left;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.deep-onsale-th:hover {
  color: #0f766e;
}

.deep-onsale-th.is-sort-asc,
.deep-onsale-th.is-sort-desc {
  color: #0f766e;
}

.deep-onsale-th.is-sort-asc::after {
  content: " ↑";
}

.deep-onsale-th.is-sort-desc::after {
  content: " ↓";
}

@media (max-width: 1280px) {
  .deep-onsale-head {
    display: none;
  }
}

@media (max-width: 1280px) {
  .deep-layout,
  .deep-layout.detail-open {
    width: 100%;
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  }

  .deep-layout.detail-open .deep-detail {
    grid-column: 2;
    position: sticky;
    top: 8px;
    max-height: calc(100svh - 16px);
  }

  .deep-onsale-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .deep-onsale-row,
  .deep-delete-notice,
  .deep-delete-request-list article {
    grid-template-columns: 1fr;
  }
}

/* v624: keep the 2D dictionary workspace tight when the room detail card is open. */
.deep-layout.detail-open {
  width: 100%;
  max-width: none;
  grid-template-columns: 258px minmax(0, 1fr);
  padding-right: 324px;
  overflow: visible;
}

.deep-layout.detail-open .deep-main {
  min-width: 0;
}

.deep-layout.detail-open .deep-detail:has(.deep-room-profile) {
  position: fixed;
  top: 74px;
  right: 0;
  z-index: 55;
  width: 324px;
  max-width: calc(100vw - 10px);
  max-height: calc(100svh - 86px);
  box-shadow: 0 18px 38px rgba(16, 53, 74, 0.18);
}

@media (max-width: 1280px) {
  .deep-layout.detail-open {
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
    padding-right: 0;
  }

  .deep-layout.detail-open .deep-detail:has(.deep-room-profile) {
    position: static;
    grid-column: 1 / -1;
    width: auto;
    max-width: none;
    max-height: none;
    box-shadow: none;
  }
}

/* v630: task-first deep farming workspace and responsive building presets. */
.deep-page .page-card {
  width: 100%;
  max-width: none;
}

.deep-shell {
  gap: 10px;
}

.deep-filter-toolbar {
  grid-template-columns: minmax(150px, 0.42fr) minmax(320px, 1fr) minmax(150px, 220px);
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
}

.deep-filter-toolbar input,
.deep-filter-toolbar select {
  min-height: 36px;
}

.deep-layout,
.deep-layout.no-sidebar {
  width: 100%;
  max-width: none;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 8px;
  overflow: visible;
}

.deep-layout.no-sidebar,
.deep-layout.communities-mode,
.deep-layout.property-leads-mode {
  grid-template-columns: minmax(0, 1fr);
}

.deep-main,
.deep-layout.no-sidebar .deep-main,
.deep-layout.communities-mode .deep-main,
.deep-layout.property-leads-mode .deep-main {
  width: 100%;
  max-width: none;
  gap: 8px;
}

.deep-sidebar,
.deep-detail {
  padding: 9px;
}

.deep-builder-card,
.deep-dictionary-card,
.deep-import-guide,
.deep-onsale-panel,
.deep-section-card {
  padding: 10px;
}

.deep-builder-card .section-title-row,
.deep-dictionary-head,
.deep-import-guide .section-title-row,
.deep-onsale-panel .section-title-row {
  gap: 8px;
}

.deep-form-grid,
.deep-form-grid.compact,
.deep-special-room-grid,
.deep-building-actions {
  gap: 7px;
}

.deep-special-floor-editor,
.deep-floor-rule-editor,
.deep-unit-layout-editor {
  padding: 9px;
  border-radius: 8px;
}

.deep-special-room-card {
  gap: 7px;
  padding: 9px;
  border-radius: 8px;
}

.deep-special-room-presets {
  gap: 5px;
}

.deep-special-room-presets button {
  min-height: 32px;
  padding: 5px 10px;
}

.deep-special-room-preset-note {
  color: #607482;
  font-size: 12px;
  font-weight: 800;
}

.deep-build-preview,
.deep-special-room-preview {
  min-height: 40px;
}

@media (min-width: 1441px) {
  .deep-layout.detail-open {
    width: 100%;
    max-width: none;
    grid-template-columns: 250px minmax(620px, 1fr) 324px;
    gap: 8px;
    padding-right: 0;
    overflow: visible;
  }

  .deep-layout.detail-open .deep-main {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .deep-layout.detail-open .deep-detail:has(.deep-room-profile) {
    position: sticky;
    grid-column: 3;
    top: 74px;
    right: auto;
    justify-self: stretch;
    width: 100%;
    max-width: none;
    max-height: calc(100svh - 86px);
    margin: 0;
    box-shadow: 0 12px 28px rgba(16, 53, 74, 0.14);
  }
}

@media (max-width: 1280px) {
  .deep-filter-toolbar {
    grid-template-columns: minmax(140px, 0.4fr) minmax(240px, 1fr) minmax(140px, 190px);
  }

  .deep-layout,
  .deep-layout.detail-open {
    grid-template-columns: minmax(220px, 250px) minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .deep-filter-toolbar,
  .deep-layout,
  .deep-layout.detail-open {
    grid-template-columns: 1fr;
  }
}

/* v631: compact property-lead workspace with admin-only temporary assignment. */
.deep-property-leads-panel {
  gap: 10px;
  padding: 10px;
}

.deep-property-leads-panel > .section-title-row {
  gap: 10px;
  padding-bottom: 2px;
}

.deep-property-leads-panel > .section-title-row h3 {
  margin: 2px 0;
  font-size: 18px;
}

.deep-property-leads-panel > .section-title-row small {
  font-size: 12px;
  line-height: 1.45;
}

.deep-lead-metrics {
  gap: 7px;
}

.deep-lead-metrics article {
  min-height: 68px;
  padding: 9px 10px;
}

.deep-lead-metrics strong {
  font-size: 22px;
}

.deep-lead-toolbar {
  gap: 7px;
}

.deep-lead-toolbar input,
.deep-lead-toolbar select {
  min-height: 36px;
  padding: 6px 9px;
  font-size: 13px;
}

.deep-lead-admin-toolbar {
  display: grid;
  grid-template-columns: auto auto minmax(180px, 1fr) auto auto;
  gap: 7px;
  align-items: center;
  padding: 8px;
  border: 1px solid #c9ddd8;
  border-radius: 8px;
  background: #f2faf7;
}

.deep-lead-admin-toolbar select {
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid #ccdce4;
  border-radius: 7px;
  color: #173044;
  background: #fff;
}

.deep-lead-page-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #244858;
  font-weight: 900;
  white-space: nowrap;
}

.deep-lead-admin-toolbar > strong {
  color: #0f766e;
  font-size: 13px;
  white-space: nowrap;
}

.deep-lead-head,
.deep-lead-row {
  gap: 8px;
  padding: 9px 10px;
}

.deep-lead-head.admin-mode,
.deep-lead-row.admin-mode {
  grid-template-columns: 30px 104px minmax(220px, 1.4fr) 116px 126px 132px 108px 126px;
}

.deep-lead-select-cell {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.deep-lead-select-cell input,
.deep-lead-page-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #0f766e;
}

.deep-lead-row > span {
  gap: 2px;
}

.deep-lead-row strong,
.deep-lead-row b {
  font-size: 13px;
}

.deep-lead-row small {
  font-size: 11px;
}

.deep-lead-row-detail {
  padding: 8px 10px 10px;
}

.deep-lead-detail-card {
  gap: 8px;
  padding: 10px;
}

.deep-lead-detail-card > .section-title-row.compact {
  align-items: center;
  gap: 10px;
}

.deep-lead-detail-card > .section-title-row.compact h4 {
  margin: 1px 0 3px;
  font-size: 17px;
  line-height: 1.3;
}

.deep-lead-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.deep-lead-detail-meta span {
  padding: 3px 7px;
  border-radius: 6px;
  color: #456474;
  background: #eaf3f6;
  font-size: 11px;
  font-weight: 850;
}

.deep-lead-detail-grid {
  gap: 7px;
}

.deep-lead-detail-grid article {
  min-height: 68px;
  padding: 8px 9px;
}

.deep-lead-detail-grid span,
.deep-lead-detail-grid small {
  font-size: 11px;
}

.deep-lead-detail-grid strong {
  margin: 2px 0;
  font-size: 16px;
  line-height: 1.3;
}

.deep-lead-maintenance {
  grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
  gap: 7px;
}

.deep-lead-maintenance label {
  gap: 3px;
  font-size: 12px;
}

.deep-lead-maintenance input,
.deep-lead-maintenance select,
.deep-lead-maintenance textarea {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 13px;
}

.deep-lead-maintenance textarea {
  min-height: 54px;
}

.deep-lead-follow-list {
  gap: 5px;
}

.deep-lead-follow-list article {
  grid-template-columns: 90px 140px minmax(0, 1fr);
  gap: 6px;
  padding: 7px 8px;
  font-size: 12px;
}

.deep-lead-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 2px;
  color: #607482;
  font-size: 12px;
  font-weight: 850;
}

.deep-lead-pagination label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.deep-lead-pagination select {
  min-height: 32px;
  padding: 4px 7px;
  border: 1px solid #ccdce4;
  border-radius: 7px;
  color: #173044;
  background: #fff;
}

@media (max-width: 1100px) {
  .deep-lead-admin-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deep-lead-admin-toolbar select {
    grid-column: 1 / -1;
  }

  .deep-lead-detail-grid,
  .deep-lead-maintenance {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .deep-lead-admin-toolbar,
  .deep-lead-detail-grid,
  .deep-lead-maintenance,
  .deep-lead-follow-list article {
    grid-template-columns: 1fr;
  }

  .deep-lead-maintenance .wide,
  .deep-lead-admin-toolbar select {
    grid-column: auto;
  }

  .deep-lead-pagination {
    justify-content: flex-start;
  }
}

/* v636: pinned room detail, safer recovery tools, intent status and immutable deal entry. */
.deep-shell {
  overflow: visible;
}

.deep-page {
  overflow-x: auto;
  overflow-y: visible;
}

.deep-layout.room-workspace .deep-detail,
.deep-layout.room-workspace.detail-open .deep-detail,
.deep-layout.room-workspace.detail-open .deep-detail:has(.deep-room-profile) {
  position: sticky !important;
  top: 108px !important;
  align-self: start !important;
  max-height: calc(100svh - 120px) !important;
  overscroll-behavior: contain;
}

.deep-room-cell .deep-room-area {
  color: #102635;
  font-weight: 950;
}

.deep-room-cell.onsale {
  color: #fff;
  background: #2478c7;
}

.deep-room-cell.onsale strong,
.deep-room-cell.onsale small {
  color: #fff;
}

.deep-room-cell.onsale mark {
  color: #0c416e;
  background: rgba(255, 255, 255, 0.94);
}

.deep-room-cell.onsale .deep-room-area {
  display: inline-block;
  width: max-content;
  max-width: 100%;
  margin-inline: auto;
  padding: 1px 5px;
  border-radius: 4px;
  color: #102635;
  background: rgba(255, 255, 255, 0.92);
}

.deep-room-cell.interested {
  background: linear-gradient(180deg, #ffd18a 0%, #fff0cc 100%);
}

.deep-room-profile mark.onsale {
  color: #fff;
  background: #2478c7;
}

.deep-room-profile mark.interested {
  color: #714100;
  background: #ffd18a;
}

.deep-delete-recovery-panel {
  margin-top: 12px;
}

.deep-delete-recovery-heading,
.deep-delete-recovery-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.deep-delete-recovery-collapsed {
  padding: 10px 12px;
  border: 1px dashed #cadce4;
  border-radius: 7px;
  color: #627987;
  background: #f7fafb;
  font-size: 12px;
  font-weight: 800;
}

.deep-delete-recovery-list {
  max-height: 620px;
  overflow: auto;
  overscroll-behavior: contain;
}

.deep-delete-recovery-pagination {
  margin-top: 8px;
  color: #607482;
  font-size: 12px;
  font-weight: 850;
}

.deep-delete-recovery-pagination button.active {
  color: #fff;
  border-color: #0f766e;
  background: #0f766e;
}

.deep-transaction-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 7px 0 9px;
  padding: 8px;
  border: 1px solid #d6e5ea;
  border-radius: 7px;
  background: #f8fbfc;
}

.deep-transaction-form label {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: #526c7a;
  font-size: 11px;
  font-weight: 850;
}

.deep-transaction-form label.wide,
.deep-transaction-actions {
  grid-column: 1 / -1;
}

.deep-transaction-form input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid #ccdce4;
  border-radius: 6px;
  color: #173044;
  background: #fff;
}

.deep-transaction-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.deep-transaction-actions small {
  color: #6a7f8b;
  font-size: 11px;
  font-weight: 750;
}

/* v635: fixed 20/50/30 room workspace and direct mixed-building creation. */
.deep-shell {
  overflow-x: auto;
}

.deep-layout.room-workspace,
.deep-layout.room-workspace.detail-open {
  width: 100% !important;
  min-width: 1180px;
  max-width: none !important;
  grid-template-columns: minmax(0, 20fr) minmax(0, 50fr) minmax(0, 30fr) !important;
  gap: 8px;
  padding-right: 0 !important;
  overflow: visible !important;
  align-items: start;
}

.deep-layout.room-workspace .deep-sidebar,
.deep-layout.room-workspace .deep-main,
.deep-layout.room-workspace .deep-detail {
  min-width: 0;
  max-width: none;
}

.deep-layout.room-workspace .deep-detail,
.deep-layout.room-workspace.detail-open .deep-detail,
.deep-layout.room-workspace.detail-open .deep-detail:has(.deep-room-profile) {
  position: sticky !important;
  grid-column: 3 !important;
  top: 74px !important;
  right: auto !important;
  display: block;
  justify-self: stretch;
  width: 100% !important;
  max-width: none !important;
  max-height: calc(100svh - 86px) !important;
  margin: 0 !important;
  padding: 10px;
  overflow: auto;
  border: 1px solid #d6e4ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(23, 48, 68, 0.11) !important;
}

.deep-layout.room-workspace .deep-detail-empty {
  min-height: 210px;
  align-content: center;
  border: 1px dashed #cbdce4;
  background: #f7fafb;
}

.deep-room-profile {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin: -10px -10px 8px;
  padding: 11px 12px 10px;
  border-bottom: 1px solid #dce8ed;
  background: #fbfdfd;
}

.deep-room-profile-heading h3 {
  margin: 1px 0 0;
  font-size: 23px;
  line-height: 1.05;
}

.deep-room-profile > mark {
  align-self: start;
  justify-self: end;
}

.deep-room-profile-meta {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.deep-room-profile-meta span {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  align-items: baseline;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid #e0eaee;
  border-radius: 7px;
  background: #fff;
}

.deep-room-profile-meta small {
  color: #6b7f8b;
  font-size: 11px;
  font-weight: 800;
}

.deep-room-profile-meta b {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #173044;
  font-size: 13px;
}

.deep-room-close-button {
  grid-column: 1 / -1;
  width: 100%;
}

.deep-room-stats.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.deep-room-stats.compact article {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  min-height: 58px;
  align-content: center;
}

.deep-room-stats.compact .deep-phone-card {
  grid-column: 1 / -1;
  grid-template-columns: 64px minmax(0, 1fr);
  min-height: 60px;
}

.deep-detail-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.deep-detail-form label {
  min-width: 0;
}

.deep-detail-form input,
.deep-detail-form select,
.deep-detail-form textarea {
  width: 100%;
  min-width: 0;
}

.deep-new-building-creator {
  display: grid;
  gap: 9px;
  margin-top: 4px;
  padding: 10px;
  border: 1px solid #cfe0e7;
  border-left: 4px solid #16766d;
  border-radius: 8px;
  background: #f8fcfb;
}

.deep-new-building-creator .deep-builder-subhead {
  margin: 0;
}

.deep-new-building-body {
  display: grid;
  gap: 9px;
  padding-top: 9px;
  border-top: 1px solid #dce9ed;
}

.deep-new-building-kinds {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.deep-new-building-kinds button {
  display: grid;
  gap: 3px;
  min-height: 66px;
  padding: 9px 10px;
  border: 1px solid #cfdee5;
  border-radius: 8px;
  color: #173044;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.deep-new-building-kinds button.active {
  border-color: #16766d;
  background: #eaf8f4;
  box-shadow: inset 3px 0 0 #16766d;
}

.deep-new-building-kinds strong {
  font-size: 14px;
}

.deep-new-building-kinds span,
.deep-new-building-fields small,
.deep-new-building-units small,
.deep-new-building-preview span {
  color: #607482;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.4;
}

.deep-new-building-fields {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.deep-new-building-fields label,
.deep-new-building-units label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: #526c7a;
  font-size: 12px;
  font-weight: 850;
}

.deep-new-building-fields input,
.deep-new-building-units input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid #cddde5;
  border-radius: 7px;
  color: #173044;
  background: #fff;
  font-weight: 850;
}

.deep-new-building-span.is-hidden {
  visibility: hidden;
}

.deep-new-building-units {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.deep-new-building-units label {
  padding: 8px;
  border: 1px solid #d9e6eb;
  border-radius: 8px;
  background: #fff;
}

.deep-new-building-preview {
  display: grid;
  gap: 3px;
  min-height: 48px;
  padding: 9px 11px;
  border: 1px solid #badbd1;
  border-radius: 8px;
  background: #effaf6;
}

.deep-new-building-preview strong {
  color: #0e655f;
  font-size: 14px;
}

.deep-new-building-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

@media (max-width: 900px) {
  .deep-layout.room-workspace,
  .deep-layout.room-workspace.detail-open {
    grid-template-columns: minmax(0, 20fr) minmax(0, 50fr) minmax(0, 30fr) !important;
  }
}

/* v633: active/invalid lead views, reminder batching and lifecycle actions. */
.deep-lead-view-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 4px;
  justify-self: start;
  padding: 4px;
  border: 1px solid #d4e3e9;
  border-radius: 8px;
  background: #f3f7f9;
}

.deep-lead-view-tabs button {
  min-height: 34px;
  padding: 6px 12px;
  border: 0;
  border-radius: 6px;
  color: #506a78;
  background: transparent;
  font-weight: 900;
  cursor: pointer;
}

.deep-lead-view-tabs button.active {
  color: #fff;
  background: #0f766e;
  box-shadow: 0 5px 12px rgba(15, 118, 110, 0.18);
}

.deep-lead-view-tabs strong {
  margin-left: 5px;
}

.deep-lead-toolbar.invalid-view {
  grid-template-columns: minmax(260px, 1fr) 170px;
}

.deep-lead-admin-toolbar {
  grid-template-columns: auto auto minmax(170px, 1fr) auto auto minmax(180px, auto) auto;
}

.deep-lead-reminder-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #456474;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.deep-lead-reminder-date input {
  min-height: 34px;
  padding: 5px 7px;
  border: 1px solid #ccdce4;
  border-radius: 7px;
  color: #173044;
  background: #fff;
}

.deep-lead-row-group {
  min-width: 1040px;
}

.deep-lead-head,
.deep-lead-row {
  grid-template-columns: 88px minmax(180px, 1.4fr) 95px 105px 105px 85px 105px 92px 62px;
  min-width: 1040px;
}

.deep-lead-head.admin-mode,
.deep-lead-row.admin-mode {
  grid-template-columns: 30px 88px minmax(180px, 1.4fr) 95px 105px 105px 85px 105px 92px 62px;
}

.deep-lead-row-action {
  display: flex !important;
  justify-content: flex-start;
}

.deep-lead-row-action button {
  min-height: 28px;
  padding: 4px 8px;
  white-space: nowrap;
}

@media (max-width: 1360px) {
  .deep-lead-admin-toolbar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .deep-lead-admin-toolbar > select {
    grid-column: span 2;
  }
}

@media (max-width: 700px) {
  .deep-lead-view-tabs,
  .deep-lead-toolbar.invalid-view,
  .deep-lead-admin-toolbar {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .deep-lead-admin-toolbar > select {
    grid-column: auto;
  }
}

/* Keep v636 sticky rules last so older workspace compatibility rules cannot override them. */
.deep-shell {
  overflow: visible;
}

.deep-page {
  overflow: visible;
}

.deep-layout.room-workspace .deep-detail,
.deep-layout.room-workspace.detail-open .deep-detail,
.deep-layout.room-workspace.detail-open .deep-detail:has(.deep-room-profile) {
  top: 108px !important;
  align-self: start !important;
  max-height: calc(100svh - 120px) !important;
}

/* v637: soften onsale cards and keep listing prices calm on blue. */
.deep-room-cell.onsale {
  background: #3a86cd;
}

.deep-room-cell.onsale > b {
  color: #fff;
}

.deep-room-profile mark.onsale {
  background: #3a86cd;
}

/* v644: compact room detail, quick edits and WeChat marker. */
.deep-room-wechat-tag {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2;
  min-width: 30px;
  padding: 2px 5px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 5px;
  color: #fff;
  background: #087f72;
  box-shadow: 0 3px 9px rgba(8, 85, 76, 0.2);
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
  line-height: 1.2;
}

.deep-room-cell.onsale .deep-room-wechat-tag {
  color: #075e56;
  background: #d8fff3;
  border-color: #fff;
}

.deep-room-price-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 6px;
}

.deep-room-quick-stat {
  display: grid;
  gap: 2px;
  min-width: 0;
  min-height: 60px;
  align-content: center;
  padding: 8px 10px;
  border: 1px solid #dce8ed;
  border-radius: 7px;
  background: #f7fafb;
}

.deep-room-quick-stat.editable {
  cursor: text;
}

.deep-room-quick-stat.editable:hover {
  border-color: #79a9c8;
  background: #f2f8fb;
}

.deep-room-quick-stat span,
.deep-room-quick-stat small {
  color: #647a88;
  font-size: 11px;
  font-weight: 800;
}

.deep-room-quick-stat strong {
  color: #16354b;
  font-size: 17px;
  line-height: 1.15;
}

.deep-room-contact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 6px;
  margin-top: 6px;
}

.deep-room-contact-row .deep-phone-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 2px 7px;
  min-height: 64px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 7px;
}

.deep-room-contact-row .deep-phone-card small {
  grid-column: 2;
}

.deep-wechat-toggle {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 64px;
  place-items: center;
  padding: 7px;
  border: 1px solid #d7e5eb;
  border-radius: 7px;
  color: #536d7d;
  background: #f7fafb;
  cursor: pointer;
  overflow: hidden;
}

.deep-wechat-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.deep-wechat-toggle span {
  display: grid;
  gap: 3px;
  text-align: center;
}

.deep-wechat-toggle b {
  color: #17394f;
  font-size: 13px;
}

.deep-wechat-toggle em {
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.deep-wechat-toggle.checked,
.deep-wechat-toggle:has(input:checked) {
  color: #fff;
  border-color: #087f72;
  background: linear-gradient(145deg, #0a8c7c, #087166);
  box-shadow: 0 6px 14px rgba(8, 113, 102, 0.18);
}

.deep-wechat-toggle.checked b,
.deep-wechat-toggle:has(input:checked) b {
  color: #fff;
}

.deep-quick-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: end;
  margin-top: 6px;
  padding: 8px;
  border: 1px solid #9fc4db;
  border-radius: 7px;
  background: #f3f9fc;
  box-shadow: inset 3px 0 0 #2d79ad;
}

.deep-quick-editor label {
  display: grid;
  gap: 4px;
  color: #526c7a;
  font-size: 11px;
  font-weight: 850;
}

.deep-quick-editor input {
  width: 100%;
  min-width: 0;
  min-height: 35px;
  padding: 6px 8px;
  border: 1px solid #c8dce7;
  border-radius: 6px;
  color: #173044;
  background: #fff;
  font: inherit;
}

.deep-compact-heading,
.deep-follow-detail-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.deep-compact-heading span,
.deep-follow-detail-heading span {
  color: #6a7e8b;
  font-size: 11px;
  font-weight: 800;
}

.deep-follow-detail-heading {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid #e1ebef;
}

.deep-follow-detail-heading strong {
  color: #173044;
  font-size: 13px;
}

.deep-room-maintenance .deep-detail-form {
  gap: 6px;
}

.deep-room-maintenance .wide {
  grid-column: 1 / -1;
}

@media (max-width: 520px) {
  .deep-room-contact-row {
    grid-template-columns: minmax(0, 1fr) 88px;
  }

  .deep-quick-editor {
    grid-template-columns: 1fr;
  }
}

/* v646: collapsible deep directory, compact pagination and resilient follow editor */
.deep-sidebar-buildings-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  margin-top: 8px;
  padding: 6px 9px;
  color: #31536b;
  background: #f4f9fb;
  border: 1px solid #d3e3eb;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  text-align: left;
}

.deep-sidebar-buildings-toggle:hover,
.deep-sidebar-buildings-toggle:focus-visible {
  color: #087f72;
  background: #eaf7f4;
  border-color: #8fcfc3;
  outline: none;
}

.deep-sidebar-buildings-toggle strong {
  flex: 0 0 auto;
  color: #087f72;
  font-size: 12px;
}

#customerSystemPanel .customer-table-footer {
  justify-content: center;
  gap: 8px;
  padding: 6px 0 2px;
}

#customerSystemPanel .customer-page-size,
#customerSystemPanel .customer-pager {
  gap: 5px;
  min-height: 34px;
  padding: 3px 5px;
  background: #f5f9fb;
  border: 1px solid #d7e4ec;
  border-radius: 7px;
}

#customerSystemPanel .customer-pager {
  margin-left: 0;
}

#customerSystemPanel .customer-page-size span {
  padding-left: 3px;
  font-size: 11px;
}

#customerSystemPanel .customer-page-size select,
#customerSystemPanel .customer-pager select {
  width: auto;
  min-width: 126px;
  min-height: 28px;
  height: 28px;
  padding: 0 24px 0 8px;
  border-color: #cbdce7;
  border-radius: 5px;
  font-size: 12px;
  line-height: 28px;
}

#customerSystemPanel .customer-page-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  color: #31536b;
  background: #fff;
  border: 1px solid #cbdce7;
  border-radius: 5px;
  cursor: pointer;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

#customerSystemPanel .customer-page-arrow:hover:not(:disabled),
#customerSystemPanel .customer-page-arrow:focus-visible {
  color: #fff;
  background: #087f72;
  border-color: #087f72;
  outline: none;
}

#customerSystemPanel .customer-page-arrow:disabled {
  color: #9fb0bc;
  background: #edf3f6;
  cursor: not-allowed;
  opacity: 0.72;
}

#customerSystemPanel .customer-inline-follow-row {
  padding: 7px 9px;
  background: #f5f9fb;
}

#customerSystemPanel .customer-inline-follow-card {
  gap: 8px;
  padding: 9px;
  border-color: #c9dce7;
  border-radius: 7px;
  box-shadow: 0 7px 18px rgba(40, 73, 96, 0.07);
}

#customerSystemPanel .customer-inline-follow-card textarea,
.customer-drawer-follow-box textarea {
  border: 1px solid #c5d9e6;
  border-radius: 7px;
  background: #fbfdfe;
  line-height: 1.5;
}

#customerSystemPanel .customer-inline-follow-card textarea:focus,
.customer-drawer-follow-box textarea:focus {
  border-color: #56aa9e;
  outline: 2px solid rgba(8, 127, 114, 0.12);
}

@media (max-width: 760px) {
  #customerSystemPanel .customer-table-footer {
    justify-content: flex-start;
  }

  #customerSystemPanel .customer-page-size select,
  #customerSystemPanel .customer-pager select {
    min-width: 112px;
  }
}

/* v643: weak-password safety gate */
.weak-password-gate {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(238, 246, 251, 0.94);
  backdrop-filter: blur(3px);
}

body.weak-password-locked {
  overflow: hidden;
}

body.weak-password-locked #employeeInfoModal {
  z-index: 9001;
}

/* v651: stable workspace alignment, responsive customer tables and group lead dashboard. */
.app-shell {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.workspace-nav,
.workspace-tabs-row,
.open-page-tabs,
.module-subnav,
.app-page,
.app-page > .page-card,
.deep-layout,
.deep-main,
.deep-property-leads-panel,
#customerSystemPanel {
  min-width: 0;
  max-width: 100%;
}

@media (min-width: 761px) {
  body:not(.is-mobile-landscape) .workspace-nav,
  body:not(.is-mobile-landscape) .app-page {
    width: calc(100% - var(--side-nav-width));
    max-width: calc(100% - var(--side-nav-width));
  }
}

.open-page-tabs {
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.deep-layout.property-leads-mode,
.deep-layout.property-leads-mode .deep-main,
.deep-property-leads-panel {
  width: 100%;
  overflow-x: hidden;
}

.deep-lead-metrics {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.deep-lead-toolbar {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.deep-property-dashboard {
  display: grid;
  gap: 12px;
  overflow: hidden;
}

.deep-property-dashboard-toolbar {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(150px, 190px) minmax(220px, 1fr);
  gap: 10px;
  align-items: end;
  padding: 11px;
  border: 1px solid #d7e5ec;
  border-radius: 8px;
  background: #f7fbfd;
}

.deep-property-dashboard-toolbar label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.deep-property-dashboard-toolbar label > span,
.deep-property-dashboard-toolbar > small {
  color: #61778a;
  font-size: 12px;
  font-weight: 800;
}

.deep-property-dashboard-toolbar select,
.deep-property-dashboard-toolbar input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 6px 9px;
  border: 1px solid #cbdce7;
  border-radius: 7px;
  background: #fff;
}

.deep-property-dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
}

.deep-property-dashboard-metrics article {
  min-width: 0;
  padding: 11px;
  border: 1px solid #d5e4eb;
  border-radius: 8px;
  background: #f8fbfd;
}

.deep-property-dashboard-metrics article.danger {
  border-color: #efb4b4;
  background: #fff5f5;
}

.deep-property-dashboard-metrics span,
.deep-property-dashboard-metrics small {
  display: block;
  color: #61778a;
  font-size: 12px;
  font-weight: 800;
}

.deep-property-dashboard-metrics strong {
  display: block;
  margin: 5px 0;
  color: #173044;
  font-size: 24px;
}

.deep-property-dashboard-table {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d7e5ec;
  border-radius: 8px;
}

.deep-property-dashboard-head,
.deep-property-dashboard-row {
  box-sizing: border-box;
  display: grid;
  gap: 7px;
  align-items: center;
  min-width: 0;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid #e1ebf0;
  color: #173044;
  background: #fff;
  font-size: 12px;
  text-align: left;
}

.deep-property-dashboard-head {
  color: #31536b;
  background: #edf6fd;
  font-weight: 900;
}

.deep-property-dashboard-summary .deep-property-dashboard-head,
.deep-property-dashboard-summary .deep-property-dashboard-row {
  grid-template-columns: minmax(110px, 1.4fr) repeat(6, minmax(42px, 0.55fr));
}

.deep-property-dashboard-leads .deep-property-dashboard-head,
.deep-property-dashboard-leads .deep-property-dashboard-row {
  grid-template-columns: minmax(76px, 0.8fr) minmax(130px, 1.8fr) minmax(66px, 0.7fr) minmax(62px, 0.7fr) minmax(120px, 1.2fr) minmax(82px, 0.8fr) minmax(108px, 1fr);
}

.deep-property-dashboard-row > span,
.deep-property-dashboard-head > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deep-property-dashboard-row:last-child {
  border-bottom: 0;
}

.deep-property-dashboard-summary button.deep-property-dashboard-row {
  width: 100%;
  cursor: pointer;
}

.deep-property-dashboard-summary button.deep-property-dashboard-row:hover {
  background: #f0faf7;
}

.deep-property-dashboard-row .danger-text {
  color: #c53a3f;
  font-weight: 900;
}

.deep-property-dashboard-detail {
  display: grid;
  gap: 7px;
  min-width: 0;
}

#customerSystemPanel {
  width: 100%;
  overflow: hidden;
}

#customerSystemPanel .opportunity-toolbar,
#customerSystemPanel .opportunity-filters,
#customerSystemPanel .opportunity-filter-form {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  flex-wrap: wrap;
}

#customerSystemPanel .opportunity-filters {
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
}

#customerSystemPanel .opportunity-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

#customerSystemPanel .customer-table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

#customerSystemPanel .customer-table .customer-table-head,
#customerSystemPanel .customer-table .customer-table-row {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  grid-template-columns: 52px minmax(76px, 0.8fr) 58px 82px 66px minmax(130px, 1.5fr) 60px minmax(110px, 1fr) minmax(76px, 0.8fr) 88px minmax(132px, 1.1fr);
  gap: 5px;
  padding-inline: 7px;
}

#customerSystemPanel .customer-table .customer-table-row > *,
#customerSystemPanel .customer-table .customer-table-head > * {
  min-width: 0;
}

#customerSystemPanel .customer-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

#customerSystemPanel .customer-row-actions button {
  flex: 1 1 auto;
  min-width: 0;
  padding-inline: 6px;
}

@media (max-width: 1500px) {
  #customerSystemPanel .customer-table .customer-table-head,
  #customerSystemPanel .customer-table .customer-table-row {
    grid-template-columns: 32px 50px minmax(72px, 0.8fr) 78px 64px minmax(120px, 1.6fr) minmax(72px, 0.8fr) 82px minmax(128px, 1.1fr);
  }

  #customerSystemPanel .customer-table .customer-table-head > :nth-child(4),
  #customerSystemPanel .customer-table .customer-table-row > :nth-child(4),
  #customerSystemPanel .customer-table .customer-table-head > :nth-child(8),
  #customerSystemPanel .customer-table .customer-table-row > :nth-child(8),
  #customerSystemPanel .customer-table .customer-table-head > :nth-child(9),
  #customerSystemPanel .customer-table .customer-table-row > :nth-child(9) {
    display: none;
  }
}

@media (max-width: 1050px) {
  .deep-property-dashboard-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deep-property-dashboard-toolbar > small {
    grid-column: 1 / -1;
  }

  .deep-property-dashboard-leads .deep-property-dashboard-head,
  .deep-property-dashboard-leads .deep-property-dashboard-row {
    grid-template-columns: minmax(70px, 0.75fr) minmax(120px, 1.7fr) minmax(62px, 0.7fr) minmax(64px, 0.7fr) minmax(110px, 1.2fr);
  }

  .deep-property-dashboard-leads .deep-property-dashboard-head > :nth-child(6),
  .deep-property-dashboard-leads .deep-property-dashboard-row > :nth-child(6),
  .deep-property-dashboard-leads .deep-property-dashboard-head > :nth-child(7),
  .deep-property-dashboard-leads .deep-property-dashboard-row > :nth-child(7) {
    display: none;
  }

  #customerSystemPanel .customer-table .customer-table-head,
  #customerSystemPanel .customer-table .customer-table-row {
    grid-template-columns: 32px 48px minmax(68px, 0.8fr) 62px minmax(128px, 1.8fr) 80px minmax(124px, 1.1fr);
  }

  #customerSystemPanel .customer-table .customer-table-head > :nth-child(5),
  #customerSystemPanel .customer-table .customer-table-row > :nth-child(5),
  #customerSystemPanel .customer-table .customer-table-head > :nth-child(10),
  #customerSystemPanel .customer-table .customer-table-row > :nth-child(10) {
    display: none;
  }
}

@media (max-width: 760px) {
  .deep-property-dashboard-toolbar {
    grid-template-columns: 1fr;
  }

  .deep-property-dashboard-toolbar > small {
    grid-column: auto;
  }

  .deep-property-dashboard-summary .deep-property-dashboard-head,
  .deep-property-dashboard-summary .deep-property-dashboard-row {
    grid-template-columns: minmax(90px, 1.4fr) repeat(3, minmax(42px, 0.6fr));
  }

  .deep-property-dashboard-summary .deep-property-dashboard-head > :nth-child(3),
  .deep-property-dashboard-summary .deep-property-dashboard-row > :nth-child(3),
  .deep-property-dashboard-summary .deep-property-dashboard-head > :nth-child(6),
  .deep-property-dashboard-summary .deep-property-dashboard-row > :nth-child(6),
  .deep-property-dashboard-summary .deep-property-dashboard-head > :nth-child(7),
  .deep-property-dashboard-summary .deep-property-dashboard-row > :nth-child(7) {
    display: none;
  }
}

.weak-password-gate-card {
  width: min(620px, 100%);
  padding: 30px;
  border: 3px solid #e5484d;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(35, 78, 116, 0.18);
  color: #1f63a8;
  text-align: center;
}

.weak-password-gate-label {
  display: inline-block;
  margin-bottom: 10px;
  color: #276dab;
  font-size: 13px;
  font-weight: 900;
}

.weak-password-gate-card h2 {
  margin: 0;
  color: #195b9d;
  font-size: 26px;
  line-height: 1.35;
}

.weak-password-gate-card p {
  max-width: 500px;
  margin: 14px auto 22px;
  color: #3a72a8;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.75;
}

.weak-password-upgrade-link {
  min-height: 40px;
  padding: 0 6px;
  border-radius: 0;
  color: #135d9f;
  background: transparent;
  font-size: 16px;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.weak-password-upgrade-link:hover,
.weak-password-upgrade-link:focus-visible {
  color: #0b477f;
  outline: 2px solid #72a9d7;
  outline-offset: 5px;
}

@media (max-width: 640px) {
  .weak-password-gate {
    padding: 16px;
  }

  .weak-password-gate-card {
    padding: 24px 18px;
  }

  .weak-password-gate-card h2 {
    font-size: 21px;
  }
}

/* v640 lightweight home workspace and clearer deep-farming selection */
.home-dashboard {
  gap: 12px;
}

.home-profile-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  min-height: 82px;
  padding: 14px 16px;
  color: #12283b;
  background: #fff;
  border: 1px solid #d5e2eb;
  border-left: 4px solid #0f806f;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(42, 83, 113, 0.06);
  overflow: hidden;
}

.home-profile-card::after {
  content: none;
}

.home-profile-card > div,
.home-avatar {
  position: static;
  min-width: 0;
}

.home-avatar {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  color: #fff;
  background-color: #1f6f91;
  border: 2px solid #d7e7ef;
  border-radius: 8px;
  box-shadow: none;
  font-size: 21px;
}

.home-profile-card .eyebrow {
  color: #607789;
}

.home-profile-card h2 {
  margin: 2px 0 5px;
  color: #12283b;
  font-size: 22px;
}

.home-profile-card .home-profile-copy p:last-child {
  min-height: 24px;
  padding: 0;
  color: #557086;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 13px;
  font-weight: 800;
}

.home-profile-guide {
  display: grid;
  gap: 3px;
  margin-left: auto;
  padding-left: 18px;
  border-left: 1px solid #dce8ef;
  text-align: right;
}

.home-profile-guide strong {
  color: #173e58;
  font-size: 14px;
}

.home-profile-guide span {
  color: #6a7f8f;
  font-size: 12px;
  font-weight: 700;
}

.home-metric-grid {
  gap: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d5e2eb;
  border-radius: 8px;
}

.home-metric-grid article,
.home-metric-grid article:nth-child(1),
.home-metric-grid article:nth-child(2),
.home-metric-grid article:nth-child(3) {
  min-height: 58px;
  padding: 10px 12px;
  background: #fff;
  border: 0;
  border-top: 0;
  border-right: 1px solid #e0eaf0;
  border-radius: 0;
  box-shadow: none;
}

.home-metric-grid article:last-child {
  border-right: 0;
}

.home-metric-grid strong {
  font-size: 20px;
}

.home-primary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.85fr);
  gap: 12px;
  align-items: start;
}

.home-side-stack {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.home-panel {
  padding: 14px;
  box-shadow: 0 8px 18px rgba(42, 83, 113, 0.05);
}

.home-panel .section-title-row {
  margin-bottom: 10px;
  padding-bottom: 10px;
}

.home-panel .section-title-row h3 {
  font-size: 17px;
}

.home-action-list,
.home-opportunity-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.home-opportunity-list {
  grid-template-columns: 1fr;
}

.home-action-card {
  min-height: 72px;
  padding: 10px 12px;
  background: #fff;
  border-color: #e0e9ef;
}

.home-action-card span {
  min-height: 20px;
  padding: 2px 7px;
}

.home-action-card strong {
  font-size: 14px;
}

.home-action-card em {
  font-size: 12px;
}

.home-quick-grid {
  gap: 8px;
}

.home-quick-button {
  min-height: 44px;
  padding: 8px 11px;
  background: #f3f8fa;
}

.home-task-list,
.home-notice-list {
  gap: 0;
}

.home-task-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.home-task-card {
  min-height: 64px;
  padding: 10px 12px;
  background: #fff;
}

.home-task-card strong,
.home-notice-item strong {
  font-size: 14px;
}

.home-task-card span,
.home-notice-item span {
  margin-top: 4px;
}

.home-notice-item {
  padding: 10px 2px;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #e2ebf0;
  border-radius: 0;
}

.home-notice-item:last-child {
  border-bottom: 0;
}

.home-notice-item p {
  display: -webkit-box;
  margin: 5px 0 0;
  overflow: hidden;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.deep-community-overview-table {
  min-width: 1260px;
}

.deep-community-overview-head,
.deep-community-overview-row {
  grid-template-columns: minmax(190px, 1.35fr) minmax(100px, 0.8fr) 72px 70px 70px 70px 70px 70px 70px 84px minmax(190px, 1.25fr) minmax(310px, 1.65fr);
}

.deep-community-row-actions {
  flex-wrap: nowrap;
  gap: 6px;
  white-space: nowrap;
}

.deep-community-row-actions .ghost-button.small {
  flex: 0 0 auto;
}

.deep-current-building-pill {
  background: #edf3f7;
  color: #31536b;
}

.deep-unit-tabs .ghost-button.small.active,
.deep-unit-tabs .ghost-button.small[aria-pressed="true"] {
  color: #fff;
  background: #087f72;
  border-color: #087f72;
  box-shadow: 0 0 0 3px rgba(8, 127, 114, 0.16), 0 6px 14px rgba(8, 127, 114, 0.16);
}

.deep-unit-tabs .ghost-button.small.active:hover,
.deep-unit-tabs .ghost-button.small[aria-pressed="true"]:hover {
  color: #fff;
  background: #066b61;
  border-color: #066b61;
}

@media (max-width: 1100px) {
  .home-primary-grid {
    grid-template-columns: 1fr;
  }

  .home-side-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .home-profile-guide {
    display: none;
  }

  .home-primary-grid,
  .home-side-stack,
  .home-task-list {
    grid-template-columns: 1fr;
  }

  .home-action-list {
    grid-template-columns: 1fr;
  }
}

/* v652: compact customer actions, accessible follow entry and roomy filters. */

/* v653: organization conflict normalization and clearer modeler permission labels. */

/* v654: include sale and rental managers in broker dashboard and lead assignment scopes. */

/* v655: stable lead search, structured rent range and compact responsive lead workspace. */
.deep-property-leads-panel {
  box-sizing: border-box;
  gap: 12px;
  padding: 14px;
}

.deep-lead-toolbar {
  box-sizing: border-box;
  gap: 10px;
  padding: 10px;
  border: 1px solid #d7e5ec;
  border-radius: 10px;
  background: #f7fafc;
}

.deep-lead-toolbar input,
.deep-lead-toolbar select {
  min-width: 0;
  min-height: 40px;
  border-color: #c8dbe6;
  border-radius: 8px;
  background: #fff;
}

.deep-lead-toolbar input:focus,
.deep-lead-toolbar select:focus,
.deep-lead-form input:focus,
.deep-lead-form select:focus,
.deep-lead-form textarea:focus,
.deep-lead-maintenance input:focus,
.deep-lead-maintenance select:focus,
.deep-lead-maintenance textarea:focus {
  border-color: #168b7f;
  outline: 3px solid rgba(22, 139, 127, 0.13);
  box-shadow: none;
}

.deep-lead-form {
  box-sizing: border-box;
  min-width: 0;
  padding: 16px;
  overflow: hidden;
  border-color: #c9e0dc;
  border-radius: 12px;
  background: #fbfefd;
  box-shadow: 0 8px 22px rgba(24, 73, 90, 0.07);
}

.deep-lead-form > .section-title-row.compact {
  align-items: center;
  min-width: 0;
  padding-bottom: 11px;
  border-bottom: 1px solid #e1ecef;
}

.deep-lead-form > .section-title-row.compact > div,
.deep-lead-detail-card > .section-title-row.compact > div {
  min-width: 0;
}

.deep-lead-form > .section-title-row.compact button,
.deep-lead-detail-card > .section-title-row.compact button {
  flex: 0 0 auto;
}

.deep-lead-create-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.deep-lead-create-grid > label {
  min-width: 0;
  gap: 6px;
  color: #557080;
  font-size: 12px;
  font-weight: 850;
}

.deep-lead-create-grid input,
.deep-lead-create-grid select,
.deep-lead-create-grid textarea {
  box-sizing: border-box;
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  border-color: #cbdce5;
  border-radius: 8px;
  background: #fff;
}

.deep-lead-create-grid textarea {
  min-height: 74px;
  resize: vertical;
}

.deep-lead-create-grid .span-2 {
  grid-column: span 2;
}

.deep-rent-range-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.deep-rent-range-inputs em,
.deep-rent-range-inputs b {
  color: #60798a;
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  white-space: nowrap;
}

.deep-lead-create-grid > .primary-button {
  width: min(220px, 100%);
  min-height: 42px;
  justify-self: end;
}

.deep-lead-table {
  border-color: #cfdee6;
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(24, 73, 90, 0.05);
}

.deep-lead-row-group {
  width: 100%;
  min-width: 0;
}

.deep-lead-row {
  transition: background-color 140ms ease, box-shadow 140ms ease, color 140ms ease;
}

.deep-lead-row:hover {
  background: #f4faf9;
  box-shadow: inset 4px 0 0 #65afa7;
}

.deep-lead-row-group.active > .deep-lead-row,
.deep-lead-row-group.active > .deep-lead-row.danger,
.deep-lead-row-group.active > .deep-lead-row.warn {
  position: relative;
  z-index: 1;
  background: #e7f6f3 !important;
  box-shadow: inset 5px 0 0 #0f8b7e, inset 0 0 0 1px #79beb6;
}

.deep-lead-row-group.active > .deep-lead-row strong,
.deep-lead-row-group.active > .deep-lead-row b {
  color: #0b5f58;
}

.deep-lead-row-detail {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 12px;
  overflow: hidden;
  border-top-color: #a9d7d0;
  background: #f1faf7;
}

.deep-lead-detail-card {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  gap: 12px;
  padding: 14px;
  overflow: hidden;
  border-color: #b8dcd6;
  border-radius: 11px;
  background: #fbfefd;
  box-shadow: 0 8px 20px rgba(21, 91, 82, 0.07);
}

.deep-lead-detail-card > .section-title-row.compact {
  align-items: flex-start;
  min-width: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #dcebe8;
}

.deep-lead-detail-card > .section-title-row.compact h4 {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.deep-lead-detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 220px));
  justify-content: start;
  gap: 9px;
  min-width: 0;
}

.deep-lead-detail-grid article {
  box-sizing: border-box;
  min-width: 0;
  min-height: 76px;
  padding: 10px;
  border-color: #d7e6ea;
  border-radius: 9px;
}

.deep-lead-detail-grid article.rent {
  border-color: #b7dcd5;
  background: #f0faf7;
}

.deep-lead-detail-grid article.rent strong {
  color: #0d756b;
}

.deep-lead-detail-grid strong {
  overflow-wrap: anywhere;
}

.deep-lead-maintenance {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 9px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #dce9ec;
  border-radius: 10px;
  background: #f7fbfc;
}

.deep-lead-maintenance label {
  min-width: 0;
}

.deep-lead-maintenance input,
.deep-lead-maintenance select,
.deep-lead-maintenance textarea {
  box-sizing: border-box;
  min-width: 0;
  border-color: #cbdce5;
  border-radius: 8px;
}

.deep-lead-maintenance .wide {
  grid-column: span 3;
}

.deep-lead-maintenance > .primary-button {
  min-width: 116px;
  min-height: 38px;
  align-self: end;
}

.deep-lead-follow-list {
  min-width: 0;
  padding-top: 2px;
}

@media (max-width: 1450px) {
  .deep-lead-create-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .deep-lead-maintenance {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .deep-property-leads-panel {
    padding: 10px;
  }

  .deep-lead-create-grid,
  .deep-lead-maintenance {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deep-lead-maintenance .wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .deep-lead-toolbar,
  .deep-lead-create-grid,
  .deep-lead-maintenance {
    grid-template-columns: minmax(0, 1fr);
  }

  .deep-lead-create-grid .span-2,
  .deep-lead-maintenance .wide {
    grid-column: auto;
  }

  .deep-rent-range-inputs {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .deep-rent-range-inputs b {
    grid-column: 1 / -1;
  }

  .deep-lead-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
#customerSystemPanel .opportunity-filters {
  box-sizing: border-box;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  width: calc(100% - 16px);
  margin: 8px;
  padding: 10px;
  border: 1px solid #d5e4ec;
  border-radius: 9px;
  background: #f7fbfd;
}

#customerSystemPanel .opportunity-filters > * {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

#customerSystemPanel #customerSearch {
  grid-column: span 2;
}

.customer-date-filter {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding-left: 9px;
  border: 1px solid #cbdce7;
  border-radius: 7px;
  color: #526a7d;
  background: #fff;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

#customerSystemPanel .customer-date-filter input[type="date"] {
  min-width: 0;
  height: 36px;
  padding: 0 8px;
  border: 0;
  outline: 0;
  color: #173044;
  background: transparent;
}

#customerSystemPanel .customer-table .customer-table-head,
#customerSystemPanel .customer-table .customer-table-row {
  grid-template-columns: 34px 52px minmax(96px, 0.9fr) 64px 84px 68px minmax(210px, 1.8fr) 64px minmax(150px, 1.15fr) minmax(88px, 0.8fr) 88px 104px;
}

#customerSystemPanel .customer-demand-cell {
  display: -webkit-box;
  max-height: 2.9em;
  overflow: hidden;
  line-height: 1.45;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#customerSystemPanel .customer-follow-cell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-width: 0;
}

#customerSystemPanel .customer-follow-cell .ghost-button {
  min-width: 44px;
  min-height: 30px;
  padding: 0 8px;
  white-space: nowrap;
}

#customerSystemPanel .customer-follow-cell small {
  min-width: 0;
  overflow: hidden;
  color: #60778a;
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#customerSystemPanel .customer-row-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}

#customerSystemPanel .customer-row-actions button {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  padding: 0 5px;
  white-space: nowrap;
}

@media (max-width: 1500px) {
  #customerSystemPanel .customer-table .customer-table-head,
  #customerSystemPanel .customer-table .customer-table-row {
    grid-template-columns: 32px 50px minmax(92px, 0.9fr) 80px 64px minmax(190px, 1.8fr) minmax(140px, 1.15fr) minmax(78px, 0.8fr) 82px 100px;
  }

  #customerSystemPanel .customer-table .customer-table-head > :nth-child(9),
  #customerSystemPanel .customer-table .customer-table-row > :nth-child(9) {
    display: grid;
  }
}

@media (max-width: 1050px) {
  #customerSystemPanel .opportunity-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #customerSystemPanel .customer-table .customer-table-head,
  #customerSystemPanel .customer-table .customer-table-row {
    grid-template-columns: 32px 48px minmax(88px, 0.85fr) 62px minmax(170px, 1.8fr) minmax(132px, 1.15fr) 80px 96px;
  }
}

@media (max-width: 760px) {
  #customerSystemPanel .opportunity-filters {
    grid-template-columns: 1fr;
    width: calc(100% - 12px);
    margin: 6px;
    padding: 8px;
  }

  #customerSystemPanel #customerSearch {
    grid-column: auto;
  }
}

/* v656: compact two-row lead filters with rent and time ranges. */
.deep-lead-toolbar,
.deep-lead-toolbar.invalid-view {
  grid-template-columns: minmax(240px, 1.4fr) minmax(140px, 0.65fr) minmax(140px, 0.65fr);
  gap: 4px 7px;
  padding: 4px;
  border-radius: 9px;
  background: #f6fafb;
}

.deep-lead-toolbar > input,
.deep-lead-toolbar > select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 30px;
  height: 30px;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 12px;
}

.deep-lead-price-filter,
.deep-lead-time-filter {
  box-sizing: border-box;
  display: grid;
  align-items: center;
  min-width: 0;
  min-height: 30px;
  height: 30px;
  overflow: hidden;
  border: 1px solid #c8dbe6;
  border-radius: 7px;
  background: #fff;
}

.deep-lead-price-filter {
  grid-column: 1;
  grid-template-columns: auto minmax(62px, 1fr) auto minmax(62px, 1fr) auto;
  gap: 5px;
  padding: 0 8px;
}

.deep-lead-time-filter {
  grid-column: 2 / -1;
  grid-template-columns: minmax(108px, 0.8fr) minmax(120px, 1fr) auto minmax(120px, 1fr);
}

.deep-lead-price-filter > span,
.deep-lead-price-filter > b,
.deep-lead-price-filter > em,
.deep-lead-time-filter > em {
  color: #60798a;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  white-space: nowrap;
}

.deep-lead-price-filter input,
.deep-lead-time-filter input,
.deep-lead-time-filter select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 26px;
  height: 26px;
  padding: 2px 6px;
  border: 0;
  border-radius: 0;
  outline: 0;
  color: #183247;
  background: transparent;
  font-size: 12px;
}

.deep-lead-time-filter input,
.deep-lead-time-filter select {
  border-right: 1px solid #e3ecef;
}

.deep-lead-time-filter input:last-child {
  border-right: 0;
}

.deep-lead-time-filter > em {
  padding: 0 5px;
}

.deep-lead-price-filter:focus-within,
.deep-lead-time-filter:focus-within {
  border-color: #168b7f;
  outline: 3px solid rgba(22, 139, 127, 0.13);
}

.deep-lead-price-filter.invalid {
  border-color: #dc6969;
  background: #fff8f8;
}

.deep-lead-table {
  max-width: 100%;
  overflow-x: auto;
}

.deep-lead-row-group {
  min-width: 1090px;
}

/* v734: 房源列封顶 250px（以「九龙仓君庭水泷苑10幢 10幢 1单元 301室」为上限，超出 ellipsis），省出宽度给跟踪列；跟踪列 minmax+fr 随屏宽自适应拉伸，大屏显示更多跟进内容；不写死总宽 */
.deep-lead-head,
.deep-lead-row {
  grid-template-columns: 80px minmax(200px, 250px) 96px 86px 92px minmax(150px, 1.5fr) 78px 96px 84px 54px;
  gap: 6px;
  min-width: 1090px;
  padding: 8px;
}

.deep-lead-head.admin-mode,
.deep-lead-row.admin-mode {
  grid-template-columns: 28px 80px minmax(200px, 250px) 96px 86px 92px minmax(150px, 1.5fr) 78px 96px 84px 54px;
  min-width: 1120px;
}

.deep-lead-rent-cell b {
  color: #0d756b;
}

.deep-lead-rent-cell small {
  color: #6c8493;
}

@media (max-width: 760px) {
  .deep-lead-toolbar,
  .deep-lead-toolbar.invalid-view {
    grid-template-columns: minmax(0, 1fr);
  }

  .deep-lead-price-filter,
  .deep-lead-time-filter {
    grid-column: 1;
  }

  .deep-lead-time-filter {
    grid-template-columns: minmax(98px, 0.8fr) minmax(112px, 1fr) auto minmax(112px, 1fr);
  }
}

/* v657: restore the global box model and keep form/card grids inside their panels. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:where(input, select, textarea) {
  min-width: 0;
  max-width: 100%;
}

:where(
  .form-grid,
  .compact-grid,
  .opportunity-filters,
  .opportunity-log-filters,
  .directory-filters,
  .listing-filters,
  .new-community-panel,
  .customer-detail-form,
  .deep-form-grid,
  .deep-new-building-fields,
  .deep-new-building-units
) > * {
  min-width: 0;
  max-width: 100%;
}

#customerDetailDrawer .side-drawer {
  max-width: 100vw;
  overflow-x: hidden;
}

#customerDetailDrawer .customer-detail-form {
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#customerDetailDrawer .customer-detail-form input,
#customerDetailDrawer .customer-detail-form select,
#customerDetailDrawer .customer-detail-form textarea {
  width: 100%;
}

#opportunityLogPanel .opportunity-log-filters {
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#opportunityLogPanel .opportunity-log-filters input {
  width: 100%;
}

#communitiesPage .directory-filters {
  width: min(760px, 100%);
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 180px) auto auto;
  align-items: center;
}

#communitiesPage .directory-filters .ghost-button {
  min-width: 70px;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .deep-new-building-fields,
  .deep-new-building-units {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  #opportunityLogPanel .opportunity-log-filters {
    grid-template-columns: minmax(0, 1fr);
  }

  #customerDetailDrawer .customer-detail-form {
    grid-template-columns: minmax(0, 1fr);
  }

  #customerDetailDrawer .customer-detail-form .drawer-wide-field,
  #customerDetailDrawer .customer-detail-form .primary-button {
    grid-column: auto;
  }
}

/* v658: split score projects into sale/rent workspaces with safe inline editing. */
#scoreItemsPanel > .section-title-row,
#scoreItemsPanel .score-items-shell {
  width: min(980px, 100%);
  max-width: 100%;
}

.score-item-workspace-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 5px;
  background: #eaf2f7;
  border: 1px solid #d2e2ec;
  border-radius: 10px;
}

.score-item-workspace-tab {
  min-width: 0;
  min-height: 64px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #4c6172;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.score-item-workspace-tab > span:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.score-item-workspace-tab strong {
  color: #1d3548;
  font-size: 15px;
}

.score-item-workspace-tab small {
  color: #718696;
  font-size: 12px;
  font-weight: 800;
}

.score-item-workspace-tab.active {
  background: #fff;
  border-color: #b9d6e8;
  box-shadow: 0 5px 14px rgba(26, 67, 96, 0.1);
}

.score-item-workspace-tab.active strong {
  color: #0d756b;
}

.score-workspace-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: #2f78b7;
  border-radius: 9px;
  font-size: 15px;
  font-style: normal;
  font-weight: 900;
}

.score-workspace-icon.rent {
  background: #0d8878;
}

#scoreItemsPanel .score-item-form {
  grid-template-columns: auto minmax(160px, 1.2fr) minmax(110px, 0.8fr) 90px 104px 104px 94px;
  margin: 0;
  padding: 12px;
  background: #f8fbfd;
  border-color: #cddfea;
}

#scoreItemsPanel .score-table-wrap {
  max-height: calc(100vh - 260px);
  overflow: auto;
  background: #fff;
}

.score-item-workspace-heading {
  min-height: 62px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #5f7586;
  background: #f8fbfd;
  border-bottom: 1px solid #d7e7f0;
  font-size: 12px;
  font-weight: 800;
}

.score-item-workspace-heading > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.score-item-workspace-heading > div > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.score-item-workspace-heading strong {
  color: #1c3548;
  font-size: 16px;
}

.score-item-workspace-heading small {
  color: #718696;
  font-size: 11px;
}

#scoreItemsPanel .score-item-head,
#scoreItemsPanel .score-item-row {
  grid-template-columns: 58px minmax(175px, 1.45fr) minmax(92px, 0.75fr) 68px 88px 58px 58px 184px;
  gap: 8px;
  padding: 0 12px;
}

#scoreItemsPanel .score-item-head {
  top: 0;
  z-index: 5;
}

#scoreItemsPanel .score-item-row {
  min-height: 58px;
  font-size: 13px;
}

#scoreItemsPanel .score-item-row.editing {
  background: #f1faf8;
  box-shadow: inset 4px 0 0 #0d8878;
}

.score-item-order-input {
  width: 48px;
  min-height: 34px;
  padding: 0 6px;
  color: #17354b;
  text-align: center;
  background: #f8fbfd;
  border: 1px solid #c5dae8;
  border-radius: 7px;
  font-weight: 900;
}

.score-item-order-input:focus {
  outline: 2px solid rgba(13, 136, 120, 0.18);
  border-color: #0d8878;
}

.score-item-name-button {
  min-width: 0;
  padding: 5px 0;
  display: grid;
  gap: 2px;
  color: #1d3548;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.score-item-name-button strong,
.score-item-name-button small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-item-name-button strong {
  font-size: 14px;
}

.score-item-name-button small {
  color: #7a8e9d;
  font-size: 10px;
  font-weight: 800;
}

.score-item-name-button:hover strong {
  color: #0d8878;
}

#scoreItemsPanel .score-item-actions {
  justify-content: flex-end;
}

#scoreItemsPanel .score-item-actions .small {
  min-height: 30px;
  padding: 0 8px;
}

.score-item-editor {
  padding: 14px;
  display: grid;
  gap: 12px;
  background: #f5fbfa;
  border-bottom: 1px solid #bcded7;
  box-shadow: inset 4px 0 0 #0d8878;
}

.score-item-editor-title,
.score-item-editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.score-item-editor-title > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.score-item-editor-title strong {
  color: #163a42;
  font-size: 15px;
}

.score-item-editor-title span,
.score-item-editor-actions > span {
  color: #68818b;
  font-size: 11px;
  font-weight: 800;
}

.score-item-editor-title em {
  color: #51707d;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.score-item-editor-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(120px, 0.85fr) repeat(4, minmax(105px, 0.65fr));
  gap: 9px;
}

.score-item-editor-grid label {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: #5f7483;
  font-size: 11px;
  font-weight: 900;
}

.score-item-editor-grid input,
.score-item-editor-grid select {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  color: #1c3548;
  background: #fff;
  border: 1px solid #c6dce7;
  border-radius: 7px;
  font-weight: 800;
}

.score-item-editor-actions {
  justify-content: flex-end;
}

.score-item-editor-actions > span {
  margin-right: auto;
}

.score-item-empty {
  min-height: 180px;
  padding: 30px;
  display: grid;
  place-content: center;
  gap: 5px;
  color: #728795;
  text-align: center;
}

.score-item-empty strong {
  color: #2d485a;
}

@media (max-width: 920px) {
  #scoreItemsPanel .score-item-head,
  #scoreItemsPanel .score-item-row {
    grid-template-columns: 54px minmax(155px, 1.25fr) 88px 62px 78px 52px 52px 164px;
    gap: 6px;
    padding-inline: 8px;
  }

  .score-item-editor-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .score-item-editor-grid .wide {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .score-item-workspace-tabs {
    grid-template-columns: minmax(0, 1fr);
  }

  .score-item-workspace-heading small,
  .score-item-workspace-heading > span {
    display: none;
  }

  #scoreItemsPanel .score-table-wrap {
    overflow-x: auto;
  }

  #scoreItemsPanel .score-item-head,
  #scoreItemsPanel .score-item-row {
    min-width: 820px;
  }

  .score-item-editor {
    min-width: 0;
  }

  .score-item-editor-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .score-item-editor-grid .wide {
    grid-column: auto;
  }

  .score-item-editor-title,
  .score-item-editor-actions {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}

/* AI 知识库与技能：乐享式资料工作台，本地试验版 */
.ai-knowledge-shell {
  width: min(1540px, 100%);
  min-height: calc(100vh - 150px);
  margin: 0 auto;
  color: #1d3343;
}

.ai-knowledge-shell[hidden] {
  display: none !important;
}

.ai-knowledge-hero {
  min-height: 136px;
  padding: 26px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: #fff;
  border: 1px solid #d5e1e8;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(36, 71, 92, 0.07);
}

.ai-knowledge-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 20px;
}

.ai-knowledge-brand-mark {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #2678bd;
  border: 8px solid #e7f1fa;
  border-radius: 22px;
  box-shadow: 0 0 0 1px #c6dae8, 0 10px 24px rgba(38, 120, 189, 0.16);
  font-family: "Songti SC", "STSong", serif;
  font-size: 30px;
  font-weight: 800;
}

.ai-knowledge-brand .eyebrow {
  margin: 0 0 4px;
  color: #237b70;
  font-size: 10px;
  letter-spacing: 0.12em;
}

.ai-knowledge-brand h2 {
  margin: 0;
  color: #142d3e;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: clamp(27px, 2.4vw, 38px);
  letter-spacing: 0.01em;
}

.ai-knowledge-brand p:last-child {
  margin: 7px 0 0;
  color: #6c818f;
  font-size: 13px;
}

.ai-knowledge-hero-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
}

.ai-local-draft-badge {
  padding: 6px 9px;
  color: #7a6320;
  background: #fff8dc;
  border: 1px solid #ead58b;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 900;
}

.ai-knowledge-hero-actions button,
.ai-knowledge-files-head button,
.ai-skill-workspace-head > button {
  min-height: 38px;
  padding: 0 15px;
  color: #24475b;
  background: #fff;
  border: 1px solid #c4d7e2;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.ai-knowledge-hero-actions button:last-child,
.ai-knowledge-files-head button.primary,
.ai-skill-workspace-head > button {
  color: #fff;
  background: #0b8779;
  border-color: #08786c;
}

.ai-knowledge-hero-actions button:hover,
.ai-knowledge-files-head button:hover,
.ai-skill-workspace-head > button:hover {
  border-color: #6aaea5;
  box-shadow: 0 7px 18px rgba(11, 135, 121, 0.1);
  transform: translateY(-1px);
}

.ai-knowledge-toolbar {
  margin-top: 13px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #fff;
  border: 1px solid #d5e1e8;
  border-radius: 11px;
}

.ai-knowledge-view-switch {
  display: flex;
  gap: 5px;
}

.ai-knowledge-view-switch button {
  min-height: 38px;
  padding: 0 17px;
  color: #627987;
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.ai-knowledge-view-switch button.active {
  color: #0c756b;
  background: #eaf7f4;
}

.ai-knowledge-search {
  width: min(390px, 42%);
  min-width: 250px;
  min-height: 40px;
  padding: 0 4px 0 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #748893;
  background: #f7f9fb;
  border: 1px solid #d3e0e7;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 900;
}

.ai-knowledge-search:focus-within {
  background: #fff;
  border-color: #77b7ae;
  box-shadow: 0 0 0 3px rgba(11, 135, 121, 0.08);
}

.ai-knowledge-search input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 0 8px;
  color: #203c4e;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 12px;
}

.ai-knowledge-content {
  min-width: 0;
}

.ai-knowledge-overview {
  margin-top: 13px;
  padding: 25px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  background: #f8fbfd;
  border: 1px solid #d6e2e9;
  border-radius: 12px;
}

.ai-knowledge-overview > div:first-child {
  min-width: 0;
}

.ai-knowledge-overview > div:first-child > span,
.ai-library-section-heading > div > span,
.ai-skill-workspace-head > div > span,
.ai-knowledge-files-head > div > span {
  color: #708895;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.ai-knowledge-overview h3,
.ai-skill-workspace-head h3 {
  margin: 4px 0 5px;
  color: #163449;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: 24px;
}

.ai-knowledge-overview p,
.ai-skill-workspace-head p,
.ai-knowledge-files-head p {
  margin: 0;
  color: #6b808d;
  font-size: 12px;
}

.ai-knowledge-overview dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, 1fr));
  gap: 8px;
}

.ai-knowledge-overview dl > div {
  min-width: 86px;
  padding: 11px 14px;
  background: #fff;
  border: 1px solid #d5e2e9;
  border-radius: 8px;
}

.ai-knowledge-overview dt {
  color: #718691;
  font-size: 9px;
  font-weight: 900;
}

.ai-knowledge-overview dd {
  margin: 3px 0 0;
  color: #15374b;
  font-size: 22px;
  font-weight: 900;
}

.ai-library-section,
.ai-skill-workspace {
  margin-top: 13px;
  padding: 22px;
  background: #fff;
  border: 1px solid #d4e1e8;
  border-radius: 12px;
  box-shadow: 0 10px 27px rgba(41, 77, 99, 0.055);
}

.ai-library-section-heading,
.ai-skill-workspace-head,
.ai-knowledge-files-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.ai-library-section-heading > div {
  display: grid;
  gap: 3px;
}

.ai-library-section-heading strong {
  color: #27485b;
  font-size: 15px;
}

.ai-library-section-heading small {
  color: #82949f;
  font-size: 10px;
}

.ai-library-grid {
  margin-top: 17px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.ai-library-card,
.ai-library-create-card {
  min-width: 0;
  min-height: 245px;
  padding: 17px;
  position: relative;
  overflow: hidden;
  color: #243e4f;
  text-align: left;
  background: #f7f9fc;
  border: 1px solid #d9e3ea;
  border-top: 4px solid #a8c8df;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(50, 79, 98, 0.04);
  cursor: pointer;
}

.ai-library-card::before {
  content: "";
  width: 92px;
  height: 4px;
  position: absolute;
  top: -4px;
  left: 0;
  background: #4289bd;
}

.ai-library-card.tone-mint { border-top-color: #bce8d8; }
.ai-library-card.tone-mint::before { background: #2fa47f; }
.ai-library-card.tone-rose { border-top-color: #f2ced5; }
.ai-library-card.tone-rose::before { background: #c9677a; }
.ai-library-card.tone-sand { border-top-color: #f1ddbd; }
.ai-library-card.tone-sand::before { background: #c58b38; }
.ai-library-card.tone-green { border-top-color: #c6ead4; }
.ai-library-card.tone-green::before { background: #4a9b6c; }
.ai-library-card.tone-violet { border-top-color: #ddd4ef; }
.ai-library-card.tone-violet::before { background: #7f68ad; }
.ai-library-card.tone-blue { border-top-color: #cddff0; }
.ai-library-card.tone-blue::before { background: #397eb6; }

.ai-library-card:hover {
  background: #fff;
  border-color: #a7c5d6;
  box-shadow: 0 15px 30px rgba(35, 74, 98, 0.11);
  transform: translateY(-2px);
}

.ai-library-card > header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: start;
}

.ai-library-code {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #186b60;
  background: #dcefe8;
  border: 1px solid #c7e4da;
  border-radius: 8px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 19px;
  font-weight: 900;
}

.tone-rose .ai-library-code { color: #9c4c5a; background: #f6e5e8; border-color: #efd4da; }
.tone-sand .ai-library-code { color: #976927; background: #f7eddb; border-color: #ecdcbf; }
.tone-green .ai-library-code { color: #327952; background: #e2f2e8; border-color: #cce7d6; }
.tone-violet .ai-library-code { color: #654d91; background: #eee9f7; border-color: #ded5ee; }
.tone-blue .ai-library-code { color: #2c6697; background: #e4eef7; border-color: #d1e1ee; }

.ai-library-card header div {
  min-width: 0;
}

.ai-library-card header strong,
.ai-directory-title strong {
  display: block;
  overflow: hidden;
  color: #17364a;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-library-card header small {
  margin-top: 4px;
  display: -webkit-box;
  overflow: hidden;
  color: #758894;
  font-size: 10px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ai-library-card header em {
  color: #82949e;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.ai-library-recent {
  min-height: 112px;
  margin-top: 16px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.ai-library-recent span {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  color: #627985;
  font-size: 10px;
}

.ai-library-recent i {
  overflow: hidden;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-library-recent i::before {
  content: "·";
  margin-right: 6px;
  color: #94a5ae;
}

.ai-library-recent time {
  color: #94a2aa;
}

.ai-library-recent p {
  margin: 34px 0 0;
  color: #9aa7ae;
  text-align: center;
  font-size: 11px;
}

.ai-library-card footer {
  padding-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid #e0e8ed;
  font-size: 9px;
}

.ai-library-card footer span {
  color: #84959f;
}

.ai-library-card footer b {
  color: #18776d;
}

.ai-library-create-card {
  display: grid;
  place-content: center;
  gap: 6px;
  color: #607784;
  text-align: center;
  background: #fafbfd;
  border-style: dashed;
  border-top-width: 1px;
}

.ai-library-create-card strong {
  color: #31546a;
  font-size: 15px;
}

.ai-library-create-card span {
  font-size: 10px;
}

.ai-library-create-card:hover {
  color: #0b8779;
  background: #f3fbf9;
  border-color: #85c0b7;
}

.ai-knowledge-empty {
  min-height: 220px;
  padding: 28px;
  display: grid;
  place-content: center;
  gap: 5px;
  color: #80929c;
  text-align: center;
}

.ai-knowledge-empty.compact {
  min-height: 170px;
}

.ai-knowledge-empty strong {
  color: #3b5869;
}

.ai-knowledge-empty span {
  font-size: 11px;
}

.ai-knowledge-detail {
  min-height: 650px;
  margin-top: 13px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  overflow: hidden;
  background: #fff;
  border: 1px solid #d3e0e7;
  border-radius: 12px;
  box-shadow: 0 11px 28px rgba(42, 75, 95, 0.06);
}

.ai-knowledge-directory {
  min-width: 0;
  padding: 17px;
  background: #f5f7fa;
  border-right: 1px solid #dbe4ea;
}

.ai-knowledge-back,
.ai-directory-add {
  width: 100%;
  min-height: 36px;
  color: #567181;
  background: #fff;
  border: 1px solid #cfdee6;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.ai-knowledge-back:hover,
.ai-directory-add:hover {
  color: #0a786d;
  border-color: #8fc5bd;
}

.ai-directory-title {
  margin: 17px 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.ai-directory-title small {
  margin-top: 3px;
  display: block;
  color: #83949d;
  font-size: 9px;
}

.ai-knowledge-directory nav {
  display: grid;
  gap: 4px;
}

.ai-knowledge-directory nav button {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  color: #536d7c;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.ai-knowledge-directory nav button.active {
  color: #176e65;
  background: #e4f3f0;
  border-color: #c6e5df;
}

.ai-knowledge-directory nav button b {
  min-width: 20px;
  color: #84959e;
  text-align: right;
  font-size: 9px;
}

.ai-directory-add {
  margin-top: 12px;
  background: transparent;
  border-style: dashed;
}

.ai-knowledge-files {
  min-width: 0;
  padding: 25px;
}

.ai-knowledge-files-head {
  min-height: 86px;
  align-items: flex-start;
}

.ai-knowledge-files-head h3 {
  margin: 4px 0 6px;
  color: #173449;
  font-family: "Songti SC", "STSong", serif;
  font-size: 26px;
}

.ai-knowledge-files-head > div:last-child {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
}

.ai-knowledge-table-head,
.ai-knowledge-document-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 110px 80px 88px;
  gap: 12px;
  align-items: center;
}

.ai-knowledge-table-head {
  min-height: 38px;
  padding: 0 14px 0 58px;
  color: #798c97;
  border-bottom: 1px solid #dfe7ec;
  font-size: 9px;
  font-weight: 900;
}

.ai-knowledge-document-list {
  display: grid;
}

.ai-knowledge-document-row {
  width: 100%;
  min-height: 61px;
  padding: 7px 14px;
  grid-template-columns: 32px minmax(236px, 1fr) 110px 80px 88px;
  color: #536d7c;
  text-align: left;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #edf1f4;
  cursor: pointer;
}

.ai-knowledge-document-row:hover,
.ai-knowledge-document-row.selected {
  background: #f4f8fa;
}

.ai-knowledge-document-row.selected {
  box-shadow: inset 3px 0 0 #0c8c7d;
}

.ai-document-type {
  width: 26px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #087f73;
  background: #e4f5f2;
  border: 1px solid #bfe1da;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 900;
}

.ai-document-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.ai-document-main strong {
  overflow: hidden;
  color: #284556;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-document-main small {
  overflow: hidden;
  color: #87969f;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-knowledge-document-row > span:not(.ai-document-type, .ai-document-main),
.ai-knowledge-document-row time {
  overflow: hidden;
  color: #7f8f98;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-document-preview {
  margin-top: 18px;
  padding: 17px;
  background: #f4faf8;
  border: 1px solid #cce5df;
  border-left: 4px solid #0c8c7d;
  border-radius: 8px;
}

.ai-document-preview header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.ai-document-preview header span {
  color: #668279;
  font-size: 9px;
  font-weight: 900;
}

.ai-document-preview h4 {
  margin: 3px 0 0;
  color: #1e463f;
  font-size: 16px;
}

.ai-document-preview header button {
  min-height: 30px;
  padding: 0 10px;
  color: #55746e;
  background: #fff;
  border: 1px solid #c5ddd8;
  border-radius: 5px;
  font-size: 10px;
  cursor: pointer;
}

.ai-document-preview > p {
  margin: 13px 0;
  color: #4f6c68;
  font-size: 11px;
  line-height: 1.7;
}

.ai-document-preview dl {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-document-preview dl div {
  min-width: 130px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #d7e7e3;
  border-radius: 6px;
}

.ai-document-preview dt {
  color: #81938e;
  font-size: 8px;
}

.ai-document-preview dd {
  margin: 2px 0 0;
  color: #345a53;
  font-size: 10px;
  font-weight: 800;
}

.ai-skill-workspace-head {
  align-items: center;
}

.ai-skill-workspace-head > div {
  min-width: 0;
}

.ai-skill-flow {
  margin-top: 19px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.ai-skill-flow span {
  min-height: 45px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #5f7885;
  background: #f5f8fa;
  border: 1px solid #d8e3e9;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 900;
}

.ai-skill-flow b {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: #0c756b;
  background: #dcf0ec;
  border-radius: 50%;
  font-size: 9px;
}

.ai-skill-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.ai-skill-card {
  min-width: 0;
  padding: 17px;
  background: #f8fafc;
  border: 1px solid #d8e3e9;
  border-left: 4px solid #91a9b8;
  border-radius: 9px;
}

.ai-skill-card.enabled {
  background: #f7fbfa;
  border-color: #c7e3dd;
  border-left-color: #0b8779;
}

.ai-skill-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ai-skill-card > header > span {
  padding: 5px 7px;
  color: #516c7c;
  background: #eaf0f4;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 900;
}

.ai-skill-card.enabled > header > span {
  color: #0c766b;
  background: #e0f2ee;
}

.ai-skill-toggle {
  min-height: 27px;
  padding: 0 9px;
  color: #71838d;
  background: #fff;
  border: 1px solid #d0dce3;
  border-radius: 14px;
  font-size: 9px;
  font-weight: 900;
  cursor: pointer;
}

.ai-skill-toggle[aria-pressed="true"] {
  color: #fff;
  background: #0c887a;
  border-color: #0c887a;
}

.ai-skill-card h4 {
  margin: 14px 0 5px;
  color: #1d3b4e;
  font-size: 16px;
}

.ai-skill-card > p {
  min-height: 42px;
  margin: 0;
  color: #6f838f;
  font-size: 11px;
  line-height: 1.65;
}

.ai-skill-bindings {
  margin-top: 13px;
  padding: 10px;
  display: grid;
  gap: 3px;
  background: #fff;
  border: 1px solid #e0e7ec;
  border-radius: 6px;
}

.ai-skill-bindings span {
  color: #86969e;
  font-size: 8px;
  font-weight: 900;
}

.ai-skill-bindings strong {
  overflow: hidden;
  color: #4f6b7a;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-skill-card footer {
  margin-top: 13px;
  display: flex;
  gap: 7px;
}

.ai-skill-card footer button {
  min-height: 32px;
  padding: 0 11px;
  color: #486777;
  background: #fff;
  border: 1px solid #cddce4;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.ai-skill-card footer button:first-child {
  color: #0a756a;
  border-color: #9bcfc7;
}

.ai-skill-card footer button:disabled {
  color: #98a5ac;
  background: #f2f4f6;
  border-color: #e0e5e8;
  cursor: not-allowed;
}

.ai-knowledge-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 42px));
  padding: 0;
  overflow: auto;
  color: #233f50;
  background: #fff;
  border: 1px solid #cbdce5;
  border-radius: 12px;
  box-shadow: 0 26px 80px rgba(16, 39, 53, 0.3);
}

.ai-knowledge-dialog::backdrop {
  background: rgba(19, 42, 57, 0.44);
  backdrop-filter: blur(3px);
}

.ai-knowledge-dialog header,
.ai-knowledge-dialog footer {
  padding: 16px 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.ai-knowledge-dialog header {
  border-bottom: 1px solid #e0e8ed;
}

.ai-knowledge-dialog header span {
  color: #718691;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.ai-knowledge-dialog h3 {
  margin: 3px 0 0;
  color: #18384b;
  font-size: 20px;
}

.ai-knowledge-dialog header > button,
.ai-knowledge-dialog footer button {
  min-height: 34px;
  padding: 0 12px;
  color: #58717f;
  background: #fff;
  border: 1px solid #cedce4;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.ai-knowledge-dialog footer {
  justify-content: flex-end;
  border-top: 1px solid #e0e8ed;
}

.ai-knowledge-dialog footer button.primary {
  color: #fff;
  background: #0b8779;
  border-color: #0a796d;
}

.ai-dialog-form {
  padding: 18px 19px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.ai-dialog-form.one-column {
  grid-template-columns: minmax(0, 1fr);
}

.ai-dialog-form label,
.ai-dialog-form fieldset {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: #617987;
  border: 0;
  font-size: 10px;
  font-weight: 900;
}

.ai-dialog-form label.wide,
.ai-dialog-form fieldset.wide {
  grid-column: 1 / -1;
}

.ai-dialog-form input,
.ai-dialog-form select,
.ai-dialog-form textarea {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 9px 11px;
  color: #1f3c4e;
  background: #fff;
  border: 1px solid #cbdce5;
  border-radius: 7px;
  outline: 0;
  font: inherit;
  font-size: 12px;
}

.ai-dialog-form input:focus,
.ai-dialog-form select:focus,
.ai-dialog-form textarea:focus {
  border-color: #75b7ae;
  box-shadow: 0 0 0 3px rgba(11, 135, 121, 0.08);
}

.ai-dialog-form textarea {
  resize: vertical;
  line-height: 1.6;
}

.ai-dialog-form legend {
  margin-bottom: 7px;
}

.ai-dialog-library-options {
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  background: #f7f9fb;
  border: 1px solid #d7e3e9;
  border-radius: 7px;
}

.ai-dialog-library-options label {
  min-height: 32px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #496777;
  background: #fff;
  border: 1px solid #e0e7eb;
  border-radius: 5px;
  font-size: 10px;
}

.ai-dialog-library-options input {
  width: 15px;
  min-height: 15px;
  padding: 0;
}

.ai-dialog-note {
  margin: 0;
  padding: 10px 11px;
  color: #7a672e;
  background: #fff8df;
  border: 1px solid #ebd892;
  border-radius: 6px;
  font-size: 10px;
  line-height: 1.6;
}

@media (max-width: 1120px) {
  .ai-library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-knowledge-detail {
    grid-template-columns: 210px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .ai-knowledge-hero {
    padding: 18px;
    align-items: flex-start;
    flex-direction: column;
  }

  .ai-knowledge-brand {
    align-items: flex-start;
  }

  .ai-knowledge-brand-mark {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
    border-width: 6px;
    border-radius: 16px;
    font-size: 23px;
  }

  .ai-knowledge-hero-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .ai-knowledge-hero-actions button {
    flex: 1 1 120px;
  }

  .ai-local-draft-badge {
    width: 100%;
  }

  .ai-knowledge-toolbar,
  .ai-knowledge-overview,
  .ai-library-section-heading,
  .ai-skill-workspace-head,
  .ai-knowledge-files-head {
    align-items: stretch;
    flex-direction: column;
  }

  .ai-knowledge-search {
    width: 100%;
    min-width: 0;
  }

  .ai-knowledge-view-switch {
    width: 100%;
  }

  .ai-knowledge-view-switch button {
    flex: 1 1 0;
  }

  .ai-knowledge-overview {
    padding: 18px;
  }

  .ai-knowledge-overview dl {
    width: 100%;
  }

  .ai-library-section,
  .ai-skill-workspace {
    padding: 14px;
  }

  .ai-library-grid,
  .ai-skill-grid,
  .ai-skill-flow {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-library-card,
  .ai-library-create-card {
    min-height: 226px;
  }

  .ai-knowledge-detail {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-knowledge-directory {
    border-right: 0;
    border-bottom: 1px solid #dbe4ea;
  }

  .ai-knowledge-directory nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-knowledge-files {
    padding: 15px;
  }

  .ai-knowledge-files-head > div:last-child {
    width: 100%;
  }

  .ai-knowledge-files-head button {
    flex: 1 1 0;
  }

  .ai-knowledge-table-head {
    display: none;
  }

  .ai-knowledge-document-row {
    min-height: 72px;
    grid-template-columns: 32px minmax(0, 1fr) 72px;
  }

  .ai-knowledge-document-row > span:nth-of-type(3),
  .ai-knowledge-document-row > span:nth-of-type(4) {
    display: none;
  }

  .ai-knowledge-document-row time {
    text-align: right;
  }

  .ai-dialog-form,
  .ai-dialog-library-options {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* v668 AI 管理中心：统一服务商、模型路由、权限与运行日志 */
.ai-admin-root,
.ai-admin-workspace,
.ai-provider-layout,
.ai-provider-editor,
.ai-routing-panel,
.ai-policy-panel,
.ai-log-panel {
  width: 100%;
  min-width: 0;
}

.ai-admin-root {
  display: grid;
  gap: 12px;
  color: #173047;
}

.ai-admin-loading,
.ai-admin-empty {
  min-height: 280px;
  padding: 34px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: #60788b;
  background: #fff;
  border: 1px solid #d2e0e9;
  border-radius: 12px;
  text-align: center;
}

.ai-admin-loading strong,
.ai-admin-empty strong {
  color: #18344c;
  font-size: 18px;
}

.ai-admin-empty.compact {
  min-height: 140px;
}

.ai-admin-empty.error {
  color: #9a3b43;
  background: #fff8f8;
  border-color: #efc8cb;
}

.ai-admin-hero {
  min-height: 132px;
  padding: 20px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(360px, 1.4fr) auto minmax(360px, 0.8fr);
  gap: 20px;
  align-items: center;
  overflow: hidden;
  background:
    linear-gradient(118deg, rgba(10, 125, 113, 0.08), transparent 35%),
    linear-gradient(180deg, #ffffff, #f8fbfd);
  border: 1px solid #cadde8;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(34, 72, 101, 0.06);
}

.ai-admin-hero::after {
  content: "";
  width: 210px;
  height: 210px;
  position: absolute;
  top: -130px;
  right: 24%;
  border: 28px solid rgba(47, 111, 168, 0.045);
  border-radius: 50%;
  pointer-events: none;
}

.ai-admin-hero-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 15px;
}

.ai-admin-hero-mark {
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 58px;
  color: #fff;
  background: linear-gradient(145deg, #2f6fa8, #0b8073);
  border: 6px solid #e5f0f6;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(31, 96, 134, 0.16);
  font-family: Georgia, "Songti SC", serif;
  font-size: 18px;
  font-weight: 900;
}

.ai-admin-hero-copy > div {
  min-width: 0;
}

.ai-admin-hero-copy > div > span,
.ai-admin-section-head > div > span {
  color: #0b8073;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.ai-admin-hero h2 {
  margin: 3px 0 4px;
  color: #132d43;
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: 24px;
  line-height: 1.18;
}

.ai-admin-hero p,
.ai-admin-section-head p {
  margin: 0;
  color: #6a8193;
  font-size: 11px;
  line-height: 1.55;
}

.ai-admin-hero-status {
  min-width: 150px;
  display: grid;
  justify-items: start;
  gap: 5px;
}

.ai-admin-hero-status > span,
.ai-provider-state {
  padding: 6px 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #8a681c;
  background: #fff7dc;
  border: 1px solid #ead79a;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

.ai-admin-hero-status > span.ready,
.ai-provider-state.ready {
  color: #087166;
  background: #eaf8f4;
  border-color: #a9dace;
}

.ai-admin-hero-status i,
.ai-provider-state i {
  width: 7px;
  height: 7px;
  background: currentColor;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(10, 128, 115, 0.13);
}

.ai-admin-hero-status small {
  color: #8293a0;
  font-size: 9px;
}

.ai-admin-hero dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(74px, 1fr));
  gap: 7px;
}

.ai-admin-hero dl > div {
  min-width: 0;
  padding: 10px 11px;
  display: grid;
  gap: 2px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid #d5e2ea;
  border-radius: 9px;
}

.ai-admin-hero dt {
  color: #7890a2;
  font-size: 9px;
  font-weight: 800;
}

.ai-admin-hero dd {
  margin: 0;
  color: #17324a;
  font-size: 21px;
  font-weight: 900;
}

.ai-admin-nav {
  min-width: 0;
  min-height: 52px;
  padding: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  background: #fff;
  border: 1px solid #cfdee8;
  border-radius: 10px;
}

.ai-admin-nav > button {
  min-height: 38px;
  padding: 0 18px;
  flex: 0 0 auto;
  color: #587085;
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.ai-admin-nav > button.active {
  color: #0a746a;
  background: #e9f6f3;
}

.ai-admin-action-status {
  margin-left: auto;
  padding: 6px 10px;
  flex: 0 0 auto;
  color: #527087;
  background: #f3f8fb;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 800;
}

.ai-admin-action-status[data-type="success"] {
  color: #087166;
  background: #eaf8f4;
}

.ai-admin-action-status[data-type="error"] {
  color: #b3343d;
  background: #fff0f1;
}

.ai-admin-action-status[data-type="saving"] {
  color: #286498;
  background: #edf6fd;
}

.ai-admin-workspace {
  min-height: 520px;
  background: #fff;
  border: 1px solid #cedee8;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(37, 76, 104, 0.05);
  overflow: hidden;
}

.ai-provider-layout {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: 590px;
}

.ai-provider-sidebar {
  min-width: 0;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f5f8fa;
  border-right: 1px solid #d8e4eb;
}

.ai-provider-sidebar-head {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ai-provider-sidebar-head > div {
  display: grid;
  gap: 2px;
}

.ai-provider-sidebar-head strong {
  color: #1b374e;
  font-size: 13px;
}

.ai-provider-sidebar-head span {
  color: #8194a3;
  font-size: 9px;
}

.ai-provider-sidebar-head button,
.ai-admin-secondary,
.ai-admin-primary {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.ai-provider-sidebar-head button,
.ai-admin-secondary {
  color: #315d7e;
  background: #fff;
  border: 1px solid #c5d8e5;
}

.ai-admin-primary {
  color: #fff;
  background: #0a8375;
  border: 1px solid #0a8375;
  box-shadow: 0 5px 12px rgba(10, 131, 117, 0.14);
}

.ai-admin-primary:hover {
  background: #087267;
}

.ai-admin-primary:focus-visible,
.ai-admin-secondary:focus-visible,
.ai-provider-sidebar-head button:focus-visible {
  outline: 2px solid #2f79ba;
  outline-offset: 2px;
}

.ai-admin-primary:disabled,
.ai-admin-secondary:disabled {
  cursor: wait;
  opacity: 0.62;
}

.ai-provider-list {
  display: grid;
  gap: 7px;
}

.ai-provider-card {
  width: 100%;
  min-width: 0;
  min-height: 64px;
  padding: 9px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  color: #29475e;
  background: #fff;
  border: 1px solid #d3e0e8;
  border-radius: 9px;
  text-align: left;
  cursor: pointer;
}

.ai-provider-card.active {
  background: #f1f8fd;
  border-color: #73acd4;
  box-shadow: inset 3px 0 0 #2f79ba;
}

.ai-provider-mark {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: #2f6fa8;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 900;
}

.ai-provider-card-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ai-provider-card-copy strong,
.ai-provider-card-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-provider-card-copy strong {
  font-size: 11px;
}

.ai-provider-card-copy small {
  color: #7a8f9f;
  font-size: 8px;
}

.ai-provider-card em {
  padding: 3px 6px;
  color: #7a641e;
  background: #fff4ce;
  border-radius: 999px;
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.ai-provider-card em.ready {
  color: #087166;
  background: #e2f5f0;
}

.ai-provider-card em.failed {
  color: #b3343d;
  background: #ffeaec;
}

.ai-provider-card em.disabled {
  color: #697c8b;
  background: #edf1f4;
}

.ai-provider-security-note {
  margin-top: auto;
  padding: 11px;
  display: grid;
  gap: 4px;
  color: #637b8e;
  background: #eef5f8;
  border: 1px solid #d2e1e9;
  border-radius: 9px;
}

.ai-provider-security-note strong {
  color: #2a506b;
  font-size: 10px;
}

.ai-provider-security-note span {
  font-size: 9px;
  line-height: 1.55;
}

.ai-provider-editor {
  padding: 20px;
}

.ai-provider-editor > header,
.ai-admin-section-head {
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.ai-provider-editor > header > div > span {
  color: #0c8074;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.ai-provider-editor h3,
.ai-admin-section-head h3 {
  margin: 3px 0 2px;
  color: #17334b;
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: 21px;
}

.ai-provider-state.failed {
  color: #b3343d;
  background: #fff0f1;
  border-color: #efc4c8;
}

.ai-provider-state.disabled,
.ai-provider-state.locked {
  color: #63798a;
  background: #eef2f5;
  border-color: #d3dde4;
}

.ai-provider-secret-banner {
  margin-bottom: 14px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff9e9;
  border: 1px solid #ead89e;
  border-radius: 9px;
}

.ai-provider-secret-banner.ready {
  background: #edf9f6;
  border-color: #b9ded6;
}

.ai-provider-secret-banner > div {
  display: grid;
  gap: 2px;
}

.ai-provider-secret-banner strong {
  color: #264860;
  font-size: 11px;
}

.ai-provider-secret-banner span,
.ai-provider-secret-banner small {
  color: #748b9b;
  font-size: 9px;
}

.ai-provider-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.ai-provider-form label,
.ai-route-card label {
  min-width: 0;
  display: grid;
  gap: 4px;
  color: #627a8e;
  font-size: 9px;
  font-weight: 900;
}

.ai-provider-form .wide {
  grid-column: 1 / -1;
}

.ai-provider-form input,
.ai-provider-form select,
.ai-provider-form textarea,
.ai-route-card input,
.ai-route-card select,
.ai-policy-card input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
  color: #1c3a51;
  background: #fbfdfe;
  border: 1px solid #c9dbe6;
  border-radius: 7px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  outline: none;
}

.ai-provider-form textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.55;
}

.ai-provider-form input:focus,
.ai-provider-form select:focus,
.ai-provider-form textarea:focus,
.ai-route-card input:focus,
.ai-route-card select:focus,
.ai-policy-card input:focus {
  border-color: #4f98c6;
  box-shadow: 0 0 0 3px rgba(47, 121, 186, 0.1);
}

.ai-provider-last-error {
  margin-top: 12px;
  padding: 9px 11px;
  display: grid;
  gap: 3px;
  color: #a03a43;
  background: #fff3f4;
  border: 1px solid #efc8cb;
  border-radius: 8px;
  font-size: 9px;
}

.ai-provider-editor > footer {
  margin-top: 16px;
  padding-top: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid #e1e9ee;
}

.ai-provider-editor > footer > div {
  display: flex;
  gap: 7px;
}

.ai-routing-panel,
.ai-policy-panel,
.ai-log-panel {
  padding: 20px;
}

.ai-admin-section-head > div {
  min-width: 0;
}

.ai-routing-flow {
  margin-bottom: 14px;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(7, auto);
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #627b8e;
  background: #f2f8fb;
  border: 1px solid #d5e4ec;
  border-radius: 9px;
  font-size: 9px;
  font-weight: 800;
}

.ai-routing-flow span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ai-routing-flow b {
  width: 23px;
  height: 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0a776d;
  background: #e2f3ef;
  border-radius: 50%;
  font-size: 8px;
}

.ai-route-list {
  display: grid;
  gap: 8px;
}

.ai-route-card {
  min-width: 0;
  padding: 11px;
  display: grid;
  grid-template-columns: minmax(210px, 1.45fr) minmax(130px, 0.8fr) minmax(155px, 0.95fr) 90px 88px 82px;
  gap: 8px;
  align-items: end;
  background: #fbfdfe;
  border: 1px solid #d4e1e9;
  border-left: 3px solid #2f79ba;
  border-radius: 9px;
}

.ai-route-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
  align-self: center;
}

.ai-route-copy > span {
  color: #8395a3;
  font-size: 8px;
  text-transform: uppercase;
}

.ai-route-copy strong {
  color: #1b3a52;
  font-size: 11px;
}

.ai-route-copy small {
  color: #718799;
  font-size: 9px;
  line-height: 1.4;
}

.ai-route-check {
  min-height: 38px;
  padding: 0 8px;
  display: flex !important;
  align-items: center;
  gap: 5px;
  color: #4e687b !important;
  background: #f4f8fa;
  border: 1px solid #d5e1e8;
  border-radius: 7px;
  white-space: nowrap;
}

.ai-route-check input {
  width: 15px !important;
  min-height: 15px !important;
  padding: 0 !important;
  accent-color: #0a8375;
}

.ai-admin-callout {
  margin-top: 12px;
  padding: 10px 12px;
  color: #6b7f8e;
  background: #f2f7fa;
  border: 1px solid #d3e1e9;
  border-radius: 8px;
  font-size: 10px;
}

.ai-admin-callout.warning {
  color: #82661f;
  background: #fff9e7;
  border-color: #ead99f;
}

.ai-policy-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.ai-policy-card {
  min-width: 0;
  min-height: 164px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  background: #f8fbfd;
  border: 1px solid #d4e2ea;
  border-radius: 10px;
}

.ai-policy-card.accent {
  background: #eef8f5;
  border-color: #bdded6;
}

.ai-policy-card > span {
  color: #0a7b70;
  font-size: 9px;
  font-weight: 900;
}

.ai-policy-card > strong {
  color: #1c3a51;
  font-size: 12px;
}

.ai-policy-card > small {
  margin-top: auto;
  color: #748a9a;
  font-size: 9px;
  line-height: 1.45;
}

.ai-policy-card > label:not(.switch-card label) {
  width: 100%;
  position: relative;
}

.ai-policy-card > label > em {
  position: absolute;
  right: 10px;
  top: 11px;
  color: #7c91a0;
  font-size: 9px;
  font-style: normal;
}

.ai-policy-card.switch-card > label {
  width: 42px;
  height: 23px;
  margin-top: 9px;
  position: relative;
  cursor: pointer;
}

.ai-policy-card.switch-card input {
  position: absolute;
  opacity: 0;
}

.ai-policy-card.switch-card i {
  position: absolute;
  inset: 0;
  background: #c9d5dd;
  border-radius: 999px;
  transition: 0.18s ease;
}

.ai-policy-card.switch-card i::after {
  content: "";
  width: 17px;
  height: 17px;
  position: absolute;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(24, 53, 74, 0.2);
  transition: 0.18s ease;
}

.ai-policy-card.switch-card input:checked + i {
  background: #0a8375;
}

.ai-policy-card.switch-card input:checked + i::after {
  transform: translateX(19px);
}

.ai-tool-permission-map {
  margin-top: 13px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ai-tool-permission-map > div {
  min-width: 0;
  padding: 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 8px;
  align-items: center;
  background: #fff;
  border: 1px solid #d5e2e9;
  border-radius: 9px;
}

.ai-tool-permission-map span {
  padding: 3px 6px;
  grid-row: 1 / span 2;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 900;
}

.ai-tool-permission-map .read {
  color: #087166;
  background: #e3f5f0;
}

.ai-tool-permission-map .confirm {
  color: #80621b;
  background: #fff3c9;
}

.ai-tool-permission-map .blocked {
  color: #ad3540;
  background: #ffe8ea;
}

.ai-tool-permission-map strong {
  color: #29475e;
  font-size: 10px;
}

.ai-tool-permission-map small {
  color: #7b8f9d;
  font-size: 8px;
}

.ai-log-metrics {
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.ai-log-metrics article {
  min-width: 0;
  padding: 11px;
  display: grid;
  gap: 2px;
  background: #f8fbfd;
  border: 1px solid #d5e2e9;
  border-radius: 9px;
}

.ai-log-metrics article.danger {
  background: #fff4f5;
  border-color: #efc7ca;
}

.ai-log-metrics span,
.ai-log-metrics small {
  color: #748a9b;
  font-size: 8px;
}

.ai-log-metrics strong {
  color: #17354d;
  font-size: 20px;
}

.ai-log-table {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid #d3e1e9;
  border-radius: 9px;
}

.ai-log-head,
.ai-log-row {
  min-width: 860px;
  display: grid;
  grid-template-columns: 150px 90px minmax(180px, 1.3fr) 110px 80px 80px 70px;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  font-size: 9px;
}

.ai-log-head {
  color: #587287;
  background: #eef5f9;
  font-weight: 900;
}

.ai-log-row {
  min-height: 45px;
  color: #3a566c;
  border-top: 1px solid #e1eaf0;
}

.ai-log-row > span {
  min-width: 0;
}

.ai-log-row > span:nth-child(3) {
  display: grid;
  gap: 1px;
}

.ai-log-row > span:nth-child(3) strong,
.ai-log-row > span:nth-child(3) small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-log-row small {
  color: #8193a0;
  font-size: 8px;
}

.ai-log-result {
  width: fit-content;
  padding: 3px 7px;
  color: #087166;
  background: #e4f5f1;
  border-radius: 999px;
  font-weight: 900;
}

.ai-log-result.failed {
  color: #b3343d;
  background: #ffe9eb;
}

@media (max-width: 1280px) {
  .ai-admin-hero {
    grid-template-columns: minmax(360px, 1fr) auto;
  }

  .ai-admin-hero dl {
    grid-column: 1 / -1;
  }

  .ai-route-card {
    grid-template-columns: minmax(200px, 1.3fr) repeat(2, minmax(130px, 1fr)) 90px;
  }

  .ai-route-check {
    justify-content: center;
  }

  .ai-policy-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .ai-provider-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-provider-sidebar {
    border-right: 0;
    border-bottom: 1px solid #d8e4eb;
  }

  .ai-provider-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-provider-security-note {
    margin-top: 0;
  }

  .ai-tool-permission-map,
  .ai-policy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-routing-flow {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .ai-routing-flow i {
    display: none;
  }
}

@media (max-width: 760px) {
  .ai-admin-hero {
    padding: 15px;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .ai-admin-hero-copy {
    align-items: flex-start;
  }

  .ai-admin-hero h2 {
    font-size: 20px;
  }

  .ai-admin-hero-status {
    width: 100%;
  }

  .ai-admin-hero dl {
    grid-column: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-admin-nav {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .ai-admin-nav > button {
    min-width: calc(50% - 3px);
    flex: 1 1 calc(50% - 3px);
  }

  .ai-admin-action-status {
    width: 100%;
    margin-left: 0;
    text-align: center;
  }

  .ai-provider-list,
  .ai-provider-form,
  .ai-policy-grid,
  .ai-tool-permission-map,
  .ai-log-metrics,
  .ai-route-card,
  .ai-routing-flow {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-provider-editor,
  .ai-routing-panel,
  .ai-policy-panel,
  .ai-log-panel {
    padding: 14px;
  }

  .ai-provider-secret-banner,
  .ai-provider-editor > header,
  .ai-provider-editor > footer,
  .ai-admin-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .ai-provider-form .wide {
    grid-column: auto;
  }

  .ai-provider-editor > footer > div {
    width: 100%;
  }

  .ai-provider-editor > footer button,
  .ai-admin-section-head > button {
    width: 100%;
  }

  .ai-provider-editor > footer > div button {
    flex: 1 1 0;
  }

  .ai-route-card {
    align-items: stretch;
  }

  .ai-route-check {
    justify-content: flex-start;
  }

  .ai-log-table {
    overflow: visible;
    border: 0;
  }

  .ai-log-head {
    display: none;
  }

  .ai-log-row {
    min-width: 0;
    margin-bottom: 7px;
    padding: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    background: #f8fbfd;
    border: 1px solid #d5e2e9;
    border-radius: 8px;
  }
}

/* v669 AI 对话闭环：实时模型回答、知识引用与安全降级 */
.ai-command-status > span[data-state="error"] {
  color: #f0b7ad;
}

.ai-command-status > span[data-state="error"] i {
  background: #e46b5d;
  box-shadow: 0 0 0 4px rgba(228, 107, 93, 0.13);
}

.ai-command-status > span[data-state="loading"] i,
.ai-connection-pill[data-state="loading"] {
  animation: ai-runtime-breathe 1.4s ease-in-out infinite;
}

.ai-connection-pill[data-state="ready"] {
  color: #087166 !important;
  background: #e9f8f4;
  border-color: #9fd8cb;
}

.ai-connection-pill[data-state="error"] {
  max-width: 340px;
  overflow: hidden;
  color: #9a3d45 !important;
  background: #fff3f3;
  border-color: #edc0c4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-model-progress {
  min-height: 42px;
  margin: 10px 0 0 44px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #607a89;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #d5e3ea;
  border-radius: 8px;
}

.ai-model-progress i {
  width: 6px;
  height: 6px;
  background: #0a887a;
  border-radius: 50%;
  animation: ai-model-dot 1.1s ease-in-out infinite;
}

.ai-model-progress i:nth-child(2) {
  animation-delay: 0.14s;
}

.ai-model-progress i:nth-child(3) {
  animation-delay: 0.28s;
}

.ai-model-progress span {
  margin-left: 5px;
  font-size: 11px;
  font-weight: 800;
}

.ai-model-answer {
  margin: 10px 0 0 44px;
  padding: 13px 15px;
  position: relative;
  overflow: hidden;
  color: #26485b;
  background:
    linear-gradient(120deg, rgba(9, 132, 118, 0.065), transparent 40%),
    #fff;
  border: 1px solid #c8dfdb;
  border-radius: 9px;
}

.ai-model-answer::before {
  content: "";
  width: 4px;
  position: absolute;
  inset: 0 auto 0 0;
  background: #0a887a;
}

.ai-model-answer p {
  margin: 0;
  color: #294b5d;
  font-size: 12px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.ai-model-answer small {
  margin-top: 8px;
  display: block;
  color: #78909d;
  font-size: 9px;
  font-weight: 800;
}

.ai-model-fallback {
  margin: 10px 0 0 44px;
  padding: 10px 12px;
  display: grid;
  gap: 3px;
  color: #8f4e42;
  background: #fff7f4;
  border: 1px solid #eccbc3;
  border-radius: 8px;
}

.ai-model-fallback strong {
  font-size: 11px;
}

.ai-model-fallback span {
  font-size: 10px;
}

.ai-answer-sources {
  margin: 11px 0 0 44px;
  display: grid;
  gap: 6px;
}

.ai-answer-sources > div {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.ai-answer-sources > div span {
  color: #0a8275;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.09em;
}

.ai-answer-sources > div strong {
  color: #5a7483;
  font-size: 10px;
}

.ai-answer-sources > button {
  min-width: 0;
  min-height: 46px;
  padding: 7px 9px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  color: #26495c;
  text-align: left;
  background: #f7fbfa;
  border: 1px solid #cee1dd;
  border-radius: 7px;
  cursor: pointer;
}

.ai-answer-sources > button:hover {
  background: #eef8f5;
  border-color: #94c9c0;
}

.ai-answer-sources em {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #08786d;
  background: #ddf1ed;
  border-radius: 6px;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
}

.ai-answer-sources button > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ai-answer-sources button > span strong,
.ai-answer-sources button > span small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-answer-sources button > span strong {
  font-size: 11px;
}

.ai-answer-sources button > span small {
  color: #718794;
  font-size: 9px;
}

.ai-answer-sources button > b {
  color: #08786d;
  font-size: 9px;
  white-space: nowrap;
}

.ai-command-submit:disabled {
  cursor: wait;
  opacity: 0.72;
}

.ai-radar-grid article.tone-teal {
  background: #eef9f6;
  border-color: #b9ddd5;
}

@keyframes ai-runtime-breathe {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}

@keyframes ai-model-dot {
  0%, 65%, 100% { transform: translateY(0); opacity: 0.45; }
  32% { transform: translateY(-3px); opacity: 1; }
}

@media (max-width: 760px) {
  .ai-model-progress,
  .ai-model-answer,
  .ai-model-fallback,
  .ai-answer-sources {
    margin-left: 0;
  }

  .ai-answer-sources > button {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .ai-answer-sources button > b {
    grid-column: 2;
  }
}
.ai-document-fallback-note {
  margin: 18px 0 0;
  padding: 10px 14px;
  border: 1px solid #b9dfd8;
  border-radius: 10px;
  color: #176d64;
  background: #eef9f7;
  font-size: 13px;
  font-weight: 700;
}

/* v679 Kimi 流式后台任务、售房定价报告 v1.0、管理员技能训练中心 */
.ai-document-template-rail {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.ai-document-template-rail > button:first-child {
  background:
    linear-gradient(180deg, rgba(201, 169, 97, 0.1), transparent 62%),
    #fff;
}

.ai-document-template-rail > button:first-child > span {
  background: #8b6f2e;
}

.ai-document-template-rail > button:first-child.active {
  color: #725718;
  background: #f8f1df;
  box-shadow: inset 0 -4px #c9a961;
}

.ai-document-template-rail > button:first-child.active > span {
  background: #8b6f2e;
}

.ai-document-stream-preview {
  width: min(100%, 760px);
  max-height: 310px;
  margin: 18px auto 0;
  padding: 16px;
  overflow: auto;
  color: #314b60;
  background: #fff;
  border: 1px solid #d1e0e7;
  border-left: 4px solid #c9a961;
  border-radius: 8px;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
  font: 11px/1.75 "PingFang SC", "Microsoft YaHei", sans-serif;
}

.ai-pricing-report-preview {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: row;
  align-items: start;
  gap: 14px;
  background: #e9edf0;
}

.ai-pricing-report-page {
  aspect-ratio: 210 / 297;
  min-width: 0;
  padding: 7%;
  position: relative;
  overflow: hidden;
  color: #333;
  background: #f5f0e8;
  border: 1px solid #d7ceb9;
  box-shadow: 0 8px 22px rgba(22, 36, 48, 0.12);
}

.ai-pricing-report-page > header,
.ai-pricing-report-page > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #7e8589;
  font-size: 7px;
}

.ai-pricing-report-page > header {
  padding-bottom: 6px;
  border-bottom: 1px solid #c9a961;
}

.ai-pricing-report-page > header strong {
  color: #0a1628;
  font-family: Georgia, "Songti SC", serif;
  font-size: 10px;
}

.ai-pricing-report-page > div {
  margin-top: 8px;
  font-size: 7px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.ai-pricing-report-page:not(.cover) > div {
  max-height: calc(100% - 46px);
  overflow: hidden;
}

.ai-pricing-report-page.compact > div {
  font-size: 6.5px;
  line-height: 1.42;
}

.ai-pricing-report-page.tight > div {
  font-size: 6px;
  line-height: 1.36;
}

.ai-pricing-report-page h2,
.ai-pricing-report-page h3,
.ai-pricing-report-page h4 {
  margin: 9px 0 5px;
  padding-left: 6px;
  color: #0a1628;
  border-left: 2px solid #c9a961;
  font-family: Georgia, "Songti SC", serif;
  font-size: 9px;
}

.ai-pricing-report-page.compact h2,
.ai-pricing-report-page.compact h3,
.ai-pricing-report-page.compact h4 {
  margin: 7px 0 4px;
  font-size: 8.4px;
}

.ai-pricing-report-page.tight h2,
.ai-pricing-report-page.tight h3,
.ai-pricing-report-page.tight h4 {
  margin: 6px 0 3px;
  font-size: 7.8px;
}

.ai-pricing-report-page p {
  margin: 0 0 4px;
}

.ai-pricing-report-page.compact p,
.ai-pricing-report-page.tight p {
  margin-bottom: 3px;
}

.ai-pricing-report-page ul,
.ai-pricing-report-page ol {
  margin: 3px 0;
  padding-left: 15px;
}

.ai-pricing-report-page table {
  width: 100%;
  margin: 5px 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 5.8px;
}

.ai-pricing-report-page.compact table {
  font-size: 5.4px;
}

.ai-pricing-report-page.tight table {
  font-size: 5px;
}

.ai-pricing-report-page th,
.ai-pricing-report-page td {
  padding: 3px;
  text-align: left;
  vertical-align: top;
  border-right: 1px solid #d4cbb9;
  border-bottom: 1px solid #d8d2c7;
  word-break: break-word;
}

.ai-pricing-report-page th {
  color: #0a1628;
  background: #f0e6d2;
  font-weight: 700;
}

.ai-pricing-report-page tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.36);
}

.ai-pricing-report-page h2,
.ai-pricing-report-page h3,
.ai-pricing-report-page h4,
.ai-pricing-report-page table,
.ai-pricing-report-page tr {
  break-inside: avoid;
  page-break-inside: avoid;
}

.ai-pricing-report-page code {
  padding: 0 2px;
  color: #0a1628;
  background: rgba(201, 169, 97, 0.14);
  border-radius: 2px;
  font: inherit;
}

.ai-pricing-report-page > footer {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: 4%;
  padding-top: 5px;
  border-top: 1px solid #d1c9ba;
}

.ai-pricing-report-page.cover {
  padding: 8%;
  color: #fff;
  background: #0a1628;
  border: 7px double #c9a961;
}

.ai-pricing-report-page.cover > header {
  color: #d4b975;
  border-color: rgba(201, 169, 97, 0.55);
}

.ai-pricing-report-page.cover > header strong,
.ai-pricing-report-page.cover h2,
.ai-pricing-report-page.cover h3,
.ai-pricing-report-page.cover h4 {
  color: #c9a961;
}

.ai-pricing-report-page.cover table {
  color: #fff;
}

.ai-pricing-report-page.cover th {
  color: #c9a961;
  background: rgba(255, 255, 255, 0.05);
}

.ai-pricing-report-page.cover > footer {
  color: #98a2ad;
  border-color: rgba(201, 169, 97, 0.4);
}

.ai-training-center {
  min-width: 0;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: 690px;
}

.ai-training-sidebar {
  min-width: 0;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  background: #f5f8fa;
  border-right: 1px solid #d8e4eb;
}

.ai-training-sidebar > header,
.ai-training-libraries > header,
.ai-training-examples > header,
.ai-training-method > header,
.ai-training-structure > header {
  display: flex;
  align-items: center;
  gap: 9px;
}

.ai-training-sidebar > header {
  justify-content: space-between;
}

.ai-training-sidebar > header > div {
  display: grid;
  gap: 2px;
}

.ai-training-sidebar > header span,
.ai-training-editor section > header span,
.ai-training-title > div:first-child > span {
  color: #0b8073;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.ai-training-sidebar > header strong {
  color: #19364e;
  font-size: 15px;
}

.ai-training-sidebar > header em {
  color: #7890a1;
  font-size: 9px;
  font-style: normal;
}

.ai-training-skill-list {
  display: grid;
  gap: 7px;
}

.ai-training-skill-list > button {
  width: 100%;
  min-width: 0;
  min-height: 68px;
  padding: 9px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  color: #2c485d;
  background: #fff;
  border: 1px solid #d4e0e8;
  border-radius: 9px;
  text-align: left;
  cursor: pointer;
}

.ai-training-skill-list > button.active {
  background: #f0f8f6;
  border-color: #78b9ad;
  box-shadow: inset 3px 0 #0a8375;
}

.ai-training-skill-list > button > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #173a51;
  border-radius: 9px;
  font: 900 15px Georgia, "Songti SC", serif;
}

.ai-training-skill-list > button.active > span {
  background: #0a8375;
}

.ai-training-skill-list button > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.ai-training-skill-list button strong,
.ai-training-skill-list button small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-training-skill-list button strong {
  font-size: 11px;
}

.ai-training-skill-list button small {
  color: #7a8e9d;
  font-size: 8px;
}

.ai-training-skill-list button > em,
.ai-training-status {
  padding: 3px 6px;
  color: #80651f;
  background: #fff3ca;
  border-radius: 999px;
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.ai-training-skill-list button > em.published,
.ai-training-status.published {
  color: #087166;
  background: #e4f5f1;
}

.ai-training-note {
  margin-top: auto;
  padding: 12px;
  display: grid;
  gap: 4px;
  color: #647d8f;
  background: #eef5f8;
  border: 1px solid #d3e2ea;
  border-radius: 9px;
}

.ai-training-note strong {
  color: #294f69;
  font-size: 10px;
}

.ai-training-note span {
  font-size: 9px;
  line-height: 1.55;
}

.ai-training-editor {
  min-width: 0;
  padding: 20px;
  display: grid;
  align-content: start;
  gap: 14px;
}

.ai-training-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ai-training-title h3 {
  margin: 3px 0;
  color: #142f45;
  font: 700 23px/1.2 Georgia, "Songti SC", serif;
}

.ai-training-title p {
  margin: 0;
  color: #6e8494;
  font-size: 10px;
}

.ai-training-title > div:last-child {
  display: flex;
  align-items: center;
  gap: 7px;
}

.ai-training-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ai-training-status i {
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
}

.ai-training-basics,
.ai-training-rules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.ai-training-basics .wide {
  grid-column: 1 / -1;
}

.ai-training-basics label,
.ai-training-rules label,
.ai-training-example-form label {
  min-width: 0;
  display: grid;
  gap: 4px;
  color: #61798c;
  font-size: 9px;
  font-weight: 900;
}

.ai-training-basics input,
.ai-training-rules input,
.ai-training-method textarea,
.ai-training-example-form input,
.ai-training-example-form textarea {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  color: #1e3c53;
  background: #fbfdfe;
  border: 1px solid #c9dbe6;
  border-radius: 7px;
  font: 700 10px/1.6 "PingFang SC", "Microsoft YaHei", sans-serif;
  outline: none;
}

.ai-training-basics input,
.ai-training-rules input,
.ai-training-example-form input {
  min-height: 38px;
}

.ai-training-method textarea {
  min-height: 360px;
  resize: vertical;
}

.ai-training-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(310px, 0.8fr);
  gap: 12px;
}

.ai-training-method,
.ai-training-structure,
.ai-training-libraries,
.ai-training-examples {
  min-width: 0;
  padding: 14px;
  background: #fbfdfe;
  border: 1px solid #d4e2e9;
  border-radius: 10px;
}

.ai-training-editor section > header {
  margin-bottom: 11px;
}

.ai-training-editor section > header > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #0a8375;
  border-radius: 50%;
  font-size: 8px;
}

.ai-training-editor section > header > div {
  display: grid;
  gap: 2px;
}

.ai-training-editor section > header strong {
  color: #25455c;
  font-size: 12px;
}

.ai-training-editor section > header small {
  color: #7a8e9d;
  font-size: 8px;
}

.ai-training-sections {
  display: grid;
  gap: 5px;
}

.ai-training-sections label {
  min-height: 38px;
  padding: 7px 8px;
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) 18px auto;
  gap: 7px;
  align-items: center;
  color: #35536a;
  background: #fff;
  border: 1px solid #d8e3e9;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 800;
}

.ai-training-sections label b {
  color: #0a8074;
}

.ai-training-sections label input {
  accent-color: #0a8375;
}

.ai-training-sections label em {
  color: #8193a0;
  font-size: 7px;
  font-style: normal;
}

.ai-training-rules {
  margin-top: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ai-training-libraries > div {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.ai-training-libraries > div > label {
  min-width: 0;
  padding: 10px;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  background: #fff;
  border: 1px solid #d7e2e8;
  border-radius: 8px;
}

.ai-training-libraries input {
  margin-top: 2px;
  accent-color: #0a8375;
}

.ai-training-libraries label span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ai-training-libraries label strong,
.ai-training-libraries label small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-training-libraries label strong {
  color: #315067;
  font-size: 9px;
}

.ai-training-libraries label small {
  color: #8092a0;
  font-size: 7px;
}

.ai-training-example-list {
  display: grid;
  gap: 7px;
}

.ai-training-example-list article {
  min-width: 0;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr) auto;
  gap: 10px;
  align-items: center;
  background: #fff;
  border: 1px solid #d7e2e8;
  border-left: 3px solid #c9a961;
  border-radius: 8px;
}

.ai-training-example-list article > div {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.ai-training-example-list article b {
  color: #8b6f2e;
  font-size: 9px;
}

.ai-training-example-list article span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ai-training-example-list article strong,
.ai-training-example-list article small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-training-example-list article strong {
  color: #2f4d64;
  font-size: 10px;
}

.ai-training-example-list article small,
.ai-training-example-list article p {
  color: #768b9a;
  font-size: 8px;
}

.ai-training-example-list article p {
  margin: 0;
  line-height: 1.5;
}

.ai-training-example-list article button {
  padding: 5px 8px;
  color: #a33a42;
  background: #fff3f4;
  border: 1px solid #ecc5c8;
  border-radius: 6px;
  font-size: 8px;
  font-weight: 900;
  cursor: pointer;
}

.ai-training-example-form {
  margin-top: 10px;
  padding-top: 10px;
  display: grid;
  grid-template-columns: minmax(150px, 0.55fr) repeat(2, minmax(0, 1fr)) auto;
  gap: 8px;
  align-items: end;
  border-top: 1px solid #e0e8ed;
}

.ai-training-example-form textarea {
  min-height: 74px;
  resize: vertical;
}

.ai-training-example-form > button {
  height: 38px;
}

@media (max-width: 1280px) {
  .ai-document-template-rail {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .ai-document-template-rail > button:nth-child(4n) {
    border-right: 0;
  }

  .ai-training-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-training-libraries > div {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .ai-training-center {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-training-sidebar {
    border-right: 0;
    border-bottom: 1px solid #d8e4eb;
  }

  .ai-training-skill-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-training-note {
    margin-top: 0;
  }

  .ai-training-libraries > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-training-example-form {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .ai-document-template-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-document-template-rail > button:nth-child(2n) {
    border-right: 0;
  }

  .ai-pricing-report-preview,
  .ai-training-skill-list,
  .ai-training-basics,
  .ai-training-rules,
  .ai-training-libraries > div {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-training-editor {
    padding: 14px;
  }

  .ai-training-title {
    align-items: stretch;
    flex-direction: column;
  }

  .ai-training-title > div:last-child {
    flex-wrap: wrap;
  }

  .ai-training-title > div:last-child button {
    flex: 1 1 120px;
  }

  .ai-training-basics .wide {
    grid-column: auto;
  }

  .ai-training-example-list article {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* v683: 极简定价封面与 WorkBuddy 式技能训练工作台 */
.ai-pricing-report-page.cover {
  padding: 8%;
  color: #fff;
  background:
    radial-gradient(circle at 82% 14%, rgba(201, 169, 97, 0.1), transparent 29%),
    #0a1628;
  border: 1px solid #c9a961;
}

.ai-pricing-report-page.cover > div {
  height: calc(100% - 30px);
  margin-top: 10px;
}

.ai-pricing-cover-minimal {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.ai-pricing-cover-brand {
  color: #d4b975;
  font: 800 8px/1.2 Georgia, "Songti SC", serif;
  letter-spacing: 0.16em;
}

.ai-pricing-cover-title {
  margin-top: 23%;
}

.ai-pricing-cover-title small {
  display: block;
  margin-bottom: 8px;
  color: #8f9aa8;
  font-size: 6px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.ai-pricing-cover-title h2 {
  margin: 0;
  padding: 0;
  color: #fff !important;
  border: 0;
  font: 700 18px/1.3 Georgia, "Songti SC", serif;
  letter-spacing: 0.02em;
}

.ai-pricing-cover-title p {
  margin-top: 7px;
  color: #aeb8c2;
  font-size: 6.5px;
}

.ai-pricing-cover-price {
  margin-top: 17%;
  padding-top: 11px;
  border-top: 1px solid rgba(201, 169, 97, 0.75);
}

.ai-pricing-cover-price > span {
  color: #d4b975;
  font-size: 6px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.ai-pricing-cover-price > strong {
  display: block;
  margin: 7px 0 4px;
  color: #fff;
  font: 700 23px/1.05 Georgia, "Songti SC", serif;
}

.ai-pricing-cover-price > p {
  color: #c3cbd2;
  font-size: 7px;
}

.ai-pricing-cover-minimal blockquote {
  margin: auto 0 0;
  padding: 7px 0 7px 10px;
  color: #e7e1d4;
  border-left: 2px solid #c9a961;
  font-size: 7px;
  line-height: 1.55;
}

.ai-pricing-cover-minimal time {
  margin-top: 12px;
  color: #87939e;
  font-size: 6px;
  text-align: right;
}

.ai-training-center.workbuddy {
  min-height: 760px;
  grid-template-columns: 224px minmax(430px, 1fr) 290px;
  align-items: stretch;
  background: #fff;
}

.ai-training-center.workbuddy .ai-training-sidebar {
  padding: 16px 12px;
  background: #f6f7f9;
}

.ai-training-new {
  width: 100%;
  min-height: 38px;
  color: #6c7d89;
  background: #fff;
  border: 1px dashed #bdcbd4;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 900;
}

.ai-training-center.workbuddy .ai-training-skill-list > button {
  min-height: 62px;
  grid-template-columns: 34px minmax(0, 1fr);
}

.ai-training-center.workbuddy .ai-training-skill-list > button > em {
  grid-column: 2;
  justify-self: start;
}

.ai-training-center.workbuddy .ai-training-editor {
  padding: 22px;
  align-content: start;
  gap: 15px;
  background: #fff;
}

.ai-training-center.workbuddy .ai-training-title {
  padding-bottom: 14px;
  border-bottom: 1px solid #e2e8ec;
}

.ai-training-session,
.ai-training-method-workbench {
  min-width: 0;
  padding: 16px;
  background: #fff;
  border: 1px solid #d8e2e8;
  border-radius: 12px;
  box-shadow: 0 5px 16px rgba(26, 55, 74, 0.05);
}

.ai-training-session > header {
  margin-bottom: 13px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ai-training-session > header > div {
  display: grid;
  gap: 3px;
}

.ai-training-session > header > div > span {
  width: auto;
  height: auto;
  display: block;
  color: #0a8375;
  background: transparent;
  border-radius: 0;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.ai-training-session > header strong {
  color: #18384f;
  font-size: 15px;
}

.ai-training-session > header small {
  color: #7b8f9e;
  font-size: 8px;
}

.ai-training-session > header > em {
  padding: 5px 8px;
  color: #0a7469;
  background: #e8f5f2;
  border-radius: 999px;
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.ai-training-dropzone {
  padding: 6px;
  background: #f7fafb;
  border: 1px dashed #aac2cf;
  border-radius: 10px;
  transition: 160ms ease;
}

.ai-training-dropzone.dragging {
  background: #e9f7f4;
  border-color: #0a8a7c;
  box-shadow: 0 0 0 3px rgba(10, 138, 124, 0.08);
}

.ai-training-dropzone > button {
  width: 100%;
  min-height: 94px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: #35546b;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.ai-training-dropzone > button > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #0a8375;
  border-radius: 50%;
  font-size: 19px;
  line-height: 1;
}

.ai-training-dropzone > button strong {
  font-size: 11px;
}

.ai-training-dropzone > button small {
  max-width: 520px;
  color: #82939f;
  font-size: 8px;
  line-height: 1.5;
}

.ai-training-source-list {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.ai-training-source-list > label {
  min-width: 0;
  min-height: 46px;
  padding: 7px 9px;
  display: grid;
  grid-template-columns: 16px 30px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  background: #fbfcfd;
  border: 1px solid #e0e7eb;
  border-radius: 8px;
}

.ai-training-source-list > label.selected {
  background: #eef8f6;
  border-color: #8fc7bd;
}

.ai-training-source-list > label > input {
  accent-color: #0a8375;
}

.ai-training-source-list > label > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #0a756b;
  background: #e2f2ef;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 900;
}

.ai-training-source-list > label > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ai-training-source-list > label strong,
.ai-training-source-list > label small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-training-source-list > label strong {
  color: #29475e;
  font-size: 9px;
}

.ai-training-source-list > label small,
.ai-training-source-list > p {
  color: #7c8f9e;
  font-size: 8px;
}

.ai-training-source-list > label.recognition-running,
.ai-training-source-list > label.recognition-queued {
  border-color: #b7d6e3;
  background: #f1f8fb;
}

.ai-training-source-list > label.recognition-failed {
  border-color: #e5b7ba;
  background: #fff7f7;
}

.ai-training-source-list > label.recognition-succeeded {
  border-color: #a7d4ca;
}

.ai-training-source-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}

.ai-training-source-actions > button {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #3c657b;
  background: #f4f8fa;
  border: 1px solid #d4e0e6;
  border-radius: 6px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 900;
}

.ai-training-source-actions > button:last-child {
  color: #9b565b;
  background: #fff7f7;
  border-color: #edd8da;
}

.ai-training-recognition {
  margin-top: 12px;
  min-width: 0;
  border-radius: 10px;
}

.ai-training-recognition.empty {
  min-height: 128px;
  padding: 18px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  color: #768b99;
  background: #f8fafb;
  border: 1px solid #e0e7eb;
  text-align: center;
}

.ai-training-recognition.empty > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #183e56;
  border-radius: 9px;
  font: 900 15px Georgia, "Songti SC", serif;
}

.ai-training-recognition.empty strong {
  color: #2f4d63;
  font-size: 11px;
}

.ai-training-recognition.empty p {
  max-width: 500px;
  margin: 0;
  font-size: 8px;
  line-height: 1.6;
}

.ai-training-recognition.running {
  padding: 14px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  background: #eef8f6;
  border: 1px solid #b8ddd6;
}

.ai-training-recognition-orb {
  width: 42px;
  height: 42px;
  position: relative;
  display: grid;
  place-items: center;
  color: #fff;
  background: #0a8375;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 900;
}

.ai-training-recognition-orb i {
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(10, 131, 117, 0.35);
  border-radius: inherit;
  animation: ai-training-pulse 1.6s ease-in-out infinite;
}

@keyframes ai-training-pulse {
  50% { transform: scale(1.12); opacity: 0.35; }
}

.ai-training-recognition.running > div:last-child {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.ai-training-recognition.running strong {
  color: #1c4e48;
  font-size: 10px;
}

.ai-training-recognition.running p {
  max-height: 52px;
  margin: 0;
  overflow: hidden;
  color: #587872;
  font-size: 8px;
  line-height: 1.55;
}

.ai-training-recognition.running > div:last-child > span {
  height: 4px;
  overflow: hidden;
  background: #cfe5e1;
  border-radius: 999px;
}

.ai-training-recognition.running > div:last-child > span i {
  height: 100%;
  display: block;
  background: #0a8375;
  border-radius: inherit;
  transition: width 180ms ease;
}

.ai-training-recognition.running small {
  color: #6e8c87;
  font-size: 7px;
}

.ai-training-recognition.failed {
  padding: 13px;
  color: #914047;
  background: #fff3f3;
  border: 1px solid #efc4c7;
}

.ai-training-recognition.failed strong {
  font-size: 10px;
}

.ai-training-recognition.failed p {
  margin: 4px 0 0;
  font-size: 8px;
}

.ai-training-recognition.result {
  padding: 14px;
  display: grid;
  gap: 10px;
  background: #f2faf8;
  border: 1px solid #a9d5cd;
}

.ai-training-recognition.result > header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-training-recognition.result > header span {
  padding: 3px 6px;
  color: #087268;
  background: #dcefeb;
  border-radius: 999px;
  font-size: 7px;
  font-weight: 900;
}

.ai-training-recognition.result > header strong {
  color: #234d48;
  font-size: 11px;
}

.ai-training-recognition.result > p,
.ai-training-recognition.result li {
  margin: 0;
  color: #52716c;
  font-size: 8px;
  line-height: 1.6;
}

.ai-training-recognition.result > section {
  min-width: 0;
  padding: 10px;
  display: grid;
  gap: 4px;
  background: #fff;
  border: 1px solid #d5e6e2;
  border-radius: 8px;
}

.ai-training-recognition.result label {
  color: #0a7c70;
  font-size: 7px;
  font-weight: 900;
}

.ai-training-recognition.result pre {
  max-height: 180px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #29465a;
  font: 8px/1.65 "PingFang SC", "Microsoft YaHei", sans-serif;
}

.ai-training-recognition.result section strong {
  color: #29465a;
  font-size: 9px;
}

.ai-training-recognition.result section small {
  color: #72868f;
  font-size: 8px;
  line-height: 1.55;
}

.ai-training-recognition.result > div:last-child {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.ai-training-command {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 8px;
  align-items: stretch;
}

.ai-training-command textarea {
  width: 100%;
  min-width: 0;
  min-height: 78px;
  padding: 10px;
  color: #24455c;
  background: #fff;
  border: 1px solid #c9d9e2;
  border-radius: 9px;
  resize: vertical;
  outline: none;
  font: 9px/1.6 "PingFang SC", "Microsoft YaHei", sans-serif;
}

.ai-training-command > button {
  padding: 10px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  color: #fff;
  background: #0a8375;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
}

.ai-training-command > button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.ai-training-command > button strong {
  font-size: 10px;
}

.ai-training-command > button small {
  color: rgba(255, 255, 255, 0.76);
  font-size: 7px;
}

.ai-training-method-workbench textarea {
  min-height: 300px;
}

.ai-training-inspector {
  min-width: 0;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 10px;
  background: #f8fafb;
  border-left: 1px solid #dce5ea;
}

.ai-training-inspector > section {
  min-width: 0;
  padding: 12px;
  background: #fff;
  border: 1px solid #dbe4e9;
  border-radius: 10px;
}

.ai-training-publish-card {
  display: grid;
  gap: 4px;
  color: #667e8f;
}

.ai-training-publish-card > span,
.ai-training-cover-setting > span {
  color: #0a8073;
  font-size: 8px;
  font-weight: 900;
}

.ai-training-publish-card > strong {
  color: #173850;
  font: 700 22px/1.2 Georgia, "Songti SC", serif;
}

.ai-training-publish-card > small {
  font-size: 8px;
}

.ai-training-publish-card > div {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.ai-training-version-history {
  display: grid;
  gap: 8px;
}

.ai-training-version-history > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ai-training-version-history > header > div {
  display: grid;
  gap: 1px;
}

.ai-training-version-history > header span {
  color: #0a8073;
  font-size: 8px;
  font-weight: 900;
}

.ai-training-version-history > header strong {
  color: #294a61;
  font-size: 10px;
}

.ai-training-version-history > header em {
  color: #708692;
  font-size: 7px;
  font-style: normal;
}

.ai-training-version-history > p {
  margin: 0;
  color: #7a8d99;
  font-size: 7px;
  line-height: 1.55;
}

.ai-training-version-history > div {
  max-height: 260px;
  display: grid;
  gap: 4px;
  overflow: auto;
}

.ai-training-version-history > div > button {
  min-width: 0;
  padding: 7px 6px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  color: #36546a;
  background: #fbfcfd;
  border: 1px solid #e1e8ec;
  border-radius: 7px;
  text-align: left;
  cursor: pointer;
}

.ai-training-version-history > div > button.active {
  background: #edf8f5;
  border-color: #85c4b8;
  box-shadow: inset 3px 0 #0a8375;
}

/* v685 AI 工作台收敛：双报告、双资料入口、附件解析与训练审校 */
.ai-document-template-rail {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ai-document-template-rail > button {
  min-height: 112px;
}

.ai-document-input-modes {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ai-document-attachment-box {
  min-width: 0;
  padding: 12px;
  display: grid;
  gap: 10px;
  background: #f5f9fb;
  border: 1px dashed #afc9d5;
  border-radius: 8px;
}

.ai-document-attachment-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ai-document-attachment-head > div:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.ai-document-attachment-head span {
  color: #315268;
  font-size: 10px;
  font-weight: 900;
}

.ai-document-attachment-head small {
  color: #738996;
  font-size: 8px;
  line-height: 1.55;
}

.ai-document-attachment-head > div:last-child {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
}

.ai-document-attachment-head button {
  min-height: 32px;
  padding: 6px 10px;
  color: #0a776d;
  background: #fff;
  border: 1px solid #9dcfc6;
  border-radius: 6px;
  font: inherit;
  font-size: 9px;
  font-weight: 900;
  cursor: pointer;
}

.ai-document-attachment-head button:disabled {
  cursor: wait;
  opacity: 0.5;
}

.ai-document-attachment-list {
  display: grid;
  gap: 6px;
}

.ai-document-attachment-list > article {
  min-width: 0;
  padding: 7px 8px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #d9e5ea;
  border-radius: 7px;
}

.ai-document-attachment-list > article.status-running,
.ai-document-attachment-list > article.status-queued {
  background: #f0f8fb;
  border-color: #a9d0df;
}

.ai-document-attachment-list > article.status-succeeded {
  background: #f1faf7;
  border-color: #a8d6cd;
}

.ai-document-attachment-list > article.status-failed {
  background: #fff7f7;
  border-color: #e2b6ba;
}

.ai-document-attachment-list article > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #087c70;
  background: #e1f2ef;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 900;
}

.ai-document-attachment-list article > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ai-document-attachment-list strong,
.ai-document-attachment-list small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-document-attachment-list strong {
  color: #28475c;
  font-size: 9px;
}

.ai-document-attachment-list small,
.ai-document-attachment-list > p {
  margin: 0;
  color: #768b98;
  font-size: 8px;
}

.ai-document-attachment-list em {
  color: #a14b53;
  font-size: 8px;
  font-style: normal;
}

.ai-document-attachment-list button {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #9d5158;
  background: #fff;
  border: 1px solid #ead4d6;
  border-radius: 6px;
  cursor: pointer;
}

.ai-provider-capabilities {
  margin: 0;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  border: 1px solid #c9dbe6;
  border-radius: 8px;
}

.ai-provider-capabilities legend {
  padding: 0 5px;
  color: #627a8e;
  font-size: 9px;
  font-weight: 900;
}

.ai-provider-capabilities label {
  padding: 7px;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  background: #f8fbfc;
  border: 1px solid #e0e8ec;
  border-radius: 6px;
}

.ai-provider-capabilities input {
  width: 15px;
  min-height: 15px;
  accent-color: #0a8375;
}

.ai-provider-capabilities span {
  display: grid;
  gap: 2px;
}

.ai-provider-capabilities strong {
  color: #294a60;
  font-size: 9px;
}

.ai-provider-capabilities small {
  color: #7b8f9c;
  font-size: 7px;
  line-height: 1.45;
}

.ai-route-capability-warning {
  grid-column: 1 / -1;
  margin: 0;
  padding: 6px 8px;
  color: #9b5a18;
  background: #fff8e7;
  border: 1px solid #efd7a0;
  border-radius: 6px;
  font-size: 8px;
}

.ai-training-document-review,
.ai-training-test-panel {
  margin-top: 12px;
  padding: 13px;
  display: grid;
  gap: 10px;
  background: #fff;
  border: 1px solid #b7d7d1;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(24, 59, 78, 0.05);
}

.ai-training-document-review > header,
.ai-training-test-panel > header,
.ai-training-document-review > footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ai-training-document-review header > div,
.ai-training-test-panel > header {
  min-width: 0;
}

.ai-training-document-review header > div {
  display: grid;
  gap: 2px;
}

.ai-training-document-review header span,
.ai-training-test-panel header span {
  color: #0a8073;
  font-size: 8px;
  font-weight: 900;
}

.ai-training-document-review header strong,
.ai-training-test-panel header strong {
  color: #294a60;
  font-size: 11px;
}

.ai-training-document-review header small {
  color: #798d99;
  font-size: 8px;
}

.ai-training-document-review > label {
  display: grid;
  gap: 5px;
  color: #5e7685;
  font-size: 8px;
  font-weight: 900;
}

.ai-training-document-review textarea {
  width: 100%;
  min-width: 0;
  padding: 10px;
  color: #29465a;
  background: #fbfdfe;
  border: 1px solid #cadbe3;
  border-radius: 7px;
  resize: vertical;
  font: 9px/1.7 "PingFang SC", "Microsoft YaHei", sans-serif;
}

.ai-training-document-review button,
.ai-training-test-panel button {
  min-height: 30px;
}

.ai-training-document-review > footer > span,
.ai-training-test-panel > p {
  margin: 0;
  color: #768a96;
  font-size: 8px;
  line-height: 1.6;
}

.ai-training-document-review > footer > div {
  display: flex;
  gap: 6px;
}

.ai-training-test-panel {
  border-color: #d8e2e7;
}

.ai-training-test-panel > pre {
  max-height: 320px;
  margin: 0;
  padding: 10px;
  overflow: auto;
  color: #29475b;
  background: #f7fafb;
  border-left: 3px solid #0a8375;
  white-space: pre-wrap;
  word-break: break-word;
  font: 8px/1.65 "PingFang SC", "Microsoft YaHei", sans-serif;
}

.ai-training-test-panel .running {
  display: grid;
  gap: 5px;
  color: #3e6377;
  font-size: 8px;
}

.ai-training-test-panel .running > span {
  height: 4px;
  overflow: hidden;
  background: #e3ecef;
  border-radius: 99px;
}

.ai-training-test-panel .running i {
  height: 100%;
  display: block;
  background: #0a8375;
}

@media (max-width: 760px) {
  .ai-document-template-rail,
  .ai-document-input-modes,
  .ai-provider-capabilities {
    grid-template-columns: 1fr;
  }

  .ai-document-attachment-head,
  .ai-training-document-review > footer {
    align-items: stretch;
    flex-direction: column;
  }
}

.ai-training-version-history button > i {
  width: 7px;
  height: 7px;
  background: #97a7b2;
  border-radius: 50%;
}

.ai-training-version-history button > i.publish {
  background: #0a907e;
}

.ai-training-version-history button > i.rollback {
  background: #c28a32;
}

/* v686 附件入口收纳、技能训练流程简化与员工版本隔离 */
.ai-document-attachment-shell {
  min-width: 0;
  display: grid;
  justify-items: start;
  gap: 8px;
}

.ai-document-attachment-trigger {
  width: fit-content;
  min-width: 158px;
  min-height: 40px;
  padding: 7px 10px;
  display: grid;
  grid-template-columns: 24px auto auto auto;
  align-items: center;
  gap: 7px;
  color: #34566b;
  background: #fff;
  border: 1px solid #c6d9e2;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(28, 58, 76, 0.04);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: 160ms ease;
}

.ai-document-attachment-trigger:hover,
.ai-document-attachment-trigger:focus-visible,
.ai-document-attachment-shell.expanded .ai-document-attachment-trigger {
  color: #08776d;
  background: #f1faf8;
  border-color: #8fc9be;
  outline: none;
  box-shadow: 0 0 0 3px rgba(10, 131, 117, 0.08);
}

.ai-document-attachment-trigger > strong {
  font-size: 9px;
  white-space: nowrap;
}

.ai-document-attachment-trigger > small {
  color: #7c909d;
  font-size: 8px;
  white-space: nowrap;
}

.ai-document-attachment-trigger > i {
  color: #79909e;
  font-size: 7px;
  font-style: normal;
  white-space: nowrap;
}

.ai-document-attachment-mark {
  width: 12px;
  height: 19px;
  position: relative;
  justify-self: center;
  border: 2px solid currentColor;
  border-radius: 7px;
  transform: rotate(38deg);
}

.ai-document-attachment-mark::after {
  content: "";
  width: 5px;
  height: 12px;
  position: absolute;
  left: 2px;
  top: 2px;
  border: 1.5px solid currentColor;
  border-radius: 5px;
}

.ai-document-attachment-shell > .ai-document-attachment-box {
  width: 100%;
  animation: ai-attachment-reveal 160ms ease-out both;
}

@keyframes ai-attachment-reveal {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.ai-training-simple-guide {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.ai-training-simple-guide > article {
  min-width: 0;
  padding: 9px;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  background: #f7fafb;
  border: 1px solid #dce6eb;
  border-radius: 9px;
}

.ai-training-simple-guide > article.active {
  background: #eef8f6;
  border-color: #a8d1c9;
}

.ai-training-simple-guide b {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #1c4057;
  border-radius: 7px;
  font-size: 9px;
}

.ai-training-simple-guide article.active b {
  background: #0a8375;
}

.ai-training-simple-guide span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ai-training-simple-guide strong {
  color: #294a60;
  font-size: 9px;
}

.ai-training-simple-guide small {
  overflow: hidden;
  color: #7b8f9c;
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-training-version-explainer {
  padding: 11px 13px;
  display: grid;
  grid-template-columns: minmax(110px, auto) 22px minmax(110px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  background: #f7fafb;
  border: 1px solid #dbe5ea;
  border-radius: 10px;
}

.ai-training-version-explainer.has-draft {
  background: #fff9e9;
  border-color: #ecd69d;
}

.ai-training-version-explainer > div {
  display: grid;
  gap: 2px;
}

.ai-training-version-explainer span {
  color: #738996;
  font-size: 7px;
  font-weight: 900;
}

.ai-training-version-explainer strong {
  color: #1d4057;
  font-size: 11px;
}

.ai-training-version-explainer > i {
  color: #8ba0ac;
  font-size: 13px;
  font-style: normal;
  text-align: center;
}

.ai-training-version-explainer > p {
  margin: 0;
  color: #6c818f;
  font-size: 8px;
  line-height: 1.55;
}

.ai-training-simple-details {
  min-width: 0;
  background: #fff;
  border: 1px solid #d8e3e8;
  border-radius: 11px;
}

.ai-training-simple-details > summary,
.ai-training-side-details > summary {
  padding: 11px 13px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  list-style: none;
}

.ai-training-simple-details > summary::-webkit-details-marker,
.ai-training-side-details > summary::-webkit-details-marker {
  display: none;
}

.ai-training-simple-details > summary > span {
  padding: 4px 7px;
  color: #08766b;
  background: #e5f4f1;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 900;
}

.ai-training-simple-details > summary > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ai-training-simple-details > summary strong {
  color: #27485e;
  font-size: 10px;
}

.ai-training-simple-details > summary small,
.ai-training-simple-details > summary > i {
  color: #7a8e9a;
  font-size: 8px;
  font-style: normal;
}

.ai-training-simple-details[open] > summary {
  border-bottom: 1px solid #e0e8ec;
}

.ai-training-simple-details[open] > summary > i {
  font-size: 0;
}

.ai-training-simple-details[open] > summary > i::after {
  content: "收起";
  font-size: 8px;
}

.ai-training-simple-details-body {
  padding: 12px;
  display: grid;
  gap: 12px;
}

.ai-training-publish-card > p {
  margin: 6px 0 0;
  padding: 7px 8px;
  color: #667d8b;
  background: #f3f7f9;
  border-radius: 7px;
  font-size: 7.5px;
  line-height: 1.55;
}

.ai-training-publish-card > p.has-draft {
  color: #805f1c;
  background: #fff4d7;
}

.ai-training-side-details {
  min-width: 0;
  background: #fff;
  border: 1px solid #dbe4e9;
  border-radius: 10px;
}

.ai-training-side-details > summary {
  grid-template-columns: minmax(0, 1fr) auto;
}

.ai-training-side-details > summary span {
  color: #294a61;
  font-size: 9px;
  font-weight: 900;
}

.ai-training-side-details > summary small {
  color: #7b8e9a;
  font-size: 7px;
}

.ai-training-side-details[open] > summary {
  border-bottom: 1px solid #e1e8ec;
}

.ai-training-side-details > div {
  padding: 9px;
}

.ai-training-side-details-body {
  display: grid;
  gap: 9px;
}

.ai-training-side-details-body > section {
  min-width: 0;
  padding: 10px;
  background: #fbfdfe;
  border: 1px solid #e1e8ec;
  border-radius: 8px;
}

@media (max-width: 1180px) {
  .ai-training-simple-guide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-training-version-explainer {
    grid-template-columns: 1fr 22px 1fr;
  }

  .ai-training-version-explainer > p {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .ai-document-attachment-trigger {
    width: 100%;
    grid-template-columns: 24px auto 1fr auto;
  }

  .ai-training-simple-guide,
  .ai-training-version-explainer {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-training-version-explainer > i {
    transform: rotate(90deg);
  }
}

/* v687 客户购房双卡：轻量事实输入、内外信息隔离与图片式预览 */
.ai-buyer-dual-output-note {
  min-width: 0;
  padding: 11px 13px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 3px 10px;
  color: #31566b;
  background: #eef8f6;
  border: 1px solid #abd4cc;
  border-radius: 9px;
}

.ai-buyer-dual-output-note > span {
  grid-row: 1 / 3;
  padding: 6px 9px;
  color: #fff;
  background: #0a8375;
  border-radius: 7px;
  font-size: 8px;
  font-weight: 900;
}

.ai-buyer-dual-output-note > strong {
  font-size: 10px;
}

.ai-buyer-dual-output-note > small {
  color: #748a97;
  font-size: 8px;
}

.ai-buyer-fact-panel {
  min-width: 0;
  padding: 13px;
  display: grid;
  gap: 12px;
  background: #f8fbfc;
  border: 1px solid #d3e1e7;
  border-radius: 11px;
}

.ai-buyer-fact-panel > header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.ai-buyer-fact-panel > header > div {
  display: grid;
  gap: 2px;
}

.ai-buyer-fact-panel > header span {
  color: #0a8375;
  font-size: 8px;
  font-weight: 900;
}

.ai-buyer-fact-panel > header strong {
  color: #213f54;
  font-size: 12px;
}

.ai-buyer-fact-panel > header p {
  margin: 0;
  color: #748995;
  font-size: 8px;
}

.ai-buyer-fact-panel > div {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ai-buyer-fact-panel label {
  min-width: 0;
}

.ai-buyer-fact-panel textarea {
  min-height: 78px;
  background: #fff;
}

.ai-buyer-fact-panel label.wide {
  grid-column: 1 / -1;
}

.ai-buyer-dual-card-preview {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.ai-buyer-card {
  min-width: 0;
  padding: 22px;
  display: grid;
  gap: 16px;
  color: #34566a;
  background: #eef4f6;
  border: 1px solid #bfd3dc;
  border-top: 5px solid #153b53;
  border-radius: 4px;
  box-shadow: 0 14px 34px rgba(26, 58, 76, 0.08);
}

.ai-buyer-card.customer {
  color: #475b67;
  background: #fbf7ef;
  border-color: #d9caa7;
  border-top-color: #ad873c;
}

.ai-buyer-card-title {
  min-width: 0;
  padding-bottom: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(59, 91, 109, 0.2);
}

.ai-buyer-card-title > div {
  min-width: 0;
}

.ai-buyer-card-title span {
  color: #0a8375;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.ai-buyer-card.customer .ai-buyer-card-title span {
  color: #9b762f;
}

.ai-buyer-card-title h2 {
  margin: 5px 0 4px;
  color: #17374d;
  font: 900 22px/1.25 "Songti SC", "STSong", "PingFang SC", sans-serif;
}

.ai-buyer-card-title p {
  max-width: 760px;
  margin: 0;
  color: #657d8b;
  font-size: 10px;
  line-height: 1.6;
}

.ai-buyer-card-title > b {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #0a8375;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 900;
}

.ai-buyer-card.customer .ai-buyer-card-title > b {
  background: #ad873c;
}

.ai-buyer-card-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.ai-buyer-card-block {
  min-width: 0;
  padding: 13px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #cddde3;
  border-radius: 10px;
}

.ai-buyer-card.customer .ai-buyer-card-block {
  background: rgba(255, 253, 249, 0.94);
  border-color: #dfd3b8;
}

.ai-buyer-card-block.wide {
  grid-column: span 2;
}

.ai-buyer-card-block > header {
  margin-bottom: 9px;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
}

.ai-buyer-card-block > header span {
  width: 27px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #0a8375;
  border-radius: 6px;
  font-size: 8px;
  font-weight: 900;
}

.ai-buyer-card.customer .ai-buyer-card-block > header span {
  background: #ad873c;
}

.ai-buyer-card-block > header strong {
  color: #24465b;
  font-size: 11px;
}

.ai-buyer-card-block p,
.ai-buyer-card-block li,
.ai-buyer-card-block dd,
.ai-buyer-card-block small {
  color: #536d7b;
  font-size: 9px;
  line-height: 1.65;
}

.ai-buyer-card-block p {
  margin: 0;
}

.ai-buyer-card-block ul {
  margin: 0;
  padding-left: 17px;
}

.ai-buyer-card-block dl {
  margin: 0;
  display: grid;
  gap: 8px;
}

.ai-buyer-card-block dl > div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
}

.ai-buyer-card-block dt,
.ai-buyer-priority > span,
.ai-buyer-strategy > span {
  color: #0a8375;
  font-size: 8px;
  font-weight: 900;
}

.ai-buyer-card.customer .ai-buyer-card-block dt,
.ai-buyer-card.customer .ai-buyer-priority > span {
  color: #9c772f;
}

.ai-buyer-card-block dd {
  margin: 0;
}

.ai-buyer-grade-line {
  display: block;
  margin-bottom: 5px;
  color: #0a8375;
  font-size: 17px;
}

.ai-buyer-priority,
.ai-buyer-strategy {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: start;
  gap: 6px 10px;
}

.ai-buyer-directions,
.ai-buyer-comparisons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ai-buyer-directions > article,
.ai-buyer-comparisons > article {
  min-width: 0;
  padding: 9px;
  background: #fffaf0;
  border-left: 3px solid #ad873c;
  border-radius: 6px;
}

.ai-buyer-directions strong,
.ai-buyer-comparisons strong {
  display: block;
  margin-bottom: 4px;
  color: #29485b;
  font-size: 9px;
}

.ai-buyer-directions small,
.ai-buyer-comparisons small {
  display: block;
  margin-top: 4px;
  color: #8b7652;
}

.ai-buyer-next-step {
  margin-top: 9px !important;
  padding: 8px;
  color: #fff !important;
  background: #ad873c;
  border-radius: 7px;
  font-weight: 800;
}

.ai-buyer-card > footer {
  padding-top: 10px;
  color: #758b97;
  border-top: 1px solid rgba(59, 91, 109, 0.18);
  font-size: 8px;
  line-height: 1.6;
}

.ai-buyer-card.customer > footer {
  color: #857a64;
}

@media (max-width: 1180px) {
  .ai-buyer-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-buyer-card-block.wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .ai-buyer-fact-panel > header,
  .ai-buyer-card-title {
    align-items: stretch;
    flex-direction: column;
  }

  .ai-buyer-fact-panel > div,
  .ai-buyer-card-grid,
  .ai-buyer-directions,
  .ai-buyer-comparisons {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-buyer-card-block.wide {
    grid-column: auto;
  }

  .ai-buyer-card {
    padding: 14px;
  }
}

.ai-buyer-output-card {
  width: 100%;
  aspect-ratio: 210 / 297;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.ai-buyer-output-card.ai-buyer-a4-card {
  width: 794px;
  height: 1123px;
  aspect-ratio: auto;
  margin: 0;
  box-shadow: none;
}

.ai-buyer-output-card .ai-buyer-card-title,
.ai-buyer-output-card .ai-buyer-card-grid,
.ai-buyer-output-card .ai-buyer-card-block,
.ai-buyer-output-card > footer {
  min-height: 0;
}

.ai-buyer-output-card .ai-buyer-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  overflow: hidden;
}

.ai-buyer-output-card .ai-buyer-card-block {
  overflow: hidden;
}

.ai-buyer-output-card .ai-buyer-card-title,
.ai-buyer-output-card .ai-buyer-card-block,
.ai-buyer-output-card .ai-buyer-card-block p,
.ai-buyer-output-card .ai-buyer-card-block li,
.ai-buyer-output-card .ai-buyer-card-block dd,
.ai-buyer-output-card .ai-buyer-card-block small {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ai-buyer-output-card .ai-buyer-card-block.wide {
  grid-column: span 2;
}

.ai-buyer-output-card.ai-buyer-density-compact {
  padding: 18px;
  gap: 12px;
}

.ai-buyer-output-card.ai-buyer-density-compact .ai-buyer-card-title {
  padding-bottom: 10px;
}

.ai-buyer-output-card.ai-buyer-density-compact .ai-buyer-card-title h2 {
  margin: 3px 0;
  font-size: 20px;
}

.ai-buyer-output-card.ai-buyer-density-compact .ai-buyer-card-title p {
  font-size: 9px;
  line-height: 1.48;
}

.ai-buyer-output-card.ai-buyer-density-compact .ai-buyer-card-title > b {
  width: 52px;
  height: 52px;
  flex-basis: 52px;
}

.ai-buyer-output-card.ai-buyer-density-compact .ai-buyer-card-grid {
  gap: 8px;
}

.ai-buyer-output-card.ai-buyer-density-compact .ai-buyer-card-block {
  padding: 10px;
}

.ai-buyer-output-card.ai-buyer-density-compact .ai-buyer-card-block > header {
  margin-bottom: 6px;
}

.ai-buyer-output-card.ai-buyer-density-compact .ai-buyer-card-block p,
.ai-buyer-output-card.ai-buyer-density-compact .ai-buyer-card-block li,
.ai-buyer-output-card.ai-buyer-density-compact .ai-buyer-card-block dd,
.ai-buyer-output-card.ai-buyer-density-compact .ai-buyer-card-block small {
  font-size: 8.2px;
  line-height: 1.48;
}

.ai-buyer-output-card.ai-buyer-density-compact .ai-buyer-directions,
.ai-buyer-output-card.ai-buyer-density-compact .ai-buyer-comparisons {
  gap: 5px;
}

.ai-buyer-output-card.ai-buyer-density-compact .ai-buyer-directions > article,
.ai-buyer-output-card.ai-buyer-density-compact .ai-buyer-comparisons > article {
  padding: 7px;
}

.ai-buyer-output-card.ai-buyer-density-tight {
  padding: 15px;
  gap: 9px;
}

.ai-buyer-output-card.ai-buyer-density-tight .ai-buyer-card-title {
  padding-bottom: 8px;
}

.ai-buyer-output-card.ai-buyer-density-tight .ai-buyer-card-title h2 {
  margin: 2px 0;
  font-size: 18px;
}

.ai-buyer-output-card.ai-buyer-density-tight .ai-buyer-card-title p {
  font-size: 8px;
  line-height: 1.4;
}

.ai-buyer-output-card.ai-buyer-density-tight .ai-buyer-card-title > b {
  width: 46px;
  height: 46px;
  flex-basis: 46px;
  border-radius: 13px;
  font-size: 16px;
}

.ai-buyer-output-card.ai-buyer-density-tight .ai-buyer-card-grid {
  gap: 6px;
}

.ai-buyer-output-card.ai-buyer-density-tight .ai-buyer-card-block {
  padding: 8px;
  border-radius: 8px;
}

.ai-buyer-output-card.ai-buyer-density-tight .ai-buyer-card-block > header {
  margin-bottom: 4px;
  gap: 5px;
}

.ai-buyer-output-card.ai-buyer-density-tight .ai-buyer-card-block > header span {
  width: 24px;
  height: 21px;
}

.ai-buyer-output-card.ai-buyer-density-tight .ai-buyer-card-block > header strong {
  font-size: 10px;
}

.ai-buyer-output-card.ai-buyer-density-tight .ai-buyer-card-block p,
.ai-buyer-output-card.ai-buyer-density-tight .ai-buyer-card-block li,
.ai-buyer-output-card.ai-buyer-density-tight .ai-buyer-card-block dd,
.ai-buyer-output-card.ai-buyer-density-tight .ai-buyer-card-block small {
  font-size: 7.4px;
  line-height: 1.4;
}

.ai-buyer-output-card.ai-buyer-density-tight .ai-buyer-priority,
.ai-buyer-output-card.ai-buyer-density-tight .ai-buyer-strategy {
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 4px 7px;
}

.ai-buyer-output-card.ai-buyer-density-tight .ai-buyer-directions,
.ai-buyer-output-card.ai-buyer-density-tight .ai-buyer-comparisons {
  gap: 4px;
}

.ai-buyer-output-card.ai-buyer-density-tight .ai-buyer-directions > article,
.ai-buyer-output-card.ai-buyer-density-tight .ai-buyer-comparisons > article {
  padding: 5px;
}

.ai-buyer-output-card.ai-buyer-density-ultra {
  padding: 12px;
  gap: 7px;
}

.ai-buyer-output-card.ai-buyer-density-ultra .ai-buyer-card-title {
  padding-bottom: 6px;
}

.ai-buyer-output-card.ai-buyer-density-ultra .ai-buyer-card-title h2 {
  margin: 1px 0;
  font-size: 16px;
}

.ai-buyer-output-card.ai-buyer-density-ultra .ai-buyer-card-title p {
  font-size: 7px;
  line-height: 1.32;
}

.ai-buyer-output-card.ai-buyer-density-ultra .ai-buyer-card-title > b {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
  border-radius: 11px;
  font-size: 14px;
}

.ai-buyer-output-card.ai-buyer-density-ultra .ai-buyer-card-grid {
  gap: 4px;
}

.ai-buyer-output-card.ai-buyer-density-ultra .ai-buyer-card-block {
  padding: 6px;
  border-radius: 7px;
}

.ai-buyer-output-card.ai-buyer-density-ultra .ai-buyer-card-block > header {
  margin-bottom: 3px;
  gap: 4px;
}

.ai-buyer-output-card.ai-buyer-density-ultra .ai-buyer-card-block > header span {
  width: 21px;
  height: 18px;
  font-size: 7px;
}

.ai-buyer-output-card.ai-buyer-density-ultra .ai-buyer-card-block > header strong {
  font-size: 9px;
}

.ai-buyer-output-card.ai-buyer-density-ultra .ai-buyer-card-block p,
.ai-buyer-output-card.ai-buyer-density-ultra .ai-buyer-card-block li,
.ai-buyer-output-card.ai-buyer-density-ultra .ai-buyer-card-block dd,
.ai-buyer-output-card.ai-buyer-density-ultra .ai-buyer-card-block small {
  font-size: 6.4px;
  line-height: 1.32;
}

.ai-buyer-output-card.ai-buyer-density-ultra .ai-buyer-card-block ul {
  padding-left: 12px;
}

.ai-buyer-output-card.ai-buyer-density-ultra .ai-buyer-priority,
.ai-buyer-output-card.ai-buyer-density-ultra .ai-buyer-strategy {
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 3px 5px;
}

.ai-buyer-output-card.ai-buyer-density-ultra .ai-buyer-directions,
.ai-buyer-output-card.ai-buyer-density-ultra .ai-buyer-comparisons {
  gap: 3px;
}

.ai-buyer-output-card.ai-buyer-density-ultra .ai-buyer-directions > article,
.ai-buyer-output-card.ai-buyer-density-ultra .ai-buyer-comparisons > article {
  padding: 4px;
}

.ai-training-version-history button > span {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.ai-training-version-history button strong,
.ai-training-version-history button small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-training-version-history button strong {
  font-size: 8px;
}

.ai-training-version-history button small,
.ai-training-version-history button time,
.ai-training-version-history .empty {
  color: #81929d;
  font-size: 7px;
}

.ai-training-version-compare {
  min-width: 0;
  padding: 16px;
  display: grid;
  gap: 13px;
  background: #fbfcfd;
  border: 1px solid #cbdbe3;
  border-top: 3px solid #173f56;
  border-radius: 10px;
}

.ai-training-version-compare.loading,
.ai-training-version-compare.error {
  min-height: 90px;
  place-content: center;
  text-align: center;
  color: #647d8d;
}

.ai-training-version-compare > header,
.ai-training-version-compare > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-training-version-compare > header > div {
  display: grid;
  gap: 2px;
}

.ai-training-version-compare > header span {
  color: #0a8375;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.ai-training-version-compare > header strong {
  color: #173c54;
  font: 700 14px/1.3 Georgia, "Songti SC", serif;
}

.ai-training-version-compare > header small {
  color: #748995;
  font-size: 8px;
}

.ai-training-version-diff-ledger {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.ai-training-version-diff-ledger article {
  min-width: 0;
  padding: 8px;
  display: grid;
  gap: 3px;
  background: #fff;
  border: 1px solid #e0e7eb;
  border-radius: 7px;
}

.ai-training-version-diff-ledger article.changed {
  background: #fff9ed;
  border-color: #ead09b;
}

.ai-training-version-diff-ledger article > span {
  color: #718691;
  font-size: 7px;
}

.ai-training-version-diff-ledger article > strong {
  color: #35546a;
  font-size: 8px;
}

.ai-training-version-diff-ledger article.changed > strong {
  color: #9a671d;
}

.ai-training-version-diff-ledger article > small {
  max-height: 56px;
  overflow: hidden;
  color: #7d8d96;
  font-size: 6.5px;
  line-height: 1.45;
}

.ai-training-version-prompt-diff {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid #d9e3e8;
  border-radius: 8px;
  overflow: hidden;
}

.ai-training-version-prompt-diff article {
  min-width: 0;
  padding: 10px;
  background: #fff;
}

/* v701: customer buyer facts and text-only dual-card archive. */
.customer-buyer-facts-section,
.customer-buyer-archive-section {
  display: grid;
  gap: 14px;
}

.customer-buyer-section-heading {
  min-width: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.customer-buyer-section-heading > div {
  min-width: 0;
}

.customer-buyer-section-heading .eyebrow {
  margin: 0 0 3px;
  color: #07877a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}

.customer-buyer-section-heading h3 {
  margin: 0;
  color: #16354a;
  font-size: 18px;
}

.customer-buyer-section-heading > span {
  color: #758b99;
  font-size: 12px;
  line-height: 1.5;
  text-align: right;
}

.customer-buyer-facts-form {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d5e3ea;
  border-radius: 12px;
  background: #fbfdfe;
}

.customer-buyer-facts-form label {
  min-width: 0;
  margin: 0;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: minmax(145px, .48fr) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid #dfe9ee;
}

.customer-buyer-facts-form label:last-child {
  border-bottom: 0;
}

.customer-buyer-facts-form label > span {
  color: #2b536a;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.customer-buyer-facts-form textarea {
  width: 100%;
  min-width: 0;
  min-height: 64px;
  padding: 10px 12px;
  resize: vertical;
  color: #17354a;
  background: #fff;
  border: 1px solid #cbdde6;
  border-radius: 9px;
  line-height: 1.55;
}

.customer-buyer-facts-form textarea:focus {
  border-color: #078c7f;
  box-shadow: 0 0 0 3px rgba(7, 140, 127, .1);
  outline: 0;
}

.customer-buyer-facts-form textarea:disabled {
  color: #617783;
  background: #f2f6f8;
}

.customer-buyer-facts-save {
  justify-self: end;
}

.customer-buyer-card-archive {
  min-width: 0;
  display: grid;
  gap: 9px;
}

.customer-buyer-card-archive-empty,
.customer-buyer-card-archive-item {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #d5e4e9;
  border-radius: 11px;
  background: #f9fcfc;
}

.customer-buyer-card-archive-empty {
  display: grid;
  gap: 4px;
  color: #728692;
}

.customer-buyer-card-archive-empty strong {
  color: #31566a;
}

.customer-buyer-card-archive-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-left: 4px solid #0a8b7d;
}

.customer-buyer-card-archive-item > div:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.customer-buyer-card-archive-item strong,
.customer-buyer-card-archive-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-buyer-card-archive-item strong {
  color: #17364b;
  font-size: 13px;
}

.customer-buyer-card-archive-item span {
  color: #7a8f9b;
  font-size: 11px;
}

.customer-buyer-card-archive-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.customer-buyer-card-viewer {
  position: fixed;
  z-index: 1500;
  inset: 0;
  padding: 24px;
  display: none;
  place-items: center;
  background: rgba(9, 28, 41, .68);
  backdrop-filter: blur(6px);
}

.customer-buyer-card-viewer.visible {
  display: grid;
}

.customer-buyer-card-viewer > section {
  width: min(930px, 96vw);
  max-height: 94vh;
  overflow: auto;
  padding: 18px;
  background: #eef4f6;
  border: 1px solid #c6d9e2;
  border-radius: 16px;
  box-shadow: 0 28px 80px rgba(5, 24, 37, .28);
}

.customer-buyer-card-viewer > section > header {
  position: sticky;
  z-index: 2;
  top: -18px;
  margin: -18px -18px 16px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid #d5e2e8;
}

.customer-buyer-card-viewer > section > header .eyebrow {
  margin: 0 0 2px;
  color: #07877a;
}

.customer-buyer-card-viewer > section > header h2 {
  margin: 0;
  color: #17364b;
  font-size: 20px;
}

#customerBuyerCardViewerContent {
  width: min(794px, 100%);
  margin: 0 auto;
}

#customerBuyerCardViewerContent .ai-buyer-output-card {
  width: 100%;
  min-width: 0;
  box-shadow: 0 12px 34px rgba(18, 52, 72, .12);
}

.ai-buyer-archive-action {
  flex: 1 1 100%;
  min-width: 0;
  padding-top: 10px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #d8e4e9;
}

.ai-buyer-archive-action select {
  width: 100%;
  min-width: 0;
}

.ai-buyer-archive-action small {
  grid-column: 1 / -1;
  color: #6f8794;
  font-size: 11px;
}

@media (max-width: 760px) {
  .customer-buyer-section-heading,
  .customer-buyer-card-archive-item {
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr);
  }

  .customer-buyer-section-heading {
    display: grid;
  }

  .customer-buyer-section-heading > span {
    text-align: left;
  }

  .customer-buyer-facts-form label {
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
  }

  .customer-buyer-card-archive-actions {
    flex-wrap: wrap;
  }

  .customer-buyer-card-viewer {
    padding: 8px;
  }

  .customer-buyer-card-viewer > section {
    width: 100%;
    padding: 10px;
  }

  .customer-buyer-card-viewer > section > header {
    top: -10px;
    margin: -10px -10px 10px;
  }

  .ai-buyer-archive-action {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-buyer-archive-action small {
    grid-column: auto;
  }
}

.ai-training-version-prompt-diff article + article {
  border-left: 1px solid #d9e3e8;
  background: #f8fbfc;
}

.ai-training-version-prompt-diff span {
  display: block;
  margin-bottom: 7px;
  color: #0a7c70;
  font-size: 8px;
  font-weight: 900;
}

.ai-training-version-prompt-diff pre {
  max-height: 280px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #365268;
  font: 7.5px/1.65 "PingFang SC", "Microsoft YaHei", sans-serif;
}

.ai-training-version-compare > footer {
  padding-top: 10px;
  border-top: 1px solid #e0e7eb;
}

.ai-training-version-compare > footer > span {
  max-width: 70%;
  color: #738793;
  font-size: 7px;
  line-height: 1.55;
}

.ai-training-version-compare > footer > button {
  padding: 8px 11px;
  color: #fff;
  background: #a34348;
  border: 0;
  border-radius: 7px;
  font-size: 8px;
  font-weight: 900;
  cursor: pointer;
}

.ai-training-inspector .ai-training-basics {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.ai-training-inspector .ai-training-basics > header {
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-training-inspector .ai-training-basics > header span {
  color: #0a8073;
  font-size: 8px;
  font-weight: 900;
}

.ai-training-inspector .ai-training-basics > header strong {
  color: #294a61;
  font-size: 10px;
}

.ai-training-inspector .ai-training-basics input,
.ai-training-inspector .ai-training-basics textarea {
  width: 100%;
  min-width: 0;
  padding: 8px 9px;
  color: #28485e;
  background: #fbfcfd;
  border: 1px solid #cddce4;
  border-radius: 7px;
  resize: vertical;
  outline: none;
  font: 8px/1.55 "PingFang SC", "Microsoft YaHei", sans-serif;
}

.ai-training-cover-setting {
  display: grid;
  gap: 4px;
  background: linear-gradient(135deg, #0f2638, #183f55) !important;
}

.ai-training-cover-setting > strong {
  color: #fff;
  font: 700 14px/1.3 Georgia, "Songti SC", serif;
}

.ai-training-cover-setting > small {
  color: #aebdc7;
  font-size: 8px;
  line-height: 1.55;
}

.ai-training-inspector .ai-training-structure,
.ai-training-inspector .ai-training-libraries {
  padding: 12px;
}

.ai-training-inspector .ai-training-sections {
  max-height: 310px;
  overflow: auto;
}

.ai-training-inspector .ai-training-sections label {
  min-height: 34px;
  padding: 6px;
  grid-template-columns: 22px minmax(0, 1fr) 16px auto;
  font-size: 8px;
}

.ai-training-inspector .ai-training-rules {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ai-training-inspector .ai-training-rules input {
  min-height: 34px;
  padding: 6px 7px;
}

.ai-training-inspector .ai-training-libraries > div {
  grid-template-columns: minmax(0, 1fr);
}

.ai-training-center.workbuddy .ai-training-example-form {
  grid-template-columns: minmax(130px, 0.6fr) repeat(2, minmax(0, 1fr)) auto;
}

@media (max-width: 1500px) {
  .ai-training-center.workbuddy {
    grid-template-columns: 214px minmax(0, 1fr);
  }

  .ai-training-inspector {
    grid-column: 2;
    padding: 14px 22px 22px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid #dce5ea;
    border-left: 0;
  }

  .ai-training-inspector .ai-training-structure,
  .ai-training-inspector .ai-training-libraries {
    grid-row: span 2;
  }
}

@media (max-width: 980px) {
  .ai-training-center.workbuddy {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-training-center.workbuddy .ai-training-sidebar,
  .ai-training-center.workbuddy .ai-training-editor,
  .ai-training-center.workbuddy .ai-training-inspector {
    grid-column: 1;
  }

  .ai-training-inspector {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-training-command,
  .ai-training-center.workbuddy .ai-training-example-form,
  .ai-training-version-prompt-diff {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-training-version-prompt-diff article + article {
    border-top: 1px solid #d9e3e8;
    border-left: 0;
  }

  .ai-training-version-diff-ledger {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-training-command > button {
    min-height: 58px;
  }
}

/* v688 客户购房方案：附件精简、事实单列与双卡长文本安全排版 */
.ai-document-form > .ai-buyer-dual-output-note,
.ai-document-form > .ai-buyer-fact-panel,
.ai-document-form > .ai-document-attachment-shell {
  width: 100%;
  grid-column: 1 / -1;
}

.ai-buyer-dual-output-note {
  min-height: 54px;
  padding: 10px 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 4px 12px;
}

.ai-buyer-dual-output-note > span {
  grid-row: auto;
  padding: 6px 10px;
}

.ai-buyer-dual-output-note > strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ai-buyer-dual-output-note > small {
  max-width: 230px;
  line-height: 1.45;
  text-align: right;
}

.ai-buyer-fact-panel {
  padding: 0;
  gap: 0;
  overflow: hidden;
  background: #fff;
}

.ai-buyer-fact-panel > header {
  min-height: 62px;
  padding: 12px 14px;
  align-items: center;
  background: #f4f9fa;
  border-bottom: 1px solid #dce8ed;
}

.ai-buyer-fact-panel > header > div {
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 8px;
}

.ai-buyer-fact-panel > header p {
  max-width: 260px;
  line-height: 1.45;
  text-align: right;
}

.ai-buyer-fact-panel > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.ai-buyer-fact-panel label,
.ai-buyer-fact-panel label.wide {
  min-width: 0;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: minmax(112px, 0.32fr) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border-top: 1px solid #e3ecef;
}

.ai-buyer-fact-panel label:first-child {
  border-top: 0;
}

.ai-buyer-fact-panel label > span {
  color: #34576b;
  font-size: 9px;
  line-height: 1.5;
}

.ai-buyer-fact-panel textarea {
  min-height: 58px;
  padding: 9px 11px;
  background: #fbfdfe;
  border-radius: 7px;
}

.ai-buyer-fact-panel label:last-child textarea {
  min-height: 92px;
}

.ai-document-attachment-shell {
  gap: 7px;
}

.ai-document-attachment-trigger {
  min-width: 0;
  min-height: 38px;
  padding: 7px 12px;
  grid-template-columns: 22px auto;
  gap: 7px;
}

.ai-document-attachment-trigger > strong {
  font-size: 9px;
}

.ai-document-attachment-box {
  width: 100%;
  padding: 10px;
}

.ai-document-attachment-head {
  align-items: center;
}

.ai-document-attachment-head > div:first-child {
  display: block;
}

.ai-document-attachment-head span {
  font-size: 9px;
}

@media (max-width: 760px) {
  .ai-buyer-dual-output-note {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .ai-buyer-dual-output-note > small {
    grid-column: 1 / -1;
    max-width: none;
    text-align: left;
  }

  .ai-buyer-fact-panel > header {
    align-items: flex-start;
  }

  .ai-buyer-fact-panel > header p {
    max-width: none;
    text-align: left;
  }

  .ai-buyer-fact-panel label,
  .ai-buyer-fact-panel label.wide {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .ai-document-attachment-trigger {
    width: fit-content;
    grid-template-columns: 22px auto;
  }
}

/* v689 最终覆盖：附件稳定展开、双卡说明横向可读 */
.ai-document-attachment-shell > .ai-document-attachment-box {
  animation: none;
}

.ai-document-attachment-trigger {
  transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.ai-document-attachment-trigger:hover,
.ai-document-attachment-trigger:focus-visible,
.ai-document-attachment-shell.expanded .ai-document-attachment-trigger {
  box-shadow: none;
}

.ai-document-attachment-trigger:focus-visible {
  outline: 2px solid rgba(10, 131, 117, 0.22);
  outline-offset: 2px;
}

.ai-buyer-dual-output-note {
  min-height: 0;
  padding: 11px 13px;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 7px;
}

.ai-buyer-dual-output-note > span {
  width: fit-content;
  grid-row: auto;
}

.ai-buyer-dual-output-note > div {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
}

.ai-buyer-dual-output-note > div > strong {
  min-width: 0;
  color: #294d62;
  font-size: 10px;
  line-height: 1.5;
  word-break: normal;
  overflow-wrap: break-word;
}

.ai-buyer-dual-output-note > small {
  max-width: none;
  line-height: 1.5;
  text-align: left;
}

@media (max-width: 760px) {
  .ai-buyer-dual-output-note {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* v691：客户双卡入口、经理客户看板、知识库与文档工作室视觉统一 */
.drawer-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-manager-customer-panel {
  margin-top: 15px;
  padding: 0;
  overflow: hidden;
  color: #183247;
  background: #fff;
  border: 1px solid #cddce5;
  border-top: 4px solid #122536;
  border-radius: 2px;
}

.ai-manager-customer-head {
  min-height: 104px;
  padding: 20px 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid #d9e4ea;
}

.ai-manager-customer-head > div {
  min-width: 0;
}

.ai-manager-customer-head span {
  color: #0b8577;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.ai-manager-customer-head h3 {
  margin: 5px 0 3px;
  color: #142f43;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: 25px;
  letter-spacing: 0.01em;
}

.ai-manager-customer-head p,
.ai-manager-customer-head small {
  margin: 0;
  color: #6b808d;
  font-size: 10px;
  line-height: 1.6;
}

.ai-manager-customer-head > small {
  max-width: 520px;
  padding: 9px 12px;
  color: #58727f;
  background: #f4f8fa;
  border: 1px solid #d9e4ea;
}

.ai-manager-metrics {
  padding: 16px 18px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  background: #f6f9fb;
  border-bottom: 1px solid #d9e4ea;
}

.ai-manager-metrics button {
  min-width: 0;
  min-height: 92px;
  padding: 13px 14px;
  display: grid;
  align-content: center;
  gap: 2px;
  color: #5f7582;
  text-align: left;
  background: #fff;
  border: 1px solid #cfdee6;
  border-radius: 2px;
  cursor: pointer;
}

.ai-manager-metrics button:hover,
.ai-manager-metrics button.active {
  color: #0a756a;
  background: #ecf8f5;
  border-color: #87c9bf;
  box-shadow: inset 0 -4px 0 #0b8b7c;
}

.ai-manager-metrics span {
  overflow: hidden;
  font-size: 10px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-manager-metrics strong {
  color: #163449;
  font-family: "Songti SC", "STSong", serif;
  font-size: 25px;
}

.ai-manager-metrics small {
  overflow: hidden;
  color: #7c8f99;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-manager-customer-table {
  min-width: 900px;
  overflow-x: auto;
}

.ai-manager-customer-table-head,
.ai-manager-customer-row {
  min-width: 900px;
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) minmax(90px, 0.7fr) 72px minmax(130px, 0.85fr) minmax(250px, 1.7fr) 176px;
  gap: 12px;
  align-items: center;
}

.ai-manager-customer-table-head {
  min-height: 42px;
  padding: 0 18px;
  color: #6f8490;
  background: #edf5fa;
  border-bottom: 1px solid #d4e2e9;
  font-size: 9px;
  font-weight: 900;
}

.ai-manager-customer-row {
  min-height: 63px;
  padding: 10px 18px;
  color: #526b79;
  border-bottom: 1px solid #e3ebef;
  font-size: 10px;
}

.ai-manager-customer-row:hover {
  background: #f7fbfc;
}

.ai-manager-customer-row > strong {
  overflow: hidden;
  color: #17364a;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-manager-customer-row > span,
.ai-manager-customer-row > time {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-manager-customer-row > b {
  width: 34px;
  min-height: 25px;
  display: grid;
  place-items: center;
  color: #087d70;
  background: #e2f3ef;
  border: 1px solid #c5e4de;
  font-size: 9px;
}

.ai-manager-customer-row > div {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.ai-manager-customer-row em {
  padding: 4px 6px;
  color: #536f7c;
  background: #eff4f7;
  border: 1px solid #d6e2e8;
  border-radius: 2px;
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.ai-manager-customer-row em.issue-next,
.ai-manager-customer-row em.issue-viewing {
  color: #a26219;
  background: #fff8e9;
  border-color: #ead4a8;
}

.ai-manager-customer-row em.issue-generated {
  color: #8d3f48;
  background: #fff2f3;
  border-color: #edc9cd;
}

.ai-manager-customer-row nav {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.ai-manager-customer-row nav button {
  min-height: 30px;
  padding: 0 9px;
  color: #34596d;
  background: #fff;
  border: 1px solid #c8d9e2;
  border-radius: 2px;
  font-size: 9px;
  font-weight: 900;
  cursor: pointer;
}

.ai-manager-customer-row nav button:last-child {
  color: #fff;
  background: #0b8879;
  border-color: #0b8879;
}

.ai-manager-customer-empty {
  min-height: 150px;
  padding: 28px;
  display: grid;
  place-content: center;
  gap: 4px;
  color: #81939d;
  text-align: center;
  font-size: 10px;
}

.ai-manager-customer-empty strong {
  color: #385869;
  font-size: 13px;
}

/* 知识库沿用文档工作室：深蓝边线、宋体标题、墨绿状态、直角卡片 */
.ai-knowledge-shell {
  width: min(1540px, 100%);
}

.ai-knowledge-hero {
  min-height: 120px;
  padding: 22px 26px;
  background: #fff;
  border: 1px solid #ccdce5;
  border-top: 4px solid #122536;
  border-radius: 2px;
  box-shadow: none;
}

.ai-knowledge-brand {
  gap: 18px;
}

.ai-knowledge-brand-mark {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  color: #fff;
  background: #122536;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: 28px;
}

.ai-knowledge-brand .eyebrow {
  color: #0b8275;
  font-size: 9px;
}

.ai-knowledge-brand h2 {
  color: #152f42;
  font-size: clamp(28px, 2.5vw, 40px);
}

.ai-knowledge-brand p:last-child {
  color: #69808e;
  font-size: 12px;
}

.ai-knowledge-hero-actions button,
.ai-knowledge-files-head button,
.ai-skill-workspace-head > button {
  min-height: 36px;
  border-radius: 2px;
  box-shadow: none;
}

.ai-knowledge-hero-actions button:hover,
.ai-knowledge-files-head button:hover,
.ai-skill-workspace-head > button:hover {
  box-shadow: none;
  transform: none;
}

.ai-local-draft-badge {
  color: #0a746a;
  background: #e9f7f3;
  border-color: #a9d8d0;
  border-radius: 2px;
}

.ai-knowledge-toolbar {
  min-height: 58px;
  margin-top: 12px;
  padding: 0 12px;
  border-color: #ccdce5;
  border-radius: 2px;
}

.ai-knowledge-view-switch {
  align-self: stretch;
  gap: 0;
}

.ai-knowledge-view-switch button {
  min-height: 56px;
  padding: 0 18px;
  border-radius: 0;
  font-size: 12px;
}

.ai-knowledge-view-switch button.active {
  color: #08796d;
  background: #eaf7f4;
  box-shadow: inset 0 -4px 0 #0b8879;
}

.ai-knowledge-search {
  border-radius: 2px;
}

.ai-knowledge-overview {
  margin-top: 12px;
  padding: 22px 26px;
  background: #fff;
  border-color: #ccdce5;
  border-radius: 2px;
}

.ai-knowledge-overview > div:first-child > span,
.ai-library-section-heading > div > span,
.ai-skill-workspace-head > div > span,
.ai-knowledge-files-head > div > span {
  color: #0a8174;
}

.ai-knowledge-overview h3,
.ai-skill-workspace-head h3 {
  color: #153247;
  font-size: 25px;
}

.ai-knowledge-overview dl > div {
  border-radius: 0;
}

.ai-library-section,
.ai-skill-workspace {
  margin-top: 12px;
  padding: 22px;
  border-color: #ccdce5;
  border-radius: 2px;
  box-shadow: none;
}

.ai-library-card,
.ai-library-create-card {
  min-height: 228px;
  padding: 16px;
  background: #f8fafc;
  border-color: #d2dfe6;
  border-top: 1px solid #d2dfe6;
  border-left: 4px solid #92a9b7;
  border-radius: 2px;
  box-shadow: none;
}

.ai-library-card::before {
  display: none;
}

.ai-library-card.tone-mint,
.ai-library-card.tone-green,
.ai-library-card.tone-blue,
.ai-library-card.tone-rose,
.ai-library-card.tone-sand,
.ai-library-card.tone-violet {
  border-top-color: #d2dfe6;
}

.ai-library-card.tone-mint,
.ai-library-card.tone-green {
  border-left-color: #0b8879;
}

.ai-library-card.tone-blue {
  border-left-color: #2e739f;
}

.ai-library-card.tone-sand {
  border-left-color: #ae8735;
}

.ai-library-card.tone-rose {
  border-left-color: #b86270;
}

.ai-library-card.tone-violet {
  border-left-color: #76649a;
}

.ai-library-card:hover {
  background: #fff;
  border-color: #9fc1d2;
  border-left-color: #0b8879;
  box-shadow: inset 0 -4px 0 #0b8879;
  transform: none;
}

.ai-library-code {
  color: #fff;
  background: #17384d;
  border: 0;
  border-radius: 0;
}

.tone-mint .ai-library-code,
.tone-green .ai-library-code {
  color: #fff;
  background: #0b8879;
  border: 0;
}

.tone-sand .ai-library-code { color: #fff; background: #a98235; border: 0; }
.tone-rose .ai-library-code { color: #fff; background: #a95764; border: 0; }
.tone-violet .ai-library-code { color: #fff; background: #6e5c91; border: 0; }
.tone-blue .ai-library-code { color: #fff; background: #2c6f99; border: 0; }

.ai-library-card header strong,
.ai-directory-title strong,
.ai-skill-card h4 {
  color: #17364a;
}

.ai-library-card footer b {
  color: #08796d;
}

.ai-library-create-card {
  border-left-width: 1px;
  border-style: dashed;
}

.ai-knowledge-detail {
  margin-top: 12px;
  border-color: #ccdce5;
  border-radius: 2px;
  box-shadow: none;
}

.ai-knowledge-directory {
  background: #f4f7f9;
}

.ai-knowledge-back,
.ai-directory-add,
.ai-knowledge-directory nav button,
.ai-document-preview,
.ai-document-preview dl div,
.ai-skill-flow span,
.ai-skill-card,
.ai-skill-bindings,
.ai-skill-card footer button,
.ai-skill-toggle {
  border-radius: 2px;
}

.ai-knowledge-directory nav button.active {
  color: #08786d;
  background: #e7f5f2;
  border-color: #c1e1db;
  box-shadow: inset 4px 0 0 #0b8879;
}

.ai-knowledge-files-head h3 {
  color: #153247;
}

.ai-knowledge-document-row.selected {
  background: #edf8f5;
  box-shadow: inset 4px 0 0 #0b8879;
}

.ai-document-type {
  border-radius: 0;
}

.ai-document-preview {
  background: #f2faf7;
  border-left-color: #0b8879;
}

.ai-skill-flow span {
  background: #f5f8fa;
}

.ai-skill-flow b {
  border-radius: 0;
}

.ai-skill-card {
  background: #f8fafc;
  border-left-color: #839dac;
}

.ai-skill-card.enabled {
  background: #f3faf8;
  border-color: #bfded8;
  border-left-color: #0b8879;
}

.ai-skill-card > header > span {
  border-radius: 0;
}

.ai-skill-toggle {
  border-radius: 2px;
}

@media (max-width: 1180px) {
  .ai-manager-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .drawer-header-actions {
    width: 100%;
    justify-content: stretch;
  }

  .drawer-header-actions button {
    flex: 1 1 120px;
  }

  .ai-manager-customer-head {
    padding: 17px;
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .ai-manager-customer-head > small {
    max-width: none;
  }

  .ai-manager-metrics {
    padding: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-manager-metrics button {
    min-height: 82px;
  }

  .ai-knowledge-hero {
    padding: 18px;
  }

  .ai-knowledge-brand-mark {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
    border: 0;
    border-radius: 0;
    font-size: 23px;
  }

  .ai-knowledge-toolbar {
    padding: 0;
  }
}

/* v692 知识库目录树与原文件预览 */
.ai-knowledge-directory nav {
  max-height: 520px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.ai-knowledge-directory nav button > span {
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-knowledge-directory nav .ai-directory-folder > span {
  padding-left: calc(var(--folder-depth, 0) * 15px);
}

.ai-knowledge-directory nav .ai-directory-folder > span > i {
  width: 19px;
  height: 17px;
  flex: 0 0 19px;
  display: grid;
  place-items: center;
  color: #9a751e;
  background: #fff5d9;
  border: 1px solid #e7d39b;
  border-radius: 2px;
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
}

.ai-knowledge-breadcrumb {
  min-height: 38px;
  padding: 5px 0 9px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  color: #92a0a8;
  border-bottom: 1px solid #dfe7ec;
}

.ai-knowledge-breadcrumb button {
  min-height: 26px;
  padding: 0 7px;
  color: #617986;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.ai-knowledge-breadcrumb button:hover,
.ai-knowledge-breadcrumb button.active {
  color: #08796d;
  background: #edf8f5;
  border-color: #c5e2dc;
}

.ai-knowledge-folder-row {
  width: 100%;
  min-height: 61px;
  padding: 7px 14px;
  display: grid;
  grid-template-columns: 32px minmax(236px, 1fr) 110px 80px 88px;
  gap: 12px;
  align-items: center;
  color: #536d7c;
  text-align: left;
  background: #fbfcfd;
  border: 0;
  border-bottom: 1px solid #e8eef2;
  cursor: pointer;
}

.ai-knowledge-folder-row:hover {
  background: #f2f8f7;
  box-shadow: inset 4px 0 0 #c9a34c;
}

.ai-folder-type {
  width: 28px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #8b6717;
  background: #fff4d7;
  border: 1px solid #e4cf93;
  border-radius: 2px;
  font-size: 9px;
  font-weight: 900;
}

.ai-knowledge-folder-row > span:not(.ai-folder-type, .ai-document-main),
.ai-knowledge-folder-row time {
  overflow: hidden;
  color: #7f8f98;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-folder-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.ai-folder-row-actions button {
  min-height: 28px;
  padding: 4px 8px;
  color: #355565;
  background: #fff;
  border: 1px solid #cfdee5;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.ai-folder-row-actions button:hover {
  color: #08796d;
  border-color: #83c7ba;
}

.ai-folder-row-actions button.danger {
  color: #b64444;
  border-color: #edc9c9;
}

.ai-document-preview-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.ai-document-readonly-note {
  min-height: 32px;
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  color: #08796d;
  background: #edf8f5;
  border: 1px solid #c5e2dc;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 800;
}

.ai-document-media {
  width: 100%;
  margin: 16px 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d5e5e1;
}

.ai-document-image {
  min-height: 220px;
  padding: 14px;
  display: grid;
  place-items: center;
}

.ai-document-image img {
  display: block;
  max-width: 100%;
  max-height: 620px;
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
}

.ai-document-pdf iframe {
  width: 100%;
  height: 620px;
  display: block;
  border: 0;
}

.ai-document-audio,
.ai-document-video {
  padding: 14px;
}

.ai-document-audio audio,
.ai-document-video video {
  width: 100%;
  max-height: 620px;
  display: block;
}

.ai-document-structured-preview {
  width: 100%;
  margin: 16px 0;
  overflow: hidden;
  color: #17354a;
  background: #fff;
  border: 1px solid #d5e5e1;
}

.ai-document-structured-preview > header {
  min-height: 52px;
  padding: 12px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #f2f8f7;
  border-bottom: 1px solid #d5e5e1;
}

.ai-document-structured-preview > header > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.ai-document-structured-preview > header strong {
  color: #0e745f;
  font-size: 14px;
}

.ai-document-structured-preview > header span,
.ai-document-structured-preview > header em {
  color: #748b99;
  font-size: 11px;
  font-style: normal;
}

.ai-document-sheet-scroll {
  max-height: 650px;
  overflow: auto;
  scrollbar-gutter: stable;
}

.ai-document-structured-preview table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
  font-size: 12px;
  line-height: 1.55;
}

.ai-document-structured-preview th,
.ai-document-structured-preview td {
  min-width: 108px;
  max-width: 320px;
  padding: 9px 12px;
  vertical-align: top;
  background: #fff;
  border-right: 1px solid #e0ebe8;
  border-bottom: 1px solid #e0ebe8;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.ai-document-structured-preview tr:nth-child(even) td {
  background: #fbfdfd;
}

.ai-document-structured-preview tr.sheet-name th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #0e745f;
  background: #e8f5f1;
  text-align: left;
}

.ai-document-structured-preview article {
  max-height: 650px;
  padding: 20px 24px 28px;
  overflow: auto;
  color: #314b60;
  font: 13px/1.85 "PingFang SC", "Microsoft YaHei", sans-serif;
  scrollbar-gutter: stable;
}

.ai-document-structured-preview article p {
  margin: 0 0 0.9em;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.ai-document-structured-preview article h5 {
  margin: 24px 0 12px;
  padding-bottom: 8px;
  color: #0e745f;
  border-bottom: 1px solid #d5e5e1;
  font-size: 15px;
}

.ai-document-structured-preview.loading,
.ai-document-structured-preview.empty {
  min-height: 128px;
  padding: 28px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: #748b99;
  text-align: center;
}

.ai-document-structured-preview.loading strong,
.ai-document-structured-preview.empty strong {
  color: #17354a;
  font-size: 14px;
}

.ai-document-structured-preview.loading span,
.ai-document-structured-preview.empty span {
  font-size: 12px;
}

@media (max-width: 980px) {
  .ai-knowledge-directory nav {
    max-height: 270px;
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-knowledge-folder-row {
    min-height: 72px;
    grid-template-columns: 32px minmax(0, 1fr) 72px;
  }

  .ai-knowledge-folder-row > span:nth-of-type(3),
  .ai-knowledge-folder-row > span:nth-of-type(4) {
    display: none;
  }

  .ai-knowledge-folder-row time {
    text-align: right;
  }

  .ai-folder-row-actions {
    justify-content: flex-end;
  }

  .ai-document-pdf iframe {
    height: 440px;
  }

  .ai-document-sheet-scroll,
  .ai-document-structured-preview article {
    max-height: 520px;
  }
}

@media (max-width: 620px) {
  .ai-document-preview header {
    align-items: stretch;
    flex-direction: column;
  }

  .ai-document-preview-actions {
    justify-content: stretch;
  }

  .ai-document-preview-actions button {
    flex: 1 1 120px;
  }

  .ai-document-readonly-note {
    flex: 1 1 100%;
    justify-content: center;
  }

  .ai-document-pdf iframe {
    height: 360px;
  }
}

@media print {
  body.ai-knowledge-print-protected * {
    visibility: hidden !important;
  }

  body.ai-knowledge-print-protected::before {
    content: "知识库资料仅限在线预览，员工账号不提供打印。";
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    padding: 40mm 24mm;
    display: block;
    visibility: visible !important;
    color: #17354a;
    background: #fff;
    font: 700 18px/1.8 "PingFang SC", "Microsoft YaHei", sans-serif;
    text-align: center;
  }
}

/* v705 AI 助手：提升可读性，并让编辑态拥有清晰、稳定的光标反馈。 */
#aiAssistantPage {
  font-size: 16px;
}

#aiAssistantPage :where(
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  select,
  textarea
) {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

#aiAssistantPage textarea {
  caret-color: #0f8f80;
}

#aiAssistantInput {
  font-size: 18px !important;
  line-height: 1.65;
}

#aiAssistantPage :where(
  .ai-command-identity p,
  .ai-command-composer > p,
  .ai-welcome-card p,
  .ai-system-answer p,
  .ai-result-copy p,
  .ai-result-copy small,
  .ai-command-radar span,
  .ai-guardrails span,
  .ai-pending-empty span,
  .ai-document-hero-copy > div > p,
  .ai-document-settings > header p,
  .ai-document-template-rail p,
  .ai-document-input-modes small,
  .ai-document-source-card small,
  .ai-document-source-card p,
  .ai-document-output footer,
  .ai-buyer-fact-panel header p,
  .ai-knowledge-shell p,
  .ai-training-center p
) {
  font-size: 14px;
  line-height: 1.65;
}

#aiAssistantPage :where(
  .ai-document-form label > span,
  .ai-buyer-fact-panel label > span,
  .ai-command-composer > label
) {
  font-size: 15px;
  line-height: 1.5;
}

#aiAssistantPage :where(
  .ai-document-template-rail strong,
  .ai-document-input-modes strong,
  .ai-document-source-card strong
) {
  font-size: 16px;
  line-height: 1.5;
}

#aiAssistantPage :where(
  .ai-command-prompts button,
  .ai-document-actions button,
  .ai-document-generate,
  .ai-document-attachment-trigger
) {
  font-size: 14px;
}

@media (max-width: 780px) {
  #aiAssistantPage :where(
    input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
    select,
    textarea
  ) {
    font-size: 16px;
  }
}

/* ============================================================
   v707: 客户系统版面重设计
   重点等级(淡紫) / 登记日期区间 / 经纪人·合作人 combobox /
   表头点击排序 / sticky 操作列 / 斑马纹 + hover / 横向滚动恢复
   ============================================================ */

/* --- 登记日期区间 --- */
#customerSystemPanel .customer-date-range {
  grid-column: span 2;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 6px;
}

#customerSystemPanel .customer-date-range em {
  color: #7d92a1;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

/* --- 经纪人 / 合作人筛选 combobox --- */
#customerSystemPanel .customer-employee-combobox {
  position: relative;
  display: block;
  min-width: 0;
}

#customerSystemPanel .customer-employee-combobox > input[type="text"] {
  padding-right: 28px;
  text-overflow: ellipsis;
}

.customer-employee-combobox-toggle {
  position: absolute;
  top: 50%;
  right: 3px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  transform: translateY(-50%);
}

.customer-employee-combobox-toggle:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.customer-employee-combobox-list {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  z-index: 60;
  max-height: 264px;
  padding: 4px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.customer-employee-combobox-list .combobox-option {
  display: block;
  width: 100%;
  padding: 7px 9px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  text-align: left;
}

.customer-employee-combobox-list .combobox-option strong {
  display: block;
  font-size: 12px;
  font-weight: 800;
}

.customer-employee-combobox-list .combobox-option span {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-employee-combobox-list .combobox-option:hover {
  background: var(--primary-soft);
}

.customer-employee-combobox-list .combobox-option.active {
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-weight: 850;
}

/* --- 「重点」等级：淡紫行底色 + 紫色 pill（A/B/C/D 原色不动） --- */
.customer-table-row.customer-level-key {
  background: #EFE9FB;
}

.customer-table-row.customer-level-key .customer-level-pill,
.customer-table-row.customer-level-key .customer-level-select {
  color: #7B61C9;
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(123, 97, 201, 0.42);
}

/* --- 表格行底色 / 斑马纹 / hover（等级行保留原色，仅加深） --- */
.customer-table .customer-table-row {
  background: var(--panel);
}

.customer-table .customer-table-row.customer-row-zebra {
  background: var(--panel-soft);
}

.customer-table .customer-table-row:hover {
  background: color-mix(in srgb, var(--primary-soft) 62%, var(--panel));
}

.customer-table .customer-table-row.customer-level-a:hover {
  background: #b8e9cc;
}

.customer-table .customer-table-row.customer-level-b:hover {
  background: #cae3fd;
}

.customer-table .customer-table-row.customer-level-c:hover {
  background: #fdf3ba;
}

.customer-table .customer-table-row.customer-level-d:hover {
  background: #e3cdb6;
}

.customer-table .customer-table-row.customer-level-key:hover {
  background: #e5dbf8;
}

/* --- 表头：主题化 + 可排序 --- */
#customerSystemPanel .customer-table .customer-table-head,
#customerOtherPanel .customer-table .customer-table-head {
  color: var(--text);
  background: var(--primary-soft);
  border-bottom: 2px solid var(--line);
}

.customer-table .customer-sort-cell {
  cursor: pointer;
  user-select: none;
}

.customer-table .customer-sort-cell:hover,
.customer-table .customer-sort-cell.is-sorted {
  color: var(--primary-dark);
}

.customer-sort-arrow {
  display: inline-block;
  min-width: 11px;
  margin-left: 2px;
  color: var(--primary);
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
}

/* --- 操作列 sticky 钉在右侧 --- */
.customer-table .customer-row-actions,
.customer-table .customer-actions-head {
  position: sticky;
  right: 0;
  z-index: 5;
  background: inherit;
}

.customer-table .customer-row-actions::before,
.customer-table .customer-actions-head::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -12px;
  width: 12px;
  background: linear-gradient(to right, transparent, rgba(20, 42, 62, 0.12));
  content: "";
  pointer-events: none;
}

/* --- 横向滚动恢复 + 合理 min-width（配合 sticky 操作列） --- */
#customerSystemPanel .opportunity-table-wrap {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

#customerSystemPanel .customer-table {
  min-width: 1215px;
}

/* --- 跟进列：最新内容 + 最近跟进时间（两行内） --- */
#customerSystemPanel .customer-follow-cell .customer-follow-latest {
  display: grid;
  gap: 1px;
  min-width: 0;
}

#customerSystemPanel .customer-follow-cell .customer-follow-text {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#customerSystemPanel .customer-follow-cell .customer-follow-meta {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#customerSystemPanel .customer-follow-cell .customer-follow-empty {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

/* --- 客户名 / 来源 单行省略 --- */
#customerSystemPanel .customer-source-cell {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#customerSystemPanel .customer-created-cell {
  white-space: nowrap;
}

/* --- 响应式 --- */
@media (max-width: 1500px) {
  #customerSystemPanel .customer-table {
    min-width: 1035px;
  }
}

@media (max-width: 1050px) {
  #customerSystemPanel .customer-table {
    min-width: 795px;
  }
}

@media (max-width: 760px) {
  #customerSystemPanel .customer-date-range {
    grid-column: auto;
  }

  #customerSystemPanel .customer-table {
    min-width: 755px;
  }

  .customer-employee-combobox-list {
    max-height: 220px;
  }
}

/* ============================================================
   v708: 修复 — ①恢复等级整行底色（特异性压过 v708 基础行底色）
   ②筛选工具栏紧凑化（flex 自然宽度 + 统一 33px 高度）
   ============================================================ */

/* --- ① 等级行底色恢复（原色值不动；特异性 0,3,0 > 基础行底色 0,2,0） --- */
.customer-table .customer-table-row.customer-level-a {
  background: #c7efd5;
}

.customer-table .customer-table-row.customer-level-b {
  background: #d9ecff;
}

.customer-table .customer-table-row.customer-level-c {
  background: #fff9d8;
}

.customer-table .customer-table-row.customer-level-d {
  background: #ead8c6;
}

.customer-table .customer-table-row.customer-level-key {
  background: #EFE9FB;
}

/* --- ② 筛选工具栏紧凑化 --- */
#customerSystemPanel .opportunity-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}

#customerSystemPanel .opportunity-filters > * {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
}

#customerSystemPanel .opportunity-filters > #customerSearch {
  flex: 0 1 260px;
  width: 260px;
  min-width: 180px;
}

#customerSystemPanel .opportunity-filters > select,
#customerSystemPanel .opportunity-filters > .customer-employee-combobox {
  flex: 0 0 auto;
  width: 150px;
}

#customerSystemPanel .opportunity-filters input,
#customerSystemPanel .opportunity-filters select {
  min-height: 33px;
  height: 33px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 13px;
}

/* 登记日期区间整组收紧：标签 + 136px 输入 ×2 + 「至」 */
#customerSystemPanel .customer-date-range {
  flex: 0 0 auto;
  grid-column: auto;
  grid-template-columns: auto auto auto auto;
  gap: 6px;
  min-height: 33px;
  padding-left: 8px;
  padding-right: 8px;
}

#customerSystemPanel .customer-date-range input[type="date"] {
  width: 136px;
  min-width: 0;
  height: 31px;
  min-height: 31px;
  padding: 0 6px;
  font-size: 13px;
}

/* combobox 文本输入填满 150px 外壳 */
#customerSystemPanel .customer-employee-combobox > input[type="text"] {
  width: 100%;
  min-height: 33px;
  height: 33px;
  font-size: 13px;
}

/* 移动端：控件整行排列、日期输入自适应 */
@media (max-width: 760px) {
  #customerSystemPanel .opportunity-filters > * {
    flex: 1 1 100%;
    width: 100%;
  }

  #customerSystemPanel .opportunity-filters > #customerSearch,
  #customerSystemPanel .opportunity-filters > select,
  #customerSystemPanel .opportunity-filters > .customer-employee-combobox {
    flex: 1 1 100%;
    width: 100%;
  }

  #customerSystemPanel .customer-date-range {
    grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr);
  }

  #customerSystemPanel .customer-date-range input[type="date"] {
    width: auto;
  }
}

/* ============================================================
   v709: 「其他状态」「公客池」页签同步客户系统标准 + 公客池领取对话框
   ============================================================ */

/* --- 「其他状态」筛选栏紧凑化（与客户系统同款） --- */
#customerOtherPanel .opportunity-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}

#customerOtherPanel .opportunity-filters > * {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
}

#customerOtherPanel .opportunity-filters > #customerOtherSearch {
  flex: 0 1 260px;
  width: 260px;
  min-width: 180px;
}

#customerOtherPanel .opportunity-filters > select {
  flex: 0 0 auto;
  width: 150px;
}

#customerOtherPanel .opportunity-filters input,
#customerOtherPanel .opportunity-filters select {
  min-height: 33px;
  height: 33px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 13px;
}

#customerOtherPanel .customer-date-range {
  flex: 0 0 auto;
  grid-template-columns: auto auto auto auto;
  gap: 6px;
  min-height: 33px;
  padding-left: 8px;
  padding-right: 8px;
}

#customerOtherPanel .customer-date-range em {
  color: #7d92a1;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

#customerOtherPanel .customer-date-range input[type="date"] {
  width: 136px;
  min-width: 0;
  height: 31px;
  min-height: 31px;
  padding: 0 6px;
  border: 0;
  outline: 0;
  color: #173044;
  background: transparent;
  font-size: 13px;
}

@media (max-width: 760px) {
  #customerOtherPanel .opportunity-filters > *,
  #customerOtherPanel .opportunity-filters > #customerOtherSearch,
  #customerOtherPanel .opportunity-filters > select {
    flex: 1 1 100%;
    width: 100%;
  }

  #customerOtherPanel .customer-date-range {
    grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr);
  }

  #customerOtherPanel .customer-date-range input[type="date"] {
    width: auto;
  }
}

/* --- 公客池工具条紧凑化 --- */
#customerPoolPanel .customer-pool-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}

#customerPoolPanel .customer-pool-tools > * {
  flex: 0 0 auto;
  min-width: 0;
}

#customerPoolPanel .customer-pool-tools label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

#customerPoolPanel .customer-pool-tools > input[type="text"] {
  flex: 0 1 240px;
  width: 240px;
  min-width: 160px;
  min-height: 33px;
  height: 33px;
  padding: 0 10px;
  font-size: 13px;
}

#customerPoolPanel .customer-pool-tools select {
  width: auto;
  min-height: 33px;
  height: 33px;
  font-size: 13px;
}

#customerPoolPanel .customer-pool-tools > span {
  margin-left: auto;
}

/* --- 公客池表格：横向滚动 + min-width --- */
#customerPoolPanel .opportunity-table-wrap {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

#customerPoolPanel .customer-pool-table {
  min-width: 1160px;
}

/* --- 公客池行底色 / 斑马纹 / hover / 等级色（与客户系统同色值） --- */
.customer-pool-table .customer-pool-row {
  background: var(--panel);
}

.customer-pool-table .customer-pool-row.customer-row-zebra {
  background: var(--panel-soft);
}

.customer-pool-table .customer-pool-row.customer-level-a {
  background: #c7efd5;
}

.customer-pool-table .customer-pool-row.customer-level-b {
  background: #d9ecff;
}

.customer-pool-table .customer-pool-row.customer-level-c {
  background: #fff9d8;
}

.customer-pool-table .customer-pool-row.customer-level-d {
  background: #ead8c6;
}

.customer-pool-table .customer-pool-row.customer-level-key {
  background: #EFE9FB;
}

.customer-pool-table .customer-pool-row:hover {
  background: color-mix(in srgb, var(--primary-soft) 62%, var(--panel));
}

.customer-pool-table .customer-pool-row.customer-level-a:hover {
  background: #b8e9cc;
}

.customer-pool-table .customer-pool-row.customer-level-b:hover {
  background: #cae3fd;
}

.customer-pool-table .customer-pool-row.customer-level-c:hover {
  background: #fdf3ba;
}

.customer-pool-table .customer-pool-row.customer-level-d:hover {
  background: #e3cdb6;
}

.customer-pool-table .customer-pool-row.customer-level-key:hover {
  background: #e5dbf8;
}

/* --- 公客池表头主题化 + 可排序 --- */
#customerPoolPanel .customer-pool-table .customer-pool-head {
  color: var(--text);
  background: var(--primary-soft);
  border-bottom: 2px solid var(--line);
}

.customer-pool-table .customer-sort-cell {
  cursor: pointer;
  user-select: none;
}

.customer-pool-table .customer-sort-cell:hover,
.customer-pool-table .customer-sort-cell.is-sorted {
  color: var(--primary-dark);
}

/* --- 公客池操作列 sticky --- */
.customer-pool-table .customer-pool-actions,
.customer-pool-table .customer-pool-actions-head {
  position: sticky;
  right: 0;
  z-index: 5;
  background: inherit;
}

.customer-pool-table .customer-pool-actions::before,
.customer-pool-table .customer-pool-actions-head::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -12px;
  width: 12px;
  background: linear-gradient(to right, transparent, rgba(20, 42, 62, 0.12));
  content: "";
  pointer-events: none;
}

/* --- 公客池单元格紧凑呈现 --- */
.customer-pool-name-cell {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.customer-pool-name-cell strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-pool-name-cell .customer-level-pill {
  flex: 0 0 auto;
  min-width: 30px;
  height: 20px;
  margin-right: 0;
  padding: 0 6px;
  font-size: 11px;
}

.customer-pool-phone-cell {
  white-space: nowrap;
}

.customer-pool-demand-cell {
  display: -webkit-box;
  max-height: 2.9em;
  overflow: hidden;
  line-height: 1.45;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.customer-pool-follow-cell {
  min-width: 0;
}

.customer-pool-follow-cell .customer-follow-latest {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.customer-pool-follow-cell .customer-follow-text {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-pool-follow-cell .customer-follow-meta {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-pool-follow-cell .customer-follow-empty {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.customer-pool-owner-cell {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-pool-owner-cell small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- 公客池领取对话框 --- */
.customer-pool-claim-panel {
  width: min(560px, 100%);
}

.customer-pool-claim-steps {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.customer-pool-claim-steps li {
  flex: 1;
  padding: 8px 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.customer-pool-claim-steps b {
  display: block;
  color: var(--primary-dark);
  font-size: 13px;
}

.customer-pool-claim-steps span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.customer-pool-claim-info {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.customer-pool-claim-info > div {
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.customer-pool-claim-info span {
  flex: 0 0 40px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.customer-pool-claim-info strong {
  color: var(--text);
  font-size: 15px;
}

.customer-pool-claim-info a {
  color: var(--primary);
  font-size: 16px;
  font-weight: 900;
  text-decoration: none;
}

.customer-pool-claim-info em {
  color: var(--text);
  font-size: 13px;
  font-style: normal;
}

.customer-pool-claim-follow {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.customer-pool-claim-follow textarea {
  width: 100%;
  min-height: 84px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  resize: vertical;
}

.customer-pool-claim-hint {
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 12px;
  font-weight: 800;
}

#confirmCustomerPoolClaim:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

@media (max-width: 560px) {
  .customer-pool-claim-steps {
    flex-direction: column;
  }
}

/* ============================================================
   v710: 客户表格表头加宽加厚约 1.5 倍 + 全列双态排序箭头放大
   ============================================================ */
#customerSystemPanel .customer-table .customer-table-head,
#customerOtherPanel .customer-table .customer-table-head,
#customerPoolPanel .customer-pool-table .customer-pool-head {
  padding-top: 12px;
  padding-bottom: 12px;
  font-size: calc(15px * var(--customer-ui-scale, 1));
  font-weight: 900;
  letter-spacing: 0.02em;
}

.customer-table .customer-sort-arrow,
.customer-pool-table .customer-sort-arrow {
  min-width: 13px;
  font-size: 12px;
}

@media (max-width: 1500px) {
  #customerSystemPanel .customer-table .customer-table-head,
  #customerOtherPanel .customer-table .customer-table-head,
  #customerPoolPanel .customer-pool-table .customer-pool-head {
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: calc(13px * var(--customer-ui-scale, 1));
  }
}

/* ============================================================
   v711: 客户系统批量操作（行复选框 + 批量操作条 + 结果 toast）
   ============================================================ */

/* --- 复选框列 --- */
.customer-table .customer-check-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.customer-table .customer-check-cell input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--primary);
}

/* 选中行高亮（在无等级/斑马纹底色之上叠加，等级行保留等级色） */
.customer-table .customer-table-row.customer-row-selected {
  box-shadow: inset 3px 0 0 var(--primary);
}

/* --- 批量操作条 --- */
.customer-batch-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  margin-top: 8px;
  padding: 6px 12px;
  background: var(--primary-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
}

.customer-batch-bar[hidden] {
  display: none;
}

.customer-batch-bar .customer-batch-count {
  margin-right: 4px;
  white-space: nowrap;
}

.customer-batch-bar .customer-batch-count b {
  color: var(--primary-dark);
  font-size: 14px;
}

.customer-batch-bar .customer-batch-clear {
  margin-left: auto;
}

/* --- 批量结果轻提示 --- */
#customerActionToast {
  position: fixed;
  bottom: 36px;
  left: 50%;
  z-index: 120;
  padding: 10px 20px;
  color: #fff;
  background: rgba(20, 37, 54, 0.92);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(20, 37, 54, 0.28);
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(10px);
  transition: opacity 0.25s, transform 0.25s;
}

#customerActionToast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* ============================================================
   v712: 客户表格体验优化
   ①列模板变量化（JS 按用户拖拽覆盖，fallback=新默认列宽）
   ②默认列宽重排（客户收窄/跟进加宽/等级加宽修压边）
   ③整页显示（容器不再限高内滚，仅横向滚动）+ 页面级钉顶表头
   ④「其他状态」页签列模板/隐列规则与「客户系统」统一
   ============================================================ */

/* --- ① 列模板变量化：full(>1500, 12 列) --- */
#customerSystemPanel .customer-table .customer-table-head,
#customerSystemPanel .customer-table .customer-table-row,
#customerOtherPanel .customer-table .customer-table-head,
#customerOtherPanel .customer-table .customer-table-row {
  gap: 6px;
  grid-template-columns: var(--customer-cols, 34px 62px 112px 76px 92px 76px minmax(210px, 1.5fr) 72px minmax(270px, 2fr) minmax(132px, 0.8fr) 96px 112px);
}

#customerSystemPanel .customer-table,
#customerOtherPanel .customer-table {
  min-width: var(--customer-table-min, 1424px);
}

/* --- mid(≤1500, 隐来源·面积段, 10 列) --- */
@media (max-width: 1500px) {
  #customerSystemPanel .customer-table .customer-table-head,
  #customerSystemPanel .customer-table .customer-table-row,
  #customerOtherPanel .customer-table .customer-table-head,
  #customerOtherPanel .customer-table .customer-table-row {
    grid-template-columns: var(--customer-cols-mid, 34px 62px 112px 92px 76px minmax(210px, 1.5fr) minmax(270px, 2fr) minmax(132px, 0.8fr) 96px 112px);
  }

  #customerSystemPanel .customer-table,
  #customerOtherPanel .customer-table {
    min-width: var(--customer-table-min-mid, 1264px);
  }

  #customerOtherPanel .customer-table .customer-table-head > :nth-child(4),
  #customerOtherPanel .customer-table .customer-table-row > :nth-child(4),
  #customerOtherPanel .customer-table .customer-table-head > :nth-child(8),
  #customerOtherPanel .customer-table .customer-table-row > :nth-child(8) {
    display: none;
  }
}

/* --- small(≤1050, 再隐录入时间·归属, 8 列) --- */
@media (max-width: 1050px) {
  #customerSystemPanel .customer-table .customer-table-head,
  #customerSystemPanel .customer-table .customer-table-row,
  #customerOtherPanel .customer-table .customer-table-head,
  #customerOtherPanel .customer-table .customer-table-row {
    grid-template-columns: var(--customer-cols-small, 34px 62px 112px 76px minmax(210px, 1.5fr) minmax(270px, 2fr) 96px 112px);
  }

  #customerSystemPanel .customer-table,
  #customerOtherPanel .customer-table {
    min-width: var(--customer-table-min-small, 1028px);
  }

  #customerOtherPanel .customer-table .customer-table-head > :nth-child(5),
  #customerOtherPanel .customer-table .customer-table-row > :nth-child(5),
  #customerOtherPanel .customer-table .customer-table-head > :nth-child(10),
  #customerOtherPanel .customer-table .customer-table-row > :nth-child(10) {
    display: none;
  }
}

/* --- ② 表头单元格防压边：右留空 + 排序单元格为拖拽手柄定位容器 --- */
#customerSystemPanel .customer-table .customer-table-head > span,
#customerOtherPanel .customer-table .customer-table-head > span {
  padding-right: 4px;
}

#customerSystemPanel .customer-table .customer-table-head > .customer-sort-cell,
#customerOtherPanel .customer-table .customer-table-head > .customer-sort-cell {
  position: relative;
  padding-right: 10px;
}

/* --- 客户名单行省略（列收窄后不换行，title 悬停看全名） --- */
#customerSystemPanel .customer-table .customer-name-cell,
#customerOtherPanel .customer-table .customer-name-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- ③ 整页显示：容器不再限高内滚，仅保留横向滚动 --- */
#customerSystemPanel .opportunity-table-wrap,
#customerOtherPanel .opportunity-table-wrap {
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
}

/* --- 页面级钉顶表头的视觉分层（位移由 JS translateY 实现） --- */
.customer-table .customer-table-head.is-stuck {
  box-shadow: 0 8px 18px rgba(20, 42, 62, 0.16);
}

/* --- 列宽拖拽手柄（6px 热区贴在表头单元格右缘） --- */
.customer-table .customer-col-resizer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 7;
  width: 6px;
  cursor: col-resize;
  touch-action: none;
}

.customer-table .customer-col-resizer::after {
  position: absolute;
  top: 22%;
  right: 2px;
  bottom: 22%;
  width: 2px;
  border-radius: 1px;
  background: transparent;
  content: "";
  transition: background 0.15s;
}

.customer-table .customer-col-resizer:hover::after,
.customer-table .customer-col-resizer.is-active::after {
  background: var(--primary);
}

/* 触摸设备不启用拖拽（JS 侧同步降级） */
@media (hover: none), (pointer: coarse) {
  .customer-table .customer-col-resizer {
    display: none;
  }
}

/* 拖拽中的全局光标与选中禁止 */
body.customer-col-resizing {
  cursor: col-resize;
  user-select: none;
}

body.customer-col-resizing * {
  cursor: col-resize !important;
}

/* 拖拽中的宽度提示气泡 */
#customerColResizeTip {
  position: fixed;
  z-index: 130;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(20, 37, 54, 0.92);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
}

#customerColResizeTip.show {
  opacity: 1;
}

/* 分页栏「恢复默认列宽」入口 */
.customer-table-footer .customer-col-reset {
  white-space: nowrap;
}


/* ============================================================
   v713: 客户详情「需求 AI 一键分析」
   需求框加高可拖拽 + AI 分析按钮条（两主题兼容，走 CSS 变量）
   ============================================================ */

#customerDetailDrawer .customer-detail-form #customerDetailDemand {
  min-height: 132px;
  resize: vertical;
  line-height: 1.6;
}

#customerDetailDrawer .customer-demand-ai-bar {
  display: flex;
  gap: 10px;
  align-items: center;
}

#customerDetailDrawer .customer-demand-ai-bar .ghost-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

#customerDetailDrawer .customer-demand-ai-bar small {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
}

#customerDetailDrawer .customer-demand-ai-bar .ghost-button.is-loading {
  opacity: 0.65;
  cursor: wait;
}

@media (max-width: 560px) {
  #customerDetailDrawer .customer-demand-ai-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}


/* ============================================================
   v714: 知识库多选 + 移动/批量删除
   行首复选框列（label 包裹不影响 nth-of-type 规则）+ 批量操作条
   ============================================================ */

/* --- 行/表头模板前置 26px 复选框列 --- */
.ai-knowledge-table-head,
.ai-knowledge-document-row,
.ai-knowledge-folder-row {
  grid-template-columns: 26px 32px minmax(236px, 1fr) 110px 80px 88px;
}

.ai-knowledge-table-head {
  padding: 0 14px;
  grid-template-columns: 26px 32px minmax(280px, 1fr) 110px 80px 88px;
}

.ai-knowledge-table-head .ai-head-name {
  grid-column: 2 / 4;
}

.ai-row-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  min-height: 30px;
  margin: 0;
  cursor: pointer;
}

.ai-row-check input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--primary, #0c8c7d);
}

.ai-knowledge-document-row.is-checked,
.ai-knowledge-folder-row.is-checked {
  background: var(--primary-soft, #e9f3f1);
  box-shadow: inset 3px 0 0 var(--primary, #0c8c7d);
}

/* --- 批量操作条 --- */
.ai-knowledge-batch-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 6px 12px;
  background: var(--primary-soft, #eef6f4);
  border-bottom: 1px solid var(--line, #dfe7ec);
  color: var(--text, #284556);
  font-size: 12px;
  font-weight: 700;
}

.ai-knowledge-batch-bar .ai-knowledge-batch-count {
  margin-right: 4px;
  white-space: nowrap;
}

.ai-knowledge-batch-bar .ai-knowledge-batch-count b {
  color: var(--primary-dark, #087f73);
  font-size: 13px;
}

.ai-knowledge-batch-bar select {
  min-width: 170px;
  max-width: 260px;
  min-height: 30px;
  padding: 3px 8px;
  border: 1px solid var(--line, #cfdeea);
  border-radius: 6px;
  background: var(--panel, #fff);
  color: var(--text, #284556);
  font-size: 12px;
}

.ai-knowledge-batch-bar button {
  min-height: 30px;
  padding: 3px 12px;
  border: 1px solid var(--line, #cfdeea);
  border-radius: 6px;
  background: var(--panel, #fff);
  color: var(--text, #284556);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.ai-knowledge-batch-bar button:hover {
  border-color: var(--primary, #0c8c7d);
  color: var(--primary-dark, #087f73);
}

.ai-knowledge-batch-bar button.danger {
  border-color: #e0b4b4;
  color: #b03232;
}

.ai-knowledge-batch-bar button.danger:hover {
  background: #fdf0f0;
  border-color: #c94848;
}

.ai-knowledge-batch-bar [data-ai-batch-clear] {
  margin-left: auto;
}

/* --- 移动端：复选框列纳入三列模板 --- */
@media (max-width: 900px) {
  .ai-knowledge-document-row,
  .ai-knowledge-folder-row {
    grid-template-columns: 26px 32px minmax(0, 1fr) 72px;
  }
}

/* ============================================================
   v715 · 2026-07-24 二更
   ① 客户分页栏「恢复默认列宽」最右小号弱化按钮
   ② 3D小区列表建模师圆形头像
   ============================================================ */

/* ① 恢复默认列宽：移到分页栏最右，缩小弱化避免误点 */
#customerSystemPanel .customer-table-footer .customer-col-reset {
  margin-left: 12px;
  min-height: 24px;
  padding: 0 8px;
  color: var(--muted, #6f8392);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 22px;
  cursor: pointer;
  opacity: 0.85;
}

#customerSystemPanel .customer-table-footer .customer-col-reset:hover {
  color: var(--primary, #2f6fa8);
  border-color: var(--primary-soft, #eaf4ff);
  background: var(--primary-soft, #eaf4ff);
  opacity: 1;
}

/* ② 小区列表建模师头像：圆形小头像 + 首字占位（参照悬赏广场 task-avatar 体系） */
.community-modeler-cell {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: center;
}

.community-modeler-cell > span:not(.task-avatar) {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.task-avatar.community-modeler-avatar {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 50%;
  font-size: 11px;
  margin-right: 4px;
  vertical-align: middle;
}

/* ============================================================
   v716 · 2026-07-24 二更补
   修复：新增客户弹窗「合作人」combobox 下拉不可见
   根因：容器定位规则原限定 #customerSystemPanel，弹窗（fixed
   backdrop 成为定位祖先）内缺 position:relative，下拉与箭头
   相对整个 backdrop 定位到视口之外。改为通用类选择器（原
   #customerSystemPanel 规则更具体仍优先，筛选栏行为不变）。
   ============================================================ */

.customer-employee-combobox {
  position: relative;
  display: block;
  min-width: 0;
}

.customer-employee-combobox > input[type="text"] {
  padding-right: 28px;
  text-overflow: ellipsis;
}

/* 弹窗内 combobox 与表单控件同宽、下拉贴住输入框 */
.modal-panel .customer-employee-combobox {
  width: 100%;
}

.modal-panel .customer-employee-combobox-list {
  z-index: 80;
}

/* ============================================================
   v717 · 2026-07-25 一更
   ① 房源线索工具栏「选择在职经纪人」收窄为 200px 固定宽
   ② 「关全部临时任务」琥珀色醒目按钮
   ③ 更换录入人弹窗样式
   ============================================================ */

/* ① 桌面：select 固定 200px，超长省略号，与按钮同高对齐 */
.deep-lead-admin-toolbar {
  grid-template-columns: auto auto 200px repeat(8, auto);
  justify-content: start;
}

.deep-lead-admin-toolbar > #deepLeadTemporaryAssignee {
  width: 200px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ② 关全部临时任务：琥珀色醒目但与危险红区分，确认框防误点 */
.deep-lead-admin-toolbar [data-deep-action="close-all-property-leads-temporary"] {
  color: #9a6b12;
  border-color: #d9a83f;
  font-weight: 900;
}

.deep-lead-admin-toolbar [data-deep-action="close-all-property-leads-temporary"]:hover {
  background: #fdf3dd;
  border-color: #c28f1f;
}

/* ③ 更换录入人弹窗 */
.deep-lead-owner-change-panel {
  width: min(460px, 100%);
}

.deep-lead-owner-change-tip {
  margin: 4px 0 12px;
  color: var(--muted, #627789);
  font-size: 13px;
  line-height: 1.6;
}

.deep-lead-owner-change-panel .customer-employee-combobox {
  margin-bottom: 16px;
}

/* 断点同步：1360/1100/700 三档维持原响应式行为 */
@media (max-width: 1360px) {
  .deep-lead-admin-toolbar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .deep-lead-admin-toolbar > #deepLeadTemporaryAssignee {
    grid-column: span 2;
    width: 100%;
    max-width: 260px;
  }
}

@media (max-width: 1100px) {
  .deep-lead-admin-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deep-lead-admin-toolbar > #deepLeadTemporaryAssignee {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 700px) {
  .deep-lead-admin-toolbar {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .deep-lead-admin-toolbar > #deepLeadTemporaryAssignee {
    grid-column: auto;
    width: 100%;
    max-width: none;
  }
}


/* v718: 2D楼栋字典操作台——右侧详情真固定、上方信息压缩一半、矩阵为主、窄屏降级纵向流。 */

/* 根因修复：.app-shell 的 overflow-x:hidden 会让它成为滚动容器，导致详情卡 sticky 相对它（而非视口）失效、
   表现为详情卡跟随房号矩阵一起滚走。房间操作台页面改用等效裁剪但不产生滚动容器的 clip，sticky 即可相对视口顶格固定。
   不支持 clip 的旧浏览器自动回退到前一条 hidden，行为与现状一致。 */
.app-shell:has(.deep-layout.room-workspace) {
  overflow-x: hidden;
  overflow-x: clip;
}

/* 桌面端：右侧详情卡顶格固定；内容超高时仅在卡片内部滚动（鼠标悬停其上才滚它自己），不随主页面滚。 */
@media (min-width: 901px) {
  .deep-layout.room-workspace .deep-detail,
  .deep-layout.room-workspace.detail-open .deep-detail,
  .deep-layout.room-workspace.detail-open .deep-detail:has(.deep-room-profile) {
    position: sticky !important;
    top: 108px !important;
    align-self: start !important;
    max-height: calc(100svh - 120px) !important;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* 桌面宽屏：当前作业盘统计行 + 状态行压缩到约一半宽，字号随卡片等比缩（数字 20px、标签 10-11px），数字仍是视觉重点。 */
@media (min-width: 1281px) {
  .deep-layout.room-workspace .deep-hero-panel {
    width: max(460px, 50%);
    max-width: 100%;
    grid-template-columns: minmax(132px, 0.9fr) minmax(0, 1.75fr);
    gap: 6px 8px;
    padding: 8px;
  }

  .deep-layout.room-workspace .deep-hero-copy h2 {
    font-size: 17px;
  }

  .deep-layout.room-workspace .deep-hero-copy small {
    font-size: 11px;
  }

  .deep-layout.room-workspace .deep-hero-metrics {
    grid-template-columns: minmax(56px, 64px) repeat(4, minmax(0, 1fr));
    gap: 4px;
  }

  .deep-layout.room-workspace .deep-hero-panel article,
  .deep-layout.room-workspace .deep-hero-meter {
    min-height: 38px;
    padding: 3px 6px;
  }

  .deep-layout.room-workspace .deep-hero-panel article span {
    font-size: 11px;
  }

  .deep-layout.room-workspace .deep-hero-panel article strong {
    margin-top: 2px;
    font-size: 20px;
    line-height: 1.1;
  }

  .deep-layout.room-workspace .deep-hero-meter span {
    inset: 5px;
  }

  .deep-layout.room-workspace .deep-hero-meter strong {
    font-size: 20px;
    line-height: 1.05;
  }

  .deep-layout.room-workspace .deep-hero-meter small {
    font-size: 10px;
  }

  .deep-layout.room-workspace .deep-status-rail {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 4px;
    padding: 6px 0 0;
  }

  .deep-layout.room-workspace .deep-status-rail button {
    gap: 1px;
    min-height: 34px;
    padding: 2px 3px;
    border-radius: 6px;
  }

  .deep-layout.room-workspace .deep-status-rail strong {
    font-size: 15px;
    line-height: 1.1;
  }

  .deep-layout.room-workspace .deep-status-rail span {
    font-size: 10px;
  }

  .deep-layout.room-workspace .deep-main {
    gap: 8px;
  }
}

/* 窄屏/移动端：房间操作台降级为正常纵向流，详情卡固定规则全部解除。 */
@media (max-width: 900px) {
  .deep-layout.room-workspace,
  .deep-layout.room-workspace.detail-open {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .deep-layout.room-workspace .deep-detail,
  .deep-layout.room-workspace.detail-open .deep-detail,
  .deep-layout.room-workspace.detail-open .deep-detail:has(.deep-room-profile) {
    position: static !important;
    grid-column: auto !important;
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
  }
}


/* v719: 2D楼栋字典操作台微调——统计/状态卡自动均分拉满中间列、纵向再收窄约20%、标签禁换行、快速筛选行不越界。 */

@media (min-width: 901px) {
  /* 快速筛选行：整体约束在中间列宽内，搜索框可压缩、状态下拉限宽，任何窗口宽度下控件不越出中间工作区右缘。
     根因：v630 的三列 minmax 下限合计 620px+，1366 档中间列约 590px，grid 被撑出容器。 */
  .deep-layout.room-workspace .deep-filter-toolbar {
    grid-template-columns: auto minmax(0, 1fr) minmax(120px, 160px);
    max-width: 100%;
    overflow: hidden;
  }

  .deep-layout.room-workspace .deep-filter-toolbar input {
    min-width: 0;
  }

  .deep-layout.room-workspace .deep-filter-toolbar select {
    width: 100%;
    max-width: 160px;
  }

  /* 当前作业盘统计卡行：取消 v718 的半宽限宽，整行拉满中间列；纵向 padding/高度再降约 20%（数字保持 18-20px）。 */
  .deep-layout.room-workspace .deep-hero-panel {
    width: 100%;
    max-width: 100%;
    grid-template-columns: minmax(132px, 0.9fr) minmax(0, 1.75fr);
    gap: 6px 10px;
    padding: 6px 8px;
  }

  .deep-layout.room-workspace .deep-hero-metrics {
    grid-template-columns: minmax(64px, 72px) repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .deep-layout.room-workspace .deep-hero-panel article,
  .deep-layout.room-workspace .deep-hero-meter {
    min-height: 30px;
    padding: 2px 6px;
  }

  .deep-layout.room-workspace .deep-hero-panel article span {
    font-size: 11px;
    white-space: nowrap;
  }

  .deep-layout.room-workspace .deep-hero-panel article strong {
    margin-top: 1px;
    font-size: 20px;
    line-height: 1.05;
  }

  .deep-layout.room-workspace .deep-hero-meter span {
    inset: 3px;
  }

  .deep-layout.room-workspace .deep-hero-meter strong {
    font-size: 17px;
    line-height: 1;
  }

  .deep-layout.room-workspace .deep-hero-meter small {
    font-size: 9px;
    white-space: nowrap;
  }

  /* 状态卡行：8 枚均分拉满中间列，纵向收窄约 20%，标签禁换行。 */
  .deep-layout.room-workspace .deep-status-rail {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 8px;
    padding: 4px 0 0;
  }

  .deep-layout.room-workspace .deep-status-rail button {
    gap: 0;
    min-height: 27px;
    padding: 1px 4px;
    border-radius: 6px;
  }

  .deep-layout.room-workspace .deep-status-rail strong {
    font-size: 15px;
    line-height: 1.1;
  }

  .deep-layout.room-workspace .deep-status-rail span {
    font-size: 10px;
    white-space: nowrap;
  }
}


/* v720: 业主商机入口迁入房源深耕——面板在房源深耕页内保持顶对齐（对齐原商机页 5669 行行为）。 */
.deep-page .opportunity-panel.active {
  margin-top: 0;
}

/* ===================== v721 数据面板（管理考核 · 阶段一） ===================== */
.databoard-page > .page-card {
  width: 100%;
  max-width: none;
}

.databoard-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.databoard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.databoard-head h2 {
  margin: 2px 0 4px;
  font-size: 20px;
  color: var(--text);
}

.databoard-head small {
  color: var(--muted);
  font-size: 12px;
}

.databoard-head-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.databoard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.databoard-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.databoard-tab {
  border: none;
  background: transparent;
  padding: 7px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
}

.databoard-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--soft-shadow);
}

.databoard-range {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.databoard-range label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.databoard-range input[type="date"] {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text);
  background: var(--panel);
  font-family: inherit;
}

.databoard-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.databoard-summary-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--soft-shadow);
}

.databoard-summary-card span {
  font-size: 12px;
  color: var(--muted);
}

.databoard-summary-card strong {
  font-size: 22px;
  color: var(--text);
}

.databoard-summary-card small {
  font-size: 11px;
  color: var(--muted);
}

.databoard-table-wrap {
  overflow: auto;
  max-height: calc(100svh - 320px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.databoard-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  min-width: 1080px;
  font-size: 13px;
  color: var(--text);
}

.databoard-table th,
.databoard-table td {
  padding: 9px 12px;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

.databoard-table thead th {
  position: sticky;
  top: 0;
  z-index: 6;
  background: var(--panel-soft);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.databoard-table .databoard-col-user {
  position: sticky;
  left: 0;
  z-index: 5;
  text-align: left;
  background: var(--panel);
  box-shadow: 8px 0 14px rgba(20, 37, 54, 0.05);
  min-width: 168px;
}

.databoard-table thead .databoard-col-user {
  z-index: 7;
  background: var(--panel-soft);
}

.databoard-table tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 4;
  font-weight: 700;
  background: var(--panel-soft);
  border-bottom: none;
  border-top: 2px solid var(--line);
}

.databoard-table tfoot .databoard-col-user {
  z-index: 5;
}

.databoard-table tbody tr:hover td {
  background: var(--primary-soft);
}

.databoard-table tbody tr:hover .databoard-col-user {
  background: var(--primary-soft);
}

.databoard-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.databoard-user b {
  display: block;
  font-size: 13px;
}

.databoard-user small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.databoard-avatar {
  width: 30px;
  height: 30px;
  font-size: 13px;
  flex-shrink: 0;
}

.databoard-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.databoard-badge.ok {
  background: var(--accent-soft);
  color: var(--accent);
}

.databoard-badge.miss {
  background: rgba(207, 58, 66, 0.1);
  color: var(--danger);
}

.databoard-col-placeholder {
  color: var(--muted);
}

.databoard-empty {
  text-align: center !important;
  padding: 32px 12px !important;
  color: var(--muted);
}

.databoard-footnote {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

@media (max-width: 900px) {
  .databoard-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .databoard-tabs {
    align-self: flex-start;
  }

  .databoard-table-wrap {
    max-height: none;
  }
}

/* ===================== v722 数据面板 · 阶段二：上传与字段配置 ===================== */
.databoard-dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  width: min(760px, calc(100vw - 32px));
  max-height: min(84svh, 900px);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}

.databoard-dialog::backdrop {
  background: rgba(20, 37, 54, 0.35);
}

.databoard-dialog > div {
  padding: 18px 20px;
  overflow: auto;
  max-height: inherit;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.databoard-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.databoard-dialog-head h3 {
  margin: 0;
  font-size: 17px;
}

.databoard-dialog-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

.databoard-dialog-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.databoard-dialog-row label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  flex: 1;
  min-width: 180px;
}

.databoard-dialog-row input {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  background: var(--panel);
  font-family: inherit;
}

.databoard-upload-empty {
  padding: 22px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

.databoard-upload-empty p {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}

.databoard-upload-draft {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.databoard-preview-wrap {
  overflow: auto;
  max-height: 240px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.databoard-preview-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}

.databoard-preview-table th,
.databoard-preview-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.databoard-preview-table thead th {
  position: sticky;
  top: 0;
  background: var(--panel-soft);
  color: var(--muted);
  font-weight: 700;
}

.databoard-dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.databoard-dataset-list h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
}

.databoard-dataset-list ul,
.databoard-config-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.databoard-dataset-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
}

.databoard-dataset-list li b {
  display: block;
  font-size: 13px;
}

.databoard-dataset-list li small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.databoard-config-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.databoard-config-visible {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}

.databoard-config-visible small {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 10px;
}

.databoard-config-list select {
  max-width: 260px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text);
  background: var(--panel);
  font-family: inherit;
}

.databoard-dialog .danger {
  color: var(--danger);
  border-color: rgba(207, 58, 66, 0.35);
}

@media (max-width: 900px) {
  .databoard-dialog {
    width: calc(100vw - 20px);
  }
}

/* ===================== v723 数据面板：搜索筛选 + 列排序 + 数据后台 ===================== */
.databoard-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.databoard-search input[type="search"],
.databoard-search select {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text);
  background: var(--panel);
  font-family: inherit;
}

.databoard-search input[type="search"] {
  width: 180px;
}

.databoard-search select {
  max-width: 150px;
}

.databoard-table th.databoard-th-sort {
  position: sticky;
  cursor: pointer;
  user-select: none;
  padding-right: 20px;
}

.databoard-table th.databoard-th-sort:hover {
  color: var(--primary);
}

.databoard-table th.databoard-th-sort.is-sort-asc::after,
.databoard-table th.databoard-th-sort.is-sort-desc::after {
  position: absolute;
  right: 6px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 950;
}

.databoard-table th.databoard-th-sort.is-sort-asc::after {
  content: "↑";
}

.databoard-table th.databoard-th-sort.is-sort-desc::after {
  content: "↓";
}

/* 数据后台 */
.databoard-admin-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.databoard-admin-block > h3 {
  margin: 0;
  font-size: 15px;
  color: var(--text);
}

.databoard-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
  align-items: start;
}

.databoard-config-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--panel-soft);
}

.databoard-config-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.databoard-config-block-head h4 {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.databoard-config-block-head span {
  display: inline-flex;
  gap: 6px;
}

.databoard-dataset-table-wrap {
  max-height: 300px;
}

.databoard-dataset-table-wrap td small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.databoard-custom-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
}

.databoard-custom-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}

.databoard-custom-form input[type="text"],
.databoard-custom-form select {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text);
  background: var(--panel);
  font-family: inherit;
  min-width: 160px;
}

.databoard-custom-lines {
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  padding: 0;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.databoard-custom-lines legend {
  font-size: 12px;
  color: var(--muted);
  float: left;
  margin-right: 8px;
  line-height: 32px;
}

.databoard-custom-lines label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
}

.databoard-custom-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 900px) {
  .databoard-search {
    width: 100%;
  }

  .databoard-search input[type="search"] {
    flex: 1;
    min-width: 140px;
  }

  .databoard-config-grid {
    grid-template-columns: 1fr;
  }
}

/* ===================== v724 数据面板：工具条单行 + 数据后台紧凑化 ===================== */
/* 页头说明区已移除，工具条顶到卡片上方 */
.databoard-shell {
  gap: 10px;
}

/* 工具条一行放下：业务组页签 + 日期范围 + 搜索筛选 */
.databoard-toolbar {
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 10px;
}

.databoard-tab {
  padding: 6px 14px;
  font-size: 12px;
}

.databoard-range {
  gap: 6px;
  flex-wrap: nowrap;
  font-size: 11px;
}

.databoard-range label {
  gap: 4px;
}

.databoard-range input[type="date"] {
  padding: 5px 6px;
  font-size: 11px;
}

.databoard-search {
  gap: 6px;
  flex-wrap: nowrap;
  margin-left: auto;
}

.databoard-search input[type="search"],
.databoard-search select {
  padding: 5px 8px;
}

.databoard-search input[type="search"] {
  width: 140px;
}

.databoard-search select {
  max-width: 120px;
}

/* 数据后台紧凑化（小卡片改小） */
.databoard-admin-block {
  gap: 8px;
  padding: 10px 12px;
}

.databoard-admin-block > h3 {
  font-size: 13px;
}

.databoard-config-grid {
  gap: 8px;
}

.databoard-config-block {
  padding: 8px 10px;
}

.databoard-config-block-head {
  margin-bottom: 6px;
}

.databoard-config-block-head h4 {
  font-size: 12px;
}

.databoard-config-list li {
  padding: 5px 8px;
  font-size: 12px;
}

.databoard-upload-empty {
  padding: 12px;
}

.databoard-upload-empty p {
  margin-bottom: 8px;
  font-size: 12px;
}

.databoard-preview-table {
  font-size: 11.5px;
}

.databoard-preview-table th,
.databoard-preview-table td {
  padding: 4px 8px;
}

.databoard-custom-form {
  gap: 8px;
  padding: 8px 10px;
}

.databoard-custom-form input[type="text"],
.databoard-custom-form select {
  min-width: 130px;
  padding: 5px 8px;
}

/* 窄屏仍允许折行，保护移动端 */
@media (max-width: 900px) {
  .databoard-toolbar {
    flex-wrap: wrap;
  }

  .databoard-range,
  .databoard-search {
    flex-wrap: wrap;
  }

  .databoard-search {
    margin-left: 0;
  }
}

/* ===================== v725 数据面板 · 表格取消内部滚动、表头页面级固定并加深 ===================== */
.databoard-table-wrap {
  overflow: visible;
  max-height: none;
}
.databoard-table thead th {
  top: 108px; /* 页签条44px + 二级子导航64px，表头贴其下沿固定 */
  color: var(--text);
}
@media (max-width: 1100px) {
  .databoard-table-wrap {
    overflow-x: auto;
  }
}

/* ===================== v726 修复数据面板表头固定 ===================== */
/* .app-shell 的 overflow-x:hidden 会使 overflow-y 计算为 auto，成为滚动容器，导致 sticky 失效。
   数据面板激活时改用 overflow-x:clip（同样裁掉横向溢出，但不生成滚动容器，sticky 恢复相对视口固定）。 */
body:has(.app-page.databoard-page.active) .app-shell {
  overflow-x: clip;
}

/* ===================== v728 数据面板 · 数据列居中（经纪人列保持左对齐） ===================== */
.databoard-table th,
.databoard-table td {
  text-align: center;
}
.databoard-table .databoard-col-user,
.databoard-table td.databoard-col-user,
.databoard-table th.databoard-col-user {
  text-align: left;
}

/* ===================== v729 数据后台版面重设计：分区标题栏 + 配置网格 + 修复复选框竖排 ===================== */
/* 数据后台整体：紧凑管理台间距 */
#dataBoardAdminContent {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 数据后台页头紧凑化 */
#dataBoardAdminContent .databoard-head h2 {
  font-size: 17px;
  margin: 0 0 2px;
}

#dataBoardAdminContent .databoard-head small {
  font-size: 11.5px;
}

/* 分区卡片：统一标题栏风格 */
.databoard-admin-block {
  gap: 8px;
  padding: 10px 14px 12px;
  border-radius: 10px;
}

.databoard-admin-block > h3 {
  margin: 0;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text);
}

.databoard-admin-block .databoard-dialog-hint {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
}

/* 显示字段配置：复选框多列网格（修复每字竖排） */
.databoard-config-grid {
  gap: 8px;
}

.databoard-config-block {
  padding: 8px 10px 10px;
}

.databoard-config-block-head {
  margin-bottom: 7px;
}

.databoard-config-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 5px 8px;
}

.databoard-config-list li {
  display: block;
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  font-size: 12px;
}

.databoard-config-visible {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
  cursor: pointer;
}

/* 复选框尺寸收敛，防主题放大 */
.databoard-config-visible input[type="checkbox"] {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin: 0;
  accent-color: var(--primary);
}

/* 列名单行显示：无论多窄都不换行，超出省略 */
.databoard-config-visible > span {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

/* 来源标记小徽章 */
.databoard-config-visible small {
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  flex: 0 0 auto;
}

/* 上传区：空态与草稿紧凑对齐 */
.databoard-upload-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
}

.databoard-upload-empty p {
  margin: 0;
  font-size: 12px;
}

.databoard-upload-draft {
  gap: 8px;
}

.databoard-dialog-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.databoard-dialog-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

/* 新增字段表单：控件一行排齐 */
.databoard-custom-form {
  gap: 8px;
  padding: 8px 10px;
  align-items: flex-end;
}

.databoard-custom-form label {
  font-size: 11.5px;
  gap: 4px;
}

/* 上传记录表格紧凑 */
.databoard-dataset-table-wrap {
  max-height: 220px;
}

/* 窄屏降级：配置网格单列/双列 */
@media (max-width: 900px) {
  .databoard-config-list {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .databoard-upload-empty {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* v732: 房源深耕工作台 3 项——①在售表头行高+50%、字体放大加深；②板块1快速筛选工具栏与
   板块2当前作业盘统计卡纵向压缩（min-width:901px 生效，移动端走既有规则不受影响）；
   ③板块3重复搜索框已删（app.js），列表上方不留空隙。 */

/* ①表头：行高约 25px → 38px（+50%），字号 11 → 13px，颜色 #526c7a → 数据行正文色 #173044。 */
.deep-onsale-head {
  padding: 11px 10px;
}

.deep-onsale-th {
  color: #173044;
  font-size: 13px;
  font-weight: 900;
}

.deep-onsale-th:hover,
.deep-onsale-th.is-sort-asc,
.deep-onsale-th.is-sort-desc {
  color: #0f766e;
}

@media (min-width: 901px) {
  /* ②板块1 快速筛选工具栏：纵向 padding 10-12px → 4px，控件 36-42px → 30px，标题 18 → 15px。 */
  .deep-filter-toolbar {
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .deep-filter-toolbar input,
  .deep-filter-toolbar select {
    min-height: 30px;
  }

  .deep-filter-toolbar strong {
    font-size: 15px;
  }

  /* ②板块2 当前作业盘统计卡（通用布局）：padding 14 → 6/8，指标卡 min-height 46 → 26，
     数字 18 → 16px，状态 chips min-height 54 → 24。 */
  .deep-hero-panel {
    padding: 6px 8px;
  }

  .deep-hero-copy {
    gap: 2px;
  }

  .deep-hero-copy h2 {
    font-size: 16px;
  }

  .deep-hero-panel article,
  .deep-hero-meter {
    min-height: 26px;
    padding: 2px 6px;
  }

  .deep-hero-panel article span {
    font-size: 10px;
  }

  .deep-hero-panel article strong {
    margin-top: 1px;
    font-size: 16px;
    line-height: 1.05;
  }

  .deep-hero-meter strong {
    font-size: 15px;
    line-height: 1;
  }

  .deep-hero-meter small {
    font-size: 9px;
  }

  .deep-status-rail {
    padding-top: 3px;
  }

  .deep-status-rail button {
    gap: 0;
    min-height: 24px;
    padding: 1px 4px;
  }

  .deep-status-rail strong {
    font-size: 14px;
    line-height: 1.1;
  }

  .deep-status-rail span {
    font-size: 9px;
  }

  /* ②板块2 room-workspace 作用域（同特异性后加载，压过 v719 的值再降约 20%）：
     padding 6/8 → 4/8，指标卡 30 → 24，数字 20 → 15px，chips 27 → 22。 */
  .deep-layout.room-workspace .deep-hero-panel {
    padding: 4px 8px;
  }

  .deep-layout.room-workspace .deep-hero-copy h2 {
    font-size: 15px;
  }

  .deep-layout.room-workspace .deep-hero-panel article,
  .deep-layout.room-workspace .deep-hero-meter {
    min-height: 24px;
    padding: 1px 6px;
  }

  .deep-layout.room-workspace .deep-hero-panel article span {
    font-size: 10px;
  }

  .deep-layout.room-workspace .deep-hero-panel article strong {
    font-size: 15px;
  }

  .deep-layout.room-workspace .deep-hero-meter strong {
    font-size: 14px;
  }

  .deep-layout.room-workspace .deep-status-rail button {
    min-height: 22px;
  }

  .deep-layout.room-workspace .deep-status-rail strong {
    font-size: 13px;
  }

  .deep-layout.room-workspace .deep-status-rail span {
    font-size: 9px;
  }
}

/* ===================== v733 房源深耕 · 待机占位卡高度自适应 ===================== */
/* 未选中房号时右侧「房号详情」待机卡只包裹内容、不撑满整列，避免压着列表；点开房号的详情卡不受影响 */
@media (min-width: 901px) {
  .deep-layout.room-workspace .deep-detail:has(.deep-detail-empty) {
    align-self: start !important;
    height: auto !important;
    max-height: none !important;
  }
  .deep-layout.room-workspace .deep-detail-empty {
    min-height: 0;
    padding: 22px 18px;
  }
}

/* ===================== v734 登录页文字版 logo（ZJ振家 + 业务操作系统） ===================== */
/* 替换含「3D」字样的图片 logo（原图 zhenjia-logo-auth-black.png 未改动、不再引用）；样式对齐原图：红色 ZJ 徽章 + 深色粗体「振家」 */
.auth-card-brand .auth-brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 0 0 auto;
}

.auth-card-brand .auth-brand-logo > strong {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  color: #fff;
  background: #f2213a;
  border-radius: 13px;
  font-size: 26px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
}

.auth-card-brand .auth-brand-logo > em {
  font-style: normal;
  color: #10202f;
  font-size: 40px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .auth-card-brand .auth-brand-logo > strong {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    font-size: 20px;
  }

  .auth-card-brand .auth-brand-logo > em {
    font-size: 28px;
  }
}

/* ===================== v735 logo 换用户指定图片（logo-zhenjia.png） ===================== */
/* 导航/登录/积分录入三处换图；文字版 logo 保留为图片加载失败时的兜底（hidden 切换），[hidden] 优先级需压过 v734 的 display 规则 */
.auth-card-brand .auth-brand-logo[hidden] {
  display: none !important;
}

/* ===================== v737: 3D房源列表顶部已发布小区卡片条 + 选中小区在售明细 ===================== */
.listing-community-cards {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.listing-community-card {
  flex: 0 0 auto;
  min-width: 168px;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
}
.listing-community-card strong {
  font-size: 13.5px;
  font-weight: 900;
  color: var(--text);
}
.listing-community-card > span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}
.listing-community-card:hover {
  border-color: #87c6bd;
  box-shadow: 0 6px 16px rgba(24, 73, 90, .08);
}
.listing-community-card.active {
  border-color: #0f8b7e;
  box-shadow: inset 3px 0 0 #0f8b7e;
  background: #f0faf8;
}
.listing-community-detail {
  margin-top: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}
.listing-community-detail > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 2px 2px 8px;
}
.listing-community-detail > header strong {
  font-size: 14px;
  font-weight: 900;
  color: var(--text);
}
.listing-community-detail-scroll {
  overflow-x: auto;
}
@media (max-width: 900px) {
  .listing-community-card {
    min-width: 150px;
  }
}

/* ===================== v737 数据面板 · 多列紧凑自适应（买卖组全列可见） ===================== */
.databoard-table {
  min-width: 100%;
  font-size: 12px;
}
.databoard-table th,
.databoard-table td {
  padding: 6px 8px;
}
.databoard-table thead th {
  font-size: 11.5px;
}
.databoard-table .databoard-col-user {
  min-width: 140px;
}
.databoard-badge {
  font-size: 10px;
  padding: 1px 5px;
}

/* ===================== v738 数据面板 · 固定布局，任何屏宽全列可见 ===================== */
/* table-layout:fixed + 全宽，列等分剩余空间，永不溢出被裁；小屏兜底横向滚动 */
.databoard-table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
}
.databoard-table th,
.databoard-table td {
  padding: 6px 3px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.databoard-table thead th {
  white-space: normal;
  line-height: 1.25;
  font-size: 11px;
  padding: 6px 3px;
}
.databoard-table .databoard-col-user {
  width: 148px;
  min-width: 148px;
}
/* 月总积分徽章竖排在数字下方，避免窄列被截断 */
.databoard-table .databoard-badge {
  display: block;
  width: fit-content;
  margin: 2px auto 0;
  font-size: 9.5px;
  padding: 1px 5px;
}
/* 窄屏（小笔记本等）再压一档 */
@media (max-width: 1400px) {
  .databoard-table {
    font-size: 11.5px;
  }
  .databoard-table thead th {
    font-size: 10.5px;
  }
  .databoard-table .databoard-col-user {
    width: 128px;
    min-width: 128px;
  }
}
/* 手机/平板兜底：实在放不下时允许横向滚动 */
@media (max-width: 1100px) {
  .databoard-table-wrap {
    overflow-x: auto;
  }
  .databoard-table {
    min-width: 960px;
  }
}

/* ===================== v744 量化考核面板 ===================== */
/* 每个指标单元格三行：实际值/基准 → 进度条 → 得分；配色四档语义色，适配两套主题 */
.quant-table th,
.quant-table td {
  text-align: center;
  vertical-align: middle;
}
.quant-table .databoard-col-user {
  text-align: left;
}
.quant-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: stretch;
  min-width: 0;
}
.quant-value {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.quant-bar {
  display: block;
  height: 5px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.quant-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
}
.quant-bar-fill.t0 { background: #dc2626; }
.quant-bar-fill.t1 { background: #d97706; }
.quant-bar-fill.t2 { background: #2563eb; }
.quant-bar-fill.t3 { background: #16a34a; }
.quant-score {
  font-size: 11px;
  font-weight: 700;
}
.quant-score.t0 { color: #dc2626; }
.quant-score.t1 { color: #d97706; }
.quant-score.t2 { color: #2563eb; }
.quant-score.t3 { color: #16a34a; }
.quant-score.tzero { color: var(--muted); font-weight: 500; }
.quant-pending {
  color: var(--muted);
  font-size: 11.5px;
}
.quant-total {
  font-size: 14px;
  font-weight: 800;
}
.quant-total.t0 { color: #dc2626; }
.quant-total.t1 { color: #d97706; }
.quant-total.t2 { color: #2563eb; }
.quant-total.t3 { color: #16a34a; }
.quant-total-full {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
}
/* 数据后台 · 量化考核手工数据区块 */
.quant-admin-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--muted);
}
.quant-admin-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.quant-admin-toolbar input[type="month"] {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text);
  background: var(--panel);
  font-family: inherit;
}
.quant-admin-table input {
  width: 100%;
  max-width: 120px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 12px;
  color: var(--text);
  background: var(--panel);
  font-family: inherit;
}
.quant-admin-table input:focus {
  outline: 2px solid var(--primary-soft);
  border-color: var(--primary);
}
.quant-admin-status {
  font-size: 12px;
  color: var(--accent);
}
.quant-admin-table-wrap {
  max-height: min(60svh, 560px);
  overflow: auto;
}
.quant-admin-table thead th {
  position: sticky;
  top: 0;
  background: var(--panel-soft);
  z-index: 2;
}
.quant-admin-table td b {
  display: block;
  font-size: 12.5px;
}
.quant-admin-table td small {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
}
@media (max-width: 1400px) {
  .quant-value { font-size: 10.5px; }
  .quant-score { font-size: 10.5px; }
  .quant-total { font-size: 12.5px; }
}

/* ===================== v745 量化考核·绩效扣除 + 考勤统计 ===================== */
/* 绩效扣除：上行扣除分红粗，下行灰色算式 */
.quant-deduct {
  color: #dc2626;
  font-weight: 800;
  font-size: 13px;
}
.quant-deduct-formula {
  display: block;
  font-size: 9.5px;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
}
/* 考勤统计表：日期列多，不用 fixed 布局，自然宽 + 横向滚动 */
.attendance-table {
  table-layout: auto;
  width: max-content;
  min-width: 100%;
  font-size: 11.5px;
}
.attendance-table th,
.attendance-table td {
  padding: 4px 3px;
  text-align: center;
  vertical-align: middle;
}
.attendance-table .databoard-col-user {
  text-align: left;
}
.att-day-head {
  min-width: 26px;
  line-height: 1.2;
}
.att-day-head small {
  display: block;
  font-size: 9px;
  font-weight: 400;
  color: var(--muted);
}
.attendance-table .att-weekend {
  background: var(--panel-soft);
}
.attendance-table .att-today {
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.attendance-table .att-future {
  opacity: 0.35;
}
.att-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin: 1px auto;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.attendance-legend .att-mark {
  display: inline-flex;
  margin: 0 3px 0 6px;
  vertical-align: -3px;
}
.att-ok { background: rgba(22, 163, 74, 0.14); color: #16a34a; }
.att-field { background: rgba(37, 99, 235, 0.14); color: #2563eb; }
.att-bad { background: rgba(220, 38, 38, 0.13); color: #dc2626; }
.att-none { background: transparent; color: var(--muted); font-weight: 400; }
.att-pending { background: transparent; color: var(--muted); font-weight: 400; }
.att-btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}
.att-btn:hover {
  outline: 1.5px solid var(--primary);
  outline-offset: 0;
}
.att-btn.att-saving {
  opacity: 0.5;
  cursor: wait;
}
/* 右侧三列统计 sticky */
.attendance-table .att-stat {
  position: sticky;
  z-index: 5;
  min-width: 92px;
  background: var(--panel);
}
.attendance-table thead .att-stat {
  background: var(--panel-soft);
  z-index: 7;
  font-size: 10.5px;
  white-space: normal;
  line-height: 1.25;
}
.attendance-table .att-stat-1 {
  right: 184px;
  box-shadow: -8px 0 14px rgba(20, 37, 54, 0.05);
}
.attendance-table .att-stat-2 { right: 92px; }
.attendance-table .att-stat-3 { right: 0; }
.attendance-table tbody tr:hover .att-stat {
  background: var(--primary-soft);
}
.att-deduct-formula {
  font-size: 11px;
  color: var(--text);
  white-space: nowrap;
}
.att-deduct-total {
  color: #dc2626;
  font-weight: 800;
  font-size: 13px;
}
.attendance-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
  align-items: center;
}
.attendance-legend-group {
  display: inline-flex;
  align-items: center;
}
.attendance-legend-group b {
  color: var(--text);
  margin-right: 2px;
}
.attendance-table-wrap {
  max-height: calc(100svh - 320px);
}
@media (max-width: 1400px) {
  .attendance-table { font-size: 10.5px; }
  .attendance-table .att-stat { min-width: 80px; }
  .attendance-table .att-stat-1 { right: 160px; }
  .attendance-table .att-stat-2 { right: 80px; }
}

/* ===================== v746 绩效表头分值副标题 + 考勤脚注错位修复 ===================== */
/* 指标列表头主标题下的分值小字（考核得分/绩效扣除两列不加） */
.quant-th-score {
  display: block;
  font-size: 9.5px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.2;
  white-space: nowrap;
}
/* 考勤脚注错位根因：v725 把 .databoard-table-wrap 全局改为 overflow:visible + max-height:none
   （表头页面级 sticky top:108px），考勤表行数多，超高内容从 wrap 下沿溢出盖住静态脚注。
   修复：考勤表恢复内部滚动容器，表头 sticky 回归容器内 top:0，脚注保持静态文档流。 */
.attendance-table-wrap {
  overflow: auto;
  max-height: calc(100svh - 320px);
}
.attendance-table thead th {
  top: 0;
}
@media (max-width: 900px) {
  .attendance-table-wrap {
    max-height: calc(100svh - 300px);
  }
}

/* ===================== v747 绩效考核项配置 ===================== */
.quantcfg-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--panel);
}
.quantcfg-block + .quantcfg-block {
  margin-top: 12px;
}
.quantcfg-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.quantcfg-block-head h4 {
  margin: 0;
  font-size: 13.5px;
  color: var(--text);
}
.quantcfg-block-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.quantcfg-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.quantcfg-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-soft);
  font-size: 12px;
  color: var(--muted);
}
.quantcfg-item label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.quantcfg-item input[type="number"] {
  width: 64px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text);
  background: var(--panel);
  font-family: inherit;
}
.quantcfg-item select {
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text);
  background: var(--panel);
  font-family: inherit;
}
.quantcfg-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--text);
  min-width: 120px;
}
.quantcfg-badge {
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 6px;
  line-height: 1.6;
}
.quantcfg-add {
  margin-top: 8px;
}
.quantcfg-add summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  padding: 4px 0;
}
.quantcfg-add .quantcfg-list {
  margin-top: 6px;
  max-height: 260px;
  overflow: auto;
}
.quantcfg-add-row {
  font-size: 12px;
  color: var(--text);
}
.quantcfg-add-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 3px 2px;
}
.quantcfg-add-row small {
  color: var(--muted);
}
.quantcfg-manual-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.quantcfg-manual-form input[type="text"] {
  width: 150px;
}
.quantcfg-manual-form input[type="number"] {
  width: 80px;
}
.quantcfg-manual-form input,
.quantcfg-manual-form select {
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 12px;
  color: var(--text);
  background: var(--panel);
  font-family: inherit;
}

/* ===================== v748 添加考核项区域修复 + 考勤 20 次考核制/旷工 ===================== */
/* 根因：全局 input,select{width:100%;min-height:36px}（L10242）把添加区复选框撑满整行，
   名称与说明被挤到右侧窄列折行。修复：复选框恢复固有尺寸，添加区改自适应卡片网格，
   复选框最左 + 名称加粗 + 灰色说明小字，全部左对齐。 */
.quantcfg-add .quantcfg-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
}
.quantcfg-add .quantcfg-add-row {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-soft);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.quantcfg-add .quantcfg-add-row:has(input[type="checkbox"]:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.quantcfg-add .quantcfg-add-row label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text);
}
.quantcfg-add .quantcfg-add-row input[type="checkbox"] {
  width: auto;
  min-height: 0;
  padding: 0;
  margin: 0;
  flex: 0 0 auto;
}
.quantcfg-add .quantcfg-add-name {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.quantcfg-add .quantcfg-add-meta {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 配置区下拉框同样受全局 select{width:100%} 影响，恢复固有宽度 */
.quantcfg-item select,
.quantcfg-manual-form select {
  width: auto;
}
.quantcfg-manual-form select {
  min-width: 88px;
}
@media (max-width: 640px) {
  .quantcfg-add .quantcfg-list {
    grid-template-columns: 1fr;
  }
}
/* 考勤：旷工状态位（深红，与未打卡亮红 #dc2626 区分） */
.att-awol {
  background: rgba(153, 27, 27, 0.18);
  color: #991b1b;
}
/* 考勤统计列改四列 sticky 右侧：缺卡扣减/旷工扣减/积分缺填/合计扣减（覆盖 v745 三列偏移） */
.attendance-table .att-stat-1 {
  right: 276px;
  box-shadow: -8px 0 14px rgba(20, 37, 54, 0.05);
}
.attendance-table .att-stat-2 {
  right: 184px;
  box-shadow: none;
}
.attendance-table .att-stat-3 {
  right: 92px;
}
.attendance-table .att-stat-4 {
  right: 0;
}
@media (max-width: 900px) {
  .attendance-table .att-stat-1 {
    right: 240px;
  }
  .attendance-table .att-stat-2 {
    right: 160px;
  }
  .attendance-table .att-stat-3 {
    right: 80px;
  }
  .attendance-table .att-stat-4 {
    right: 0;
  }
}

/* ===================== v749 手工数据分区小组筛选 ===================== */
.quant-manual-team-filter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.quant-manual-team-filter select {
  width: auto;
  min-width: 110px;
  min-height: 0;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text);
  background: var(--panel);
  font-family: inherit;
}
.quant-manual-block .quantcfg-block-head {
  margin-bottom: 6px;
}

/* ===================== v751 考勤「请假」状态 ===================== */
/* 请假=已走流程：不计打卡次数、不产生扣减；琥珀色与绿✓/蓝外/红✗/深红旷区分 */
.att-leave {
  background: rgba(217, 119, 6, 0.15);
  color: #d97706;
}

/* ===================== v752 考勤「本休」状态 ===================== */
/* 本休=排班休息天：不计打卡次数、不产生扣减；灰蓝色与绿✓/蓝外/琥珀假/红✗/深红旷区分 */
.att-rest {
  background: rgba(100, 116, 139, 0.15);
  color: #64748b;
}

/* ===== 首页 v2「我的数据面板」（2026-08-04 三更，styles.css v747） =====
   版式参照 panel-参考.html，颜色全部走系统主题变量（蓝灰/深炭灰两套主题自动适配），
   金/绿/红语义色用 --hv-* 变量定义。前缀 hv- 避免与旧样式冲突。 */
.home-v2 {
  --hv-gold: #d9a320;
  --hv-gold-deep: #a87b12;
  --hv-gold-soft: rgba(217, 163, 32, 0.14);
  --hv-green: #2fa46a;
  --hv-green-soft: rgba(47, 164, 106, 0.13);
  --hv-red-soft: rgba(207, 58, 66, 0.12);
  --hv-bar-soft: #b9c9e2;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.home-v2 .home-profile-card { margin-bottom: 0; }
.home-v2 .hv-notices:empty { display: none; }

/* 工具条 */
.hv-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hv-toolbar h2 { font-size: 18px; font-weight: 800; margin: 0 6px 0 0; color: var(--text); }
.hv-chip-group { display: flex; gap: 6px; flex-wrap: wrap; }
.hv-chip {
  font-size: 12.5px; color: var(--muted); background: var(--panel);
  border: 1px solid var(--line); border-radius: 16px; padding: 6px 14px; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.hv-chip:hover { border-color: var(--primary); color: var(--primary); }
.hv-chip.on { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.hv-vs-lb { font-size: 12.5px; color: var(--muted); margin-left: 10px; }

/* 指标卡 */
.hv-metrics { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.hv-m-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.hv-m-card .hv-lb { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.hv-m-card .hv-num { font-size: 26px; font-weight: 800; line-height: 1.1; color: var(--text); }
.hv-m-card .hv-num small { font-size: 12px; font-weight: 600; color: var(--muted); }
.hv-vs { font-size: 11px; font-weight: 600; border-radius: 10px; padding: 2px 7px; display: inline-block; margin-top: 6px; }
.hv-vs.up { color: var(--hv-green); background: var(--hv-green-soft); }
.hv-vs.down { color: var(--danger); background: var(--hv-red-soft); }
.hv-vs.flat { color: var(--muted); background: var(--panel-soft); }

/* 骨架屏 */
.hv-skel { height: 22px; border-radius: 6px; background: var(--panel-soft); margin: 6px 0; animation: hv-pulse 1.2s ease-in-out infinite; }
.hv-skel.small { height: 12px; }
.hv-skel.light { background: rgba(255, 255, 255, 0.14); }
@keyframes hv-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.hv-error { grid-column: 1 / -1; }

/* 空状态 */
.hv-empty {
  background: var(--panel); border: 1px dashed var(--line); border-radius: 12px;
  padding: 28px 20px; text-align: center; color: var(--muted); font-size: 14px;
}

/* 卡片与栅格 */
.hv-grid { display: grid; grid-template-columns: 7fr 5fr; gap: 14px; }
.hv-span7 { grid-column: span 1; }
.hv-span5 { grid-column: span 1; }
.hv-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; min-width: 0; }
.hv-card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.hv-card-h h3 { font-size: 15.5px; font-weight: 700; color: var(--text); margin: 0; }
.hv-card-h .hv-sub { font-size: 12px; color: var(--muted); }
.hv-card-h .hv-right { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.hv-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.hv-legend span { display: inline-flex; align-items: center; gap: 5px; }
.hv-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.hv-dot-blue { background: var(--primary); }
.hv-dot-gold { background: var(--hv-gold); border-radius: 50% !important; }
.hv-dot-gray { background: var(--hv-bar-soft); }
.hv-muted { color: var(--muted); }
.hv-gold-text { color: var(--hv-gold-deep); }

/* 趋势图 */
.hv-trend-svg { width: 100%; height: auto; display: block; }

/* 客户来源 donut */
.hv-src-wrap { display: flex; align-items: center; gap: 22px; padding: 8px 0 4px; flex-wrap: wrap; }
.hv-donut { width: 150px; height: 150px; border-radius: 50%; flex: none; position: relative; }
.hv-donut::after { content: ""; position: absolute; inset: 34px; background: var(--panel); border-radius: 50%; }
.hv-donut-hole { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 1; }
.hv-donut-hole b { font-size: 22px; color: var(--text); }
.hv-donut-hole span { font-size: 11px; color: var(--muted); }
.hv-src-list { flex: 1; min-width: 160px; }
.hv-src-it { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 5px 0; color: var(--text); }
.hv-src-it .hv-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.hv-src-it .hv-nm { flex: 1; }
.hv-src-it b { font-size: 13.5px; }
.hv-src-it .hv-cnt { font-size: 11px; color: var(--muted); }

/* 转化对比 */
.hv-cv { margin-bottom: 14px; }
.hv-cv-h { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 6px; }
.hv-cv-h .hv-st { color: var(--muted); }
.hv-cv-h .hv-st-num { color: var(--muted); font-size: 11.5px; }
.hv-cv-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.hv-cv-row .hv-who { width: 56px; font-size: 11px; color: var(--muted); text-align: right; flex: none; }
.hv-track { flex: 1; height: 14px; background: var(--panel-soft); border-radius: 7px; overflow: hidden; }
.hv-track.thin { height: 8px; }
.hv-fill { height: 100%; border-radius: 7px; transition: width 0.3s; }
.hv-cv-row .hv-pc { width: 52px; font-size: 12px; font-weight: 700; flex: none; color: var(--text); }
.hv-cv-note { font-size: 12.5px; color: var(--hv-green); background: var(--hv-green-soft); border-radius: 8px; padding: 9px 12px; font-weight: 600; line-height: 1.5; margin-top: 4px; }
.hv-cv-note.muted { color: var(--muted); background: var(--panel-soft); }

/* 房源健康度 */
.hv-health { margin-bottom: 12px; }
.hv-h-lb { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.hv-h-lb b { color: var(--text); }
.hv-top-houses { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.hv-th-t { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.hv-th-it { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 6px 0; color: var(--text); }
.hv-th-it .hv-rk { width: 18px; height: 18px; border-radius: 5px; background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; }
.hv-th-it .hv-nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hv-th-it .hv-dk { font-size: 12px; color: var(--muted); flex: none; }
.hv-th-it .hv-dk b { color: var(--text); }

/* 能力对标 */
.hv-bench-row { margin-bottom: 16px; }
.hv-b-lb { font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.hv-b-line { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.hv-b-line .hv-who { width: 52px; font-size: 11px; color: var(--muted); text-align: right; flex: none; }
.hv-b-line .hv-val { width: 48px; font-size: 12px; font-weight: 700; flex: none; color: var(--text); }
.hv-bench-note { font-size: 12.5px; color: var(--hv-gold-deep); background: var(--hv-gold-soft); border-radius: 8px; padding: 9px 12px; font-weight: 600; line-height: 1.5; }

/* AI 复盘（深蓝卡） */
.hv-ai {
  border-radius: 12px; padding: 20px 22px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(130deg, var(--primary-dark) 0%, var(--primary) 130%);
}
.hv-ai::after { content: ""; position: absolute; right: -70px; bottom: -100px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255, 255, 255, 0.06); pointer-events: none; }
.hv-ar-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; position: relative; z-index: 1; }
.hv-ai-ic { width: 34px; height: 34px; border-radius: 9px; background: rgba(255, 255, 255, 0.14); display: flex; align-items: center; justify-content: center; flex: none; }
.hv-ai-ic .ic { width: 18px; height: 18px; fill: none; stroke: var(--hv-gold); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hv-ar-h b { font-size: 15.5px; }
.hv-ar-h span { font-size: 11.5px; color: rgba(255, 255, 255, 0.72); }
.hv-ar-retry {
  margin-left: auto; font-size: 11.5px; color: #fff; background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 7px; padding: 5px 10px; cursor: pointer; flex: none;
}
.hv-ar-retry:hover { background: rgba(255, 255, 255, 0.24); }
.hv-ar-sum { font-size: 13px; line-height: 1.7; color: rgba(255, 255, 255, 0.88); margin: 0 0 12px; position: relative; z-index: 1; }
.hv-sg { display: flex; gap: 10px; align-items: flex-start; background: rgba(255, 255, 255, 0.08); border-radius: 9px; padding: 10px 12px; margin-bottom: 8px; font-size: 12.5px; line-height: 1.55; color: rgba(255, 255, 255, 0.94); position: relative; z-index: 1; }
.hv-sg .hv-no { width: 18px; height: 18px; border-radius: 5px; background: var(--hv-gold); color: #12244d; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; margin-top: 1px; }
.hv-ar-ft { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.14); font-size: 11.5px; color: rgba(255, 255, 255, 0.66); position: relative; z-index: 1; }

/* 周明细表 */
.hv-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.hv-table th { font-size: 12px; color: var(--muted); font-weight: 600; text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.hv-table td { padding: 10px; border-bottom: 1px solid var(--panel-soft); color: var(--text); }
.hv-table tr:last-child td { border-bottom: none; }
.hv-table td b { font-weight: 700; }
.hv-table .hv-wk { color: var(--muted); }
.hv-table tr.hv-cur { background: var(--primary-soft); }
.hv-table tr.hv-cur td:first-child { border-radius: 8px 0 0 8px; }
.hv-table tr.hv-cur td:last-child { border-radius: 0 8px 8px 0; }

/* 响应式 */
@media (max-width: 1280px) {
  .hv-metrics { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1080px) {
  .hv-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .hv-metrics { grid-template-columns: repeat(2, 1fr); }
  .hv-toolbar h2 { width: 100%; }
}

/* ===== 2026-08-05 一更：首页调整补充样式（styles.css v748） ===== */
.hv-dot-green { background: var(--hv-green); border-radius: 50% !important; }
.hv-table-wrap { overflow-x: auto; }
.hv-weekly-note { margin: 10px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.6; }

/* ===== 2026-08-10 四更：ICP 备案号（styles.css v749） ===== */
.icp-beian { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.6; }
.icp-beian a { color: inherit; text-decoration: none; }
.icp-beian a:hover { text-decoration: underline; }
.auth-page { position: relative; }
.icp-beian-auth { position: absolute; left: 0; right: 0; bottom: 10px; }
.icp-beian-side { order: 1000; padding: 6px 2px 0; color: rgba(255, 255, 255, .45); word-break: break-all; }
.icp-beian-bottom { display: none; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); margin-left: var(--side-nav-width); }
@media (max-width: 760px) {
  .icp-beian-side { display: none; }
  .icp-beian-bottom { display: block; margin-left: 0; }
}
