/* portal.css — Grasslands Governance Portal chrome.
   Ported from the design handoff prototype (Building Materials and Documents/
   Governance Site/design_handoff_governance_portal/styles.css). The prototype's
   tweaks-panel rules are dropped — defaults are locked per the README
   (density=medium, accent=regular, type=serif-sans).

   Type: Source Serif 4 for headings (echoes the wordmark);
         Inter for UI/body; JetBrains Mono for IDs.
*/

:root {
  --gold: #B8870E;
  --gold-bright: #D4A017;
  --gold-bg: #FFF8E7;
  --green: #2F6315;
  --green-bright: #3D7A1C;
  --green-bg: #EAF4E1;
  --teal: #15616E;
  --teal-bright: #1D7A8C;
  --teal-bg: #E4F1F4;
  --burgundy: #8C2D2D;
  --burgundy-bright: #A63D3D;
  --burgundy-bg: #F5E6E6;
  /* Tier 5 — Systems Register (Spec: claude-code-prompt-systems-pib §F + 6-5-2026 PIB
     and Systems Spec §6). Indigo distinguishes the systems tier visually from the four
     core tiers (gold/green/teal/burgundy) without crowding the palette. Was slate-blue
     pre-2026-06-05; renamed to indigo to match the design handoff's --sys palette. */
  --indigo: #423D8F;
  --indigo-bright: #5A53BC;
  --indigo-bg: #ECEBF8;

  --ink: #1A1814;
  --ink-2: #3A362E;
  --ink-3: #6B6558;
  --ink-4: #9A9485;
  --rule: #E5E0D4;
  --rule-2: #EFEBE0;
  --paper: #FBF9F3;
  --paper-2: #F6F2E7;
  --white: #FFFFFF;

  --vis-public: #2F6315;
  --vis-internal: #B8870E;
  --vis-restricted: #8A2A2A;
  --vis-confidential: #6B1414;

  --maxw: 1280px;
  --sidebar-w: 320px;

  --shadow-1: 0 1px 0 rgba(26,24,20,.04), 0 1px 2px rgba(26,24,20,.04);
  --shadow-2: 0 1px 0 rgba(26,24,20,.04), 0 4px 16px rgba(26,24,20,.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 15px/1.55 "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

.serif { font-family: "Source Serif 4", "Iowan Old Style", "Apple Garamond", Georgia, serif; }
.mono  { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ───────── Top bar ───────── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(251,249,243,.92);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 28px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 40px; height: 40px; flex: 0 0 40px; }
.brand img { display: block; height: 42px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.brand-name { font-size: 19px; font-weight: 600; letter-spacing: -.005em; color: var(--ink); }
.brand-sub  { font-size: 11px; color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; margin-top: 3px; }

/* Masthead nav row — shared chrome (Home · Policies · Procedures · Instructions · Forms ·
   Cloud Applications · Electronic Systems). Sits below .topbar-inner inside the sticky
   header; consistent across Home, Browse, and the Systems register. The active link is set
   per page via ViewData["Nav"]. Lens labels stay accurate per the locked Systems decision —
   never "Classroom Applications" / "All Systems". */
.topnav {
  display: flex; align-items: center; justify-content: center; gap: 2px; flex-wrap: wrap;
  max-width: var(--maxw); margin: 0 auto; padding: 6px 28px;
  border-top: 1px solid var(--rule-2);
}
.topnav a { font: 500 13px/1 "Inter", sans-serif; color: var(--ink-3); padding: 8px 13px; border-radius: 7px; white-space: nowrap; }
.topnav a:hover { background: var(--paper-2); color: var(--ink); }
.topnav a.active { color: var(--ink); background: var(--paper-2); font-weight: 600; }
/* Home suppresses the masthead search (the hero owns it) → brand + auth only. */
.topbar.no-search .topbar-inner { grid-template-columns: auto auto; justify-content: space-between; }

.topbar-search {
  position: relative;
  max-width: 520px;
  width: 100%;
  justify-self: center;
}
.search-input {
  width: 100%;
  font: 14.5px/1.4 "Inter", system-ui, sans-serif;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 10px 14px 10px 38px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search-input::placeholder { color: var(--ink-4); }
.search-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184,135,14,.15); }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-4); pointer-events: none; }
.search-kbd  { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 11px/1 "JetBrains Mono", monospace; color: var(--ink-4); border: 1px solid var(--rule); padding: 3px 6px; border-radius: 4px; background: var(--paper-2); }

.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: var(--shadow-2);
  max-height: 420px; overflow-y: auto;
  z-index: 40;
}
.search-empty { padding: 18px 16px; color: var(--ink-3); font-size: 13.5px; }
.search-empty b { color: var(--ink-2); font-weight: 600; }
.search-row { display: grid; grid-template-columns: 90px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--rule-2); cursor: pointer; }
.search-row:first-child { border-top: 0; }
.search-row:hover, .search-row.active { background: var(--paper-2); }
.search-row .id { font-size: 11.5px; color: var(--ink-3); }
.search-row .ttl { font-size: 14px; color: var(--ink); font-weight: 500; min-width: 0; }
.search-row .ttl .snip { display: block; font-size: 12px; font-weight: 400; color: var(--ink-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-row .meta { font-size: 11.5px; color: var(--ink-3); }
.search-row-all { grid-template-columns: 1fr auto; color: var(--ink-2); }
.search-row-all .ttl { font-size: 13px; font-weight: 600; }

.auth-chrome { display: flex; align-items: center; gap: 10px; }
.gear-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 7px;
  color: var(--ink-3);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .12s, color .12s, border-color .12s;
}
.gear-icon:hover  { background: var(--paper-2); color: var(--ink); border-color: var(--rule); }
.gear-icon:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}
.btn {
  font: 500 13.5px/1 "Inter", sans-serif;
  border-radius: 7px;
  padding: 9px 14px;
  border: 1px solid var(--rule);
  background: var(--white);
  color: var(--ink);
  display: inline-flex; align-items: center; gap: 7px;
  text-decoration: none;
  transition: background .12s, border-color .12s, transform .12s;
}
.btn:hover { background: var(--paper-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-primary:hover { background: var(--ink-2); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--paper-2); }
.btn-danger { background: #fff; color: var(--vis-restricted); border-color: rgba(138,42,42,.25); }

.user-menu { position: relative; }
.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 10px 5px 5px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--white);
  font: 500 13px/1 "Inter", sans-serif;
}
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green-bright), var(--teal-bright));
  color: white; display: inline-flex; align-items: center; justify-content: center;
  font: 600 11px/1 "Inter", sans-serif;
}
.user-name { color: var(--ink); }
.user-role { color: var(--ink-3); font-size: 11.5px; padding: 2px 6px; border-radius: 4px; background: var(--paper-2); }
.user-pop {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 240px;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: var(--shadow-2);
  padding: 6px;
  z-index: 40;
}
.user-pop a, .user-pop button { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 6px; font-size: 13.5px; color: var(--ink); width: 100%; background: transparent; border: 0; text-align: left; text-decoration: none; }
.user-pop a:hover, .user-pop button:hover { background: var(--paper-2); }
.user-pop hr { border: 0; border-top: 1px solid var(--rule); margin: 6px 0; }

/* ───────── Layout shell ───────── */
.shell {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 32px 28px 96px;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 40px;
}
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; gap: 24px; padding: 20px 20px 80px; }
  .sidebar { position: static !important; }
}

/* ───────── Sidebar (landing-page tier nav) ───────── */
.sidebar {
  position: sticky;
  top: 92px;
  align-self: start;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding-right: 8px;
}
.sb-eyebrow { font: 600 10.5px/1 "Inter", sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-4); margin: 0 0 12px; padding: 0 10px; }
.sb-tier {
  display: block;
  border-left: 2px solid transparent;
  margin-bottom: 4px;
  border-radius: 0 6px 6px 0;
  transition: background .12s, border-color .12s;
}
.sb-tier-head { display: block; padding: 10px 12px; cursor: pointer; }
.sb-tier:hover { background: var(--paper-2); }
.sb-tier.active { background: var(--paper-2); }
.sb-tier.active.gold     { border-left-color: var(--gold); }
.sb-tier.active.green    { border-left-color: var(--green-bright); }
.sb-tier.active.teal     { border-left-color: var(--teal-bright); }
.sb-tier.active.burgundy { border-left-color: var(--burgundy); }
.sb-tier-name { font-size: 14px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.sb-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.sb-dot.gold     { background: var(--gold); }
.sb-dot.green    { background: var(--green-bright); }
.sb-dot.teal     { background: var(--teal-bright); }
.sb-dot.burgundy { background: var(--burgundy); }
.sb-children { margin: 0 0 8px 18px; padding: 0 8px 4px; list-style: none; display: none; }
.sb-tier.active .sb-children { display: block; }
.sb-children li { font-size: 12.5px; color: var(--ink-3); padding: 5px 8px; border-radius: 4px; cursor: pointer; }
.sb-children li:hover { background: var(--paper-2); color: var(--ink-2); }
.sb-children li .ct { color: var(--ink-4); margin-left: 6px; font-variant-numeric: tabular-nums; }

.sb-divider { height: 1px; background: var(--rule); margin: 18px 10px; }

.sb-pmp {
  margin: 0 4px;
  padding: 14px;
  background: linear-gradient(180deg, var(--teal-bg), rgba(228,241,244,.4));
  border: 1px solid rgba(21,97,110,.18);
  border-radius: 10px;
}
.sb-pmp-eyebrow { font: 600 10px/1 "Inter", sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--teal); margin-bottom: 6px; }
.sb-pmp-title { font-family: "Source Serif 4", serif; font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.25; margin-bottom: 6px; }
.sb-pmp-meta { font-size: 12px; color: var(--ink-3); margin-bottom: 10px; }
.sb-pmp a { font-size: 12.5px; font-weight: 600; color: var(--teal); display: inline-flex; align-items: center; gap: 4px; }

/* Sidebar companion to the landing-page "Other important documents" feature box.
   Slate-themed to match themes/other.css; only renders when the user is in a
   Universal tier (gated server-side via TierSidebarVm.IsUniversalMember). */
.sb-other-docs {
  margin: 12px 4px 0;
  padding: 12px 14px;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-left: 3px solid #475569;
  border-radius: 10px;
}
.sb-other-docs-title { font-family: "Source Serif 4", serif; font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.sb-other-docs-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.sb-other-docs-list li { font-size: 12.5px; line-height: 1.35; }
.sb-other-docs-list a { color: #1E293B; display: inline-flex; align-items: baseline; gap: 6px; padding: 2px 0; }
.sb-other-docs-list a:hover { color: #0F172A; text-decoration: underline; text-underline-offset: 2px; }
.sb-other-docs-list a::before { content: "›"; color: #64748B; font-weight: 600; flex: 0 0 auto; }

/* ───────── Main column ───────── */
.main { min-width: 0; }

.intro {
  margin: 0 0 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--rule);
}
.intro-lede {
  font-size: 14px; line-height: 1.65;
  color: var(--ink-2);
  max-width: 78ch;
  margin: 0 0 22px;
  padding: 16px 18px;
  background: linear-gradient(180deg, var(--paper-2), rgba(246,242,231,.45));
  border: 1px solid var(--rule);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  text-wrap: pretty;
}

.quickpaths { }
.qp-eyebrow {
  display: flex; align-items: center; gap: 10px;
  font: 600 10.5px/1 "Inter", sans-serif; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px;
}
.qp-clear {
  appearance: none; border: 0; background: transparent;
  font: 500 10.5px/1 "Inter", sans-serif; letter-spacing: .04em;
  text-transform: none; color: var(--ink-4); padding: 2px 4px; border-radius: 3px;
}
.qp-clear:hover { color: var(--ink-2); background: var(--paper-2); }
.qp-row { display: flex; flex-wrap: wrap; gap: 6px; }
.qp-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px 6px 8px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--white);
  font-size: 12.5px; line-height: 1.2;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  max-width: 100%;
}
.qp-pill:hover { background: var(--paper-2); border-color: var(--ink-4); color: var(--ink); }
.qp-pill-id {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; font-weight: 600;
  padding: 2px 6px; border-radius: 999px;
  background: var(--paper-2); color: var(--ink-3);
  letter-spacing: .01em;
}
.qp-pill-name {
  font-weight: 500; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 28ch;
}
.qp-pill-ct {
  font-size: 10.5px; color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}

.qp-pill.qp-gold  .qp-pill-id { background: var(--gold-bg);  color: var(--gold); }
.qp-pill.qp-green .qp-pill-id { background: var(--green-bg); color: var(--green); }
.qp-pill.qp-teal  .qp-pill-id { background: var(--teal-bg);  color: var(--teal); }
.qp-pill.qp-gold:hover  { border-color: rgba(184,135,14,.35); }
.qp-pill.qp-green:hover { border-color: rgba(47,99,21,.32); }
.qp-pill.qp-teal:hover  { border-color: rgba(21,97,110,.32); }

.qp-row-recent .qp-pill-name { max-width: 32ch; }

.intro-toggle { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin: 0 0 8px; }
.linkbtn {
  appearance: none; border: 0; background: transparent;
  font: 500 12.5px/1 "Inter", sans-serif;
  color: var(--ink-3); padding: 4px 6px; border-radius: 4px;
  cursor: pointer;
}
.linkbtn:hover { color: var(--ink); background: var(--paper-2); }
.linkbtn-sep { color: var(--ink-4); font-size: 11px; }

/* ───────── Tier band ───────── */
.tier {
  scroll-margin-top: 92px;
  margin-bottom: 56px;
}
.tier-head {
  margin-bottom: 14px;
}
.tier-rule {
  height: 4px;
  border-radius: 2px;
  margin-bottom: 18px;
}
.tier.gold     .tier-rule { background: var(--gold); }
.tier.green    .tier-rule { background: var(--green-bright); }
.tier.teal     .tier-rule { background: var(--teal-bright); }
.tier.burgundy .tier-rule { background: var(--burgundy); }

.tier-eyebrow { font: 600 11px/1 "Inter", sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.tier.gold     .tier-eyebrow { color: var(--gold); }
.tier.green    .tier-eyebrow { color: var(--green); }
.tier.teal     .tier-eyebrow { color: var(--teal); }
.tier.burgundy .tier-eyebrow { color: var(--burgundy); }

.tier-title {
  font-family: "Source Serif 4", serif;
  font-size: 28px; font-weight: 500;
  letter-spacing: -.005em;
  color: var(--ink);
  margin: 4px 0 0;
}

/* Category groups — compact single-line rows */
.cat {
  border-top: 1px solid var(--rule);
}
.cat:last-of-type { border-bottom: 1px solid var(--rule); }
.cat-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 8px 12px;
  margin: 0 -12px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  min-height: 36px;
  transition: background-color .12s;
}
.cat:not([data-empty="true"]) .cat-head:hover { background: var(--paper-2); }
.tier.gold     .cat:not([data-empty="true"]) .cat-head:hover { background: var(--gold-bg); }
.tier.green    .cat:not([data-empty="true"]) .cat-head:hover { background: var(--green-bg); }
.tier.teal     .cat:not([data-empty="true"]) .cat-head:hover { background: var(--teal-bg); }
.tier.burgundy .cat:not([data-empty="true"]) .cat-head:hover { background: var(--burgundy-bg); }

.cat[data-empty="true"] .cat-head { cursor: default; }

.cat-id { font-family: "JetBrains Mono", monospace; font-size: 12.5px; color: var(--ink-3); padding: 3px 7px; border: 1px solid var(--rule); border-radius: 4px; background: var(--paper-2); white-space: nowrap; flex: 0 0 auto; }
.tier.gold     .cat-id { color: var(--gold); border-color: rgba(184,135,14,.3); background: var(--gold-bg); }
.tier.green    .cat-id { color: var(--green); border-color: rgba(47,99,21,.25); background: var(--green-bg); }
.tier.teal     .cat-id { color: var(--teal); border-color: rgba(21,97,110,.22); background: var(--teal-bg); }
.tier.burgundy .cat-id { color: var(--burgundy); border-color: rgba(140,45,45,.3); background: var(--burgundy-bg); }

.cat-name-cell { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-name { font: 600 14.5px/1.3 "Inter", sans-serif; color: var(--ink); letter-spacing: -.005em; }
.cat-aud-inline { font-size: 13px; color: var(--ink-3); font-weight: 400; }
.cat[data-empty="true"] .cat-name { color: var(--ink-3); font-weight: 500; }

.cat-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.cat-count { font-variant-numeric: tabular-nums; min-width: 1.5ch; text-align: right; }
.cat-count.empty { color: var(--ink-4); }
.cat-chevron { color: var(--ink-3); transition: transform .18s; }
.cat[data-empty="true"] .cat-chevron { color: var(--ink-4); }
.cat.open .cat-chevron { transform: rotate(90deg); }
.cat-body { display: none; }
.cat.open .cat-body { display: block; padding-bottom: 18px; }

/* Document grid */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding: 4px 0 22px;
}

.doc-card {
  position: relative;
  padding: 14px 14px 12px;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow: var(--shadow-1);
  transition: transform .12s, box-shadow .12s, border-color .12s;
  cursor: pointer;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
}
.doc-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); border-color: var(--ink-4); }
.doc-tier-stripe {
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
}
.tier.gold     .doc-tier-stripe { background: var(--gold); }
.tier.green    .doc-tier-stripe { background: var(--green-bright); }
.tier.teal     .doc-tier-stripe { background: var(--teal-bright); }
.tier.burgundy .doc-tier-stripe { background: var(--burgundy); }

.doc-id {
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: .01em;
  margin-bottom: 5px;
  display: flex; align-items: center; gap: 8px;
}
.doc-title {
  font-size: 14.5px; font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -.005em;
  text-wrap: pretty;
}
.doc-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px;
  font-size: 11.5px; color: var(--ink-3);
}
.doc-edit {
  font-size: 11px;
  color: var(--ink-3);
  border: 1px solid var(--rule);
  background: var(--white);
  padding: 3px 8px; border-radius: 4px;
  display: none;
  text-decoration: none;
}
.doc-card.editable .doc-edit { display: inline-flex; }
.doc-edit:hover { color: var(--ink); border-color: var(--ink-4); }

/* External-link affordance (class: link stubs, May 26 spec). The ↗ glyph on cards,
   recents pills, and search rows signals the link opens an out-of-corpus resource in a
   new tab. Kept subtle and presentational — the new-tab behaviour is on the anchor. */
.doc-ext-glyph { margin-left: auto; color: var(--ink-3); font-size: 12px; line-height: 1; }
.doc-card-external:hover .doc-ext-glyph { color: var(--ink); }
.qp-pill-ext { margin-left: 2px; color: var(--ink-3); font-size: 11px; }
.search-ext { color: var(--ink-3); font-size: 0.9em; }

/* Visibility chip */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font: 500 10.5px/1 "Inter", sans-serif;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 4px 7px 4px 6px;
  border-radius: 4px;
  border: 1px solid;
  white-space: nowrap;
}
.chip-public     { color: var(--vis-public);    background: var(--green-bg); border-color: rgba(47,99,21,.22); }
.chip-internal   { color: var(--vis-internal);  background: var(--gold-bg);  border-color: rgba(184,135,14,.28); }
.chip-restricted { color: var(--vis-restricted); background: #FBEFEF; border-color: rgba(138,42,42,.22); }
.chip-confidential { color: var(--vis-confidential); background: #F7E9E9; border-color: rgba(107,20,20,.24); }
.chip-state-draft       { color: #6B5A1A; background: var(--gold-bg);   border-color: rgba(184,135,14,.22); }
.chip-state-published   { color: var(--vis-public); background: var(--green-bg); border-color: rgba(47,99,21,.22); }
.chip-state-unpublished { color: #8A2A2A; background: #FBEFEF; border-color: rgba(138,42,42,.22); }
.chip-state-archived    { color: var(--ink-3); background: var(--ink-bg, #F2F2EF); border-color: var(--rule); }
.chip-state-rescinded   { color: #7A1F2B; background: #F7E8EA; border-color: rgba(122,31,43,.28); }
.chip-consideration     { color: #4B3F8F; background: rgba(75,63,143,.10); border-color: rgba(75,63,143,.28); white-space: nowrap; }
.chip-dot { width: 6px; height: 6px; border-radius: 50%; }
.chip-public .chip-dot     { background: var(--vis-public); }
.chip-internal .chip-dot   { background: var(--vis-internal); }
.chip-state-draft .chip-dot       { background: var(--vis-internal); }
.chip-state-published .chip-dot   { background: var(--vis-public); }
.chip-state-unpublished .chip-dot { background: #8A2A2A; }
.chip-state-archived .chip-dot    { background: var(--ink-3); }
.chip-state-rescinded .chip-dot   { background: #7A1F2B; }
.chip-consideration .chip-dot     { background: #4B3F8F; }
.chip-restricted .chip-dot { background: var(--vis-restricted); }
.chip-confidential .chip-dot { background: var(--vis-confidential); }

/* ───────── Inline PMP feature ───────── */
.pmp-feature {
  margin: 18px 0 28px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 20px 22px;
  background:
    linear-gradient(180deg, rgba(228,241,244,.55), rgba(228,241,244,.25));
  border: 1px solid rgba(21,97,110,.18);
  border-left: 3px solid var(--teal);
  border-radius: 10px;
}
.pmp-icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--teal); color: white;
  display: inline-flex; align-items: center; justify-content: center;
}
.pmp-eyebrow { font: 600 10.5px/1 "Inter", sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); margin-bottom: 4px; }
.pmp-title { font-family: "Source Serif 4", serif; font-size: 17px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.pmp-blurb { font-size: 13px; color: var(--ink-2); max-width: 60ch; }
.pmp-action { display: inline-flex; align-items: center; gap: 6px; font: 600 13px/1 "Inter", sans-serif; color: var(--teal); padding: 9px 12px; border-radius: 7px; border: 1px solid rgba(21,97,110,.3); background: white; }
.pmp-action:hover { background: var(--teal-bg); }

/* ───────── Other important documents (class: other) ─────────
   Slate-themed companion to .pmp-feature, sits directly under it on the
   landing page. Gated server-side to Universal Read / Edit / admin —
   non-members never see the card. Palette mirrors the corpus rendering
   skill's themes/other.css (slate accent #475569, card border #CBD5E1)
   so the landing-page card previews the document chrome. */
.other-docs-feature {
  margin: 0 0 28px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: start;
  padding: 20px 22px;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-left: 3px solid #475569;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}
.other-docs-icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: #475569; color: white;
  display: inline-flex; align-items: center; justify-content: center;
}
.other-docs-title { font-family: "Source Serif 4", serif; font-size: 17px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.other-docs-blurb { font-size: 13px; color: var(--ink-2); max-width: 60ch; margin-bottom: 10px; }
.other-docs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.other-docs-list li {
  font-size: 13.5px;
}
.other-docs-list a {
  color: #1E293B;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px dotted transparent;
}
.other-docs-list a:hover {
  color: #0F172A;
  border-bottom-color: #94A3B8;
}
.other-docs-list a::before {
  content: "›";
  color: #64748B;
  font-weight: 600;
  flex: 0 0 auto;
}

/* ───────── Footer ───────── */
.foot {
  margin-top: 40px;
  border-top: 1px solid var(--rule);
  background: var(--paper-2);
}
.foot-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 32px;
  align-items: start;
}
.foot-brand { display: flex; align-items: center; gap: 12px; }
.foot-brand img { display: block; height: 36px; width: auto; }
.foot-brand-text { font-family: "Source Serif 4", serif; font-size: 16px; font-weight: 600; color: var(--ink); }
.foot-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 18px 28px; font-size: 13px; color: var(--ink-2); }
.foot-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.foot-meta { font-size: 12px; color: var(--ink-3); text-align: right; line-height: 1.6; }
.foot-meta b { color: var(--ink-2); font-weight: 600; }

/* ───────── Modal (sign-in) ───────── */
.scrim {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(26,24,20,.45);
  backdrop-filter: blur(2px);
  display: grid; place-items: center;
  animation: fade-in .15s ease;
}
/* The author display:grid above outranks the UA [hidden] rule, so a JS-toggled scrim needs
   this to actually hide. Higher specificity (0,2,0) and scoped to scrims carrying [hidden]. */
.scrim[hidden] { display: none; }
@keyframes fade-in { from { opacity: 0 } to { opacity: 1 } }
.modal {
  width: min(440px, calc(100vw - 32px));
  background: var(--white);
  border-radius: 12px;
  border: 1px solid var(--rule);
  box-shadow: 0 24px 60px rgba(26,24,20,.25);
  overflow: hidden;
  animation: pop .18s cubic-bezier(.2,.7,.3,1.1);
}
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0 } to { transform: none; opacity: 1 } }
.modal-head { padding: 20px 24px 6px; }
.modal-eyebrow { display: inline-flex; align-items: center; gap: 7px; font: 600 11px/1 "Inter", sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--vis-restricted); margin-bottom: 10px; }
.modal-title { font-family: "Source Serif 4", serif; font-size: 22px; font-weight: 600; color: var(--ink); margin: 0; }
.modal-body { padding: 8px 24px 4px; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.modal-doc { margin: 14px 0 4px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.modal-doc .id { font-family: "JetBrains Mono", monospace; font-size: 11.5px; color: var(--ink-3); }
.modal-doc .ttl { font-size: 13.5px; font-weight: 600; color: var(--ink); margin-top: 2px; }
.modal-foot { padding: 16px 24px 22px; display: flex; gap: 10px; justify-content: flex-end; }
.entra-btn { background: #2F6315; color: white; border-color: #2F6315; }
.entra-btn:hover { background: #244D10; }

/* ───────── Toast ───────── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper);
  padding: 10px 16px; border-radius: 8px;
  font-size: 13.5px; font-weight: 500;
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
  z-index: 200;
  animation: pop .18s cubic-bezier(.2,.7,.3,1.1);
}

/* utility */
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ───────── Classification banner (Status/Classification/Access spec §7.1) ─────────
   Sticky-top, full-width band that marks Restricted / Confidential documents on
   screen. Internal docs use the chip in the metadata strip — no banner needed
   (matches spec §7.1). Public docs have no marking at all. */
.classification-banner {
    position: sticky;
    top: 0;
    z-index: 50;                        /* above topbar */
    width: 100%;
    padding: 10px 28px;
    color: #FFFFFF;
    font: 700 13px/1.2 "Inter", sans-serif;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-align: center;
    box-shadow: 0 1px 0 rgba(0,0,0,0.15);
}
.classification-banner--restricted   { background: #8A2A2A; }
.classification-banner--confidential { background: #5A1818; }

/* ── Search results page (/search) ─────────────────────────────────────────── */
/* No sidebar on this page — collapse the shell grid to a single readable column. */
.shell-search { grid-template-columns: 1fr; }
.shell-search .main { max-width: 960px; margin: 0 auto; width: 100%; }
.search-page { padding-top: 8px; }
.search-page-header { margin: 4px 0 18px; }
.search-page-title { font-size: 30px; color: var(--ink); margin: 0; }
.search-count { font-size: 14px; color: var(--ink-3); margin: 6px 0 0; }
.search-count b { color: var(--ink); font-weight: 600; }
.search-q { color: var(--ink-2); font-weight: 500; }

.search-controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 0 0 18px; margin-bottom: 18px; border-bottom: 1px solid var(--rule);
}
.facet-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.facet-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border: 1px solid var(--rule); border-radius: 999px;
  background: var(--white); cursor: pointer; user-select: none;
  font: 500 13px/1 "Inter", sans-serif; color: var(--ink-2);
  transition: background .12s, border-color .12s, color .12s;
}
.facet-chip:hover { border-color: var(--ink-4); }
.facet-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.facet-count {
  font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--ink-4);
  background: var(--paper-2); border-radius: 999px; padding: 1px 7px; min-width: 18px; text-align: center;
}
.facet-chip.selected { color: var(--white); border-color: transparent; }
.facet-chip.selected .facet-count { background: rgba(255,255,255,.25); color: var(--white); }
.facet-chip.facet-gold.selected     { background: var(--gold); }
.facet-chip.facet-green.selected     { background: var(--green-bright); }
.facet-chip.facet-teal.selected     { background: var(--teal); }
.facet-chip.facet-burgundy.selected { background: var(--burgundy); }

.search-sort { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.search-sort-label { font: 600 11px/1 "Inter", sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.search-sort select {
  font: 500 13px/1 "Inter", sans-serif; color: var(--ink);
  background: var(--white); border: 1px solid var(--rule); border-radius: 8px;
  padding: 7px 10px; cursor: pointer;
}
.search-sort select:hover { border-color: var(--ink-4); }

.search-results-grid { margin-top: 4px; }

/* Per-card accent stripe (results mix tiers, so the accent rides the card, not an ancestor). */
.search-results-grid .doc-card.accent-gold     .doc-tier-stripe { background: var(--gold); }
.search-results-grid .doc-card.accent-green     .doc-tier-stripe { background: var(--green-bright); }
.search-results-grid .doc-card.accent-teal     .doc-tier-stripe { background: var(--teal-bright); }
.search-results-grid .doc-card.accent-burgundy .doc-tier-stripe { background: var(--burgundy); }
.search-results-grid .doc-card.accent-slate    .doc-tier-stripe { background: var(--ink-4); }

.search-snippet {
  font-size: 13px; line-height: 1.5; color: var(--ink-3); margin: 8px 0 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.search-snippet mark { background: var(--gold-bg); color: var(--ink); padding: 0 2px; border-radius: 2px; }
.search-matched {
  font: 500 11px/1 "Inter", sans-serif; color: var(--ink-4);
  text-transform: uppercase; letter-spacing: .06em;
}

.search-empty-page {
  text-align: center; padding: 64px 24px; color: var(--ink-3); max-width: 560px; margin: 0 auto;
}
.search-empty-icon { color: var(--ink-4); margin-bottom: 12px; }
.search-empty-title { font-size: 20px; color: var(--ink); margin: 0 0 8px; }
.search-empty-sub { font-size: 14px; line-height: 1.6; margin: 0; }
.search-empty-sub a { color: var(--teal); font-weight: 500; }

/* ───────── Tier 5 — Systems / Personal Information Banks ─────────
   Slate-blue accent. Paralleling the four existing tier accent rule sets
   (.gold / .green / .teal / .burgundy) so a SYS tier card and its detail
   page chrome share the visual register. The landing-page CTA card
   (.systems-feature) is a single-row affordance pointing at /pib-directory. */
.sb-tier.active.indigo { border-left-color: var(--indigo-bright); }
.sb-dot.indigo { background: var(--indigo-bright); }
.tier.indigo .tier-rule { background: var(--indigo-bright); }
.tier.indigo .tier-eyebrow { color: var(--indigo); }
.tier.indigo .cat:not([data-empty="true"]) .cat-head:hover { background: var(--indigo-bg); }
.tier.indigo .cat-id { color: var(--indigo); border-color: rgba(66,61,143,.3); background: var(--indigo-bg); }
.tier.indigo .doc-tier-stripe { background: var(--indigo-bright); }

/* Three-lens CTA list inside the systems tier card (M8 nav restructure). */
.systems-feature-body { flex: 1 1 auto; }
.systems-feature-lenses {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.systems-feature {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(66,61,143,.22);
  border-left: 3px solid var(--indigo);
  border-radius: 10px;
  background: var(--indigo-bg);
  margin-top: 8px;
}
.systems-feature-icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--indigo); color: white;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.systems-feature-title { font-family: "Source Serif 4", serif; font-size: 17px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.systems-feature-blurb { font-size: 13px; color: var(--ink-2); max-width: 60ch; }
.systems-feature-action {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 13px/1 "Inter", sans-serif; color: var(--indigo);
  padding: 9px 12px; border-radius: 7px;
  border: 1px solid rgba(66,61,143,.3); background: white;
  margin-left: auto; flex-shrink: 0;
  text-decoration: none;
}
.systems-feature-action:hover { background: var(--indigo-bg); }

