.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.view-root { min-height: 100%; }
.view-root:focus { outline: none; }
.route-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  border: 1px solid #efc596;
  background: #fff8ec;
  color: #7b3d16;
  padding: 9px 12px;
  font-size: 13px;
}
.route-notice i { width: 16px; height: 16px; flex: 0 0 auto; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 13px;
}
.breadcrumb button {
  border: 0;
  background: transparent;
  color: var(--blue-strong);
  padding: 0;
  cursor: pointer;
}
.breadcrumb button:hover { text-decoration: underline; }
.breadcrumb i { width: 13px; height: 13px; }

.library-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 13px;
}
.library-page-title h1 { font-size: 28px; line-height: 1.2; letter-spacing: .01em; }
.library-page-title p { margin-top: 5px; color: var(--muted-strong); }
.header-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.source-badge,
.demo-badge,
.state-badge,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted-strong);
  padding: 4px 9px;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}
.source-badge { border-color: #9ebcdd; background: #f4f8fe; color: var(--blue-strong); }
.demo-badge { border-color: #efc596; background: #fff8ec; color: #9a4717; }
.state-badge.success { border-color: #98cdbb; background: #edf9f4; color: var(--success); }
.state-badge.warning { border-color: #efc596; background: #fff8ec; color: var(--warning); }
.state-badge.info { border-color: #b7cae1; background: #f3f7fc; color: var(--blue-strong); }
.tag { border-radius: 3px; background: var(--surface-muted); padding: 3px 7px; }

.library-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: var(--surface);
  margin-bottom: 12px;
}
.summary-cell { min-width: 0; padding: 10px 14px; border-left: 1px solid var(--line-soft); }
.summary-cell:first-child { border-left: 0; }
.summary-cell strong { display: block; font-size: 18px; line-height: 1.25; }
.summary-cell span { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }

.library-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  border-bottom: 1px solid #bfcddd;
  margin-bottom: 12px;
}
.library-tab {
  min-height: 39px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted-strong);
  padding: 0 15px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.library-tab:hover { color: var(--blue-strong); background: #f0f5fb; }
.library-tab.active { border-bottom-color: var(--blue); color: var(--blue-strong); }

.library-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 11px 12px;
  margin-bottom: 12px;
}
.toolbar-search { position: relative; min-width: 250px; flex: 1 1 330px; }
.toolbar-search i {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 17px;
  height: 17px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}
.toolbar-search input,
.filter-control select {
  width: 100%;
  height: 38px;
  border: 1px solid #b9c9db;
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
}
.toolbar-search input { padding: 0 11px 0 37px; }
.filter-control { display: grid; gap: 4px; min-width: 150px; }
.filter-control span { color: var(--muted); font-size: 13px; }
.filter-control select { padding: 0 30px 0 10px; }
.text-button,
.outline-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: var(--radius);
  padding: 0 13px;
  font-weight: 650;
  cursor: pointer;
}
.text-button { border: 0; background: transparent; color: var(--blue-strong); }
.text-button:hover { background: var(--blue-soft); }
.outline-button { border: 1px solid #9eb5d0; background: #fff; color: var(--blue-strong); }
.outline-button:hover { background: var(--blue-soft); }
.text-button i, .outline-button i { width: 16px; height: 16px; }

.catalog-groups { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 12px; }
.catalog-filter {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  color: var(--muted-strong);
  padding: 0 11px;
  cursor: pointer;
}
.catalog-filter:hover { border-color: #9eb5d0; color: var(--blue-strong); }
.catalog-filter.active { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-strong); font-weight: 700; }

.chain-directory {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}
.chain-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
}
.chain-entry:hover { border-color: #8fadd0; box-shadow: var(--shadow); }
.chain-entry h3 { font-size: 16px; }
.chain-entry p { margin-top: 5px; color: var(--muted); font-size: 13px; }
.chain-entry-meta { display: flex; gap: 11px; margin-top: 7px; color: var(--muted-strong); font-size: 13px; flex-wrap: wrap; }
.chain-entry > i { width: 18px; height: 18px; color: var(--blue); }

.split-view {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.tree-panel,
.table-panel,
.detail-panel {
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  border-bottom: 1px solid var(--line-soft);
  padding: 8px 12px;
}
.panel-heading h2 { font-size: 16px; }
.panel-heading span { color: var(--muted); font-size: 13px; }
.tree-scroll { max-height: calc(100vh - 285px); overflow: auto; padding: 7px; }
.tree-list,
.tree-list ul { list-style: none; margin: 0; padding: 0; }
.tree-list ul { margin-left: 13px; border-left: 1px solid #dce5ef; padding-left: 5px; }
.tree-list details > summary { list-style: none; }
.tree-list details > summary::-webkit-details-marker { display: none; }
.tree-node {
  display: flex;
  width: 100%;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  padding: 4px 6px;
  text-align: left;
  cursor: pointer;
}
.tree-node:hover { background: #f1f5fa; }
.tree-node.selected { background: var(--blue-soft); color: var(--blue-strong); font-weight: 700; }
.tree-node i { width: 14px; height: 14px; flex: 0 0 auto; }
.tree-node span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tree-node small { margin-left: auto; color: var(--muted); }
.node-detail { padding: 15px 16px; }
.node-detail h2 { font-size: 20px; }
.node-path { margin-top: 5px; color: var(--muted-strong); font-size: 13px; }
.node-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 14px; border: 1px solid var(--line); }
.node-stat { padding: 10px 12px; border-left: 1px solid var(--line-soft); }
.node-stat:first-child { border-left: 0; }
.node-stat strong, .node-stat span { display: block; }
.node-stat strong { font-size: 17px; }
.node-stat span { margin-top: 3px; color: var(--muted); font-size: 13px; }
.node-section { margin-top: 17px; }
.node-section h3 { font-size: 15px; margin-bottom: 7px; }
.node-children { display: flex; flex-wrap: wrap; gap: 7px; }
.child-link { border: 1px solid var(--line); background: var(--surface-muted); padding: 6px 9px; cursor: pointer; }
.child-link:hover { border-color: #9eb5d0; color: var(--blue-strong); }

.table-scroll { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th,
.data-table td { border-bottom: 1px solid var(--line-soft); padding: 10px 11px; text-align: left; vertical-align: top; }
.data-table th { background: #f4f7fb; color: var(--muted-strong); font-weight: 700; white-space: nowrap; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table td strong { display: block; font-size: 14px; }
.data-table td small { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }
.table-link { border: 0; background: transparent; color: var(--blue-strong); padding: 0; font-weight: 700; cursor: pointer; }
.table-link:hover { text-decoration: underline; }
.rank-cell { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--blue-strong); }
.table-footnote { padding: 9px 11px; color: var(--muted); font-size: 13px; background: #fbfcfe; }

.status-banner {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid #b7cae1;
  background: #f3f7fc;
  color: var(--muted-strong);
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 13px;
}
.status-banner.warning { border-color: #efc596; background: #fff8ec; color: #7b3d16; }
.status-banner.danger { border-color: #e3a9a4; background: #fff4f3; color: #8c261f; }
.status-banner i { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; }
.empty-state {
  display: grid;
  min-height: 260px;
  place-items: center;
  border: 1px solid var(--line);
  background: #fff;
  padding: 30px;
  text-align: center;
}
.empty-state i { width: 34px; height: 34px; color: #7891af; }
.empty-state h2 { margin-top: 10px; font-size: 18px; }
.empty-state p { max-width: 520px; margin-top: 5px; color: var(--muted-strong); }
.empty-state .outline-button { margin-top: 14px; }

.drawer-backdrop {
  position: fixed;
  inset: var(--topbar) 0 0 0;
  z-index: 30;
  background: rgba(7, 29, 55, .28);
}
.detail-drawer {
  position: fixed;
  top: var(--topbar);
  right: 0;
  bottom: 0;
  z-index: 31;
  width: min(470px, calc(100vw - 72px));
  border-left: 1px solid #aebed0;
  background: #fff;
  box-shadow: -12px 0 34px rgba(6, 41, 79, .18);
  overflow: auto;
}
.drawer-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 17px 18px 13px;
}
.drawer-head h2 { font-size: 20px; }
.drawer-head p { margin-top: 4px; color: var(--muted); font-size: 13px; }
.drawer-body { padding: 16px 18px 24px; }
.drawer-section { margin-top: 18px; }
.drawer-section:first-child { margin-top: 0; }
.drawer-section h3 { font-size: 15px; margin-bottom: 8px; }
.definition-list { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px 12px; margin: 0; }
.definition-list dt { color: var(--muted); }
.definition-list dd { margin: 0; font-weight: 600; }
.evidence-list { display: grid; gap: 7px; }
.evidence-item { border-left: 3px solid #8cadd2; background: var(--surface-muted); padding: 8px 10px; }
.evidence-item strong, .evidence-item span { display: block; }
.evidence-item span { margin-top: 3px; color: var(--muted); font-size: 13px; }

@media (max-width: 1350px) {
  .split-view { grid-template-columns: 250px minmax(0, 1fr); }
  .hide-1280 { display: none; }
  .data-table th, .data-table td { padding-inline: 8px; }
}

@media (max-width: 980px) {
  .library-page-header { display: grid; }
  .header-meta { justify-content: flex-start; }
  .library-summary { grid-template-columns: repeat(2, 1fr); }
  .summary-cell:nth-child(3) { border-left: 0; border-top: 1px solid var(--line-soft); }
  .summary-cell:nth-child(4) { border-top: 1px solid var(--line-soft); }
  .chain-directory, .split-view { grid-template-columns: 1fr; }
  .tree-scroll { max-height: 340px; }
}
.app-loading > * {
  display: none !important;
}

.app-loading::before {
  content: "正在载入项目库…";
  display: grid;
  min-height: 320px;
  place-items: center;
  color: #60748c;
  font-size: 14px;
}

/*
 * B portal institutional research terminal layer.
 *
 * index.html still carries the exploratory homepage CSS inline. These selectors
 * intentionally use the app/body scope so the durable design contract below
 * can override that baseline without changing the current DOM. New semantic
 * classes are included for the planned navigation, search, dialog and source
 * evidence work.
 */

body {
  --navy: #0b2e52;
  --blue: #0b4fb3;
  --blue-strong: #083f91;
  --blue-soft: #edf4fc;
  --surface: #ffffff;
  --surface-muted: #f7f9fc;
  --text: #16263d;
  --muted: #66758a;
  --muted-strong: #526176;
  --line: #d5dfea;
  --line-soft: #e6ecf3;
  --line-strong: #8496aa;
  --success: #087f5b;
  --warning: #a64b16;
  --danger: #b42318;
  --topbar: 48px;
  --focus-ring: #ffbf47;
  --focus-edge: #102440;
}

.app {
  --navy: #0b2e52;
  --navy-strong: #082541;
  --blue: #0b4fb3;
  --blue-strong: #083f91;
  --blue-hover: #083f91;
  --blue-soft: #edf4fc;
  --page: #f4f7fb;
  --surface: #ffffff;
  --surface-muted: #f7f9fc;
  --text: #16263d;
  --muted: #66758a;
  --muted-strong: #526176;
  --text-secondary: #526176;
  --text-muted: #66758a;
  --line: #d5dfea;
  --line-soft: #e6ecf3;
  --line-strong: #8496aa;
  --success: #087f5b;
  --warning: #a64b16;
  --danger: #b42318;
  --focus: #ffbf47;
  --sidebar: 216px;
  --topbar: 48px;
  --radius: 4px;
  --shadow: none;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 12px;
  z-index: 100;
  min-height: 40px;
  border: 2px solid var(--focus-edge);
  border-radius: 4px;
  background: #fff;
  color: #083f91;
  padding: 8px 14px;
  font-weight: 700;
  transform: translateY(-160%);
}

.skip-link:focus-visible { transform: translateY(0); }

body :is(a, button, input, select, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  box-shadow: 0 0 0 1px var(--focus-edge);
}

.view-root:focus:not(:focus-visible) { outline: none; }
.view-root:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: -3px; }

.app .content {
  width: min(100%, 1520px);
  min-width: 0;
  padding: 24px 32px 32px;
}

.app .topbar { padding-inline: 24px; }
.app .top-action { min-height: 40px; }
.app .menu-search { height: 40px; color: var(--text-secondary); }
.app .nav-item { min-height: 44px; }
.app .recent-item { min-height: 40px; }

.app .hero {
  grid-template-columns: minmax(0, 8fr) minmax(360px, 4fr);
  gap: 32px;
}

.app .title-block h1,
.library-page-title h1,
.page-heading h1 {
  color: var(--text);
  font-size: 28px;
  font-weight: 700;
  line-height: 36px;
  letter-spacing: 0;
}

.app .title-block > p,
.library-page-title p,
.page-heading p {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 22px;
}

.app .search-field input,
.toolbar-search input {
  height: 44px;
  border-color: var(--line-strong);
}

.app .home-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.app .home-search-form .search-field { min-width: 0; }
.app .home-search-form .search-field input,
.app .home-search-form .primary { height: 40px; }
.app .home-search-form .primary {
  flex: 0 0 auto;
  padding-inline: 18px;
  white-space: nowrap;
}

.app .search-field input::placeholder,
.toolbar-search input::placeholder { color: var(--text-muted); opacity: 1; }

.app .primary {
  height: 44px;
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: none;
}

.app .primary:hover { background: var(--blue-hover); }

.app .coverage,
.app .library-card,
.app .panel {
  border-color: var(--line);
  border-radius: 4px;
  background: var(--surface);
  box-shadow: none;
}

.app .coverage { padding: 14px 16px; }
.app .coverage-item strong {
  font-size: 24px;
  font-weight: 650;
  line-height: 30px;
  font-variant-numeric: tabular-nums;
}

.app .data-note { margin: 20px 0 12px; line-height: 20px; }
.app .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.app .library-card {
  padding: 16px 18px 12px;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.app .library-card:hover {
  border-color: #8fa8c5;
  background: #fbfdff;
  box-shadow: none;
}

.app .library-heading { gap: 0; }
.app .library-icon { display: none; }
.app .library-copy h2 { font-size: 18px; line-height: 26px; }
.app .library-copy p { margin-top: 4px; color: var(--text-secondary); font-size: 14px; line-height: 22px; }

.app .library-metric-row {
  justify-content: flex-start;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin-top: 12px;
  border-block: 1px solid var(--line-soft);
  padding: 10px 0;
}

.app .library-metric {
  flex: 0 1 auto;
  border-left: 0;
  padding: 0;
  text-align: left;
}

.app .library-metric strong { font-size: 15px; font-weight: 650; line-height: 22px; }
.app .library-metric span { margin-top: 0; line-height: 20px; }
.app .library-link { min-height: 40px; margin-top: 2px; }

.app .lower-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.app .lower-grid > .panel { grid-column: span 4; }
.app .panel { padding: 12px 16px; }
.app .section-title { min-height: 36px; padding-bottom: 8px; }
.app .section-title h2 { font-size: 16px; line-height: 24px; }
.app .event-row,
.app .update-row,
.app .quality-row { min-height: 40px; font-size: 13px; line-height: 20px; }
.app .panel-link { min-height: 40px; }

.breadcrumb { gap: 8px; margin-bottom: 12px; line-height: 20px; }
.breadcrumb a,
.breadcrumb button { min-height: 32px; color: var(--blue-strong); }

.library-page-header { gap: 24px; margin-bottom: 16px; }
.header-meta { gap: 8px; }

.source-badge,
.demo-badge,
.state-badge,
.tag,
.status-inline {
  min-height: 28px;
  border-radius: 3px;
  padding: 3px 8px;
  line-height: 20px;
}

.library-summary {
  margin-bottom: 16px;
  border-color: var(--line);
  border-radius: 4px;
}

.summary-cell { padding: 12px 16px; }
.summary-cell strong {
  font-size: 24px;
  font-weight: 650;
  line-height: 30px;
  font-variant-numeric: tabular-nums;
}
.summary-cell span { margin-top: 2px; line-height: 20px; }

.library-tabs { gap: 8px; margin-bottom: 16px; }
.library-tab,
.library-tabs a { min-height: 44px; padding-inline: 14px; }
.library-tabs a { display: inline-flex; align-items: center; color: var(--text-secondary); text-decoration: none; }
.library-tabs a:hover { color: var(--blue-strong); background: #f0f5fb; }
.library-tabs a.active { border-bottom: 3px solid var(--blue); color: var(--blue-strong); font-weight: 650; }

.library-toolbar {
  gap: 12px;
  margin-bottom: 16px;
  border-color: var(--line);
  border-radius: 4px;
  padding: 12px 16px;
}

.filter-control { gap: 4px; }
.filter-control span { color: var(--text-secondary); line-height: 20px; }
.filter-control select { height: 40px; border-color: var(--line-strong); }

.text-button,
.outline-button,
.secondary-button { min-height: 40px; border-radius: 4px; padding-inline: 14px; }

.catalog-groups,
.active-filters { gap: 8px; margin-bottom: 16px; }
.catalog-filter,
.filter-chip { min-height: 40px; border-color: var(--line); padding-inline: 12px; }

.chain-directory { gap: 12px 16px; }
.chain-entry { min-height: 88px; padding: 14px 16px; }
.chain-entry:hover { border-color: #8fa8c5; background: #fbfdff; box-shadow: none; }
.chain-entry h3 { font-size: 16px; line-height: 24px; }
.chain-entry p,
.chain-entry-meta { line-height: 20px; }

.split-view {
  grid-template-columns: clamp(288px, 24vw, 336px) minmax(0, 1fr);
  gap: 16px;
}

.tree-panel,
.table-panel,
.detail-panel { border-color: var(--line); border-radius: 4px; }
.panel-heading { min-height: 48px; padding: 10px 16px; }
.panel-heading h2 { font-size: 16px; line-height: 24px; }
.panel-heading span { line-height: 20px; }

.tree-scroll { max-height: calc(100vh - 336px); padding: 8px; }
.tree-list ul { margin-left: 16px; padding-left: 0; }
.tree-node,
.tree-node-link { min-height: 40px; gap: 8px; padding: 6px 8px; }
.tree-branch-row { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; }
.tree-toggle { display: inline-grid; width: 32px; height: 32px; place-items: center; border: 0; background: transparent; color: var(--muted); }
.tree-toggle:hover { background: #eef3f8; color: var(--blue-strong); }
.tree-toggle svg { transition: transform 140ms ease; }
.tree-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
.tree-branch-row > .tree-node { width: 100%; }
.tree-node.selected,
.tree-node-link[aria-current="true"] {
  box-shadow: inset 3px 0 0 var(--blue);
  background: var(--blue-soft);
  color: var(--blue-strong);
}
.tree-node small { font-variant-numeric: tabular-nums; }

.node-detail { padding: 20px; }
.node-detail h2 { font-size: 20px; line-height: 28px; }
.node-path { line-height: 20px; }
.node-stat-grid { margin-top: 16px; }
.node-stat { padding: 12px 16px; }
.node-stat strong { font-size: 20px; line-height: 28px; }
.node-section { margin-top: 24px; }
.child-link { min-height: 40px; border-radius: 4px; padding: 8px 12px; }

.table-scroll { border-radius: 4px; overscroll-behavior-inline: contain; }
.data-table { font-size: 14px; line-height: 22px; }
.data-table th,
.data-table td { padding: 12px 10px; }
.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  min-height: 44px;
  background: #f1f5f9;
  color: var(--text-secondary);
}
.data-table td { height: 52px; }
.data-table td strong { font-size: 14px; line-height: 22px; }
.data-table td small { margin-top: 2px; line-height: 20px; }
.data-table .numeric,
.data-table .date,
.rank-cell { font-variant-numeric: tabular-nums; }
.data-table .primary-column { min-width: 220px; }
.table-link { display: inline-flex; min-height: 32px; align-items: center; }
.table-footnote { padding: 10px 12px; line-height: 20px; }

.route-notice,
.status-banner {
  gap: 10px;
  margin-bottom: 16px;
  border-radius: 4px;
  padding: 10px 12px;
  line-height: 20px;
}

.empty-state,
.loading-state,
.error-state {
  min-height: 280px;
  border-color: var(--line);
  border-radius: 4px;
  padding: 32px;
}

.empty-state p,
.loading-state p,
.error-state p { line-height: 22px; }

.drawer-backdrop { inset: 48px 0 0; background: rgba(11, 46, 82, .34); }
.detail-drawer,
body .drawer-dialog {
  top: 48px;
  width: min(520px, 90vw);
  border-left-color: var(--line-strong);
  border-radius: 0;
  box-shadow: -16px 0 36px rgba(11, 46, 82, .18);
}
.drawer-head { min-height: 64px; padding: 16px 20px; }
.drawer-head h2 { font-size: 20px; line-height: 28px; }
.drawer-head p { line-height: 20px; }
.drawer-body { padding: 20px 20px 32px; }
.drawer-section { margin-top: 24px; }
.drawer-section h3 { margin-bottom: 10px; font-size: 16px; line-height: 24px; }
.definition-list { grid-template-columns: 120px minmax(0, 1fr); gap: 10px 16px; }
.definition-list dt,
.definition-list dd { line-height: 22px; }
.evidence-list,
.source-evidence-list { gap: 8px; }
.evidence-item,
.source-evidence {
  border: 1px solid var(--line);
  border-left-width: 1px;
  border-radius: 4px;
  background: var(--surface-muted);
  padding: 10px 12px;
}

body dialog {
  border-color: var(--line-strong);
  border-radius: 4px;
  box-shadow: 0 22px 56px rgba(11, 46, 82, .24);
}
body dialog::backdrop { background: rgba(11, 46, 82, .38); }
body .dialog-head { min-height: 64px; padding: 16px 20px; }
body .dialog-heading h2 { font-size: 20px; line-height: 28px; }
body .icon-button { width: 44px; height: 44px; }
body .dialog-result { border-radius: 4px; background: var(--surface); }
body .dialog-result:hover { border-color: #8fa8c5; background: #fbfdff; }

body .toast {
  border-left-width: 1px;
  border-radius: 4px;
  box-shadow: 0 12px 28px rgba(11, 46, 82, .18);
}

.result-summary,
.page-status-row {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 20px;
}

.search-page-header { margin-bottom: 16px; }
.search-page-form { max-width: 960px; margin: 0 0 16px; }
.search-results { display: grid; gap: 20px; }
.results-heading {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}
.results-heading h2 { font-size: 18px; line-height: 26px; }
.results-heading span { color: var(--text-secondary); font-size: 13px; line-height: 20px; }
.search-result-group { display: grid; gap: 8px; }
.search-result-group h3 { color: var(--text-secondary); font-size: 15px; line-height: 22px; }
.search-result-group h3 span { margin-left: 4px; font-variant-numeric: tabular-nums; font-weight: 500; }
.search-result-list { display: grid; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.search-result-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  min-height: 64px;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  padding: 10px 16px;
  text-decoration: none;
}
.search-result-item:last-child { border-bottom: 0; }
.search-result-item:hover { background: #f8fbff; }
.search-result-item strong { display: block; font-size: 14px; line-height: 22px; }
.search-result-item > span:not(.search-result-meta) { display: block; margin-top: 2px; color: var(--text-secondary); font-size: 13px; line-height: 20px; }
.search-result-meta { display: inline-flex; align-items: center; gap: 8px; }
.search-result-meta em { font-style: normal; }
.search-result-meta i { width: 16px; height: 16px; color: var(--blue-strong); }

/* Full-surface alignment pass: keep icons, metrics, dates and actions on one grid. */
.brand-mark > svg { width: 15px; height: 15px; }
.top-action > svg { width: 16px; height: 16px; }
.menu-search > svg { width: 18px; height: 18px; }
.nav-item > svg { width: 18px; height: 18px; }
.recent-item > svg { width: 16px; height: 16px; }
.app .search-field > svg,
.toolbar-search > svg {
  position: absolute;
  top: 50%;
  left: 14px;
  z-index: 1;
  width: 19px;
  height: 19px;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}
.toolbar-search > svg { left: 11px; width: 17px; height: 17px; }
.data-note > svg,
.status-banner > svg,
.route-notice > svg { width: 17px; height: 17px; flex: 0 0 17px; }
.event-row > svg { width: 17px; height: 17px; }
.event-row > svg.chevron { width: 14px; height: 14px; }
.library-link > svg,
.outline-button > svg,
.text-button > svg { width: 16px; height: 16px; }
.panel-link > svg { width: 15px; height: 15px; }

.view-root h1[tabindex="-1"]:focus,
.drawer-head h2[tabindex="-1"]:focus {
  outline: 0 !important;
  box-shadow: none !important;
}

.app .library-card {
  display: grid;
  grid-template-rows: auto auto auto;
}
.app .library-metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
}
.app .library-metric {
  min-width: 0;
  border-left: 1px solid var(--line-soft);
  padding: 0 12px;
}
.app .library-metric:first-child { border-left: 0; padding-left: 0; }
.app .library-metric:last-child { padding-right: 0; }
.app .library-metric strong,
.app .library-metric span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-row,
.update-row,
.quality-row { min-height: 42px; }
.update-row { grid-template-columns: minmax(0, 1fr) minmax(82px, .72fr) 88px; }
.row-time,
.update-source { white-space: nowrap; }

.summary-cell {
  display: grid;
  min-width: 0;
  min-height: 76px;
  align-content: center;
}
.summary-cell strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.summary-cell .summary-value-long,
.summary-value-long { font-size: 21px; line-height: 28px; }

.data-table-wide { min-width: 1120px; }
.cell-date,
.cell-status,
.cell-action,
.table-link { white-space: nowrap; }
.cell-date { font-variant-numeric: tabular-nums; }
.table-link { min-height: 36px; }

.source-evidence .definition-list { grid-template-columns: 92px minmax(0, 1fr); gap: 8px 12px; }
.source-evidence .definition-list dd { min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 1350px) {
  .app .content { padding: 24px; }
  .app .hero { grid-template-columns: minmax(0, 7fr) minmax(340px, 5fr); gap: 24px; }
  .app .lower-grid > .panel { grid-column: span 6; }
  .app .lower-grid > .panel:last-child { grid-column: 1 / -1; }
  .split-view { grid-template-columns: minmax(288px, 304px) minmax(0, 1fr); }
  .data-table th, .data-table td { padding-inline: 8px; }
  body dialog.detail-drawer,
  body .drawer-dialog { width: min(480px, 90vw); }
}

@media (max-width: 1120px) {
  .app { --sidebar: 72px; }
  .app .content { padding-inline: 20px; }
  .split-view { grid-template-columns: 1fr; }
  .tree-scroll { max-height: 360px; }
}

@media (max-width: 980px) {
  .app .hero,
  .library-page-header { grid-template-columns: 1fr; }
  .app .library-grid,
  .chain-directory { grid-template-columns: 1fr; }
  .app .lower-grid > .panel { grid-column: 1 / -1; }
  .library-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-cell:nth-child(odd) { border-left: 0; }
  .summary-cell:nth-child(n + 3) { border-top: 1px solid var(--line-soft); }
  .library-toolbar { align-items: stretch; }
  .toolbar-search,
  .filter-control { min-width: 100%; }
  .definition-list { grid-template-columns: 1fr; gap: 2px; }
  .definition-list dd { margin-bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .app .library-card,
  .skip-link,
  body .toast { transition: none; }
}
