/* ══════════════════════════════════════════════════════════════════════════
   TGI · EXEC + ADMIN SURFACES
   Pairs with assets/tgi-exec-admin.js. No build step, no dependency.

   Scope discipline: every selector here is prefixed (.pf-, .rb-, .osd-, .lg-,
   .exa-) or is a documented two-line variant of an existing class. Nothing in
   this file restyles an element another lane owns.

   Tokens come from index.html :root and assets/tgi-viz.css. No new colour is
   invented here — --s1..--s6, --st-*, --seq-*, --div-* are the validated viz
   slots; --tgi-* are the brand tokens used for chrome only.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Two-line sidebar rows ────────────────────────────────────────────────
   The nav rows already carry `desc`; the shipped shell threw it away. The
   third-ranked defect across 100 first-time users was a wall of coined tool
   names with no plain description. Brand name kept, plain descriptor added. */
.sb-item.two-line { align-items: flex-start; padding-top: 9px; padding-bottom: 9px; min-height: 44px; }
.sb-item.two-line svg { margin-top: 2px; }
.osd-l { display: block; line-height: 1.3; }
.osd-d { display: block; font-size: 11px; line-height: 1.35; margin-top: 2px;
         color: rgba(255,255,255,.42); }
.sb-item.on .osd-d { color: rgba(255,255,255,.62); }

/* ── PROOF KEY ────────────────────────────────────────────────────────────
   The superscript on a figure is a real button, not a decoration: focusable,
   announced, and with a 44px hit area supplied by ::after so the visible mark
   can stay small. 67% of TGI revenue is government money subject to
   inspection — an audit request has to be one tap. */
.pf-key {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; padding: 0 4px; margin-left: 3px;
  vertical-align: super; border: 1px solid var(--tgi-mist, #E0E6E8); border-radius: 5px;
  background: var(--tgi-cloud, #F3F6F8); cursor: pointer;
  font-family: 'Roboto Condensed', system-ui, sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: .04em; color: var(--tgi-slate, #4A5A66); line-height: 1;
  transition: background .12s linear, color .12s linear, border-color .12s linear;
}
.pf-key::after { content: ''; position: absolute; left: 50%; top: 50%;
  width: 44px; height: 44px; transform: translate(-50%, -50%); }
.pf-key:hover, .pf-key:focus-visible { background: var(--tgi-navy, #1A4174); color: #fff;
  border-color: var(--tgi-navy, #1A4174); }
.pf-key:focus-visible { outline: 2px solid var(--tgi-cyan, #00A9D7); outline-offset: 2px; }
.pf-key[data-state="unattached"] { border-style: dashed; color: var(--st-warning, #9B6109); }

/* ── PROOF DRAWER ─────────────────────────────────────────────────────────
   Right-side drawer at >=720px, bottom sheet below. role=dialog, aria-modal,
   focus trapped, ESC and scrim close, and the trigger is re-focused on close. */
.pf-scrim { position: fixed; inset: 0; z-index: 9600; background: rgba(13,39,71,.45);
  opacity: 0; pointer-events: none; transition: opacity 240ms cubic-bezier(.3,0,.8,.15); }
.pf-scrim[data-on] { opacity: 1; pointer-events: auto; }

.pf-drawer {
  position: fixed; z-index: 9601; background: #fff; display: flex; flex-direction: column;
  box-shadow: -18px 0 48px rgba(13,39,71,.18);
  inset: 0 0 0 auto; width: min(460px, 100vw); transform: translateX(102%);
  transition: transform 320ms cubic-bezier(.05,.7,.1,1);
}
.pf-drawer[data-on] { transform: none; }
@media (max-width: 719px) {
  .pf-drawer { inset: auto 0 0 0; width: auto; max-height: 88vh;
    border-radius: 18px 18px 0 0; transform: translateY(102%);
    box-shadow: 0 -18px 48px rgba(13,39,71,.22); }
}
@media (prefers-reduced-motion: reduce) {
  .pf-drawer { transition: none; } .pf-scrim { transition: none; }
}
.pf-hd { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 14px;
  border-bottom: 1px solid var(--tgi-mist, #E0E6E8); }
.pf-hd h2 { font-family: 'Cabin', system-ui, sans-serif; font-size: 18px; font-weight: 600;
  color: var(--tgi-navy, #1A4174); line-height: 1.25; margin: 0; }
.pf-x { margin-left: auto; flex: 0 0 auto; width: 44px; height: 44px; margin: -10px -10px 0 0;
  display: grid; place-items: center; border: none; background: none; cursor: pointer;
  color: var(--tgi-stone, #7A8A94); border-radius: 10px; }
.pf-x:hover { background: var(--tgi-cloud, #F3F6F8); color: var(--tgi-navy, #1A4174); }
.pf-body { padding: 18px 20px 24px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pf-val { font-family: 'Roboto', system-ui, sans-serif; font-size: 40px; font-weight: 700;
  line-height: 1.05; color: var(--tgi-navy, #1A4174);
  font-variant-numeric: proportional-nums lining-nums; letter-spacing: -.015em; }
.pf-val small { display: block; font-size: 13px; font-weight: 400; letter-spacing: 0;
  color: var(--tgi-slate, #4A5A66); margin-top: 5px; }
.pf-rows { margin: 18px 0 0; padding: 0; list-style: none; }
.pf-rows li { display: grid; grid-template-columns: 116px 1fr; gap: 10px;
  padding: 10px 0; border-top: 1px solid var(--tgi-cloud, #F3F6F8); font-size: 13.5px;
  color: var(--tgi-ink, #271107); line-height: 1.5; }
.pf-rows dt, .pf-rows .k { font-family: 'Roboto Condensed', system-ui, sans-serif;
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--tgi-stone, #7A8A94); padding-top: 3px; }
.pf-attach { margin-top: 16px; padding: 13px 15px; border-radius: 12px; font-size: 13px;
  line-height: 1.6; border: 1px dashed var(--tgi-mist, #E0E6E8);
  background: var(--tgi-pearl, #FAF8F5); color: var(--tgi-slate, #4A5A66); }
.pf-attach.ok { border-style: solid; border-color: rgba(18,137,79,.35);
  background: rgba(18,137,79,.06); color: #12894F; }
.pf-attach b { color: var(--tgi-ink, #271107); }
.pf-cite { margin-top: 16px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word;
  padding: 12px 14px; border-radius: 10px; background: var(--tgi-cloud, #F3F6F8);
  color: var(--tgi-slate, #4A5A66); border: 1px solid var(--tgi-mist, #E0E6E8); }

/* ── KIND BADGES — where a figure comes from, at a glance ────────────────── */
.pf-kind { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px;
  border-radius: 999px; font-family: 'Roboto Condensed', system-ui, sans-serif;
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
.pf-kind[data-k="published"]   { background: #DDE5F1; color: #1A4174; }
.pf-kind[data-k="filed"]       { background: #E8D4EF; color: #6B297D; }
.pf-kind[data-k="roster"]      { background: var(--tgi-cyan-lt, #D3F0FA); color: #0A6D8B; }
.pf-kind[data-k="computed"]    { background: #CFEFDC; color: #12894F; }
.pf-kind[data-k="stated"]      { background: #FBE7C6; color: #9B6109; }
.pf-kind[data-k="unavailable"] { background: var(--tgi-cloud, #F3F6F8); color: #4A5A66;
  border: 1px dashed var(--tgi-mist, #E0E6E8); }

/* ── LEDGER TABLE (exec · audit trail) ───────────────────────────────────── */
.lg-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.lg-wrap table { width: 100%; border-collapse: collapse; font-size: 13px;
  font-variant-numeric: tabular-nums lining-nums; }
.lg-wrap th { text-align: left; padding: 9px 12px 9px 0; white-space: nowrap;
  font-family: 'Roboto Condensed', system-ui, sans-serif; font-size: 10.5px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--tgi-stone, #7A8A94);
  border-bottom: 1px solid var(--tgi-mist, #E0E6E8); font-weight: 600; }
.lg-wrap td { padding: 11px 12px 11px 0; border-bottom: 1px solid var(--tgi-cloud, #F3F6F8);
  vertical-align: top; line-height: 1.45; }
.lg-wrap td.num { text-align: right; white-space: nowrap; }
.lg-open { min-height: 44px; padding: 7px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--tgi-mist, #E0E6E8); background: #fff; white-space: nowrap;
  font-family: 'Roboto Condensed', system-ui, sans-serif; font-size: 11px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--tgi-navy, #1A4174); }
.lg-open:hover { border-color: var(--tgi-cyan, #00A9D7); color: var(--tgi-cyan-dk, #0A6D8B); }

/* ── INTERNAL-DEFINITION CHIP ─────────────────────────────────────────────
   The one chip that may never be quiet. TGI's published 33% is a self-defined
   subgroup with a self-defined outcome; it is not HUD SPM 7b.1 and the two are
   never rendered in the same frame without this mark. */
.def-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
  border-radius: 999px; background: #FBE7C6; color: #7A4B08;
  border: 1px solid rgba(154,97,9,.3);
  font-family: 'Roboto Condensed', system-ui, sans-serif; font-size: 10px;
  letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
.def-chip.hud { background: #DDE5F1; color: #1A4174; border-color: rgba(26,65,116,.3); }
.def-card { border: 1px solid var(--tgi-mist, #E0E6E8); border-radius: 14px; padding: 18px 20px;
  background: #fff; display: flex; flex-direction: column; gap: 10px; }
.def-card.internal { border-color: rgba(154,97,9,.35); background: #FFFCF6; }
.def-card h4 { font-family: 'Cabin', system-ui, sans-serif; font-size: 16px; font-weight: 600;
  color: var(--tgi-navy, #1A4174); }
.def-den { font-size: 13px; color: var(--tgi-slate, #4A5A66); line-height: 1.6; }
.def-den b { color: var(--tgi-ink, #271107); }

/* A deliberately fenced worked example. Never a TGI figure. */
.wx { border: 2px dashed var(--tgi-plum, #6B297D); border-radius: 14px; padding: 16px 18px;
  background: rgba(107,41,125,.04); margin-top: 14px; }
.wx-tag { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px;
  font-family: 'Roboto Condensed', system-ui, sans-serif; font-size: 10px;
  letter-spacing: .14em; text-transform: uppercase; font-weight: 700;
  color: var(--tgi-plum, #6B297D); }

/* ── RULEBOOK EDITOR ──────────────────────────────────────────────────────
   The licence-renewal surface: the logic becomes theirs. One sentence, three
   audiences, edited in one place and previewed in all three in the same frame. */
.rb-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.rb-search { flex: 1 1 200px; min-width: 160px; min-height: 44px; padding: 10px 14px;
  border: 1px solid var(--tgi-mist, #E0E6E8); border-radius: 10px; font: inherit; font-size: 14px;
  color: var(--tgi-ink, #271107); background: #fff; }
.rb-search:focus-visible { outline: 2px solid var(--tgi-cyan, #00A9D7); outline-offset: 1px; }
.rb-filter { min-height: 44px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--tgi-mist, #E0E6E8); background: #fff;
  font-family: 'Roboto Condensed', system-ui, sans-serif; font-size: 11px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--tgi-slate, #4A5A66); }
.rb-filter[aria-pressed="true"] { background: var(--tgi-navy, #1A4174); color: #fff;
  border-color: var(--tgi-navy, #1A4174); }

.rb-rule { border: 1px solid var(--tgi-mist, #E0E6E8); border-radius: 14px; background: #fff;
  padding: 16px 18px; margin-bottom: 10px; }
.rb-rule[data-edited] { border-color: var(--tgi-gold, #E19225); box-shadow: 0 0 0 3px rgba(225,146,37,.14); }
.rb-rule-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 9px; }
.rb-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  font-weight: 600; color: var(--tgi-navy, #1A4174); }
.rb-because { font-size: 14.5px; line-height: 1.6; color: var(--tgi-ink, #271107);
  padding-left: 12px; border-left: 3px solid var(--tgi-cyan, #00A9D7); }
.rb-meta { margin-top: 9px; font-size: 12px; color: var(--tgi-stone, #7A8A94); line-height: 1.55; }
.rb-edit-btn { margin-top: 11px; min-height: 44px; padding: 10px 15px; border-radius: 10px;
  cursor: pointer; border: 1px solid var(--tgi-mist, #E0E6E8); background: #fff;
  font-size: 13px; color: var(--tgi-navy, #1A4174); font-weight: 500; }
.rb-edit-btn:hover { border-color: var(--tgi-cyan, #00A9D7); }

.rb-pane { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--tgi-mist, #E0E6E8); }
.rb-ta { width: 100%; min-height: 108px; padding: 13px 15px; border-radius: 12px; resize: vertical;
  border: 1px solid var(--tgi-navy, #1A4174); font: inherit; font-size: 14.5px; line-height: 1.6;
  color: var(--tgi-ink, #271107); background: #fff; }
.rb-ta:focus-visible { outline: 2px solid var(--tgi-cyan, #00A9D7); outline-offset: 1px; }
.rb-count { font-family: 'Roboto Condensed', system-ui, sans-serif; font-size: 11px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--tgi-stone, #7A8A94); margin-top: 6px; }
.rb-err { margin-top: 10px; padding: 11px 14px; border-radius: 10px; font-size: 13px; line-height: 1.55;
  background: rgba(213,94,39,.08); border: 1px solid rgba(213,94,39,.4); color: #A03F16; }
.rb-err:empty { display: none; }

/* THE THREE PREVIEWS, IN ONE FRAME. Same sentence, three audiences, live. */
.rb-three { display: grid; gap: 12px; margin-top: 14px;
  grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); }
.rb-pv { border-radius: 14px; padding: 14px 15px; border: 1px solid var(--tgi-mist, #E0E6E8);
  background: var(--tgi-pearl, #FAF8F5); }
.rb-pv-tag { font-family: 'Roboto Condensed', system-ui, sans-serif; font-size: 9.5px;
  letter-spacing: .16em; text-transform: uppercase; font-weight: 700; margin-bottom: 9px;
  display: flex; align-items: center; gap: 6px; }
.rb-pv.guest    { background: rgba(0,169,215,.05);  border-color: rgba(0,169,215,.32); }
.rb-pv.guest    .rb-pv-tag { color: #0A6D8B; }
.rb-pv.case     { background: rgba(26,65,116,.045); border-color: rgba(26,65,116,.28); }
.rb-pv.case     .rb-pv-tag { color: #1A4174; }
.rb-pv.funder   { background: rgba(107,41,125,.05); border-color: rgba(107,41,125,.3); }
.rb-pv.funder   .rb-pv-tag { color: #6B297D; }
.rb-pv-body { font-size: 13.5px; line-height: 1.6; color: var(--tgi-ink, #271107); }
.rb-pv-sub { font-size: 11.5px; color: var(--tgi-stone, #7A8A94); margin-top: 8px; line-height: 1.5; }
.rb-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* Session-only banner. Says it plainly, once per surface, and never lies. */
.exa-session { display: flex; gap: 11px; align-items: flex-start; padding: 12px 15px;
  border-radius: 12px; margin-bottom: 18px; font-size: 13px; line-height: 1.6;
  background: rgba(0,169,215,.07); border: 1px solid var(--tgi-cyan-lt, #D3F0FA);
  color: var(--tgi-slate, #4A5A66); }
.exa-session b { color: var(--tgi-navy, #1A4174); }
.exa-session svg { flex: 0 0 auto; margin-top: 1px; color: var(--tgi-cyan-dk, #0A6D8B); }

/* Small helpers used only by these two portals. */
.exa-owner { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px;
  color: var(--tgi-slate, #4A5A66); }
.exa-owner b { color: var(--tgi-navy, #1A4174); font-weight: 600; }
.exa-matrix { width: 100%; border-collapse: collapse; font-size: 13px; }
.exa-matrix th, .exa-matrix td { padding: 10px 12px 10px 0; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--tgi-cloud, #F3F6F8); line-height: 1.45; }
.exa-matrix th { font-family: 'Roboto Condensed', system-ui, sans-serif; font-size: 10.5px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--tgi-stone, #7A8A94);
  border-bottom-color: var(--tgi-mist, #E0E6E8); }
.exa-never { color: #B4241B; font-weight: 600; }
.exa-yes   { color: #12894F; font-weight: 600; }

.exa-slider { width: 100%; min-height: 44px; accent-color: var(--tgi-plum, #6B297D); }
.exa-proofline { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: baseline;
  padding: 12px 0; border-top: 1px solid var(--tgi-cloud, #F3F6F8); font-size: 13px; }

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .pf-rows li { grid-template-columns: 1fr; gap: 2px; }
}

/* ── 44px floor inside these two portals ──────────────────────────────────
   Binding rule: tap targets 44px or more. The shared chart toggle ships at
   ~30px, so it is raised HERE, scoped to these two mains, rather than
   restyling a component another lane owns on every surface. */
#exec-main .viz-toggle, #admin-main .viz-toggle,
#exec-main .btn, #admin-main .btn { min-height: 44px; }
#exec-main .viz-bullet[tabindex], #admin-main .viz-bullet[tabindex] { min-height: 44px; }

/* ── .sr-only was USED and never DEFINED ─────────────────────────────────
   assets/tgi-viz.js and this file both ship `<caption class="sr-only">`, and
   no stylesheet in the estate declared the class. Every screen-reader caption
   was therefore rendering as visible body text above its table. Defined here
   because this file is the first to notice; it is a shared utility, not a
   surface style, and it is additive. */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}


/* ── Access grants · what the log captures, when it has captured nothing ──── */
.lg-row{display:flex;align-items:center;gap:14px;width:100%;text-align:left;
  padding:13px 16px;margin-top:8px;border:1px solid var(--tgi-mist);border-radius:var(--r);
  background:var(--tgi-white);cursor:pointer;font:inherit;color:inherit;
  transition:border-color var(--t),transform var(--t),box-shadow var(--t)}
.lg-row:hover{border-color:var(--tgi-cyan);transform:translateX(2px);box-shadow:var(--shadow-md)}
.lg-row:focus-visible{outline:2px solid var(--tgi-cyan);outline-offset:2px}
.lg-row-k{font-weight:600;color:var(--tgi-navy);flex:1 1 auto;min-width:0;font-size:14px}
.lg-row-w{font-family:var(--fc);font-size:11px;letter-spacing:.05em;text-transform:uppercase;
  color:var(--tgi-stone);white-space:nowrap}
.lg-row-go{font-family:var(--fc);font-size:11.5px;font-weight:700;color:var(--tgi-cyan-dk);white-space:nowrap}
@media(max-width:600px){
  .lg-row{flex-wrap:wrap;gap:5px 12px}
  .lg-row-k{flex:1 1 100%}
}
@media (prefers-reduced-motion: reduce){ .lg-row{transition:none} .lg-row:hover{transform:none} }
