:root {
  --canvas: #f3f5f8;
  --paper: #fff;
  --ink: #16253a;
  --muted: #526278;
  --line: #dfe5ed;
  --navy: #101c32;
  --accent: #175c51;
  --accent-light: #e5f3ee;
  --font: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; }
a { color: var(--accent); text-underline-offset: 3px; }
button, select, input { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 2px solid #167665; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
svg { width: 19px; height: 19px; vertical-align: middle; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; z-index: 3; left: 1rem; top: 1rem; padding: 12px; background: white; }
.bar { background: var(--navy); color: #f3f7fc; }
.bar-inner, .frame { width: min(1440px, calc(100% - 88px)); margin-inline: auto; }
.bar-inner { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; font-weight: 740; font-size: 15px; }
.brand-icon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 9px; background: #2a494d; color: #c6f1e2; }
.brand-divider { display: inline-block; height: 12px; border-left: 1px solid #6a788c; margin-inline: 10px; vertical-align: -1px; }
.brand small { color: #c2ccda; font-size: 12px; font-weight: 500; }
.private { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #415168; padding: 7px 10px; border-radius: 6px; font-size: 12px; color: #e2ebf4; white-space: nowrap; }
.private svg { width: 13px; height: 13px; }
.frame { padding-block: 38px 44px; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 25px; }
.region { display: flex; align-items: center; gap: 7px; color: #3f536b; font-weight: 770; font-size: 10px; letter-spacing: .12em; margin-bottom: 8px; }
.flag { width: 17px; height: 12px; border: 1px solid #d6dfe9; border-radius: 2px; background: linear-gradient(to right, #244e97 0 33.3%, white 33.3% 66.6%, #d55360 66.6%); }
h1 { font-size: clamp(26px, 3.3vw, 42px); letter-spacing: -.045em; line-height: 1.23; font-weight: 780; }
.intro p { color: var(--muted); margin-top: 9px; line-height: 1.5; }
.outline, .quiet, .icon-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--paper); color: var(--ink); white-space: nowrap;
}
.outline:hover:not(:disabled), .icon-button:hover { background: #f2f5f8; border-color: #bdc9d7; }
.outline svg, .quiet svg { width: 15px; height: 15px; }
.quiet { color: #43556b; border-color: transparent; background: transparent; }
.quiet:hover { background: #eef2f6; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.metrics button {
  min-width: 0; min-height: 91px; display: flex; gap: 12px; align-items: center; padding: 13px 16px;
  text-align: left; background: white; border: 1px solid var(--line); border-radius: 10px; color: var(--ink);
  box-shadow: 0 2px 5px #182b4305;
}
.metrics button:hover { border-color: #94aaac; }
.metrics button[aria-pressed="true"] { border-color: #5b9788; box-shadow: inset 0 0 0 1px #5b9788; background: #fbfefd; }
.metrics strong, .metrics small { display: block; }
.metrics strong { font-size: 26px; line-height: 1.0; font-variant-numeric: tabular-nums; letter-spacing: -.04em; margin-bottom: 6px; }
.metrics small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.metric-ico { border-radius: 11px; width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; }
.metric-ico.blue { background: #e4edf9; color: #2b5c94; }
.metric-ico.gold { background: #fff1d8; color: #8a5109; }
.metric-ico.rose { background: #f8e8ed; color: #a03e59; }
.metric-ico.violet { background: #eee8f9; color: #6c4fa0; }
.metric-arrow { color: #6b7d91; margin-left: auto; }
.metric-arrow svg { width: 15px; height: 15px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 3px 12px #24364f07; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.section-title > div { display: flex; align-items: center; gap: 9px; }
.section-title h2 { font-size: 19px; letter-spacing: -.025em; }
.result-total, .cutoff { color: var(--muted); font-size: 12px; }
.result-total { border-radius: 20px; padding: 3px 8px; background: #edf1f6; white-space: nowrap; }
.result-total:empty { display: none; }
.controls, .filters { display: flex; align-items: center; gap: 8px; }
.controls { justify-content: space-between; padding: 14px 20px 15px; gap: 11px; }
.field-filter { padding: 0 20px 16px; border-bottom: 1px solid var(--line); }
.field-filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 38px; }
.field-filter-bar > strong { font-size: 14px; margin-right: 2px; }
.field-filter-bar button { min-height: 36px; font-size: 14px; }
.filter-save { margin-left: auto; color: var(--muted); font-size: 12px; }
.filter-mode { display: flex; align-items: center; gap: 7px; font-size: 14px; }
.filter-mode > span { color: var(--muted); }
.field-filter-rules { display: grid; gap: 8px; margin-top: 12px; }
.field-filter-rule { display: grid; grid-template-columns: minmax(160px, 1.15fr) minmax(120px, .75fr) minmax(160px, 1fr) 38px; align-items: center; gap: 8px; padding: 10px; background: #f7f9fb; border: 1px solid var(--line); border-radius: 9px; }
.field-filter-rule select, .field-filter-rule input { width: 100%; min-width: 0; height: 38px; border: 1px solid #ccd6e1; border-radius: 7px; padding: 0 10px; background-color: white; color: var(--ink); font-size: 14px; }
.field-filter-rule .icon-button { min-width: 0; width: 38px; padding: 0; font-size: 20px; color: #64758a; }
.filter-no-value { color: var(--muted); padding: 0 10px; font-size: 14px; }
.kpi-field-filter { padding: 14px 16px; margin-bottom: 18px; background: white; border: 1px solid var(--line); border-radius: 10px; }
@media (max-width: 700px) {
  .field-filter { padding-inline: 12px; }
  .field-filter-rule { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px; }
  .field-filter-rule > [data-filter-part="value"], .field-filter-rule > .filter-no-value { grid-column: 1 / 3; }
  .field-filter-rule > .icon-button { grid-column: 3; grid-row: 1 / 3; width: 36px; }
  .filter-save { margin-left: 0; flex-basis: 100%; }
}
.search {
  display: flex; flex: 0 1 365px; align-items: center; min-width: 170px; gap: 8px; min-height: 40px;
  color: #52667d; border: 1px solid var(--line); border-radius: 8px; padding: 0 11px; background: #f8fafc;
}
.search svg { width: 17px; height: 17px; }
.search:focus-within { outline: 2px solid #6ba091; outline-offset: 1px; }
.search input { width: 100%; min-width: 0; padding: 9px 0; border: 0; outline: 0; background: transparent; color: var(--ink); }
.search input::placeholder { color: #67798d; }
select {
  border: 1px solid var(--line); border-radius: 7px; background: white;
  min-height: 40px; max-width: 100%; padding-inline: 8px; color: var(--ink);
}
select:hover { border-color: #9eacbc; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
thead { background: #f5f7fa; color: #485a70; }
th, td { text-align: left; padding: 12px 9px; overflow-wrap: anywhere; }
th { font-size: 12px; font-weight: 700; border-top: 1px solid var(--line); }
td { height: 77px; border-bottom: 1px solid #e7ecf2; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f9fbfd; }
th:first-child, td:first-child { padding-left: 20px; width: 24%; }
th:nth-child(2) { width: 13%; }
th:nth-child(3) { width: 14%; }
th:nth-child(4) { width: 12%; }
th:nth-child(5) { width: auto; }
th:last-child, td:last-child { width: 50px; padding-right: 14px; text-align: right; }
.name-link { padding: 0; border: 0; background: none; text-align: left; color: #152d49; font-weight: 780; line-height: 1.3; }
.name-link:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.minor { margin-top: 4px; display: block; color: var(--muted); font-size: 12px; line-height: 1.32; }
.pill {
  display: inline-flex; align-items: center; gap: 5px; min-height: 22px; border-radius: 20px;
  font-size: 11px; font-weight: 700; line-height: 1.22; padding: 3px 7px; color: #465b71; background: #edf1f6;
}
.pill.pending { color: #784a09; background: #fff0d6; }
.pill.working, .pill.stage { color: #214e83; background: #eaf0fc; }
.pill.waiting { color: #613d90; background: #f0e9fa; }
.pill.blocked, .pill.risk { color: #90374c; background: #fbe9ef; }
.pill.complete, .pill.logged, .pill.focus { color: #17604f; background: #e2f3eb; }
.pills { display: flex; flex-wrap: wrap; gap: 4px; }
.progress-cell { font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.missing { color: var(--muted); }
.icon-button { padding: 0; min-width: 31px; min-height: 31px; }
.icon-button svg { width: 16px; height: 16px; }
.row-open { border-color: transparent; color: #465b72; background: transparent; }
.empty { text-align: center; padding: 42px 16px; color: var(--muted); border-top: 1px solid var(--line); }
.empty button { margin-top: 10px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.pagination button { margin-left: 7px; min-height: 32px; }
dialog { color: var(--ink); border: 1px solid var(--line); box-shadow: 0 15px 60px #0b172a32; }
dialog::backdrop { background: #101c3270; }
.drawer { margin: 0 0 0 auto; position: fixed; inset: 0 0 0 auto; height: 100%; max-height: none; width: min(570px, 100vw); max-width: 100%; padding: 0; }
body:has(dialog[open]) { overflow: hidden; }
.drawer-layout { min-height: 100%; }
.drawer-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 24px; color: var(--muted); border-bottom: 1px solid var(--line); }
.detail-toolbar { position: sticky; top: 0; z-index: 3; background: var(--paper); }
.detail-navigation { display: flex; flex: 1; align-items: center; gap: 10px; min-width: 0; }
.detail-navigation:has(.detail-back:not([hidden])) #drawer-category { display: none; }
.detail-back { display: inline-flex; align-items: center; gap: 5px; min-width: 0; text-align: left; }
.detail-back svg { flex: 0 0 18px; }
.detail-back span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-toolbar > .actions { flex-shrink: 0; }
.drawer-heading { padding: 18px 24px; }
.drawer-heading h2 { font-size: clamp(23px, 5vw, 32px); overflow-wrap: anywhere; line-height: 1.18; letter-spacing: -.035em; margin-bottom: 8px; }
.drawer-heading p { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.drawer-heading .pills { margin-top: 13px; }
.drawer-section { border-top: 1px solid var(--line); padding: 16px 24px; }
.drawer-section h3 { font-size: 15px; margin-bottom: 8px; display: flex; gap: 7px; align-items: center; }
.drawer-section h3 svg { color: var(--accent); width: 15px; height: 15px; }
.drawer-section p, .drawer-section li, .source-dialog p { font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.drawer-section ul { margin: 0; padding-left: 19px; }
.drawer-section li + li { margin-top: 8px; }
.entry-meta { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
.status-box { background: #f3f7f7; }
.status-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.status-row select { flex: 1 1 132px; max-width: 212px; }
.primary { min-height: 39px; border-radius: 7px; border: 1px solid var(--accent); background: var(--accent); color: white; padding: 0 12px; font-weight: 650; }
.primary:hover:not(:disabled) { background: #11473d; }
.action-check { display: flex; margin-top: 12px; gap: 8px; align-items: center; cursor: pointer; font-size: 13px; }
.action-check input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.saved-at { min-height: 1em; margin-top: 7px; color: var(--muted); font-size: 11px; }
.project-list { display: grid; gap: 8px; }
.project { border: 1px solid var(--line); border-radius: 7px; padding: 9px; }
.project p { margin-top: 4px; }
.project .pills { margin-block: 5px; }
.project-name { font-size: 13px; font-weight: 720; }
.source-list { display: grid; gap: 6px; }
.source-list a { overflow-wrap: anywhere; }
.source-dialog { width: min(530px, calc(100% - 30px)); border-radius: 12px; padding: 0; }
.source-dialog header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.source-dialog header, #sources-content { padding: 15px 21px; }
.source-dialog header { border-bottom: 1px solid var(--line); }
.source-dialog p + p, .source-dialog section + section { margin-top: 11px; }
.source-dialog .small-label { display: block; font-weight: 750; }
.error { padding: 9px 14px; margin: 12px 20px 0; background: #fff0f0; color: #8b3342; border: 1px solid #ebc7cd; border-radius: 6px; }
#drawer-content .error { margin-inline: 0; }
.error button { margin-inline-start: 8px; }
@media (max-width: 900px) {
  .bar-inner, .frame { width: calc(100% - 38px); }
  .controls { flex-wrap: wrap; }
  .search { flex: 1 1 270px; }
  .metrics button { padding: 12px; gap: 7px; }
  .metric-arrow { display: none; }
}
@media (max-width: 660px) {
  .frame { padding-top: 24px; }
  .bar-inner, .frame { width: calc(100% - 24px); }
  .bar-inner { min-height: 54px; }
  .intro { align-items: flex-start; flex-direction: column; gap: 11px; margin-bottom: 17px; }
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin-bottom: 15px; }
  .metrics button { min-height: 68px; }
  .metric-ico { width: 34px; height: 34px; flex-basis: 34px; }
  .metrics strong { font-size: 22px; }
  .section-title { padding: 14px 12px 0; }
  .section-title h2 { font-size: 16px; }
  .controls { padding: 11px 12px; }
  .filters { width: 100%; flex-wrap: wrap; gap: 5px; }
  .filters label { flex: 1 1 120px; min-width: 0; }
  .filters select { width: 100%; font-size: 12px; min-height: 34px; }
  .filters button { min-height: 34px; font-size: 12px; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  tbody tr { display: grid; grid-template-columns: 1fr 1fr 32px; align-items: center; gap: 8px; padding: 11px 12px; border-top: 1px solid var(--line); }
  tbody td, tbody td:first-child, tbody td:last-child { width: 100%; padding: 0; height: auto; border: 0; }
  tbody td:first-child { grid-column: 1 / 3; grid-row: 1; }
  tbody td:nth-child(2) { grid-row: 2; grid-column: 1; }
  tbody td:nth-child(3) { grid-row: 2; grid-column: 2; }
  tbody td:nth-child(4) { grid-row: 3; grid-column: 1; }
  tbody td:nth-child(5) { grid-row: 3; grid-column: 2 / -1; }
  tbody td:last-child { grid-row: 1; grid-column: 3; }
  .pagination { padding: 10px 12px; }
  .drawer-section, .drawer-heading, .drawer-top { padding-inline: 16px; }
}

.workspaces {
  max-width: 100%; overflow-x: auto;
  display: flex; align-items: center; gap: 5px; width: fit-content; padding: 4px;
  margin-bottom: 17px; border: 1px solid var(--line); border-radius: 9px; background: #e9edf3;
}
.workspaces a {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 7px; min-height: 35px; padding: 0 11px;
  border-radius: 6px; text-decoration: none; color: var(--muted); font-weight: 720; white-space: nowrap;
}
.workspaces a:hover { color: var(--ink); background: #f6f8fb; }
.workspaces a[aria-current="page"] { color: var(--accent); background: white; box-shadow: 0 1px 3px #1323371b; }
.workspaces svg { width: 15px; height: 15px; }
.tab-count { font-size: 11px; font-weight: 600; color: var(--muted); }
.tab-count:empty { display: none; }
.project-panel th:first-child, .project-panel td:first-child { width: 19%; }
.project-panel th:nth-child(2) { width: 13%; }
.project-panel th:nth-child(3) { width: 11%; }
.project-panel th:nth-child(4) { width: 10%; }
.project-panel th:nth-child(5) { width: 10%; }
.project-panel th:nth-child(6) { width: 8%; }
.project-panel th:nth-child(7) { width: auto; }
.mobile-scale-label { display: none; }
.project-panel .minor { word-break: break-word; }
.project-archive-filter { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 14px 20px 0; }
.project-archive-filter > span { font-size: 12px; color: var(--muted); }
.project-archive-filter button[aria-pressed="true"] { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }
.project-row-actions { display: grid; justify-items: end; gap: 4px; }
@media (min-width: 661px) { .project-panel th:last-child, .project-panel td:last-child { width: 96px; } }
.archive-action { font-size: 13px; min-height: 32px; white-space: nowrap; }
.archived-project-names { color: var(--muted); }
.consultation-intro { margin: 12px 20px 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.consultation-stage-select { width: 100%; min-width: 0; min-height: 38px; font-size: 14px; }
.consultation-preview { font-size: 14px; line-height: 1.5; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.consultation-preview + .consultation-preview { margin-top: 6px; }
.consultation-follow-date { display: block; margin-bottom: 9px; font-size: 14px; color: var(--accent); }
.consultation-follow-date.overdue { color: #9d3243; }
.consultation-panel th:first-child, .consultation-panel td:first-child { width: 16%; }
.consultation-panel th:nth-child(2) { width: 10%; }
.consultation-panel th:nth-child(3) { width: 12%; }
.consultation-panel th:nth-child(4) { width: 19%; }
.consultation-panel th:nth-child(5) { width: 20%; }
.consultation-panel th:nth-child(6) { width: auto; }
.consultation-panel .project-row-actions button { font-size: 13px; white-space: nowrap; }
.consultation-links .pill { margin-left: 5px; }
@media (min-width: 661px) {
  #consultation-list { overflow-x: auto; }
  .consultation-panel table { min-width: 1060px; }
  .consultation-panel th:last-child, .consultation-panel td:last-child { width: 116px; }
}
@media (max-width: 660px) {
  .consultation-intro { margin-inline: 12px; }
  .consultation-panel td:first-child { width: 100%; }
  .consultation-panel td:nth-child(3) { grid-column: 2 / -1; }
  .consultation-panel td:nth-child(4) { grid-column: 1 / -1; grid-row: 3; }
  .consultation-panel td:nth-child(5) { grid-column: 1 / -1; grid-row: 4; }
  .consultation-panel td:nth-child(6) { grid-column: 1 / -1; grid-row: 5; }
  .consultation-panel .project-row-actions button { font-size: 12px; white-space: normal; padding-inline: 0; }
}
.project-stage-select { width: 100%; min-width: 0; min-height: 38px; padding-inline: 9px 25px; font-size: 14px; }
.project-todos { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 14px; line-height: 1.45; }
.project-todos label { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.project-todos input { width: 17px; height: 17px; flex: 0 0 17px; margin: 2px 0 0; accent-color: var(--accent); }
.project-todos .todo-date { display: block; margin: 3px 0 0 25px; color: var(--muted); font-size: 12px; }
.project-todos .todo-overdue { color: #9d3243; }
.project-todos .todo-done label span { text-decoration: line-through; color: var(--muted); }
.project-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: 13px; }
.project-facts dt { color: var(--muted); }
.project-facts dd { margin: 0; overflow-wrap: anywhere; }
.project-card-link { display: inline-block; margin-top: 6px; font-size: 12px; }
#project-drawer-content .error { margin-inline: 0; }
@media (max-width: 390px) {
  .workspaces a { padding-inline: 8px; }
}

th:last-child, td:last-child { width: 64px; }
.filters { flex-wrap: wrap; }
.actions, .block-heading { display: flex; align-items: center; gap: 8px; }
.actions { justify-content: flex-end; }
.block-heading { justify-content: space-between; margin-bottom: 8px; }
.block-heading h3 { margin: 0; }
.detail-actions { justify-content: flex-start; margin-top: 14px; }
.block-heading button, .detail-actions button { min-height: 34px; font-size: 13px; }
.danger-text { color: #9d3243; }
.danger { min-height: 39px; padding: 0 12px; border: 1px solid #a23446; border-radius: 7px; background: #a23446; color: #fff; font-weight: 650; }
.danger:hover:not(:disabled) { background: #852438; }
.multiline { white-space: pre-wrap; }
.confirm-body { padding: 16px 21px; }
.confirm-body .actions { margin-top: 16px; }
.confirm-body .error { margin-inline: 0; }
.editor { width: min(680px, 100vw); }
#record-form .drawer-heading { padding-bottom: 12px; }
.editor-group { border-top: 1px solid var(--line); padding: 0 24px; }
.editor-group summary, .repeat-field summary { cursor: pointer; font-weight: 720; padding-block: 13px; }
.edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.editor-group > .edit-grid { padding-block: 0 15px; }
.edit-field { display: grid; align-content: start; gap: 5px; font-size: 13px; }
.edit-field.wide, .edit-grid > .wide { grid-column: 1 / -1; }
.edit-field span { color: #394d65; font-weight: 650; }
.edit-field input, .edit-field select, .edit-field textarea {
  width: 100%; min-width: 0; padding: 8px 9px; border: 1px solid #bfcbd8;
  border-radius: 7px; background: white; color: var(--ink); min-height: 39px; font: inherit;
}
.edit-field textarea { resize: vertical; }
.edit-field input[readonly] { background: #eef4f2; color: #325c53; }
.edit-field:has(input[name]) { scroll-margin-top: 15px; }
.repeat-field { border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; padding: 0 10px; scroll-margin-top: 12px; }
.repeat-count { padding: 1px 6px; margin-left: 3px; border-radius: 7px; color: var(--muted); background: #e9eef4; font-size: 12px; }
.repeat-rows { display: grid; gap: 8px; }
.repeat-row { border: 1px solid var(--line); border-radius: 7px; padding: 10px; background: #fff; }
.repeat-row button { margin-top: 4px; min-height: 28px; padding-inline: 6px; }
.repeat-field > button { margin-block: 8px 10px; min-height: 33px; }
.editor-actions { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 12px 24px; }
.editor-actions .error { margin: 0 0 8px; }
.notice { position: fixed; z-index: 2; bottom: 16px; right: 16px; max-width: calc(100vw - 32px); background: var(--navy); color: #fff; border-radius: 8px; padding: 11px 15px; box-shadow: 0 5px 20px #101c323a; }
@media (max-width: 660px) {
  tbody tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 48px; }
  .project-archive-filter { padding-inline: 12px; }
  .project-row-actions { gap: 2px; }
  .project-row-actions button { font-size: 12px; padding-inline: 0; }
  .project-panel td:first-child { width: 100%; }
  .project-panel td:nth-child(3) { grid-column: 2 / -1; }
  .project-panel td:nth-child(6) { grid-column: 1 / -1; grid-row: 4; }
  .project-panel td:nth-child(7) { grid-column: 1 / -1; grid-row: 5; padding-top: 8px; border-top: 1px solid var(--line); }
  .project-panel td:nth-child(7)::before { content: '待办'; display: block; margin-bottom: 7px; font-weight: 700; }
  .mobile-scale-label { display: inline; margin-inline-end: 6px; color: var(--muted); font-size: 12px; }
  .section-title > .primary { font-size: 13px; min-height: 34px; }
  .editor-group, .editor-actions { padding-inline: 16px; }
}
@media (max-width: 400px) {
  .edit-grid { grid-template-columns: minmax(0, 1fr); }
}

.controls { flex-wrap: wrap; }
.sort-controls, .sort-controls label { display: flex; align-items: center; gap: 7px; min-width: 0; }
.sort-controls { margin-left: auto; }
.sort-controls label { color: var(--muted); font-size: 13px; white-space: nowrap; }
.sort-controls select { width: 146px; min-width: 0; }
.sort-controls button { padding-inline: 9px; font-size: 13px; }
.sort-heading {
  display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0;
  color: inherit; background: transparent; font: inherit; text-align: left;
}
.sort-heading:hover, th[aria-sort] .sort-heading { color: var(--accent); }
.sort-heading span { flex: none; color: var(--muted); }
th[aria-sort] .sort-heading span { color: var(--accent); }
@media (max-width: 660px) {
  .sort-controls { width: 100%; margin-left: 0; }
  .sort-controls label { flex: 1; }
  .sort-controls select { width: 100%; }
  .sort-controls select, .sort-controls button { min-height: 34px; }
}

.workspaces { max-width: 100%; overflow-x: auto; }
.kpi-intro { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 24px 0 16px; }
.kpi-intro h2 { font-size: 25px; letter-spacing: -.02em; }
.kpi-intro p { color: var(--muted); margin-top: 5px; font-size: 13px; }
.kpi-summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); background: white; border: 1px solid var(--line); border-radius: 10px; }
.kpi-summary > div { display: grid; gap: 6px; padding: 18px 20px; }
.kpi-summary > div + div { border-left: 1px solid var(--line); }
.kpi-summary strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.kpi-summary span { font-size: 12px; color: var(--muted); }
.kpi-note { margin-block: 12px 20px; font-size: 13px; line-height: 1.6; color: var(--muted); max-width: 900px; }
.kpi-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; }
.kpi-toolbar .search { margin-right: auto; }
.kpi-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.kpi-card { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 20px 20px 12px; min-width: 0; }
.kpi-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-height: 42px; }
.kpi-card h3 { font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.kpi-card h3 button { font-weight: 700; line-height: 1.5; }
.kpi-card-head .pill { flex: none; }
.kpi-completion { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-block: 12px; }
.kpi-completion strong { font-size: 30px; font-variant-numeric: tabular-nums; letter-spacing: -.025em; }
.kpi-completion small { font-size: 13px; color: var(--muted); letter-spacing: 0; font-weight: 500; }
.kpi-completion > span { color: var(--accent); font-variant-numeric: tabular-nums; font-weight: 700; }
#kpi-board progress, #kpi-detail progress { display: block; width: 100%; height: 7px; border: 0; border-radius: 12px; overflow: hidden; background: #e6edf1; accent-color: var(--accent); }
progress::-webkit-progress-bar { background: #e6edf1; border-radius: 12px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 12px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 12px; }
.kpi-card-support { font-size: 12px; color: var(--muted); margin: 12px 0 18px; overflow-wrap: anywhere; min-height: 17px; }
.kpi-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding-top: 10px; border-top: 1px solid #edf1f5; }
.kpi-card-actions button { min-height: 32px; font-size: 12px; padding-inline: 7px; }
.kpi-card-actions .quiet { padding-left: 0; }
.kpi-target-form { display: flex; flex-wrap: wrap; gap: 9px; align-items: end; }
.kpi-target-form .edit-field { max-width: 180px; }
.kpi-target-form .error { flex-basis: 100%; margin: 0; }
.kpi-ledger { display: grid; gap: 9px; margin-top: 10px; }
.kpi-entry-card, .kpi-hint { border: 1px solid var(--line); border-radius: 8px; padding: 12px; min-width: 0; }
.kpi-entry-card .block-heading { align-items: start; }
.kpi-entry-card p { margin-top: 8px; }
.kpi-entry-card .actions button { min-height: 30px; font-size: 12px; padding-inline: 6px; }
.kpi-hint > .outline { margin-top: 8px; min-height: 31px; font-size: 12px; }
.kpi-form { padding: 0 24px 24px; }
.kpi-form-note { color: var(--muted); font-size: 13px; line-height: 1.6; }
#kpi-entry .error { margin-inline: 0; }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 660px) {
  .kpi-grid { grid-template-columns: minmax(0,1fr); }
  .kpi-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .kpi-summary > div { padding: 12px; }
  .kpi-summary > div:nth-child(3) { border-left: 0; }
  .kpi-summary > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .kpi-intro h2 { font-size: 22px; }
  .kpi-card { padding: 17px 16px 12px; }
  .kpi-toolbar .search { flex-basis: 100%; }
  .kpi-form { padding-inline: 16px; }
}

.kpi-card-head { align-items: flex-start; flex-wrap: wrap; }
.kpi-card-head h3 { margin-right: auto; flex: 1 1 130px; }
.kpi-card-head > .quiet { min-height: 24px; padding-inline: 3px; font-size: 12px; }
#kpi-indicator-editor .error { margin-inline: 0; }
@media (max-width: 660px) {
  .kpi-intro { align-items: flex-start; flex-wrap: wrap; }
  .kpi-intro .actions { flex-wrap: wrap; justify-content: flex-start; }
}

.record-picker { position: relative; min-width: 0; }
.record-picker .record-picker-input { padding-right: 35px; }
.record-picker-clear {
  position: absolute; top: 6px; right: 6px; width: 27px; height: 27px; border: 0;
  border-radius: 5px; background: #eef2f6; color: var(--muted); font-size: 18px;
  display: inline-flex; align-items: center; justify-content: center;
}
.record-picker-clear:hover { background: #e0e8ee; color: var(--ink); }
.record-picker-list {
  position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px);
  max-height: min(270px, 40vh); overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid #bdcbd6; border-radius: 8px; padding: 4px; background: white;
  box-shadow: 0 6px 20px #152d491f;
}
.record-picker-option {
  display: grid; gap: 3px; width: 100%; min-height: 38px; padding: 8px; margin: 0;
  border: 0; border-radius: 5px; background: white; text-align: left; color: var(--ink);
  line-height: 1.4; white-space: normal; overflow-wrap: anywhere; font: inherit;
}
.edit-field .record-picker-option > span { font-weight: 600; color: var(--ink); }
.record-picker-option small { color: var(--muted); font-size: 11px; }
.record-picker-option:hover, .record-picker-option[aria-selected="true"] { background: var(--accent-light); }
.record-picker-empty { padding: 12px 8px; color: var(--muted); font-size: 12px; line-height: 1.5; }

[hidden] { display: none !important; }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #f3f6fb; }
.login-card { width: min(100%, 430px); background: white; border: 1px solid #dbe3ec; border-radius: 16px; padding: 32px; box-shadow: 0 14px 48px #19384d12; }
.login-card h1 { font-size: 26px; margin: 0 0 28px; }
.login-card form { display: grid; gap: 14px; }
.login-card input { width: 100%; min-height: 44px; font-size: 16px; border: 1px solid #ccd6e2; border-radius: 8px; padding: 10px 12px; box-sizing: border-box; }
.login-card button { min-height: 44px; }

.field-filter-rule .record-picker-clear { width: 27px; height: 27px; min-height: 0; padding: 0; }
.field-filter-rule .record-picker-option { height: auto; min-height: 38px; }
.field-filter-rule .record-picker-list { z-index: 15; }
.field-filter-rule:focus-within { position: relative; z-index: 16; }
@media (max-width: 700px) {
  .field-filter-rule > .filter-value-picker { grid-column: 1 / 3; }
}

/* Upsell workspace */
.up-heading{display:flex;justify-content:space-between;align-items:center;gap:20px;margin:24px 0}.up-heading h2{font-size:28px;margin:8px 0}.up-heading p,.up-caption{color:#53677c;line-height:1.7}.up-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}.up-kpi{border:1px solid #dce4ee;border-radius:14px;background:white;padding:20px}.up-kpi>span{font-size:15px;font-weight:600}.up-kpi p{font-size:14px;color:#53677c}.up-caption{font-size:14px;margin:12px 0 20px}.up-summary{display:flex;flex-wrap:wrap;gap:22px;padding:16px 20px;background:#eaf2fc;border-radius:12px;color:#36516e}.up-summary b{font-size:22px;margin-left:8px;color:#153b6b}.up-tabs{display:flex;gap:8px;margin:24px 0 16px;flex-wrap:wrap}.up-tabs button{min-height:44px}.up-toolbar{display:flex;gap:12px;padding:16px 24px;align-items:center;flex-wrap:wrap}.up-toolbar input[type=search]{min-width:240px;flex:1}.up-toolbar select,.up-toolbar input,.up-bulk input{min-height:42px;border:1px solid #cbd7e5;border-radius:8px;padding:8px 12px;font:inherit;background:#fff}.up-toolbar select{max-width:300px}#up-filters{display:flex;flex-wrap:wrap;gap:8px}.up-bulk{padding:14px 24px;background:#eaf2fc;display:flex;align-items:center;gap:16px}.up-bulk[hidden]{display:none}.up-table-scroll{overflow:auto}.up-table{border-collapse:collapse;width:100%;min-width:1050px;font-size:14px}.up-table th{background:#f4f7fc;padding:13px 16px;text-align:left;color:#526780;white-space:nowrap}.up-table td{padding:16px;border-bottom:1px solid #e8edf4;vertical-align:top;max-width:260px}.up-table tr:hover{background:#f8fbff}.up-table input[type=checkbox]{width:17px;height:17px}.up-table .pill{white-space:normal}.up-wrap{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.65}.up-overdue{color:#bd3935!important}.up-dialog{width:min(880px,calc(100vw - 32px));max-height:90vh;border:0;border-radius:18px;padding:24px 32px}.up-dialog::backdrop{background:#12263b66}.up-dialog .up-heading{margin:0 0 20px}.up-dialog .up-heading h2{font-size:23px}.up-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.up-field{display:flex;flex-direction:column;gap:8px;font-size:14px}.up-field input,.up-field select,.up-field textarea{padding:11px;border:1px solid #cbd7e5;border-radius:8px;width:100%;box-sizing:border-box;font:inherit;background:white;min-height:42px}.up-field input[type=checkbox]{width:24px}.up-wide{grid-column:1/-1}.up-history{margin:22px 0}.up-history p{display:flex;gap:16px;border-left:3px solid #d9e6fa;padding-left:14px;white-space:pre-wrap}.up-history time{flex-shrink:0;color:#62768b}.up-source{margin-top:20px;padding:14px;background:#f2f6fb;border-radius:8px;color:#526780}.up-dialog footer{position:sticky;bottom:-24px;background:#fff;padding:16px 0;display:flex;justify-content:flex-end;border-top:1px solid #e5ebf3}#up-message{padding:0 24px}#up-description{font-size:15px;font-weight:500;max-width:800px;line-height:1.6}
@media(max-width:1000px){.up-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.up-heading{align-items:flex-start}.up-toolbar{padding:16px}}@media(max-width:600px){.up-kpis{grid-template-columns:1fr}.up-heading{flex-direction:column}.up-form-grid{grid-template-columns:1fr}.up-dialog{padding:20px}.up-toolbar select{max-width:100%;width:100%}.up-summary{gap:12px}.up-bulk{flex-wrap:wrap}.up-history p{flex-direction:column;gap:4px}}

.up-owner-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;align-items:start}.up-owner-module{background:#eaf0f6;border:1px solid #d7e0eb;border-radius:14px;overflow:hidden}.up-owner-module>header{display:flex;justify-content:space-between;align-items:center;padding:18px}.up-owner-module h3{font-size:18px}.up-owner-module h3 small{font-size:13px;color:#61758c;font-weight:400;display:block;margin-top:6px}.up-owner-body{padding:0 12px 12px;display:grid;gap:12px}.up-project-card{background:#fff;border:1px solid #dce4ee;border-radius:12px;padding:16px;min-width:0}.up-project-card>header{display:flex;gap:8px;justify-content:space-between;align-items:start;margin-bottom:14px}.up-project-card h4,.up-project-card h3{font-size:17px;overflow-wrap:anywhere;margin:0}.up-products{display:grid;gap:12px}.up-products>div{border-top:1px solid #edf1f6;padding-top:10px}.up-inline-stage{width:100%;border:1px solid #ccd7e4;border-radius:7px;padding:9px 8px;margin-top:7px;font-size:14px;background:#fff;color:#314a65;white-space:normal}.up-tasks{margin-top:16px;border-top:1px solid #e4ebf3;padding-top:10px}.up-task-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.up-task-row{display:flex;align-items:start;gap:9px;margin:12px 0}.up-task-row input{margin-top:4px;width:17px;height:17px;flex-shrink:0}.up-task-row .name-link{text-align:left;white-space:pre-wrap;overflow-wrap:anywhere;font-weight:400}.up-done{text-decoration:line-through;opacity:.55}.up-service-tasks{padding:16px 22px;margin-top:20px}.up-service-tasks .up-tasks{border:0;margin:0}.up-cec-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.up-pos-table{min-width:500px}.up-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.up-form-grid{gap:20px}.up-dialog{width:min(660px,calc(100vw - 32px))}@media(max-width:1050px){.up-owner-grid{grid-template-columns:1fr}.up-owner-body{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:650px){.up-owner-body,.up-cec-grid,.up-kpis{grid-template-columns:1fr}}
.up-product-heading{display:flex;align-items:start;justify-content:space-between;gap:10px}.up-remove{color:#aa3434;white-space:nowrap}.up-followups{margin:12px 0 4px;font-size:14px}.up-followups summary{cursor:pointer;color:#526780}.up-followups p{padding:10px 0;border-bottom:1px solid #edf1f6;display:grid;gap:6px}.up-followups time{color:#687d91;font-size:13px}.up-followups span{white-space:pre-wrap;overflow-wrap:anywhere}
