/* 主导航与工作区比例。按业务域展开目录，不依赖浏览器缩放。 */
:root { --sidebar-width: 208px; }
.topbar .brand > svg { width: 36px; height: 36px; flex: 0 0 auto; }
.topbar .brand > strong { font-size: 21px; }
.topbar .brand > span { font-size: 13px; }
@media (max-width: 700px) {
  .topbar .brand { min-width: 0; gap: 7px; }
  .topbar .brand > svg { width: 30px; height: 30px; }
  .topbar .brand > strong { font-size: 18px; }
}

.sidebar-nav, .sidebar > nav {
  padding: 12px 10px;
  overflow-y: auto;
  scrollbar-gutter: auto;
}
.nav-search { display: block; margin: 0 4px 12px; }
.nav-search input, input.nav-search {
  width: 100%;
  height: 36px;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-subtle);
  font-size: 13px;
}
input.nav-search { width: calc(100% - 8px); }
.nav-search input::placeholder, input.nav-search::placeholder { color: var(--muted); }
.nav-group, .sidebar details { margin: 0 0 4px; }
.nav-group:last-child, .sidebar details:last-child { margin-bottom: 0; }
.nav-group > summary, .sidebar details > summary {
  min-height: 40px;
  padding: 9px 10px;
  color: #4f5968;
  font-size: 13px;
  font-weight: 600;
  line-height: 22px;
  border-radius: 4px;
}
.nav-group > summary:hover { background: var(--surface-subtle); }
.nav-group[open] > summary { color: var(--text); }
.nav-group > summary::after, .sidebar details > summary::after { font-size: 17px; }
.nav-link {
  min-height: 36px;
  padding: 7px 10px 7px 18px;
  margin: 0;
  font-size: 14px;
  line-height: 22px;
  border-radius: 4px;
}
.nav-link.active, .nav-link[aria-current="page"] {
  position: relative;
  background: #edf0f4;
  color: #202b3c;
  font-weight: 600;
}
.nav-link.active::before, .nav-link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 12px;
  width: 2px;
  height: 12px;
  background: #516172;
  border-radius: 1px;
}
.sidebar-footer, .sidebar-health {
  min-height: 64px;
  padding: 11px 18px 12px;
}
.sidebar-footer .status, .sidebar-health .status { font-size: 13px; }
.sidebar-footer small, .sidebar-health small { font-size: 11px; line-height: 17px; padding-top: 2px; }
.nav-search-empty, #navEmpty { padding: 14px 10px; font-size: 13px; line-height: 1.65; color: var(--muted); }
#navResults { display: grid; gap: 2px; }
#navResults[hidden], #navGroups[hidden] { display: none !important; }
#navResults .nav-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-height: 54px;
  padding: 8px 10px;
}
#navResults .nav-link > span, #navResults .nav-link > strong {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
}
#navResults .nav-link > small {
  color: var(--muted);
  font-size: 12px;
  line-height: 17px;
  font-weight: 400;
}
#navResults .nav-link.active::before, #navResults .nav-link[aria-current="page"]::before { content: none; }

/* 页眉与范围筛选共享一组垂直节奏，正文主值保持 13px。 */
@media (min-width: 901px) {
  .main { padding-top: calc(var(--topbar-height) + 20px); }
  .scope-bar { margin-bottom: 16px; padding-top: 10px; padding-bottom: 10px; }
  .page-heading { margin-bottom: 18px; gap: 18px; }
  .page-heading h1 { font-size: 25px; line-height: 1.35; }
  .page-heading p { margin-top: 5px; font-size: 13px; line-height: 1.6; }
  .page-heading .eyebrow { margin-bottom: 3px; }
  .page-heading:has(#pageTitle) { min-height: 77px; }
  .data-table .cell-main, .data-table .cell-value { font-size: 13px; }
  .metrics { margin-bottom: 16px; }
  .metric { padding: 14px 20px; }
  .metric > span, .metric > label, .metric .metric-label { font-size: 13px; }
  .metric > strong, .metric .metric-value { margin-top: 5px; font-size: 27px; }
  .metric > small, .metric > p { margin-top: 4px; font-size: 12px; }

  /* 总览的运行链路是主内容，发行摘要使用自然高度的文本操作。 */
  #content:has(> .attention-grid),
  #content:has(> .section .attention-grid) { min-width: 0; }
  #content:has(.attention-grid) > .split { gap: 18px; }
  #content:has(.attention-grid) .section { margin-bottom: 16px; }
  #content:has(.attention-grid) .section-head { padding: 14px 18px 12px; }
  #content:has(.attention-grid) .section-head p { font-size: 13px; line-height: 1.5; }
  #content:has(.attention-grid) button.chain-summary { padding: 14px 18px; }
  #content:has(.attention-grid) .chain-summary .chain-dot > small { font-size: 11px; }
  #content:has(.attention-grid) .chain-summary > div > small { font-size: 12px; }
  #content:has(.attention-grid) .overview-release { padding: 10px 18px; }
  #content:has(.attention-grid) .overview-release > small { margin-bottom: 3px; font-size: 12px; }
  #content:has(.attention-grid) .overview-release > strong { font-size: 14px; line-height: 1.5; }
  #content:has(.attention-grid) .overview-release > p { margin-top: 3px; font-size: 13px; line-height: 1.5; }
  #content:has(.attention-grid) .overview-release > .button {
    min-height: 28px;
    padding: 3px 0;
    margin-top: 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--accent);
    font-size: 13px;
    justify-content: flex-start;
  }
  #content:has(.attention-grid) .overview-release > .button:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
  }
  #content:has(.attention-grid) .attention-item { padding: 14px 18px; }
  #content:has(.attention-grid) .attention-item > strong > span { margin-top: 5px; font-size: 13px; }
  #content:has(.attention-grid) .attention-item > small { font-size: 13px; line-height: 1.5; }
}

@media (min-width: 1101px) {
  .workbench { grid-template-columns: 220px minmax(0, 1fr); gap: 20px; }
}

@media (min-width: 901px) and (max-width: 1360px) {
  .main { padding-left: 20px; padding-right: 20px; }
  #content:has(.attention-grid) > .split { grid-template-columns: minmax(0, 2.15fr) minmax(280px, 1fr); }
  #content:has(.attention-grid) button.chain-summary {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 12px;
    column-gap: 12px;
  }
  #content:has(.attention-grid) button.chain-summary > .chain-dots { grid-column: 1 / -1; grid-row: 2; }
  #content:has(.attention-grid) button.chain-summary > span { grid-column: 2; grid-row: 1; }
}

/* 触控窗口保留抽屉导航；该断点不作为桌面无滚动的验收依据。 */
@media (max-width: 900px) {
  .sidebar { width: 248px; }
  .nav-group > summary, .sidebar details > summary { min-height: 44px; padding-top: 11px; padding-bottom: 11px; }
  .nav-link { min-height: 40px; padding-top: 9px; padding-bottom: 9px; }
  .nav-link.active::before, .nav-link[aria-current="page"]::before { top: 14px; }
  .nav-search input, input.nav-search { height: 40px; min-height: 40px; }
}

@media print {
  .nav-search { display: none; }
}
/* Context creation remains a text action, distinct from the form's final submit. */
.customer-inline-create { border: 0; background: none; color: #344054; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; min-height: 32px; padding: 4px 0; width: fit-content; text-align: left; }
.customer-inline-create:hover { color: #101828; text-decoration: underline; text-underline-offset: 3px; }
.customer-inline-create:focus-visible { outline: 2px solid #5b6b83; outline-offset: 3px; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field-label-row > label { color: #475467; font-size: 13px; }
.customer-intro { color: #667085; font-size: 14px; line-height: 1.7; margin-bottom: 20px; }
#customerError:not(:empty) { color: #b42318; padding: 8px 0; }
#customerDuplicate:not(:empty) { margin: 8px 0; }
.rail-search-hint { padding: 10px; color: #667085; font-size: 12px; line-height: 1.6; }
.scope-toggle { display:none; }
@media (max-width:540px) {
  .scope-toggle { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; min-height:44px; margin-bottom:16px; padding:9px 12px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); color:var(--muted); font:inherit; font-size:12px; text-align:left; }
  .scope-toggle > span:first-child { min-width:0; overflow-wrap:anywhere; }
  .scope-toggle > span:last-child { flex:none; color:var(--text); }
  #scopeBar.scope-compact > .scope-bar { display:none; }
  #scopeBar:not(.scope-compact) > .scope-toggle { margin-bottom:8px; }
}
