/* Data workspace controls. Theme colours share the existing tm tokens. */
.ni-sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.ni-workspace-tools { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .25rem 0; }
.ni-eyebrow { display: block; color: var(--tm-accent); font-size: .65rem; letter-spacing: .13em; font-weight: 800; text-transform: uppercase; }
.ni-workspace-scope p { margin: .35rem 0 0; color: var(--tm-muted); font-size: .76rem; line-height: 1.55; }
.ni-workspace-scope strong { color: var(--tm-text); font-variant-numeric: tabular-nums; }
.ni-workspace-buttons { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; flex-shrink: 0; }
.ni-density { display: inline-flex; padding: .2rem; border: 1px solid var(--tm-line); border-radius: 10px; background: var(--tm-bg); }
.ni-density[hidden] { display: none; }
.ni-density button { display: flex; align-items: center; gap: .35rem; border: 0; padding: .4rem .55rem; border-radius: 7px; background: transparent; color: var(--tm-muted); font-size: .68rem; font-weight: 700; cursor: pointer; }
.ni-density button[aria-pressed="true"] { color: var(--tm-accent); background: var(--tm-accent-bg); }
.ni-active-filters { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; color: var(--tm-muted); font-size: .7rem; }
.ni-active-filters > span { margin-right: .1rem; }
.ni-active-filters a { display: inline-flex; align-items: center; gap: .4rem; max-width: 100%; padding: .4rem .6rem; border: 1px solid var(--tm-line); border-radius: 8px; background: var(--tm-bg); color: var(--tm-text-2); text-decoration: none; overflow-wrap: anywhere; }
.ni-active-filters b { font-weight: 650; }
.ni-active-filters a:hover { border-color: var(--tm-accent); color: var(--tm-accent); }
.ni-active-filters .ni-clear-filters { background: transparent; border-color: transparent; color: var(--tm-accent); }
.ni-page[data-ni-density="comfortable"] .tm-table:not(.ni-chart-table) td { padding-top: .8rem; padding-bottom: .8rem; }
.ni-page[data-ni-density="compact"] .tm-table:not(.ni-chart-table) td { padding-top: .42rem; padding-bottom: .42rem; }
.ni-page .tm-table th { font-size: .65rem; letter-spacing: .04em; }
.ni-page .tm-table td { font-size: .76rem; }
.ni-page .tm-table .sub { line-height: 1.55; }
.ni-page .tm-scroll, .ni-page .ni-chart-table-wrap { position: relative; }
.ni-page [id="ni-records"], .ni-page .ni-data-insights { scroll-margin-top: calc(var(--topbar-height, 72px) + var(--page-header-height, 5.5rem) + 4rem); }
.ni-scroll-help { display: flex; justify-content: flex-end; gap: .35rem; padding: .35rem .85rem; color: var(--tm-muted); font-size: .66rem; border-bottom: 1px solid var(--tm-line); background: var(--tm-bg-soft); }
.ni-scroll-help[hidden] { display: none; }
.ni-page .tm-scroll[data-ni-overflow="true"] { overscroll-behavior-x: contain; }
.ni-workspace-buttons :is(a,button):focus-visible, .ni-active-filters a:focus-visible, .ni-page .tm-scroll:focus-visible { outline: 2px solid var(--tm-accent); outline-offset: 3px; }
.ni-section-intro { display: flex; justify-content: space-between; align-items: start; gap: 1rem; padding: 1.15rem 1.25rem; border: 1px solid var(--tm-line); border-radius: 16px; background: var(--tm-bg); }
.ni-section-intro h2 { margin: .4rem 0; font-size: 1.15rem; line-height: 1.35; color: var(--tm-text); }
.ni-section-intro p { margin: 0; font-size: .78rem; line-height: 1.65; color: var(--tm-muted); max-width: 60rem; }
.ni-section-intro .ni-intro-number { font-size: 2rem; line-height: 1; font-weight: 750; color: var(--tm-accent); font-variant-numeric: tabular-nums; }
.ni-page .ni-steps { gap: .5rem; }
.ni-page .ni-step { padding: .75rem; }
.ni-page .ni-step > b { font-size: 1.4rem; margin: .25rem 0; font-variant-numeric: tabular-nums; }
.ni-page .ni-step > small { line-height: 1.55; white-space: normal; }
.ni-page .ni-source-observations { width: min(25rem, 70vw); min-width: 13rem; }
.ni-record-detail summary { color: var(--tm-accent); cursor: pointer; font-weight: 650; }
.ni-record-detail dl { display: grid; grid-template-columns: minmax(6rem, 1fr) minmax(8rem, 1.4fr); gap: .5rem .8rem; width: min(25rem, 70vw); white-space: normal; padding: .75rem; margin-top: .5rem; border: 1px solid var(--tm-line); border-radius: 10px; background: var(--tm-bg-soft); }
.ni-record-detail dt { color: var(--tm-muted); }
.ni-record-detail dd { margin: 0; overflow-wrap: anywhere; }
.ni-record-detail summary:focus-visible { outline: 2px solid var(--tm-accent); outline-offset: 3px; }
@media (max-width: 767px) {
  .ni-workspace-tools { align-items: stretch; flex-direction: column; gap: .7rem; }
  .ni-workspace-buttons { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .ni-density { grid-column: 1 / -1; justify-self: start; }
  .ni-workspace-buttons .tm-btn { min-height: 38px; }
  .ni-section-intro { padding: 1rem; }
  .ni-section-intro h2 { font-size: 1rem; }
  .ni-page .tm-table td { font-size: .73rem; }
}
