/* Quiet knowledge workspace shell. Scoped: no builder or data changes.
 * index.html load order: knowledge.css → knowledge-profiles.css →
 * knowledge-tasks.css → THIS FILE → knowledge-products.css →
 * knowledge-source-identity.css — this file is the coherent layout/tone
 * pass over knowledge.css/knowledge-profiles.css/knowledge-tasks.css, not a
 * pile of !important overrides; it loads before the two source-identity/
 * product files, which stay narrowly scoped to their own components instead
 * of re-fighting this file's cascade. Source/category identity colors (--kn-color,
 * set by tint() in knowledge-browser.js) are neutralized here to plain text —
 * they are decorative navigation aids, not a quality or health signal.
 * Genuine status (health dots, warn/danger tokens, measured/estimated/unknown
 * text) is untouched and stays distinguishable by text + a restrained accent. */
.kn-workspace {
  --kn-nav-accent: var(--k-accent);
  --kn-canvas: var(--k-bg);
  display:flex; flex:1; min-height:0; min-width:0; overflow:hidden;
  position:relative; background:var(--kn-canvas);
  font-size:13px;
}
.kn-workspace-rail {
  display:flex; flex-direction:column; flex:0 0 auto; min-height:0;
  background:var(--k-surface); overflow:hidden;
}
.kn-workspace-brand { display:flex; flex-direction:column; gap:4px; padding:16px 16px 14px; }
.kn-workspace-brand strong { font-size:15px; font-weight:650; color:var(--k-text); }
.kn-workspace-eyebrow,.kn-workspace-context { font-size:10px; letter-spacing:.08em; color:var(--k-muted); font-weight:600; text-transform:uppercase; }
.kn-workspace-context { padding:12px 14px 4px; border-top:1px solid var(--k-line); }
.kn-workspace .kn-tabbar { flex:0 0 auto; display:flex; flex-direction:column; gap:1px; padding:0 8px 14px; border:0; background:none; overflow:visible; }
.kn-workspace .kn-tab {
  display:flex; align-items:center; text-align:left; min-height:32px;
  width:100%; padding:6px 8px; border:1px solid transparent; border-radius:5px;
  background:transparent; color:var(--k-text-2); font-size:13px;
}
.kn-workspace .kn-tab:hover { background:var(--k-raised); color:var(--k-text); }
/* Neutral selected surface with a small accent edge — no filled color block. */
.kn-workspace .kn-tab-active { background:var(--k-raised); color:var(--k-text); border-color:var(--k-line); border-left:2px solid var(--kn-nav-accent); padding-left:7px; font-weight:550; }
.kn-workspace .kn-tab:focus-visible,.kn-workspace button:focus-visible,.kn-workspace a:focus-visible { outline:2px solid var(--kn-nav-accent); outline-offset:2px; }
.kn-workspace .kn-icon { display:inline-flex; vertical-align:middle; align-items:center; justify-content:center; width:15px; height:15px; margin-right:8px; color:var(--k-dim); flex-shrink:0; }
.kn-workspace .kn-tab-active .kn-icon { color:var(--k-text-2); }
.kn-workspace .kn-icon svg { width:100%; height:100%; }
.kn-workspace-rail > .kn-catalog-nav { flex:1 1 auto!important; box-sizing:border-box; min-height:0; max-height:none; max-width:none; padding:4px 10px 20px; border:0; overflow:auto; }
.kn-workspace-rail .kn-catalog-nav > h2 { font-size:12px; font-weight:600; margin:10px 4px; color:var(--k-text-2); }
.kn-workspace-rail .kn-catalog-nav > p { font-size:12px; line-height:1.55; color:var(--k-muted); }
.kn-workspace .kn-nav-section { margin:8px 0; }
.kn-workspace .kn-nav-section > summary { padding:7px 4px; font-size:12px; }
.kn-workspace .kn-nav-item { display:flex; align-items:center; padding:7px 7px; line-height:1.3; border-radius:4px; min-height:32px; border-left:2px solid transparent; }
.kn-workspace .kn-nav-item > span:not(.kn-icon) { min-width:0; }
/* Per-item identity tint (category/source hash color) is decorative — keep
 * the navigation list readable in one ink instead of a rainbow of icons. */
.kn-workspace .kn-nav-item.kn-tinted,
.kn-workspace .kn-nav-item.kn-tinted .kn-icon { color:var(--k-text-2); }
.kn-workspace .kn-nav-item:hover { background:var(--k-raised); color:var(--k-text); }
.kn-workspace .kn-nav-item[aria-current="true"] { background:var(--k-raised); color:var(--k-text); border-left-color:var(--kn-nav-accent); font-weight:550; }
.kn-workspace .kn-nav-item[aria-current="true"] .kn-icon { color:var(--k-text); }
/* The ingestion nav is moved into the common rail: do not scope to its former root. */
.kn-ingestion-nav .kn-nav-item { box-sizing:border-box; white-space:normal; margin:2px 0; }
.kn-ingestion-nav .kn-nav-item[aria-current="true"] { background:var(--k-raised); color:var(--k-text); border-left:2px solid var(--kn-nav-accent); }
.kn-ingestion-nav .kn-ingestion-filter { display:flex; flex-direction:column; gap:6px; margin:12px 3px; color:var(--k-muted); font-size:12px; line-height:1.4; }
.kn-ingestion-nav .kn-ingestion-filter .kn-filter-select { display:block; width:100%; min-width:0; max-width:100%; font:inherit; font-size:13px; color:var(--k-text); }
.kn-ingestion-nav > .kn-data-warning { margin:12px 3px 16px; padding:9px 0; border-top:1px solid var(--k-line); border-bottom:1px solid var(--k-line); }
.kn-workspace > .kn-splitter { flex:0 0 4px; background:var(--k-line); opacity:.7; }
.kn-workspace > .kn-splitter:hover,.kn-workspace > .kn-splitter:focus { background:var(--kn-nav-accent); opacity:1; }
.kn-workspace-page { display:flex; flex:1; flex-direction:column; min-width:0; min-height:0; overflow:hidden; }
.kn-workspace-location { display:flex; flex:0 0 auto; align-items:center; justify-content:space-between; gap:14px; min-height:40px; padding:0 20px; border-bottom:1px solid var(--k-line); color:var(--k-muted); font-size:12px; }
.kn-workspace-breadcrumb { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.kn-workspace-search { border:1px solid var(--k-line); color:var(--k-muted); border-radius:5px; background:transparent; padding:5px 10px; min-height:28px; cursor:pointer; white-space:nowrap; font:inherit; font-size:12px; }
.kn-workspace-search:disabled { opacity:.4; cursor:default; }
.kn-workspace-body { display:flex; flex:1; min-height:0; min-width:0; overflow:hidden; position:relative; }
.kn-workspace-body > .kn-catalog { width:100%; }
.kn-workspace-toggle { display:none; }

/* ── Page title / toolbar — compact, no oversized headings ─────────────── */
.kn-workspace .kn-toolbar { padding:14px 20px 12px; gap:8px; background:transparent; }
.kn-workspace .kn-catalog-heading { margin-bottom:4px; }
.kn-workspace .kn-catalog-heading h1,.kn-workspace .kn-catalog-heading h2 { font-size:20px; font-weight:600; letter-spacing:-.2px; margin:0 0 4px; color:var(--k-text); }
.kn-workspace .kn-catalog-heading p { font-size:12px; line-height:1.5; color:var(--k-muted); margin:0; }
.kn-workspace .kn-search,.kn-workspace .kn-filter-select { box-sizing:border-box; min-height:32px; padding:6px 10px; border-radius:5px; font-size:13px; }
.kn-workspace .kn-search:focus { border-color:var(--kn-nav-accent); outline:1px solid var(--kn-nav-accent); }
.kn-workspace .kn-btn { min-height:32px; box-sizing:border-box; font-size:13px; padding:5px 12px; }
.kn-workspace .kn-catalog-content { padding:16px 20px; }
/* .kn-catalog-filter (knowledge.css) caps every toolbar field — search box
   included — to max-width:240px, sized for a small dropdown. The library's
   own text search deserves the wide screen it has; only the field wrapping
   an actual search input widens, so Graphics card/Source/Game/Resolution
   selects stay compact. */
.kn-workspace .kn-catalog-filter:has(> input[type="search"]) { flex:2 1 320px; max-width:640px; }
/* Copy controls: legible size/target, not the native-faint 0.85em/1px-border
   default from knowledge.css — text stays plain, no pill chrome. */
.kn-workspace .kn-copy-btn { font-size:12px; min-height:24px; padding:3px 9px; border-color:var(--k-line); color:var(--k-text-2); }
.kn-workspace .kn-copy-btn:hover,.kn-workspace .kn-copy-btn:focus-visible { color:var(--k-text); border-color:var(--kn-nav-accent); }

/* ── Tables — plain separated rows, 13px body, ~44px rows ───────────────── */
.kn-workspace .kn-benchmark-table,.kn-workspace .kn-ep-table { border:0; font-size:13px; }
.kn-workspace .kn-benchmark-table th,.kn-workspace .kn-ep-table th { padding:9px 10px; font-size:10px; text-transform:uppercase; letter-spacing:.05em; color:var(--k-muted); background:transparent; border:0; border-bottom:1px solid var(--k-line); font-weight:600; height:auto; }
.kn-workspace .kn-benchmark-table td,.kn-workspace .kn-ep-table td { padding:12px 10px; border:0; border-bottom:1px solid var(--k-line); height:auto; }
.kn-workspace .kn-benchmark-table tbody tr:hover,.kn-workspace .kn-ep-table tbody tr:hover { background:var(--k-raised); }

/* ── Chips — plain metadata (span) or a text link (button), never a pill ── */
.kn-workspace .kn-chip {
  display:inline; border:0; background:none; border-radius:0; padding:0; margin:0;
  font-size:12px; max-width:100%; text-align:left; vertical-align:baseline;
}
.kn-workspace span.kn-chip { cursor:default; }
.kn-workspace button.kn-chip { cursor:pointer; color:var(--k-text-2); text-decoration:none; }
.kn-workspace button.kn-chip:hover,.kn-workspace button.kn-chip:focus-visible { color:var(--k-accent-text); text-decoration:underline; }
.kn-workspace .kn-chip:focus-visible { outline:2px solid var(--kn-nav-accent); outline-offset:2px; }
/* Random per-value identity tint stays out of chips entirely — plain ink. */
.kn-workspace .kn-chip.kn-tinted { color:var(--k-text-2); background:none; border-color:transparent; }
.kn-workspace button.kn-chip.kn-tinted:hover,.kn-workspace button.kn-chip.kn-tinted:focus-visible { color:var(--k-accent-text); }
/* Genuine data-quality chips (measured/estimated/unknown) keep their color,
 * they just lose the pill chrome — restrained text accent, not a badge. */
.kn-workspace .kn-chip-source,.kn-workspace .kn-chip-measured,.kn-workspace .kn-chip-estimated,.kn-workspace .kn-chip-unknown { background:none; border-color:transparent; padding:0; }
.kn-workspace .kn-source-link { text-decoration:none; border-bottom:0; color:var(--k-accent-text); }
.kn-workspace .kn-source-link:hover { text-decoration:underline; }

/* ── Identity tint elsewhere (cards, source rows) — thin edge, not a fill ── */
.kn-workspace .kn-catalog-card.kn-tinted { border-top:1px solid var(--k-line); }

/* ── Archive results / task rows — plain separated rows, not boxed cards ── */
.kn-workspace .kn-archive-content .kn-result-list { gap:0; border-top:1px solid var(--k-line); }
.kn-workspace .kn-archive-content .kn-result-item { border:0; border-bottom:1px solid var(--k-line); border-radius:0; background:transparent; padding:14px 10px; }
.kn-workspace .kn-archive-content .kn-result-item:hover { background:var(--k-raised); }
.kn-workspace .kn-result-title { font-size:14px; font-weight:550; }
.kn-workspace .kn-result-meta { font-size:12px; }
.kn-workspace .kn-result-snippet { line-height:1.5; color:var(--k-muted); }
.kn-workspace .kn-catalog-detail,.kn-workspace .kn-doc-pane { background:var(--k-surface); }
.kn-workspace .kn-current-block,.kn-workspace .kn-current-guidance { border-radius:6px; box-shadow:none; }
.kn-workspace .kn-current-resource { padding:16px; }
.kn-workspace .kn-source-directory-item { border-radius:0; border-width:0 0 1px; }
.kn-workspace .kn-source-profile-header { margin-bottom:18px; }
.kn-workspace .kn-source-profile h3 { font-size:14px; }
.kn-workspace .kn-task-row { padding:13px 10px; border-radius:0; border-width:0 0 1px; min-height:42px; box-sizing:border-box; }

@media(max-width:800px) {
  .kn-workspace .kn-toolbar { padding:14px; }
  .kn-workspace .kn-catalog-content { padding:14px; }
  .kn-workspace-location { padding:0 14px; }
}
@media(max-width:640px) {
  .kn-workspace-rail { display:none; }
  .kn-workspace > .kn-splitter { display:none; }
  .kn-workspace-toggle { display:block; border:0; background:none; color:var(--kn-nav-accent); padding:9px 0; text-align:left; font:inherit; font-size:13px; cursor:pointer; min-height:32px; }
  .kn-workspace-breadcrumb { display:none; }
  .kn-workspace-location { min-height:42px; padding:0 12px; gap:8px; }
  .kn-workspace-menu-open .kn-workspace-rail { display:flex; position:absolute; top:43px; bottom:0; left:0; width:min(300px,100%); z-index:25; box-shadow:12px 0 24px rgba(0,0,0,.4); overflow:auto; }
  .kn-workspace-menu-open .kn-workspace-rail > .kn-catalog-nav { display:block; width:100%!important; flex:1 0 auto!important; max-height:none; overflow:visible; }
  .kn-workspace-brand { padding:14px; }
  .kn-workspace .kn-toolbar { padding:12px; }
  .kn-workspace .kn-catalog-content { padding:12px; }
  .kn-workspace .kn-catalog-heading h1,.kn-workspace .kn-catalog-heading h2 { font-size:18px; }
  .kn-workspace .kn-catalog-detail { z-index:30; }
  /* Tables scroll within their own row, never widen the page. */
  .kn-workspace .kn-benchmark-scroll,.kn-workspace .kn-endpoint-scroll { max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .kn-workspace .kn-nav-item,.kn-workspace .kn-tab,.kn-workspace .kn-chip button,.kn-workspace button.kn-chip { min-height:34px; }
}
