* { box-sizing: border-box; }
html { overflow-x: clip; }
[hidden] { display: none !important; }
.sr-only,
.visually-hidden,
.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  width: auto;
  height: auto;
  margin: 0;
  padding: var(--space-3) var(--space-4);
  overflow: visible;
  clip: auto;
  border: 1px solid var(--focus-ring);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-popover);
}
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: var(--text-body)/var(--line-body) system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto,
        "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  overflow-x: clip;
}
body[data-domain="network"] { --domain-accent: var(--domain-network); }
body[data-domain="ai"] { --domain-accent: var(--domain-ai); }
body[data-domain="languages"] { --domain-accent: var(--domain-languages); }
body[data-domain="os"] { --domain-accent: var(--domain-os); }
body[data-domain="linux-kernel"] { --domain-accent: var(--domain-kernel); }
body[data-domain="software-engineering"] { --domain-accent: var(--domain-software-engineering); }
body[data-domain="security-engineering"] { --domain-accent: var(--domain-security-engineering); }
body[data-domain="data-systems"] { --domain-accent: var(--domain-data-systems); }
body[data-domain="distributed-systems"] { --domain-accent: var(--domain-distributed-systems); }
body[data-domain="cloud-native"] { --domain-accent: var(--domain-cloud-native); }
body[data-domain="computer-science-foundations"] { --domain-accent: var(--domain-computer-science-foundations); }
body[data-domain="mathematics-for-computing"] { --domain-accent: var(--domain-mathematics-for-computing); }
body[data-domain="frontend-engineering"] { --domain-accent: var(--domain-frontend-engineering); }
body[data-domain="ux-engineering"] { --domain-accent: var(--domain-ux-engineering); }
body[data-domain="backend-engineering"] { --domain-accent: var(--domain-backend-engineering); }
body[data-domain="developer-productivity"] { --domain-accent: var(--domain-developer-productivity); }
body[data-domain="documentation-engineering"] { --domain-accent: var(--domain-documentation-engineering); }
body[data-domain="product-engineering"] { --domain-accent: var(--domain-product-engineering); }
body[data-domain="mobile-engineering"] { --domain-accent: var(--domain-mobile-engineering); }
body[data-domain="reliability-engineering"] { --domain-accent: var(--domain-reliability-engineering); }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--card) 30%, transparent),
    transparent 38vh
  );
}
:root[data-theme="light"] body::before,
:root:not([data-theme]) body::before {
  opacity: .72;
}
/* Relative sizes keep their ratio in body text but never drop below the
   smallest step: code inside a 12px caption was 10.56px, and the browser's
   `small` (parent / 1.2) made 10.8px inside 13px labels. */
code, pre { font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace; font-size: max(var(--text-xs), .88em); }
small { font-size: max(var(--text-xs), .8333em); }
a { color: var(--link); text-decoration: none; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
  box-shadow: 0 0 0 4px var(--focus-ring-shadow);
}
:where(button, [role="button"], input[type="button"], input[type="submit"], .seg-item, .pill):active {
  transform: scale(var(--motion-press-scale));
}
[data-input-modality="keyboard"] :where(a, button, input, select, textarea, summary, [tabindex]):focus {
  outline: var(--focus-ring-width) solid var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
}
@media (hover: hover) {
  :where(a, button, summary, .card, .metric-card, .health-card, .domain-card) {
    transition-duration: var(--motion-duration-fast);
    transition-timing-function: var(--motion-ease-standard);
  }
}
@media (pointer: coarse) {
  /* Only pills you can tap get the 44px target; a <span class="pill"> tag is
     a label, and growing it turned every tag row into a stack of bubbles. */
  :where(button, input, select, textarea, summary, a.pill, button.pill, label.pill, .seg-item, .sidebar-tree a) {
    min-height: var(--touch-target);
  }
}
.shell { display: flex; min-height: 100vh; width: 100%; overflow-x: clip; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--card);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  color: var(--text);
}
.brand img {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-brand);
}
.brand span {
  display: grid;
  min-width: 0;
  line-height: var(--line-compact);
}
.brand b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-strong);
}
.brand small {
  color: var(--muted);
  font-size: var(--text-caption);
  font-weight: var(--font-weight-semibold);
}
.domain-switcher {
  position: relative;
  margin-top: var(--space-4);
}
.domain-switcher-button {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: var(--touch-target);
  padding: var(--space-3);
  border: 1px solid color-mix(in srgb, var(--domain-accent) 28%, var(--border));
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--domain-accent) 7%, var(--card));
  color: var(--text);
  box-shadow: var(--shadow-hairline);
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.domain-switcher-tile {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--domain-tile-color, var(--domain-accent)) 45%, var(--text));
  color: var(--on-accent-solid);
  box-shadow: var(--shadow-brand);
}
.domain-switcher-icon {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.domain-switcher-copy {
  display: grid;
  min-width: 0;
  line-height: var(--line-compact);
}
.domain-switcher-copy strong,
.domain-switcher-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.domain-switcher-copy strong {
  font-size: var(--text-label);
  font-weight: var(--font-weight-strong);
}
.domain-switcher-copy small,
.domain-switcher-item small {
  color: var(--muted);
  font-weight: var(--font-weight-semibold);
}
.domain-switcher-chevron {
  margin-left: auto;
  color: var(--muted);
}
.domain-switcher-popover {
  position: absolute;
  inset: calc(100% + var(--space-2)) 0 auto;
  z-index: 40;
  display: grid;
  gap: var(--space-1);
  padding: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow-popover);
  background-image: linear-gradient(var(--card), var(--card)), linear-gradient(var(--bg), var(--bg));
  max-height: min(60vh, 460px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.domain-switcher-popover[hidden] {
  display: none;
}
.domain-switcher-label {
  margin: var(--space-2) var(--space-3) var(--space-1);
  color: var(--muted);
  font-size: var(--text-caption);
  font-weight: var(--font-weight-bold);
}
.domain-switcher-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 36px;
  width: 100%;
  min-width: 0;
  padding: 0 var(--space-2);
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  /* One size for the <a> "全部知识域" row and the <button> domain rows. */
  font-size: var(--text-label);
  text-align: left;
  text-decoration: none;
}
.domain-switcher-item .domain-switcher-check { margin-left: auto; color: var(--accent-text); }
.domain-switcher-dot.is-all { background: var(--muted); }
.domain-switcher-item:hover,
.domain-switcher-item.active {
  background: color-mix(in srgb, var(--domain-accent) 10%, transparent);
}
.domain-switcher-item.planned {
  color: var(--muted);
}
.domain-switcher-dot {
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--domain-tile-color, var(--domain-accent));
}
.icon {
  display: inline-block;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.searchbox input {
  width: 100%; margin: 12px 0; padding: 8px 12px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.seg { display: flex; background: var(--bg); border-radius: var(--radius); padding: 3px; }
/* `.seg-item` is used on <a>, <label> and <button>. Only the button form had
   no background, so it showed the UA button face — 1.86:1 against --muted. */
.seg-item { flex: 1; text-align: center; padding: 5px 0; border: 0; border-radius: var(--radius);
  background: transparent; color: var(--muted); font: inherit; font-size: var(--text-sm); cursor: pointer; }
.seg-item.active { background: var(--card); color: var(--text); box-shadow: var(--shadow-seg); }
.quick-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 10px; }
.quick-links a { border: 1px solid var(--border); border-radius: var(--radius); padding: 5px 8px; color: var(--text); font-size: var(--text-label); text-align: center; }
.sidebar-tree { flex: 1; margin-top: 12px; font-size: var(--text-sm); }
.sidebar-tree summary { cursor: pointer; }
.sidebar-tree ul { list-style: none; margin: 0; }
.sidebar-tree a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius); color: var(--text); }
.sidebar-tree a.active { background: var(--bg); border-left: 3px solid var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.count { color: var(--muted); font-size: var(--text-caption); }
.sidebar-foot {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.sidebar-foot button,
.sidebar-foot summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: var(--radius);
  padding: 6px 12px;
  cursor: pointer;
  font: inherit;
  font-size: var(--text-label);
}
.sidebar-foot summary {
  list-style: none;
}
.sidebar-foot summary::-webkit-details-marker {
  display: none;
}
/* The theme popover anchors on `.sidebar-foot`, not on the half-width summary,
   so it spans the footer exactly. It was a fixed 260px row of five anchored on
   the summary: wider than the scrolling sidebar, so 午夜 was clipped, and each
   option inherited the footer button's 12px side padding, leaving ~23px of
   text — 跟随系统 rendered one glyph per line. */
.theme-menu {
  position: static;
}
.theme-menu[open] summary {
  color: var(--accent-text);
  border-color: color-mix(in srgb, var(--accent) 36%, var(--border));
  background: color-mix(in srgb, var(--accent) 9%, var(--bg));
}
.sidebar-foot .theme-switcher {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 12;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  box-shadow: var(--shadow-popover);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
}
.sidebar-foot .theme-switcher button {
  justify-content: flex-start;
  min-height: 36px;
  padding: 6px 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
}
.sidebar-foot .theme-switcher button[aria-pressed="true"] {
  color: var(--text);
  background: var(--card);
  box-shadow: var(--shadow-seg);
}
@media (pointer: coarse) {
  .sidebar-foot .theme-switcher button {
    min-height: var(--touch-target);
  }
}
.sidebar-foot form {
  margin: 0;
}
.content { flex: 1; min-width: 0; padding: 32px 24px; }
/* 默认：随浏览器宽度填满内容区，仅在超宽屏(>1920)居中收口，避免左右大片留白 */
.content > * {
  width: 100%;
  max-width: min(1920px, 100%);
  margin-left: auto;
  margin-right: auto;
  min-width: 0;
}
/* 阅读/查看类页面保留易读列宽，不随宽屏拉伸（正文另有 70ch 内列） */
.content > .doc-layout,
.content > .viewer-shell {
  max-width: min(1180px, 100%);
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 20px;
}
.spotlight-trigger {
  display: inline-flex; align-items: center; justify-content: space-between;
  gap: 16px; min-width: min(420px, 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); color: var(--muted); padding: 9px 12px;
  font: inherit; cursor: pointer; text-align: left;
}
/* The label reads from the icon like any search field; between the icon and
   the shortcut with space-between it floated in the middle of the box. */
.spotlight-trigger span { flex: 1; min-width: 0; color: var(--text); text-align: left; }
/* No keyboard shortcut to advertise on a touch screen. */
@media (pointer: coarse) {
  .spotlight-trigger kbd { display: none; }
}
kbd {
  border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: var(--radius-sm); padding: 1px 6px; color: var(--muted);
  background: var(--bg); font: var(--text-xs)/1.4 ui-monospace, monospace;
}
.tree-theme-seg {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  margin: 2px 8px 8px;
  padding: 3px;
  border-radius: var(--radius);
  background: var(--bg);
}
.tree-theme-seg button {
  min-width: 0;
  min-height: 28px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: var(--text-caption);
  cursor: pointer;
}
.tree-theme-seg button.active {
  color: var(--text);
  background: var(--card);
  box-shadow: var(--shadow-seg);
  font-weight: 650;
}
.sidebar-tree[data-mode="xcode"] .module-node-card > summary {
  border-left-color: color-mix(in srgb, var(--accent) 48%, transparent);
}
.sidebar-tree[data-mode="health"] .module-node-card:not(.deep) > summary {
  background: color-mix(in srgb, var(--warning) 6%, transparent);
}
.quick-links.nav-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  margin-top: 12px;
}
.quick-links.nav-list a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 38px;
  text-align: left;
  border-color: transparent;
  background: transparent;
  padding: 6px 8px;
  font-weight: 600;
}
.quick-links.nav-list a:hover,
.quick-links.nav-list a.active {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent-text);
}
.quick-links.nav-list a.active {
  box-shadow: inset 3px 0 0 var(--accent);
}
.quick-links.nav-list .icon {
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  font-size: var(--text-label);
  line-height: 1;
}
.quick-links.nav-list a .count {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.quick-links.nav-list a.active .icon,
.quick-links.nav-list a:hover .icon {
  color: var(--on-accent-solid);
  background: var(--accent-text);
}
.nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-tree-placeholder {
  display: grid;
  gap: 8px;
  padding: 12px 10px 16px;
}
.sidebar-tree-placeholder a {
  color: var(--accent-text);
  font-weight: 650;
}
.dashboard-governance-strip.is-compact {
  padding-top: 4px;
  padding-bottom: 4px;
}
/* One quiet row, not a stray line of dots between the module board and the
   domain map: label, count, then the two places that act on it. */
.dashboard-governance-compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--card) 90%, transparent);
  color: var(--muted);
  font-size: var(--text-label);
}
.dashboard-governance-compact strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.dashboard-governance-compact a {
  padding-block: 2px;
  color: var(--accent-text);
  font-weight: 650;
}
.dashboard-governance-compact a:first-of-type {
  margin-left: auto;
}
.spotlight-overlay {
  position: fixed; inset: 0; display: grid;
  place-items: start center; padding: 11vh 16px 16px;
}
.spotlight-panel {
  width: min(720px, 100%); background: var(--card); color: var(--text);
  border: 1px solid var(--border); padding: 18px;
}
.domain-planned-dialog {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: var(--space-6);
}
.domain-planned-dialog[hidden] {
  display: none;
}
.domain-planned-scrim {
  position: absolute;
  inset: 0;
  background: var(--overlay-scrim-strong);
}
.domain-planned-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: var(--space-4);
  width: min(420px, 100%);
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-modal);
}
.domain-planned-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: var(--space-4);
}
.domain-planned-head h2 {
  margin: 0;
  font-size: var(--text-title-md);
  line-height: var(--line-title);
}
.spotlight-head {
  display: flex; align-items: start; justify-content: space-between; gap: 12px;
}
.spotlight-head h2 { margin: 0; font-size: var(--text-title-md); line-height: 1.2; }
.icon-button {
  width: 32px; height: 32px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg); color: var(--text);
  cursor: pointer; font: inherit;
}
/* Button 原语（设计稿 §13.3）：radius 10，高度 sm28/md34/lg40，primary=实心 accent+内高光。
   app 主用 .pill；.btn 补齐设计系统按钮组件，登录主按钮等处启用。令牌驱动零 hex。 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-card); color: var(--text);
  font: inherit; font-size: var(--text-label); font-weight: var(--font-weight-semibold);
  line-height: 1; text-decoration: none; cursor: pointer;
  transition: background var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
}
.btn .icon { width: 16px; height: 16px; }
.btn:hover { background: var(--surface-hover); border-color: color-mix(in srgb, var(--accent) 28%, var(--border)); }
.btn:active { transform: scale(var(--motion-press-scale)); }
.btn-primary {
  border-color: transparent; background: var(--accent-text); color: var(--on-accent-solid);
  box-shadow: inset 0 1px 0 var(--glass-rim-light);
}
.btn-primary:hover { background: var(--accent); border-color: transparent; filter: brightness(1.06); }
.spotlight-form input { font-size: var(--text-body); padding: 13px 14px; }
.spotlight-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 8px;
}
.spotlight-modes { width: min(260px, 100%); }
.spotlight-modes button { border: 0; background: transparent; cursor: pointer; }
.primary-action {
  border: 0;
  padding: 9px 16px; font: inherit; cursor: pointer;
}
.spotlight-hint { margin: 10px 0 0; font-size: var(--text-label); }
.spotlight-scope-switcher {
  margin: 12px 0 0;
  padding: 0;
  border: 0;
}
.spotlight-scope-switcher legend {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
}
.spotlight-suggested-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}
.spotlight-suggested-actions button,
.spotlight-suggested-actions a {
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--card) 86%, transparent);
  color: var(--text);
  padding: 5px 10px;
  font: inherit;
  font-size: var(--text-xs);
  line-height: 1.2;
  cursor: pointer;
}
.doc-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 220px;
  gap: 28px; align-items: start;
}
.doc-body { width: 100%; max-width: 70ch; min-width: 0; overflow-wrap: break-word; }
.doc-line-anchor {
  display: block;
  height: 0;
  scroll-margin-top: 28px;
  visibility: hidden;
}
.doc-body h1,
.doc-body h2,
.doc-body h3,
.doc-body h4,
.doc-body h5,
.doc-body h6,
.doc-body a {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.doc-body table, .doc-body pre { max-width: 100%; }
.doc-body table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; border-collapse: collapse; }
.doc-table-scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.doc-body .doc-table-scroll table { display: table; width: 100%; min-width: 560px; overflow: visible; }
.doc-body .doc-table-scroll th, .doc-body .doc-table-scroll td { min-width: 150px; word-break: normal; overflow-wrap: normal; }
/* A cell never narrows below ~5 glyphs. Auto layout handed the first column
   whatever a long code path left over — 65px — and 订阅者 / ODL 主反应器
   wrapped one character per line. The table scrolls sideways instead. */
.doc-body th, .doc-body td { border: 1px solid var(--border); padding: 6px 10px; min-width: 5.5em; }
.doc-body th { white-space: nowrap; }
.doc-body img { max-width: 100%; cursor: zoom-in; }
.doc-body pre { background: var(--card); border-radius: var(--radius); padding: 14px; overflow-x: auto; }
.doc-body .highlight { background: var(--card); border-radius: var(--radius); overflow-x: auto; }
.doc-body .highlight pre { margin: 0; background: transparent; }
.doc-body p code,
.doc-body li code,
.doc-body td code,
.doc-body th code,
.doc-body h1 code,
.doc-body h2 code,
.doc-body h3 code,
.card code,
.quality-card code,
.path-text,
.citation-path,
.change-path,
.inline-path {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.doc-body a,
.card a,
.card strong,
.muted {
  overflow-wrap: anywhere;
}
.doc-toc { position: sticky; top: 24px; order: 2; font-size: var(--text-sm); color: var(--muted); border-left: 1px solid var(--border); padding-left: 16px; }
.doc-toc ol { list-style: none; margin: 8px 0 0; padding: 0; }
.doc-toc li { margin: 0; }
/* The link fills its row. As an inline link it was a 15px-tall target. */
.doc-toc li > a { display: block; padding-block: 3px; }
.doc-toc .toc-l3 { padding-left: 12px; }
.doc-toc-mobile { display: none; }
.doc-tools { margin: 4px auto 14px; font-size: var(--text-label); }
.doc-loader { display: flex; gap: 12px; align-items: center; max-width: 70ch; }
.doc-loader button { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); color: var(--text); padding: 6px 12px; cursor: pointer; }
.prevnext { display: flex; justify-content: space-between; margin: 24px auto; max-width: 70ch; }
.prevnext .next { margin-left: auto; }
.feedback { max-width: 70ch; margin: 20px auto; }
.feedback textarea { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); color: var(--text); padding: 8px; }
.feedback button { margin-top: 8px; border: 0; border-radius: var(--radius); background: var(--accent-text); color: var(--on-accent-solid); padding: 6px 14px; cursor: pointer; }
/* components/ui_feedback.html: fixed tags above the free text; the redirect
   lands on #ui-feedback-sent, which only :target shows. */
.ui-feedback { margin: 16px 0 0; }
.ui-feedback summary { cursor: pointer; color: var(--muted); font-size: var(--text-label); min-height: 28px; padding-block: 4px; }
.ui-feedback textarea { font: inherit; font-size: var(--text-sm); }
.ui-feedback button { font: inherit; font-size: var(--text-sm); min-height: 36px; }
.ui-feedback-tags { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0; padding: 0; border: 0; font-size: var(--text-label); }
.ui-feedback-tags legend { padding: 0; margin-bottom: 6px; color: var(--muted); }
.ui-feedback-tags label { display: inline-flex; gap: 6px; align-items: center; min-height: 32px; cursor: pointer; }
.ui-feedback-note { margin: 6px 0 0; font-size: var(--text-caption); }
.ui-feedback-sent { display: none; max-width: 70ch; margin: 14px 0 0; padding: 8px 12px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--border); font-size: var(--text-label); }
.ui-feedback-sent:target { display: block; }
h1 { font-size: var(--text-h1); font-weight: var(--font-weight-bold); letter-spacing: var(--tracking-normal); line-height: var(--line-compact); }
.viewer-title { max-width: none; }

.card {
  background: var(--card); border-radius: var(--radius); padding: 18px 20px;
  border: 1px solid var(--border); transition: transform var(--dur-fast), box-shadow var(--dur-fast);
  min-width: 0;
}
.card,
.card * {
  max-width: 100%;
}
.card li,
.card p,
.card strong,
.card a {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover-card); }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 14px;
  padding: 0;
  list-style: none;
  min-width: 0;
}
.pill { display: inline-block; font-size: var(--text-caption); padding: 2px 10px; border-radius: var(--radius-pill); background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
/* The 44px touch target is taller than an inline-block pill's line, which
   left the label pinned to the top edge (围绕模块提问, 新建会话, the graph mode
   tabs). This was a :where() rule once; at zero specificity it lost to the
   inline-block display above and nothing moved. */
@media (pointer: coarse) {
  a.pill, label.pill, .seg-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}
/* Brand colours as 11px badge text measured 1.86-3.35:1. Same treatment the
   domain colours get: the hue mixed halfway to the theme's text colour. */
.pill.platform-hsan { color: color-mix(in srgb, var(--hsan) 45%, var(--text)); }
.pill.platform-bcm { color: color-mix(in srgb, var(--bcm) 45%, var(--text)); }
.breadcrumbs { font-size: var(--text-sm); color: var(--muted); margin-bottom: 8px; }
/* `color: inherit` put --muted on --mark-bg wherever the highlight sits inside
   a muted snippet — 4.37:1 on dark and graphite. --muted is tuned for a 12%
   accent tint (see tokens.css) and --mark-bg is 25%, a band nothing measured.
   A highlight is emphasis anyway, so it takes the theme's own text colour. */
mark { background: var(--mark-bg); color: var(--text); border-radius: 3px; }
.workbench-actions { display: grid; gap: 10px; min-width: 0; }
.quickpanel-card,
.dashboard-panel {
  min-width: 0;
  background: color-mix(in srgb, var(--card) 90%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}
.workbench-actions .searchbox {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px; align-items: center;
}
.workbench-actions .searchbox input { margin: 0; }
.workbench-actions button {
  border: 0; border-radius: var(--radius); background: var(--accent-text);
  color: var(--on-accent-solid); padding: 10px 14px; font: inherit; cursor: pointer;
}
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 18px 0; overflow-x: auto; }
.tabs a { padding: 8px 14px; border-radius: var(--radius) var(--radius) 0 0; color: var(--muted); white-space: nowrap; }
.tabs a.active { color: var(--text); border-bottom: 2px solid var(--accent); }

.wide-section { width: min(1120px, 100%); max-width: min(1120px, 100%); }
.page-scroll-x {
  min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.eyebrow {
  margin: 0 0 4px; color: var(--muted); font-size: var(--text-caption);
  font-weight: var(--font-weight-bold); letter-spacing: var(--tracking-label); text-transform: uppercase;
}
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 26px auto 12px;
}
.product-page-header > div,
.browse-workspace > div,
.timeline-workspace > div {
  min-width: 0;
}
.browse-workspace h1,
.timeline-workspace h1 {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.section-head.compact-head { margin: 0 0 10px; }
.section-head.compact-head h2 { font-size: var(--text-title-sm); }
.section-head h2 { margin: 0; line-height: 1.25; }
.compact-cards { grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); }
.change-list {
  list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px;
}
.change-list li {
  display: grid; grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px; align-items: start; font-size: var(--text-label);
}
.change-list span { text-transform: uppercase; font-size: var(--text-caption); color: var(--muted); }
.change-list li > a { padding-block: 1px; }

.workbench-hero,
.module-hero,
.quality-hero {
  padding: 10px 0 20px;
  border-bottom: 1px solid var(--border);
}
.workbench-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  gap: 22px; align-items: stretch;
}
.workbench-hero h1,
.module-hero h1,
.quality-hero h1 { margin: 0 0 8px; }
.dashboard-hero .hero-copy {
  display: grid;
  align-content: end;
  min-height: 260px;
  padding: 12px 0 8px;
}
.dashboard-hero .lede {
  max-width: 58ch;
}
.hero-signal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.hero-signal-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  background: color-mix(in srgb, var(--card) 72%, transparent);
  font-size: var(--text-label);
}
.hero-signal-row strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.quickpanel {
  align-content: start;
}
.dashboard-quick-actions .qa-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
/* Desktop: title beside the recent questions, the four quick actions as one
   row under both. Stacked in one column the actions plus questions ran far
   below the two-line title and left a blank band on the left. */
@media (min-width: 861px) {
  .workbench-hero.dashboard-hero {
    grid-template-areas: "copy recent" "actions actions";
    align-items: start;
  }
  .dashboard-hero .hero-copy { grid-area: copy; }
  /* (0,3,0): product-core's `.dashboard-cupertino .quickpanel` sets grid later. */
  .workbench-hero.dashboard-hero .workbench-actions { display: contents; }
  .dashboard-hero .hero-recent-questions { grid-area: recent; }
  .dashboard-hero .dashboard-quick-actions { grid-area: actions; }
  .dashboard-hero .dashboard-quick-actions .qa-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.dashboard-quick-actions .domain-card {
  padding: 11px 12px;
}
.hero-recent-questions .recent-qs a {
  background: color-mix(in srgb, var(--bg) 68%, transparent);
}
.metric-card,
.domain-card {
  display: grid; gap: 6px; min-width: 0; color: var(--text);
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.metric-card strong { font-size: var(--text-metric-md); line-height: 1; }
.metric-card strong small {
  margin-left: 4px;
  color: var(--muted);
  font-size: var(--text-label);
  font-weight: 600;
}
.metric-card small,
.domain-card span { color: var(--muted); line-height: 1.4; }
.metric-card.risk { border-left: 4px solid var(--warning); }
.health-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px; margin-top: 12px;
}
.dashboard-health-board .health-grid {
  grid-template-columns: minmax(240px, 1.12fr) repeat(3, minmax(0, 1fr));
}
.health-card {
  display: grid; gap: 4px; min-width: 0; color: var(--text);
  background: var(--card); border: 1px solid var(--border);
  border-left: 4px solid var(--success); border-radius: var(--radius);
  padding: 12px 14px;
}
.health-card.status-warn { border-left-color: var(--warning); }
.health-card strong { font-size: var(--text-title-md); line-height: 1.15; }
.health-card small { color: var(--muted); line-height: 1.35; }
.health-card.chart-card {
  min-height: 166px;
  align-content: start;
}
.dashboard-health-board .health-card.chart-card:first-child {
  min-height: 184px;
  align-content: center;
}
.health-card.chart-card strong {
  font-size: var(--text-h2);
  font-variant-numeric: tabular-nums;
}
.sync-strip {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.sync-strip > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.status-dot {
  width: 9px; height: 9px; border-radius: 50%; display: inline-block;
  background: var(--muted); flex: 0 0 auto;
}
.status-dot.ok { background: var(--success); }
.domain-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.diataxis-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.domain-card strong { display: block; }
.dashboard-columns {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px; align-items: start;
}
/* No recent modules: common modules span the page in two columns and the
   empty recent panel shrinks to its one-line hint underneath. */
.dashboard-columns.no-recent {
  grid-template-columns: minmax(0, 1fr);
}
.dashboard-columns.no-recent .common-module-panel .module-mini-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 860px) {
  .dashboard-columns.no-recent .common-module-panel .module-mini-list {
    grid-template-columns: minmax(0, 1fr);
  }
}
.dashboard-panel .section-head {
  margin-top: 0;
}
/* `> a` only: these style lists whose rows ARE links (recent questions). The
   descendant form also boxed the title link and the coverage ring inside each
   module card, drawing a grey tile around the module name. */
.common-module-panel .module-mini-list > a,
.recent-module-panel .module-mini-list > a,
.common-module-panel .module-work-row,
.recent-module-panel .module-work-row {
  border-color: transparent;
  background: color-mix(in srgb, var(--bg) 66%, transparent);
}
.module-mini-list {
  display: grid; gap: 8px;
}
.module-mini-list > a {
  display: grid; gap: 3px; min-width: 0; color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); padding: 10px 12px;
}
.module-work-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 10px 12px;
}
.module-work-row.at-risk {
  box-shadow: inset 3px 0 0 var(--warning);
}
.module-work-row .pdot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
}
.module-work-row .pdot.deep {
  background: var(--accent);
}
.module-work-row .pdot.learned {
  background: var(--success);
}
.module-work-row .pdot.warn {
  background: var(--warning);
}
.mitem-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.mitem-title {
  min-width: 0;
  color: var(--text);
}
.mitem-title strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.module-work-row .ring-wrap {
  color: var(--text);
}
.module-mini-list > a:hover,
.module-work-row:hover,
.domain-card:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}
.module-mini-list span { font-size: var(--text-label); overflow-wrap: anywhere; }
.module-work-row span {
  font-size: var(--text-label);
  overflow-wrap: anywhere;
}
.module-work-row .pct {
  color: var(--muted);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.module-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px 24px; align-items: start;
}
.module-hero-primary { min-width: 0; }
.module-actions,
.module-mappings {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end;
}
.module-tags {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px;
}
.module-tag { color: var(--text); }
.module-drawer-toggle { display: none; }
.module-read-time {
  display: flex; gap: 4px 8px; flex-wrap: wrap; font-size: var(--text-sm);
  overflow-wrap: normal;
}
.module-read-time span { white-space: nowrap; }
.module-signal-card {
  grid-column: 1 / -1; min-width: 0; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px;
}
.module-key-files ul {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 6px;
}
.module-key-files li { min-width: 0; }
.module-mappings { align-items: center; justify-content: flex-start; margin-left: auto; font-size: var(--text-label); }
/* 更多: the less-used module links, folded out of the action row. */
.module-more-actions { position: relative; display: flex; }
.module-more-actions > summary { display: flex; align-items: center; list-style: none; cursor: pointer; }
.module-more-actions > summary::-webkit-details-marker { display: none; }
.module-more-actions > summary::after { content: "▾"; margin-left: var(--space-2); color: var(--muted); }
.module-more-menu {
  position: absolute; z-index: 9; top: calc(100% + var(--space-2)); left: 0;
  display: grid; min-width: 168px; padding: var(--space-2);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--card); box-shadow: var(--shadow-hover-card);
}
.module-more-menu a {
  display: block; padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm);
  color: var(--text); font-size: var(--text-label); text-decoration: none; white-space: nowrap;
}
.module-more-menu a:hover, .module-more-menu a:focus-visible { background: var(--surface-hover); }
.module-feedback {
  width: min(1120px, 100%); max-width: min(1120px, 100%);
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
}
.module-feedback summary { cursor: pointer; font-weight: 700; }
.module-tabs { margin-top: 18px; }
.module-section { margin-top: 24px; }
.module-pane,
.module-pane * {
  max-width: 100%;
}
.module-pane {
  min-width: 0;
  overflow: hidden;
}
.module-overview {
  min-width: 0;
  overflow-x: hidden;
  overflow-wrap: anywhere;
  word-break: break-all;
}
.module-overview h1,
.module-overview h2,
.module-overview h3,
.module-overview h4,
.module-overview h5,
.module-overview h6 {
  width: 100%;
  overflow-x: hidden;
  overflow-wrap: anywhere;
  word-break: break-all;
}

@media (max-width: 720px) {
  .module-tabs {
    flex-wrap: wrap;
    overflow-x: visible;
  }
  .module-tabs a {
    flex: 1 1 calc(33.333% - 6px);
    text-align: center;
    padding-inline: 10px;
  }
}
.module-overview > h1:first-child { display: none; }
.doc-card { display: grid; gap: 8px; }
.module-filter-bar {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  margin-top: 16px;
}
.module-filter-bar label { display: grid; gap: 4px; min-width: 0; }
/* A native select will not shrink below the width of its widest option
   unless it is told to; at 1024px it drew 54px past its own label. */
.module-filter-bar select { width: 100%; min-width: 0; }
.module-filter-bar button,
.module-toolbar button {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--card);
  color: var(--text); padding: 7px 12px; font: inherit; cursor: pointer;
}
.module-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 14px auto;
}
.module-toolbar input {
  width: min(360px, 100%); border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--card); color: var(--text);
  padding: 8px 10px; font: inherit;
}
/* One segmented control, like Spotlight's 搜索/问答, instead of two loose
   bordered buttons of different widths. */
.module-view-toggle { display: inline-flex; gap: 2px; }
.module-toolbar .module-view-toggle button {
  min-width: 64px; border: 0; border-radius: var(--radius); background: transparent;
  color: var(--muted); padding: 6px 14px;
}
.module-toolbar .module-view-toggle button.active {
  background: var(--card); color: var(--text); box-shadow: var(--shadow-seg);
}
.module-filter-bar .module-filter-apply { align-self: end; min-height: 40px; }
.module-results {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 12px;
}
.module-card {
  min-width: 0;
}
.module-card header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-width: 0;
}
/* Titles carry the slug (`Flow Module - linux_interface_driver_development`),
   which offers no break opportunity, so the card drew 57px outside itself. */
.module-card header a { min-width: 0; }
.module-card header strong { overflow-wrap: anywhere; }
.module-card-meta,
.diagram-actions,
.module-sidebar-actions {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.module-detail-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px; align-items: start;
}
.module-main { min-width: 0; }
.module-sidebar {
  position: sticky; top: 24px; min-width: 0;
}
.module-drawer-head { display: none; }
.module-meta-drawer {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
}
.module-meta-drawer summary { cursor: pointer; font-weight: 700; }
.metadata-list {
  display: grid; grid-template-columns: 84px minmax(0, 1fr);
  gap: 6px 10px; margin: 12px 0; font-size: var(--text-label);
}
.metadata-list dt { color: var(--muted); }
.metadata-list dd { margin: 0; overflow-wrap: anywhere; }
.diagram-card { display: grid; gap: 8px; align-content: start; }
.diagram-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr));
  gap: 12px;
}
.diagram-cover {
  position: relative;
  min-height: 106px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--diagram-surface) 92%, white), var(--diagram-surface)),
    radial-gradient(circle at 18% 20%, color-mix(in srgb, var(--diagram-l1) 10%, transparent), transparent 44%),
    radial-gradient(circle at 82% 72%, color-mix(in srgb, var(--diagram-l3) 10%, transparent), transparent 46%);
}
.diagram-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .42;
  background-image:
    linear-gradient(color-mix(in srgb, var(--diagram-line) 12%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--diagram-line) 12%, transparent) 1px, transparent 1px);
  background-size: 28px 28px;
}
.diagram-node,
.diagram-link {
  position: absolute;
  z-index: 1;
  display: block;
}
.diagram-node {
  border: 1.5px solid var(--node-stroke);
  border-radius: var(--radius-sm);
  background: var(--node-fill);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--node-stroke) 18%, transparent);
}
.diagram-link {
  height: 2px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--diagram-line) 52%, transparent);
  transform-origin: left center;
}
.diagram-level-1 { --node-stroke: var(--diagram-l1); --node-fill: var(--diagram-l1-fill); }
.diagram-level-2 { --node-stroke: var(--diagram-l2); --node-fill: var(--diagram-l2-fill); }
.diagram-level-3 { --node-stroke: var(--diagram-l3); --node-fill: var(--diagram-l3-fill); }
.diagram-level-4 { --node-stroke: var(--diagram-l4); --node-fill: var(--diagram-l4-fill); }
.diagram-level-5 { --node-stroke: var(--diagram-l5); --node-fill: var(--diagram-l5-fill); }
.diagram-cover-architecture .diagram-level-1 { left: 8%; top: 36%; width: 20%; height: 30%; }
.diagram-cover-architecture .diagram-level-2 { left: 38%; top: 18%; width: 22%; height: 24%; }
.diagram-cover-architecture .diagram-level-3 { left: 38%; top: 58%; width: 22%; height: 24%; }
.diagram-cover-architecture .diagram-level-4 { left: 71%; top: 25%; width: 18%; height: 22%; }
.diagram-cover-architecture .diagram-level-5 { left: 71%; top: 61%; width: 18%; height: 18%; }
.diagram-cover-architecture .link-12 { left: 28%; top: 43%; width: 13%; transform: rotate(-20deg); }
.diagram-cover-architecture .link-23 { left: 28%; top: 57%; width: 13%; transform: rotate(20deg); }
.diagram-cover-architecture .link-34 { left: 60%; top: 38%; width: 13%; transform: rotate(-6deg); }
.diagram-cover-architecture .link-45 { left: 60%; top: 69%; width: 13%; transform: rotate(7deg); }
.diagram-cover-sequence .diagram-node { top: 14%; width: 13%; height: 18%; }
.diagram-cover-sequence .diagram-level-1 { left: 8%; }
.diagram-cover-sequence .diagram-level-2 { left: 28%; }
.diagram-cover-sequence .diagram-level-3 { left: 48%; }
.diagram-cover-sequence .diagram-level-4 { left: 68%; }
.diagram-cover-sequence .diagram-level-5 { left: 84%; width: 10%; }
.diagram-cover-sequence .diagram-link {
  top: 50%;
  width: 14%;
}
.diagram-cover-sequence .link-12 { left: 17%; }
.diagram-cover-sequence .link-23 { left: 37%; top: 64%; }
.diagram-cover-sequence .link-34 { left: 57%; top: 42%; }
.diagram-cover-sequence .link-45 { left: 76%; top: 58%; width: 10%; }
.diagram-cover-sequence .diagram-node::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: 58px;
  background: color-mix(in srgb, var(--node-stroke) 46%, transparent);
}
.diagram-cover-relation .diagram-level-1 { left: 40%; top: 37%; width: 20%; height: 26%; }
.diagram-cover-relation .diagram-level-2 { left: 11%; top: 17%; width: 18%; height: 20%; }
.diagram-cover-relation .diagram-level-3 { left: 72%; top: 18%; width: 18%; height: 20%; }
.diagram-cover-relation .diagram-level-4 { left: 16%; top: 69%; width: 17%; height: 18%; }
.diagram-cover-relation .diagram-level-5 { left: 69%; top: 68%; width: 17%; height: 18%; }
.diagram-cover-relation .link-12 { left: 29%; top: 35%; width: 16%; transform: rotate(25deg); }
.diagram-cover-relation .link-23 { left: 56%; top: 36%; width: 18%; transform: rotate(-25deg); }
.diagram-cover-relation .link-34 { left: 31%; top: 64%; width: 16%; transform: rotate(-25deg); }
.diagram-cover-relation .link-45 { left: 56%; top: 64%; width: 16%; transform: rotate(25deg); }
.diagram-cover-flow .diagram-node { left: 10%; width: 22%; height: 16%; }
.diagram-cover-flow .diagram-level-1 { top: 12%; }
.diagram-cover-flow .diagram-level-2 { left: 30%; top: 32%; }
.diagram-cover-flow .diagram-level-3 { left: 50%; top: 52%; }
.diagram-cover-flow .diagram-level-4 { left: 66%; top: 28%; width: 18%; }
.diagram-cover-flow .diagram-level-5 { left: 72%; top: 72%; width: 16%; height: 13%; }
.diagram-cover-flow .link-12 { left: 28%; top: 31%; width: 14%; transform: rotate(30deg); }
.diagram-cover-flow .link-23 { left: 48%; top: 51%; width: 14%; transform: rotate(30deg); }
.diagram-cover-flow .link-34 { left: 66%; top: 47%; width: 12%; transform: rotate(-35deg); }
.diagram-cover-flow .link-45 { left: 68%; top: 69%; width: 12%; transform: rotate(38deg); }
.bundle-block,
.command-panel {
  border-top: 1px solid var(--border); padding-top: 14px; margin-top: 18px;
}
.command-panel code { overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
.mermaid-box {
  position: relative;
}
.mermaid-actions {
  display: flex; justify-content: flex-end; margin-bottom: 8px;
}
.mermaid-actions button {
  cursor: pointer;
}
/* Ask 回答 Markdown 排版：层次清晰、突出核心观点、代码/表格/图表清爽 */
.answer-md { white-space: normal; }
.answer-md > :first-child { margin-top: 0; }
.answer-md > :last-child { margin-bottom: 0; }
.answer-md p { margin: 0 0 10px; line-height: 1.62; }
.answer-md h1, .answer-md h2, .answer-md h3, .answer-md h4 {
  margin: 16px 0 8px; line-height: 1.3; font-weight: 700;
}
.answer-md h1 { font-size: 1.18em; }
.answer-md h2 {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.10em; padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface-well));
}
.answer-md h3 { font-size: 1.02em; }
.answer-md h4 { font-size: .96em; color: var(--muted); }
.answer-md ul, .answer-md ol { margin: 0 0 10px; padding-left: 1.15em; }
.answer-md li { margin: 5px 0; line-height: 1.58; padding-left: 2px; }
.answer-md li > ul, .answer-md li > ol { margin: 4px 0; }
.answer-md strong { font-weight: 700; color: var(--text); }
.answer-md code {
  font-size: .9em; padding: 1px 5px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-well));
  border: 1px solid var(--border);
}
.answer-md pre {
  margin: 0 0 12px; padding: 12px; overflow-x: auto;
  background: var(--surface-well); border: 1px solid var(--border); border-radius: var(--radius);
}
.answer-md pre code { background: none; border: 0; padding: 0; }
.answer-md blockquote {
  margin: 0 0 12px; padding: 6px 12px; color: var(--muted);
  border-left: 3px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  background: color-mix(in srgb, var(--card) 60%, transparent);
}
/* 首段视作「核心结论」，轻量强调卡 */
.answer-md > p:first-child {
  font-weight: 560;
  padding: 10px 12px; margin-bottom: 12px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-well));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
}
.answer-md table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  margin: 0 0 12px; font-size: .92em; display: block; overflow-x: auto;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: color-mix(in srgb, var(--card) 82%, transparent);
}
.answer-md th, .answer-md td { border-bottom: 1px solid var(--border); padding: 7px 10px; text-align: left; }
.answer-md th {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 9%, var(--surface-well));
}
.answer-md tr:last-child td { border-bottom: 0; }
.answer-md .mermaid-box {
  margin: 8px 0 12px; padding: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-well) 78%, transparent);
}
.answer-cite-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 22px; margin: 0 2px; padding: 2px 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--accent) 12%, var(--card));
  color: var(--accent-text); font-size: .84em; font-weight: 700;
  vertical-align: baseline;
}
.ask-answer-signal-strip {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px; margin: 0 0 12px; padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-well) 70%, transparent);
}
.ask-answer-signal-strip div {
  display: grid; gap: 3px; min-width: 0;
}
.ask-answer-signal-strip dt {
  color: var(--muted); font-size: var(--text-caption); line-height: 1.2;
}
.ask-answer-signal-strip dd {
  margin: 0; min-width: 0; overflow-wrap: anywhere;
  color: var(--text); font-weight: 750; font-size: var(--text-xs);
}
.answer-mini-bar {
  display: block; overflow: hidden; height: 5px; border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--border) 65%, transparent);
}
.answer-mini-bar i {
  display: block; height: 100%; width: var(--answer-cite-pct, 0%);
  border-radius: inherit;
  background: var(--accent);
}
.ask-answer-signal-strip[data-citation-state="unavailable"] .answer-mini-bar i {
  background: var(--muted);
}
.ask-answer-signal-strip[data-citation-state="unavailable"] div:last-child dd {
  color: var(--warning);
}

.quality-hero {
  display: flex; align-items: end; justify-content: space-between; gap: 20px;
}
.quality-hero > strong,
.quality-hero-actions > strong { font-size: var(--text-metric-md); line-height: 1; }
.quality-hero-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.quality-summary {
  display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 14px; margin-top: 18px;
}
.quality-summary > div {
  min-width: 0; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.quality-summary h2 { margin: 0 0 10px; font-size: var(--text-body); }
.timeline-month,
.timeline-month .cards,
.timeline-month .card,
.timeline-month .card ul,
.timeline-entry-card {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.timeline-month .card ul {
  padding-left: 18px;
}
.timeline-month .card li,
.timeline-entry-card p,
.timeline-entry-card strong {
  overflow-wrap: anywhere;
  word-break: break-word;
}
/* Four controls, four tracks: with three the 筛选 button wrapped onto a row
   of its own under the category select. */
.timeline-filter {
  display: grid; grid-template-columns: 140px 140px minmax(0, 1fr) auto;
  gap: 10px; align-items: center; margin-bottom: 18px;
}
.timeline-change-list { grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
.timeline-change-list .timeline-entry-card strong { font-size: var(--text-title-sm); overflow-wrap: break-word; word-break: normal; }
.timeline-entry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--muted); font-size: var(--text-xs); }
.timeline-entry-meta time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.timeline-filter input {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); color: var(--text); padding: 8px 10px; font: inherit;
}
.timeline-filter button {
  border: 0; border-radius: var(--radius); background: var(--accent-text);
  color: var(--on-accent-solid); padding: 8px 14px; font: inherit; cursor: pointer;
}
@media (max-width: 600px) {
  .timeline-filter { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .timeline-filter input[type="search"] { min-width: 0; grid-column: 1 / -1; }
  .timeline-filter button { grid-column: 1 / -1; min-height: 44px; }
}
.asset-preview {
  margin: 0; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px;
}
.asset-preview img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.asset-preview iframe, .html-preview {
  width: 100%; height: 70vh; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--card);
}
.playbook-chain {
  list-style: none; margin: 12px 0 0; padding: 0;
}
.playbook-chain > li {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; background: var(--bg);
}
.playbook-chain ol { margin: 8px 0 0; padding-left: 22px; }
/* One row: the search grows, the two selects stay compact and 应用 sits at the
   end. As a two-column grid the per-page select took a whole row and the
   button shrank to a 20px strip under "Export". */
.quality-toolbar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-top: 16px;
}
.quality-toolbar label { display: grid; gap: 4px; flex: 0 0 140px; min-width: 0; }
.quality-toolbar label:first-of-type { flex: 1 1 280px; }
.quality-toolbar select { width: 100%; }
.quality-toolbar .quality-toolbar-apply { min-height: 40px; }
.quality-toolbar input {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); color: var(--text); padding: 8px 10px; font: inherit;
}
.finding-list {
  list-style: none; margin-top: 14px; padding: 0; display: grid; gap: 10px;
}
.finding-card {
  display: grid; gap: 8px; min-width: 0; background: var(--card);
  border: 1px solid var(--border); border-left: 4px solid var(--muted);
  border-radius: var(--radius); padding: 14px 16px;
}
.finding-card header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.finding-card p { margin: 0; }
.finding-card details { min-width: 0; }
.finding-card summary { cursor: pointer; }
.finding-card.severity-p0 { border-left-color: var(--danger); }
.finding-card.severity-p1 { border-left-color: var(--warning); }
.finding-card.severity-p2 { border-left-color: var(--accent); }
.finding-path-shell,
.citation-path-shell {
  display: grid; grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px; align-items: start; min-width: 0; overflow-wrap: anywhere;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 10px;
}
.finding-path-shell > span,
.citation-path-shell > span {
  text-transform: uppercase; font-size: var(--text-caption); line-height: 1.6;
}
.finding-path,
.citation-path {
  min-width: 0; overflow-wrap: anywhere; word-break: break-word;
}
.finding-message { line-height: 1.5; }
.finding-reference-actions {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.evidence-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); padding: 8px 10px;
}
.severity-pill { text-transform: uppercase; font-weight: 700; }
.evidence-text {
  display: block; margin-top: 6px; padding: 8px 10px; background: var(--bg);
  border-radius: var(--radius); white-space: pre-wrap; overflow-wrap: anywhere;
}

.ask-search {
  display: grid; grid-template-columns: minmax(0, 1fr) 140px auto;
  gap: 10px; align-items: center;
}
.ask-search input { margin: 0; }
.ask-search button {
  border: 0; border-radius: var(--radius); background: var(--accent-text);
  color: var(--on-accent-solid); padding: 8px 14px; font: inherit; cursor: pointer;
}
.citation-card { display: grid; gap: 8px; }
.citation-grid { grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
.citation-card p { margin: 0; }
.citation-header {
  display: flex; align-items: flex-start; gap: 8px; min-width: 0;
}
.citation-header a { min-width: 0; }
.citation-id { flex: 0 0 auto; font-weight: 700; color: var(--text); }
.citation-meta-row {
  display: grid; gap: 6px; margin: 0; font-size: var(--text-label);
}
.citation-meta-row div {
  display: grid; grid-template-columns: 52px minmax(0, 1fr);
  gap: 8px; align-items: start;
}
.citation-meta-row dt { color: var(--muted); }
.citation-meta-row dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.snippet mark { background: var(--mark-bg-soft); padding: 0 2px; border-radius: 3px; }

select {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg);
  color: var(--text); padding: 7px 10px; max-width: 100%;
}
.graph-controls { max-width: 1120px; }
.graph-controls button, .viewer-toolbar button {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--card);
  color: var(--text); padding: 6px 12px; cursor: pointer;
}
.quality-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px; max-width: 1120px;
}
.quality-card {
  display: grid; gap: 4px; background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 14px;
}
.quality-card.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.quality-card span { font-size: var(--text-metric-sm); font-weight: 700; line-height: 1.1; }
.quality-card small { color: var(--muted); line-height: 1.35; }
.quality-kind-filter { display: flex; gap: 8px; flex-wrap: wrap; }

.module-inspector-card,
.quality-dashboard-panel,
.status-dashboard-panel,
.state-card {
  min-width: 0;
  color: var(--text);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-subtle);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
}
.ask-evidence-grid,
.quality-dashboard-grid,
.status-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 12px;
}
.module-inspector-card,
.quality-dashboard-panel,
.status-dashboard-panel,
.state-card {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
}
.state-card strong,
.module-inspector-card strong,
.status-dashboard-panel strong {
  overflow-wrap: anywhere;
}
.state-card.ok { border-left: 4px solid var(--success); }
.state-card.warn { border-left: 4px solid var(--warning); }
.state-card.error,
.state-card.failed { border-left: 4px solid var(--danger); }
.state-card.empty {
  border-style: dashed;
  color: var(--muted);
}
.state-actions,
.quality-actions,
.status-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.state-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 360px);
  gap: 18px;
  align-items: end;
  padding: 12px 0 20px;
  border-bottom: 1px solid var(--border);
}
.state-hero h1 {
  margin: 0 0 8px;
}
.status-meta-list {
  display: grid;
  gap: 8px;
  margin: 0;
}
.status-meta-list div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.status-meta-list dt {
  color: var(--muted);
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.status-meta-list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.theme-switcher {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
}
.theme-switcher button {
  min-height: 36px;
  border: 0;
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: var(--text-xs);
  cursor: pointer;
}
.theme-switcher button.active,
.theme-switcher button[aria-pressed="true"] {
  color: var(--text);
  background: var(--card);
  box-shadow: var(--shadow-seg);
}
.loading-skeleton {
  position: relative;
  overflow: hidden;
  min-height: 14px;
  border-radius: var(--radius-pill);
  background: var(--border);
}
.loading-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--card) 70%, transparent), transparent);
  animation: kb-shimmer 1.4s infinite;
}
@keyframes kb-shimmer {
  to { transform: translateX(100%); }
}
.viewer-shell { max-width: none; min-height: calc(100vh - 120px); }
.viewer-toolbar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px;
}
.viewer-toolbar-group,
.viewer-export-actions {
  display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.viewer-export-menu {
  position: relative;
}
.viewer-export-menu summary {
  cursor: pointer;
  list-style: none;
}
.viewer-export-menu summary::-webkit-details-marker {
  display: none;
}
.viewer-export-actions {
  position: absolute;
  right: 0;
  z-index: 30;
  min-width: 220px;
  margin-top: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-popover);
}
.viewer-zoom-custom {
  display: inline-flex; align-items: center; gap: 4px; color: var(--muted);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 3px 8px;
  background: var(--card); font-size: var(--text-label);
}
.viewer-zoom-custom input {
  width: 64px; border: 0; border-left: 1px solid var(--border);
  border-right: 1px solid var(--border); background: transparent; color: var(--text);
  padding: 3px 6px; font: inherit;
}
.viewer-grid {
  display: grid; grid-template-columns: minmax(260px, 34%) minmax(0, 1fr);
  gap: 12px; height: 78vh;
}
.viewer-source {
  display: none; height: 100%; margin: 0; border: 1px solid var(--border);
  background: var(--card); border-radius: var(--radius); padding: 12px; overflow: auto;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.viewer-shell.split .viewer-source { display: block; }
.viewer-shell:not(.split) .viewer-grid { grid-template-columns: minmax(0, 1fr); }
.viewer-frame-wrap {
  position: relative; height: 100%; overflow: auto; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--card); cursor: grab;
  overscroll-behavior: contain; touch-action: none;
}
.viewer-frame-wrap:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.viewer-frame-wrap.is-dragging { cursor: grabbing; }
.viewer-canvas {
  position: relative; min-width: 100%; min-height: 100%;
}
.viewer-content {
  position: absolute; left: 0; top: 0; transform-origin: 0 0;
}
.viewer-content iframe {
  width: 100%; height: 100%; border: 0; background: var(--card);
  pointer-events: none;
}
.viewer-mermaid,
.viewer-inline-svg {
  width: 100%; height: 100%; min-height: 0; padding: 18px;
  display: flex; align-items: center; justify-content: center;
  box-sizing: border-box; overflow: visible;
}
.viewer-mermaid .mermaid,
.viewer-mermaid-rendered,
.viewer-inline-svg {
  display: grid; place-items: center; width: 100%; height: 100%;
  background: transparent;
}
.viewer-mermaid-rendered svg,
.viewer-inline-svg svg {
  max-width: 100%; max-height: 100%;
}
/* The diagram sits on paper; the frame around it keeps the theme. */
.viewer-mermaid,
.viewer-inline-svg {
  background: var(--diagram-paper);
  color: var(--diagram-paper-ink);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 0 1px var(--diagram-paper-border), var(--diagram-paper-shadow);
  color-scheme: light;
}
.mermaid-box pre.mermaid {
  background: var(--diagram-paper);
  color: var(--diagram-paper-ink);
  border: 1px solid var(--diagram-paper-border);
  border-radius: var(--radius);
  color-scheme: light;
}
/* Small renders of the real diagram on the module page (app.js). */
.diagram-live-thumb {
  display: grid; place-items: center; width: 100%; height: 100%; min-width: 0; min-height: 132px;
  overflow: hidden;
}
.diagram-thumb { min-width: 0; }
.diagram-live-thumb.is-rendered {
  padding: 8px;
  background: var(--diagram-paper);
}
.diagram-live-thumb.is-rendered svg {
  width: 100%; height: 100%; max-height: 200px;
}
.viewer-render-error,
.mermaid-error {
  display: grid; gap: 8px; max-width: min(560px, 88%);
  padding: 18px; border: 1px solid var(--border); border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg) 68%, var(--card));
  color: var(--muted); text-align: left;
}
.viewer-render-error strong,
.mermaid-error strong { color: var(--text); font-size: var(--text-title-sm); }
.viewer-render-error code,
.mermaid-error code,
.mermaid-error pre {
  display: block; max-height: 160px; overflow: auto; white-space: pre-wrap;
  overflow-wrap: anywhere; color: var(--muted);
}
.viewer-minimap {
  position: sticky; left: calc(100% - 126px); bottom: 12px;
  width: 110px; height: 72px; margin: -84px 12px 12px auto;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--card) 84%, transparent);
  pointer-events: none; overflow: hidden;
}
.viewer-minimap div {
  position: relative;
  min-width: 18px; min-height: 18px; border: 2px solid var(--accent);
  background: var(--mark-bg-subtle); border-radius: 4px;
}
.viewer-shell.fullscreen {
  position: fixed; inset: 0; z-index: 50; background: var(--bg);
  padding: 16px; min-height: 100vh;
}
.viewer-shell.fullscreen .viewer-grid { height: calc(100vh - 70px); }

.login-body { display: grid; place-items: center; min-height: 100vh; }
.login-card { background: var(--card); border-radius: var(--radius-xl); padding: 36px; width: min(380px, 92vw); border: 1px solid var(--border); }
.login-card label { display: block; margin: 12px 0; font-size: var(--text-sm); color: var(--muted); }
.login-card input:not([type=checkbox]) { width: 100%; padding: 10px 12px; margin-top: 4px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: var(--text-title-sm); }
.login-card button { width: 100%; margin-top: 16px; padding: 11px; border: 0; border-radius: var(--radius); background: var(--accent-text); color: var(--on-accent-solid); font-size: var(--text-title-sm); cursor: pointer; }

/* A page route used to answer 404 with FastAPI's `{"detail":"Not Found"}` —
   no title, no layout, no way back. KB paths move, so this is the page a stale
   bookmark is most likely to land on. */
.error-card { width: min(520px, 92vw); text-align: left; }
.error-card h1 { margin: 4px 0 10px; font-size: var(--text-title-md); line-height: var(--line-title); }
.error-card .eyebrow { margin: 0; color: var(--muted); font-size: var(--text-caption); font-weight: var(--font-weight-bold); letter-spacing: var(--tracking-label); }
.error-slug { margin: 16px 0 0; color: var(--text); font-size: var(--text-sm); overflow-wrap: anywhere; }
.error-primary { display: inline-flex; margin-top: 12px; overflow-wrap: anywhere; }
.error-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); }
.error-links a { color: var(--accent-text); font-size: var(--text-sm); font-weight: var(--font-weight-semibold); }

.sidebar-open { display: none; }
.content > .sidebar-open {
  width: auto;
  max-width: none;
  margin: 0;
}
.sidebar-scrim { display: none; }
.mobile-tabs { display: none; }
.mobile-search-fab { display: none; }

/* Finder/Cupertino compatibility layer from the kb-web UI kit. */
.sidebar {
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
}
.sidebar-tree {
  min-height: 0;
  padding-right: 2px;
  overflow-y: auto;
}
.tree-sticky {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 10px 0 4px;
  padding: 7px 4px;
  color: var(--muted);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  font-size: var(--text-caption);
  font-weight: 700;
  text-transform: uppercase;
}
.module-layer {
  margin-bottom: 6px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.sidebar-tree details > summary {
  list-style: none;
}
.sidebar-tree summary::-webkit-details-marker {
  display: none;
}
.sidebar-tree summary {
  display: flex;
  align-items: center;
  gap: 7px;
  border-radius: var(--radius);
  padding: 7px 8px;
  min-height: 34px;
  font-size: var(--text-label);
  font-weight: 650;
  color: var(--text);
}
.sidebar-tree .layer-summary {
  padding: 7px 6px;
}
.sidebar-tree summary:hover {
  background: var(--bg);
}
.sidebar-tree summary::before {
  content: "›";
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1;
  transition: transform var(--dur-fast);
}
.sidebar-tree details[open] > summary::before {
  transform: rotate(90deg);
}
.sidebar-tree summary .count {
  margin-left: auto;
  min-width: 18px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.layer-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lc, var(--accent));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--lc, var(--accent)) 12%, transparent);
}
.layer-title {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.layer-meta {
  color: var(--muted);
  font-size: var(--text-caption);
  font-variant-numeric: tabular-nums;
}
.sidebar-tree summary .l-bar {
  position: relative;
  flex: 0 0 42px;
  height: 4px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--border);
}
.sidebar-tree summary .l-bar i {
  display: block;
  min-width: 5px;
  height: 100%;
  border-radius: inherit;
  background: var(--lc, var(--accent));
}
.sidebar-tree ul,
.layer-body {
  padding: 2px 0 6px 16px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.layer-body {
  display: grid;
  gap: 5px;
}
.sidebar-tree li {
  min-width: 0;
}
.sidebar-tree a {
  position: relative;
  min-height: 34px;
  border-left: 3px solid transparent;
  font-size: var(--text-sm);
  font-weight: 500;
  overflow: hidden;
}
.sidebar-tree a:hover {
  background: var(--bg);
}
.sidebar-tree a.active {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent-text);
  border-left-color: var(--accent);
  font-weight: 650;
}
.sidebar-tree a .dot + * {
  min-width: 0;
}
.dot.learned,
.dot.st-learned,
.dot.st-已学习 {
  background: var(--success);
}
.dot.deep,
.dot.st-deep,
.dot.st-深度学习 {
  background: var(--accent);
}

.mod {
  position: relative;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.mod > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  border-left: 3px solid transparent;
  border-radius: var(--radius);
  padding: 7px 7px 7px 6px;
  background: color-mix(in srgb, var(--card) 66%, transparent);
  border: 1px solid transparent;
  border-left-width: 3px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.mod > summary:hover {
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-color: var(--border);
}
.mod.at-risk > summary {
  border-left-color: var(--warning);
}
.mod.active > summary {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-color: color-mix(in srgb, var(--accent) 36%, transparent);
  border-left-color: var(--accent);
}
.mod .m-stack {
  min-width: 0;
  flex: 1;
}
.mod .m-name {
  display: block;
  min-height: auto;
  padding: 0;
  border-left: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mod .m-name:hover {
  background: transparent;
  color: var(--accent-text);
}
.mod .m-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 7px;
  color: var(--muted);
  font-size: var(--text-caption);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}
.mod .m-sub span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.module-coverage {
  display: grid;
  justify-items: center;
  gap: 1px;
  flex: 0 0 34px;
}
.mod .m-sub .risk {
  color: var(--warning);
  font-weight: 650;
}
.mod .pct {
  width: auto;
  color: var(--muted);
  font-size: var(--text-caption);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.mod.deep > summary {
  border-left-color: var(--accent);
}
.mod.learned > summary {
  border-left-color: var(--success);
}
.dot.at-risk {
  background: var(--warning);
}
.dot.starter {
  background: var(--muted);
}
.mod-kids {
  list-style: none;
  margin: 2px 0 4px 14px;
  padding: 5px 0 5px 12px;
  border-left: 1px solid var(--border);
  display: grid;
  gap: 2px;
  min-width: 0;
  max-width: calc(100% - 14px);
  overflow: hidden;
}
.mod-kids a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  border-left: 0;
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  color: var(--text);
  font-size: var(--text-label);
  background: transparent;
  min-width: 0;
  max-width: 100%;
}
.mod-kids a .icon {
  width: 14px;
  height: 14px;
  color: var(--muted);
}
.mod-kids a.ask-link .icon {
  color: var(--ask-text);
}
.mod-kids a .count {
  margin-left: auto;
  flex: 0 0 auto;
}
.mod-kids a span:not(.count) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mod-kids a:hover {
  background: var(--bg);
}
.mod-kids a.ask-link {
  color: var(--ask-text);
  font-weight: 600;
}

.ring {
  flex: 0 0 auto;
  overflow: visible;
}
.ring circle {
  fill: none;
  stroke-width: 2.6;
}
.ring .ring-fg {
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
}
.ring .ring-fg[data-pct="0"] {
  visibility: hidden;
}
.ring-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.rings-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.rings-legend {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: var(--text-xs);
}
.rings-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.rings-legend b {
  color: var(--text);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.health-card,
.metric-card,
.quality-card {
  transition: transform var(--dur-fast), box-shadow var(--dur-fast), border-color var(--dur-fast);
}
.health-card:hover,
.metric-card:hover,
.quality-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.sev-bar {
  display: flex;
  gap: 2px;
  height: 6px;
  margin-top: 10px;
}
.sev-bar i {
  display: block;
  height: 100%;
  border-radius: 2px;
}
.sev-p0 { background: var(--danger); }
.sev-p1 { background: var(--warning); }
.sev-p2 { background: var(--accent); }
.spark {
  width: 100%;
  height: 44px;
  margin-top: 6px;
}

.planned-domain-overview {
  --domain-color: var(--domain-accent);
}
.planned-overview-band {
  display: grid;
  grid-template-columns: minmax(128px, 168px) minmax(0, 1fr) minmax(180px, 260px);
  gap: var(--space-5);
  align-items: stretch;
  padding: var(--space-5);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--apple-material);
  box-shadow: var(--shadow-hairline);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
}
.planned-overview-meter {
  display: grid;
  place-items: center;
  min-width: 0;
  text-align: center;
  color: var(--text);
}
.planned-overview-meter strong {
  margin-top: calc(var(--space-3) * -1);
  font-size: var(--text-metric-md);
  line-height: var(--line-title);
  font-weight: var(--font-weight-heavy);
}
.planned-overview-meter span {
  color: var(--muted);
  font-size: var(--text-caption);
  font-weight: var(--font-weight-semibold);
}
.coverage-ring {
  stroke: var(--coverage-track);
  fill: none;
  overflow: visible;
}
.coverage-ring .coverage-ring-track {
  stroke: var(--coverage-track);
  stroke-width: 9;
}
.coverage-ring .coverage-ring-value {
  stroke: var(--domain-color, var(--accent));
  stroke-width: 9;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: var(--motion-ring);
}
.planned-overview-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin: 0;
  min-width: 0;
}
.planned-overview-metrics div {
  min-width: 0;
  padding: var(--space-4);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--apple-material-strong);
}
.planned-overview-metrics dt {
  color: var(--muted);
  font-size: var(--text-caption);
  font-weight: var(--font-weight-bold);
}
.planned-overview-metrics dd {
  margin: var(--space-2) 0 0;
  color: var(--text);
  font-size: var(--text-title-sm);
  line-height: var(--line-title);
  font-weight: var(--font-weight-strong);
  overflow-wrap: anywhere;
}
.planned-overview-sparkline {
  stroke: var(--domain-color, var(--accent));
  width: 100%;
  height: 100%;
  min-height: 96px;
  align-self: center;
}
.planned-overview-sparkline .area {
  fill: color-mix(in srgb, var(--domain-color, var(--accent)) 14%, transparent);
  stroke: none;
}
.planned-overview-sparkline .line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.planned-overview-matrix {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-5);
}
.planned-overview-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: var(--space-3);
  align-items: center;
  min-width: 0;
  padding: var(--space-4);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--matrix-cell-bg);
}
.domain-icon-tile {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid color-mix(in srgb, var(--domain-color, var(--accent)) 24%, var(--hairline));
  border-radius: var(--radius);
  background: var(--apple-material);
  color: color-mix(in srgb, var(--domain-color, var(--accent)) 45%, var(--text));
}
.domain-icon-tile .icon {
  width: 19px;
  height: 19px;
}
.planned-overview-copy,
.planned-overview-gate,
.planned-overview-action,
.planned-overview-stat {
  min-width: 0;
}
.planned-overview-copy {
  display: grid;
  gap: var(--space-1);
}
.planned-overview-copy strong,
.planned-overview-gate b,
.planned-overview-action b {
  overflow-wrap: anywhere;
}
.planned-overview-copy small,
.planned-overview-stat small,
.planned-overview-gate small,
.planned-overview-action small {
  color: var(--muted);
  font-size: var(--text-caption);
  font-weight: var(--font-weight-semibold);
}
.planned-overview-stat {
  display: grid;
  justify-items: end;
  color: var(--text);
}
.planned-overview-stat b {
  font-size: var(--text-title-md);
  line-height: var(--line-title);
}
.planned-overview-gate,
.planned-overview-action {
  /* `span 2` put these long sentences' min-content onto the two `auto` stat
     tracks, which grew until the `minmax(0, 1fr)` title column was squeezed to
     0px and domain names wrapped one character per line. Spanning every track
     lets the flexible column absorb the contribution instead. */
  grid-column: 1 / -1;
  padding-top: var(--space-3);
  border-top: 1px solid var(--hairline);
}
.planned-overview-empty {
  border: 1px dashed var(--empty-state-border);
  display: grid;
  gap: var(--space-2);
  padding: var(--space-5);
  border-radius: var(--radius);
  background: var(--surface-well);
  color: var(--muted);
}
.planned-overview-empty strong {
  color: var(--text);
}
@media (max-width: 860px) {
  .planned-overview-band {
    grid-template-columns: 1fr;
  }
  .planned-overview-sparkline {
    min-height: 72px;
  }
  .planned-overview-row {
    grid-template-columns: auto minmax(0, 1fr);
  }
}

.inspector {
  position: fixed;
  z-index: 70;
  width: min(252px, calc(100vw - 20px));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 13px 15px;
  background: color-mix(in srgb, var(--card) 76%, transparent);
  box-shadow: var(--shadow-popover);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity var(--dur-fast), transform var(--dur-fast);
}
.inspector.show {
  opacity: 1;
  transform: none;
}
.inspector b {
  display: block;
  margin-bottom: 6px;
  font-size: var(--text-sm);
}
.inspector dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 12px;
  margin: 0;
  font-size: var(--text-xs);
}
.inspector dt {
  color: var(--muted);
}
.inspector dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.inspector dd.risk {
  color: var(--warning);
  font-weight: 650;
}

.spotlight-overlay {
  z-index: 80;
  background: var(--overlay-scrim-strong);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-fast);
}
.spotlight-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.spotlight-panel {
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--card) 80%, transparent);
  border-color: var(--border);
  box-shadow: var(--shadow-spotlight);
  backdrop-filter: saturate(180%) blur(28px);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  transform: translateY(6px) scale(.985);
  transition: transform var(--dur-fast);
}
.spotlight-overlay.open .spotlight-panel {
  transform: none;
}
.spotlight-head {
  padding: 2px 2px 10px;
}
.spotlight-form input {
  min-height: 48px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
}
.spotlight-modes .seg-item {
  min-height: 34px;
}
.spotlight-modes .seg-item.active[data-spotlight-mode="ask"],
.spotlight-modes .seg-item.active[data-sp-mode="ask"] {
  color: var(--ask-text);
}
.primary-action,
.spotlight-go {
  min-height: 40px;
  border-radius: var(--radius-pill);
  background: var(--accent-text);
  color: var(--on-accent-solid);
}
.primary-action.ask,
.spotlight-go.ask {
  background: var(--ask);
}
.spotlight-trigger,
.quick-links a,
.sidebar-foot button,
.module-filter-bar button,
.module-toolbar button,
.graph-controls button,
.viewer-toolbar button,
.mobile-tabs a,
.mobile-tabs button {
  min-height: 44px;
}
.icon-button {
  min-width: 40px;
  min-height: 40px;
}
@media (min-width: 1024px) {
  /* `.content > .topbar` below is sticky, so anything scrolled to the top edge
     — an `#id` deep link, scrollIntoView, Tab focus — lands underneath it.
     `#decision-readiness` already carried a per-id scroll-margin patch for
     exactly this; one scroll-padding on the scroller covers every target. */
  :root {
    scroll-padding-top: 88px;
  }
  .content {
    padding: 0 0 72px;
  }
  /* The design export sizes product shells at 1280px and `.wide-section` at
     1120px, and `.quality-apple-shell` / `.module-visual-shell` still declare
     `min(1280px, 100%)` — but this rule outranked them, so those declarations
     were dead on desktop and their components overflowed the 956px they
     actually got. That mismatch is what P102 and P103 kept fixing the symptoms
     of. Reading surfaces keep a reading measure below; everything else gets the
     width it was designed against. */
  .content > * {
    width: min(1280px, calc(100% - 72px));
    max-width: min(1280px, calc(100% - 72px));
  }
  .content > .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
  }
  .content > .graph-controls,
  .content > .graph-workbench,
  .content > .graph-mobile-list,
  .content > .wide-section {
    width: min(1280px, calc(100% - 72px));
    max-width: min(1280px, calc(100% - 72px));
  }
  /* Prose and the viewer keep a reading measure — 1280px of running text is
     not an improvement, and `.doc-body` already caps its own column at 70ch. */
  .content > .doc-layout,
  .content > .viewer-shell {
    width: min(1180px, calc(100% - 72px));
    max-width: min(1180px, calc(100% - 72px));
  }
  .spotlight-trigger {
    min-width: min(460px, 100%);
    flex: 0 1 460px;
  }
  .content > .topbar .spotlight-trigger {
    min-height: 36px;
  }
  .sidebar-open,
  .mobile-tabs {
    display: none;
  }
}
@media (max-width: 1023px) {
  .sidebar {
    position: fixed; left: 0; z-index: 20; width: min(var(--sidebar-w), 86vw);
    max-width: 86vw; transform: translateX(-100%); transition: var(--motion-drawer);
    /* `.mobile-tabs` is fixed at z-index 30, above this drawer's 20. `.content`
       below already reserves the same clearance; the drawer never did, so its
       footer — the app's only theme switcher and only logout button — sat under
       the bar and every tap landed on the bar instead. */
    padding-bottom: calc(90px + env(safe-area-inset-bottom));
  }
  .sidebar.open { transform: none; box-shadow: var(--shadow-mobile-drawer); }
  .sidebar-scrim.open {
    display: block; position: fixed; inset: 0; z-index: 18;
    background: var(--overlay-scrim);
  }
  /* Scrolls away with the topbar it sits in. It was fixed while the topbar was
     not, so on a scrolled page it floated over headings (it hid the first
     character of 网络设备 on /modules); the tab bar's 更多 opens the same drawer. */
  .sidebar-open { display: block; position: absolute; top: 12px; left: 12px; z-index: 10;
    background: var(--card); color: var(--text);
    padding: 6px 10px; }
  .content { padding: 56px 16px calc(90px + env(safe-area-inset-bottom)); }
  h1 { font-size: var(--text-h1); }
  .workbench-hero,
.module-hero,
.quality-hero,
.state-hero,
.sync-strip,
.section-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }
  .health-grid,
.dashboard-health-board .health-grid,
.domain-grid,
.diataxis-grid,
.dashboard-columns,
.module-filter-bar,
.quality-toolbar,
.ask-search,
.compare-columns,
.ask-evidence-grid,
.quality-dashboard-grid,
.status-dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .health-grid,
.domain-grid,
.diataxis-grid { gap: 10px; }
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr); }
  .spotlight-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .spotlight-modes { width: 100%; }
  .workbench-actions .searchbox { grid-template-columns: minmax(0, 1fr); }
  .module-actions { justify-content: flex-start; }
  .module-mappings { margin-left: 0; }
  .module-drawer-toggle { display: inline-block; }
  .module-hero-meta,
  .module-signal-card { min-width: 0; }
  .module-feedback { width: min(1120px, 100%); }
  .module-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); }
  .module-toolbar input { width: 100%; }
  .module-detail-grid { grid-template-columns: minmax(0, 1fr); }
  .module-sidebar { position: static; order: -1; }
  .module-sidebar.drawer-ready {
    position: fixed; left: 12px; right: 12px;
    bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 29;
    max-height: min(68vh, 560px); overflow: auto;
    transform: translateY(calc(100% + 120px)); opacity: 0;
    pointer-events: none; transition: var(--motion-drawer), opacity var(--dur-fast);
  }
  .module-sidebar.drawer-ready.open {
    transform: none; opacity: 1; pointer-events: auto;
    box-shadow: var(--shadow-drawer-panel);
  }
  .module-drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; background: var(--card); border: 1px solid var(--border);
    border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0;
    padding: 10px 12px;
  }
  .module-sidebar.drawer-ready .module-meta-drawer {
    border-radius: 0 0 var(--radius) var(--radius);
  }
  .module-meta-drawer:not([open]) { padding-bottom: 12px; }
  .quality-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quality-card { padding: 12px; }
  .quality-card span { font-size: var(--text-title-md); }
  .change-list li { grid-template-columns: minmax(0, 1fr); }
  .finding-path-shell,
  .citation-path-shell,
  .citation-meta-row div { grid-template-columns: minmax(0, 1fr); }
  .doc-layout { display: block; }
  .doc-toc { display: none; }
  .doc-toc-mobile {
    display: block; margin-bottom: 16px; background: var(--card);
    border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px;
  }
  .doc-toc-mobile summary { cursor: pointer; color: var(--text); font-weight: 700; }
  .doc-toc-mobile ol { list-style: none; margin: 8px 0 0; padding: 0; font-size: var(--text-sm); }
  .doc-toc-mobile li { margin: 0; }
  .doc-toc-mobile li > a { display: block; padding-block: 6px; }
  .doc-toc-mobile .toc-l3 { padding-left: 12px; }
  /* Liquid glass v4: a floating glass capsule. Scrolling down folds it to the
     current tab and brings out a round search button; scrolling up restores it
     (glass.js sets data-compact). */
  .mobile-tabs {
    position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 30; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 2px; padding: 6px; border: 0;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--card) var(--glass-tint), transparent);
    box-shadow: inset 0 1px 0 var(--glass-rim-light), inset 0 -1px 0 var(--glass-rim-dark), var(--shadow-sticky-bar);
    -webkit-backdrop-filter: blur(var(--glass-blur-thick)) saturate(var(--glass-sat)) brightness(var(--glass-bright));
    backdrop-filter: blur(var(--glass-blur-thick)) saturate(var(--glass-sat)) brightness(var(--glass-bright));
    transition: right var(--motion-duration-slow) var(--motion-ease-glass);
  }
  .mobile-tabs a,
  .mobile-tabs button {
    display: grid; place-items: center; gap: 1px; min-width: 0;
    min-height: 44px;
    border: 0; border-radius: var(--radius-pill); padding: 5px 2px;
    color: var(--muted); background: transparent; font: inherit; cursor: pointer;
  }
  .mobile-tabs span { font-size: var(--text-body); line-height: 1; }
  .mobile-tabs strong { font-size: var(--text-caption); line-height: 1.2; font-weight: 650; }
  .mobile-tabs a.active {
    color: var(--accent-text);
    background: color-mix(in srgb, var(--card) 86%, transparent);
    box-shadow: inset 0 1px 0 var(--glass-rim-light), var(--shadow-seg);
  }
  .mobile-tabs[data-compact="1"] {
    right: calc(100% - 12px - 76px);
    grid-template-columns: minmax(0, 1fr);
  }
  .mobile-tabs[data-compact="1"] > :not(.active) { display: none; }
  .mobile-search-fab {
    display: grid; place-items: center; position: fixed; z-index: 30;
    right: 12px; bottom: max(12px, env(safe-area-inset-bottom));
    width: 58px; height: 58px; padding: 0; border: 0; border-radius: 50%;
    color: var(--text);
    background: color-mix(in srgb, var(--card) var(--glass-tint), transparent);
    box-shadow: inset 0 1px 0 var(--glass-rim-light), inset 0 -1px 0 var(--glass-rim-dark), var(--shadow-sticky-bar);
    -webkit-backdrop-filter: blur(var(--glass-blur-thick)) saturate(var(--glass-sat));
    backdrop-filter: blur(var(--glass-blur-thick)) saturate(var(--glass-sat));
    opacity: 0; transform: scale(.5); visibility: hidden;
    transition: transform var(--motion-duration-slow) var(--motion-ease-glass), opacity var(--motion-duration-fast) var(--motion-ease-standard), visibility 0s linear var(--motion-duration-slow);
  }
  .mobile-search-fab .icon { width: 22px; height: 22px; }
  .mobile-tabs[data-compact="1"] ~ .mobile-search-fab {
    opacity: 1; transform: none; visibility: visible;
    transition: transform var(--motion-duration-slow) var(--motion-ease-glass), opacity var(--motion-duration-fast) var(--motion-ease-standard), visibility 0s;
  }
  .graph-list { display: grid; }
  .viewer-grid { display: block; height: auto; }
  .viewer-source { height: 32vh; margin-bottom: 12px; }
  .viewer-frame-wrap { height: 62vh; }
  .spotlight-overlay {
    padding: 9vh 10px 16px;
  }
  .spotlight-panel {
    max-width: calc(100vw - 20px);
    padding: 14px;
  }
  .spotlight-actions {
    gap: 10px;
  }
  .theme-switcher {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-hero .hero-copy {
    min-height: auto;
  }
  .dashboard-quick-actions .qa-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .status-meta-list div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  .sidebar-tree a,
  .sidebar-tree summary,
  .mod > summary {
    min-height: 40px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
[data-motion="reduced"] *,
[data-motion="reduced"] *::before,
[data-motion="reduced"] *::after {
  animation: none !important;
  scroll-behavior: auto !important;
  transition: none !important;
}

/* ── ::placeholder ──────────────────────────────────────────────────────────
   P110. There was no ::placeholder rule anywhere in the app, so every input
   fell back to Chrome's UA grey — the identical rgb(117,117,117) on a white
   page and on a near-black one. It is the one piece of text in the UI that the
   token system did not govern, and it failed AA in all four themes: 4.23
   light, 3.99 graphite, 3.89 dark, 3.90 midnight.

   Invisible to nine batches of contrast work because a sweep that walks text
   nodes cannot see a pseudo-element. `opacity: 1` because Firefox applies its
   own to placeholders and would undo the ratio. */
::placeholder {
  color: var(--muted);
  opacity: 1;
}

/* The Spotlight is chrome over a scrim, so its muted text does not sit on
   --card. Measured from painted pixels rather than computed style, which
   cannot see through a backdrop-filter: it was out by 1.5 points here. */
.spotlight-panel .eyebrow,
.spotlight-panel legend,
.spotlight-panel .muted,
.spotlight-panel .spotlight-hint {
  color: var(--muted-on-glass);
}
