/* The CGS FSN demo: the styles the FSN app writes inline, as classes, so that
   2,000-row tables stay small. Colours and sizes are FSN's own (components/*.tsx). */

/* ---- top bar */
.c-brandlink {
  flex: none;
  text-decoration: none;
  display: flex;
  align-items: center;
}
.c-wordmark {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}
.c-search {
  flex: 1 1 auto;
  max-width: 460px;
  min-width: 0;
}
.c-searchbox {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--rule);
  background: var(--paper);
}
.c-searchbox input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-family: var(--font-mono);
}
.c-searchbox:focus-within {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.c-searchbox kbd {
  flex: none;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-3);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1px 5px;
  background: var(--card);
}
.c-topright {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.c-utility {
  max-width: 12rem;
  font-weight: 600;
}
.c-theme {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--touch-target);
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--rule);
  background: var(--card);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.c-theme svg {
  display: none;
}
:root:not([data-theme]) .c-theme-system,
:root[data-theme="light"] .c-theme-light,
:root[data-theme="dark"] .c-theme-dark {
  display: block;
}
.c-user {
  position: relative;
  flex: none;
}
.c-user > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--card);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.c-user > summary::-webkit-details-marker {
  display: none;
}
.c-userpanel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 60;
  min-width: 250px;
  padding: 12px;
  display: grid;
  gap: 10px;
}
.c-role {
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 5px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink-2);
}
.c-dens {
  flex: 1;
  min-height: 32px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-transform: capitalize;
  border: 1px solid var(--rule);
  background: var(--card);
  color: var(--ink-2);
}
.c-dens[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
}
@media (max-width: 768px) {
  .c-theme [data-theme-label] {
    display: none;
  }
  .c-utility {
    max-width: 7.5rem;
  }
  .c-searchbox kbd {
    display: none;
  }
  .fsn-topbar .fsn-brand-lockup {
    height: 44px;
  }
}
@media (max-width: 480px) {
  .c-search {
    display: none;
  }
}

/* ---- ask */
.c-asktoggle {
  align-items: center;
  gap: 7px;
  min-height: var(--touch-target);
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.22);
  cursor: pointer;
}
.c-scope {
  font-size: 11px;
  color: var(--ink-3);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1px 6px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- page furniture */
.c-crumbs {
  margin: 0 0 4px;
}
.c-crumbs a {
  text-decoration: none;
}
.c-h1 {
  font-size: 26px;
  margin: 0;
}
.c-pad {
  padding: 14px 16px;
}
.c-tcard {
  padding: 0;
  overflow-x: auto;
}
.c-btext {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
}
.c-prov {
  border-top: 1px solid var(--rule);
  padding-top: 10px;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--ink-3);
}
.c-num {
  text-align: right;
}
.fsn-table th.c-num .fsn-sortbtn {
  justify-content: flex-end;
}
.c-dim {
  color: var(--ink-3);
}
.c-list {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.7;
}
.fsn-table th.c-rowth {
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  color: var(--ink);
  white-space: normal;
}
.c-rowth > span {
  display: block;
  font-weight: 400;
  font-size: 11px;
  color: var(--ink-3);
}
.c-fnth code {
  font-size: 12.5px;
}
.c-fnth > span {
  font-size: 11.5px;
  max-width: 60ch;
}
.fsn-table tr[id] {
  scroll-margin-top: calc(var(--topbar-h) + 12px);
}
.fsn-table tr:target {
  background: var(--hover);
  box-shadow: inset 3px 0 0 var(--accent);
}
.c-desc {
  min-width: 220px;
  max-width: 420px;
}
.c-follows {
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.5;
  min-width: 220px;
}
.c-total th,
.c-total td {
  font-weight: 700;
  border-top: 2px solid var(--rule);
}
.fsn-sortbtn .c-arrow {
  opacity: 0.25;
  font-size: 9px;
}
th[aria-sort="ascending"] .c-arrow,
th[aria-sort="descending"] .c-arrow {
  opacity: 1;
}
tr[hidden] {
  display: none;
}
#main :target {
  scroll-margin-top: calc(var(--topbar-h) + 12px);
}

/* ---- figures */
.c-figrow {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.c-fig {
  padding: 12px 14px;
  display: block;
  text-decoration: none;
  color: inherit;
}
.c-fig .fsn-figure {
  margin-top: 2px;
}
.c-fignote {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-3);
  margin-top: 3px;
}
.c-fig.c-flag {
  border-color: var(--flag-line);
  background: var(--flag-surface);
}
.c-fig.c-flag .fsn-label,
.c-fig.c-flag .fsn-figure,
.c-fig.c-flag .c-fignote {
  color: var(--flag-text);
}
.c-bignum {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-display);
}

/* ---- chips (RiscBadge and SignificanceChip) */
.c-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.01em;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}
.c-chip.sm {
  gap: 5px;
  padding: 1px 6px;
  font-size: 11px;
}
.c-chip svg {
  flex: none;
  display: block;
  width: 11px;
  height: 11px;
}
.c-chip.sm svg {
  width: 9px;
  height: 9px;
}
.c-r1 {
  border-color: var(--risc-1-line);
  background: var(--risc-1-surface);
  color: var(--risc-1-text);
}
.c-r2 {
  border-color: var(--risc-2-line);
  background: var(--risc-2-surface);
  color: var(--risc-2-text);
}
.c-r3 {
  border-color: var(--risc-3-line);
  background: var(--risc-3-surface);
  color: var(--risc-3-text);
}
.c-r4 {
  border-color: var(--risc-4-line);
  background: var(--risc-4-surface);
  color: var(--risc-4-text);
}
.c-hss {
  border-color: var(--sig-hss-line);
  background: var(--sig-hss-surface);
  color: var(--sig-hss-text);
}
.c-lss {
  border-color: var(--sig-lss-line);
  background: var(--sig-lss-surface);
  color: var(--sig-lss-text);
}
.c-none {
  border: 1px dashed var(--unknown-line);
  background: var(--unknown-surface);
  color: var(--unknown-text);
  font-weight: 500;
}
.c-meaning {
  font-weight: 400;
  opacity: 0.85;
}
.c-raw {
  font-size: 12px;
}

/* ---- distribution bar, legend, donuts */
.c-bar {
  display: flex;
  gap: 1px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--card);
}
.c-seg {
  min-width: 2px;
}
.c-s1 {
  background: var(--risc-1-surface);
  box-shadow: inset 0 0 0 1px var(--risc-1-line);
}
.c-s2 {
  background: var(--risc-2-surface);
  box-shadow: inset 0 0 0 1px var(--risc-2-line);
}
.c-s3 {
  background: var(--risc-3-surface);
  box-shadow: inset 0 0 0 1px var(--risc-3-line);
}
.c-s4 {
  background: var(--risc-4-surface);
  box-shadow: inset 0 0 0 1px var(--risc-4-line);
}
.c-bar-empty {
  border-radius: 999px;
  border: 1px dashed var(--unknown-line);
}
.c-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  align-items: center;
}
.c-legitem,
.c-bin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.c-bin {
  gap: 5px;
  font-size: 12px;
}
.c-legnum {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.c-bin .c-legnum {
  font-weight: 700;
}
.c-zero {
  opacity: 0.55;
}
.c-zero .c-legnum {
  color: var(--ink-3);
}
.c-share {
  color: var(--ink-3);
  font-weight: 400;
  font-size: 0.9em;
  white-space: nowrap;
}
.c-donuts {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.c-donut {
  padding: 16px;
  display: flex;
  gap: 16px;
  align-items: center;
}
@media (max-width: 400px) {
  .c-donut {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---- cards */
.c-syscard {
  padding: 14px;
  display: grid;
  gap: 10px;
}
.c-sites {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(272px, 1fr));
}
.c-sitecard {
  padding: 14px;
  display: grid;
  gap: 8px;
  max-width: 560px;
}
.c-planticon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  text-align: center;
  padding: 0 2px;
}
.c-mini {
  display: grid;
  gap: 3px;
  min-width: 92px;
  text-decoration: none;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
}
.c-minibar {
  display: block;
  height: 5px;
  border-radius: 999px;
  background: var(--hover);
  box-shadow: inset 0 0 0 1px var(--rule);
  overflow: hidden;
}
.c-minibar i {
  display: block;
  height: 100%;
  background: var(--accent);
}
.c-statusgrid td,
.c-statusgrid th {
  white-space: nowrap;
}

/* ---- grid toolbar */
.fsn-btn.c-pill {
  padding: 0 9px;
  font-size: 11.5px;
}

/* ---- component page */
.c-rankgrid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.c-rankcard {
  padding: 14px;
  display: grid;
  gap: 8px;
}
.c-governs {
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.5;
}
.c-governs strong {
  color: var(--ink-2);
}
.c-pilltag {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  color: var(--ink-2);
}
.c-fncard {
  padding: 14px;
  display: grid;
  gap: 10px;
}
.c-marker {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-3);
}
.c-marker.on {
  border-color: var(--sig-hss-line);
  background: var(--sig-hss-surface);
  color: var(--sig-hss-text);
}
.c-remarks {
  border-left: 2px solid var(--rule);
  padding-left: 10px;
}
.c-remarks p {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.6;
}
.c-sum {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
}
.fsn-table th.c-crit {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  letter-spacing: 0;
  text-transform: none;
  vertical-align: top;
}
.c-def {
  color: var(--ink-2);
  line-height: 1.5;
  min-width: 320px;
}
.fsn-table td.c-def {
  height: auto;
}
.c-basis {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.55;
  border-left: 2px solid currentColor;
  padding-left: 10px;
  opacity: 0.9;
  white-space: pre-wrap;
}
.c-nobasis {
  border-left: 2px dashed var(--unknown-line);
  color: var(--ink-3);
  font-size: 11.5px;
}
.c-ans {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  color: var(--ink-2);
}
.c-ans-no {
  color: var(--flag-text);
  background: var(--flag-surface);
  border-color: var(--flag-line);
}
.c-ansnote {
  display: block;
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 2px;
}
.c-memb {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--paper);
}
.c-inprog {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  border: 1px solid var(--ink-3);
  border-radius: 999px;
  padding: 1px 8px;
  white-space: nowrap;
}
.c-yes {
  font-size: 11.5px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  color: var(--accent);
  white-space: nowrap;
}
.c-no {
  font-size: 11.5px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  color: var(--ink-3);
  white-space: nowrap;
}
.fsn-table td {
  vertical-align: middle;
}
.fsn-kv > div > dd .tag {
  white-space: normal;
}

/* ---- program page */
.c-governed {
  margin: 0;
  font-size: 22px;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--accent);
}
.c-governed code {
  font-size: 12px;
  margin-left: 10px;
  color: var(--ink-3);
  font-family: var(--font-mono);
}

/* ---- search */
.c-hitkind {
  margin-left: 8px;
  font-size: 10px;
}

/* ---- fixes from the first screenshots */
.fsn-page { grid-template-columns: minmax(0, 1fr); }
.c-basiscol { white-space: nowrap; color: var(--ink-2); font-size: 12.5px; }
@media (max-width: 640px) {
  .c-search { display: none; }
  .c-utility { max-width: 9.5rem; }
}

/* ---- sign-in (FSN's login page, with the demo's own copy of its art) */
.fsn-login { background-image: url(login-art-2.jpg); }
#gate[hidden] { display: none; }
.c-gatein { min-height: var(--touch-target); padding: 0 10px; border-radius: 6px; border: 1px solid rgb(255 255 255 / 0.24); background: rgb(255 255 255 / 0.07); color: var(--ink); font-size: 14px; }
.c-gatebtn { min-height: var(--touch-target); border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-contrast); font-size: 14px; font-weight: 700; cursor: pointer; }
.c-gatebtn:disabled { opacity: 0.7; cursor: progress; }
.c-gateerr { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--flag-text); }
.c-gateerr:empty { display: none; }

/* ---- the utility, named in the top bar (it is chosen on eaglerushmore.com) */
.c-tenant { display: inline-flex; align-items: center; min-height: 34px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink-2); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
@media (max-width: 400px) { .c-tenant { font-size: 11.5px; padding: 0 8px; } }

/* ---- fixes from the QA pass */
.fsn-section { grid-template-columns: minmax(0, 1fr); }
#main [id] { scroll-margin-top: calc(var(--topbar-h) + 12px); }
.c-donuts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.fsn-login-pane { background: rgb(11 16 21 / 0.86); }
.c-searchicon { display: none; flex: none; width: 34px; height: 34px; align-items: center; justify-content: center; border-radius: 6px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink-2); }
@media (max-width: 640px) {
  .c-searchicon { display: inline-flex; }
  .fsn-navgroup-label { display: none; }
  .fsn-bottomnav { -webkit-mask-image: linear-gradient(to right, #000 88%, transparent); mask-image: linear-gradient(to right, #000 88%, transparent); }
}
@media (max-width: 360px) {
  .fsn-topbar { gap: 6px; padding: 0 8px; }
  .c-theme { padding: 0 8px; }
  .fsn-topbar .fsn-brand-lockup { height: 38px; }
}

/* Bingo: the status sheet's table as the sheet draws it. Each fill is the sheet's own colour;
   in dark mode it is mixed into the card, so the colours keep their meaning and the text stays
   readable. The table scrolls sideways on a narrow screen and never vertically. */
.c-bingo-card { display: grid; gap: 10px; }
.c-bingo-top { display: flex; align-items: baseline; justify-content: space-between; gap: 4px 16px; flex-wrap: wrap; }
.c-bingo-top .fsn-h2 { margin: 0; }
.c-bingo-small { margin: 0; font-size: 11px; color: var(--ink-3); }
.c-bingo-scroll { overflow-x: auto; }
.c-bingo { --mix: 100%; width: 100%; min-width: 900px; table-layout: fixed; border-collapse: collapse; font-size: 12px; line-height: 1.35; color: var(--ink); }
.c-bingo th, .c-bingo td { border: 1px solid var(--ink-3); padding: 6px 4px; text-align: center; vertical-align: middle; white-space: pre-line; overflow-wrap: break-word; font-weight: 400; }
.c-bingo thead th { font-weight: 700; }
.c-bingo tr > :first-child { padding-left: 2px; padding-right: 2px; }
.c-bingo thead tr:first-child th { font-size: 15px; padding: 9px 6px; }
.c-bingo .c-split { border-left: 3px solid var(--ink-2); }
.c-bingo .c-fill { background: color-mix(in srgb, var(--f) var(--mix), var(--card)); }
.c-bingo .c-grad { background: linear-gradient(var(--a), color-mix(in srgb, var(--f) var(--mix), var(--card)), color-mix(in srgb, var(--f2) var(--mix), var(--card))); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .c-bingo { --mix: 30%; } }
:root[data-theme="dark"] .c-bingo { --mix: 30%; }
