:root {
  --sf-ink: #18232b;
  --sf-muted: #53616b;
  --sf-line: #d4dde1;
  --sf-paper: #ffffff;
  --sf-ground: #f2f5f4;
  --sf-red: #a32d2b;
  --sf-green: #176b55;
  --sf-blue: #2b5896;
  --sf-gold: #8a6300;
  --sf-violet: #69488a;
  --sf-cyan: #14717a;
}

.sf-body {
  color: var(--sf-ink);
  background: var(--sf-ground);
}

.sf-page {
  --bg-red: var(--sf-red);
  --bg-green: var(--sf-green);
  --bg-blue: var(--sf-blue);
  --bg-gold: var(--sf-gold);
  --bg-violet: var(--sf-violet);
  --bg-ground: var(--sf-ground);
  --bg-line: var(--sf-line);
}

.sf-hero {
  border-top-color: var(--sf-cyan);
}

.sf-kicker {
  color: var(--sf-cyan);
}

.sf-live {
  border-left-color: var(--sf-red);
}

.sf-live-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sf-live-metrics dd {
  color: var(--sf-red);
  overflow-wrap: anywhere;
}

.sf-tabs button[aria-selected="true"] {
  color: #fff;
  background: var(--sf-cyan);
  border-color: var(--sf-cyan);
}

.sf-analysis-path {
  border-top: 3px solid var(--sf-cyan);
}

.sf-principle-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 34px;
  border: 1px solid var(--sf-line);
  background: var(--sf-paper);
}

.sf-principle-band > div {
  min-width: 0;
  min-height: 134px;
  padding: 20px;
  border-right: 1px solid var(--sf-line);
}

.sf-principle-band > div:last-child {
  border-right: 0;
}

.sf-principle-band strong,
.sf-principle-band span {
  display: block;
}

.sf-principle-band strong {
  margin-bottom: 8px;
  color: var(--sf-red);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
}

.sf-principle-band span {
  color: var(--sf-muted);
  font-size: 1rem;
  line-height: 1.55;
}

.sf-index-overview {
  display: grid;
  grid-template-columns: minmax(300px, 0.75fr) minmax(0, 1.4fr);
  gap: 24px;
  align-items: stretch;
  margin: 0 0 26px;
}

.sf-gauge,
.sf-formula {
  min-width: 0;
  border: 1px solid var(--sf-line);
  background: var(--sf-paper);
}

.sf-gauge {
  position: relative;
  display: flex;
  min-height: 330px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.sf-gauge svg {
  display: block;
  width: min(320px, 100%);
  height: 190px;
  overflow: visible;
}

.sf-gauge path {
  fill: none;
  stroke-linecap: round;
  stroke-width: 22;
}

.sf-gauge-track {
  stroke: #e3e8ea;
}

.sf-gauge-value {
  stroke: var(--sf-cyan);
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  transition: stroke-dashoffset 700ms ease, stroke 250ms ease;
}

.sf-gauge > strong {
  position: absolute;
  top: 128px;
  color: var(--sf-red);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3.3rem;
  line-height: 1;
}

.sf-gauge > span {
  max-width: 310px;
  margin-top: -20px;
  color: var(--sf-muted);
  font-size: 1.08rem;
  font-weight: 760;
  line-height: 1.45;
  text-align: center;
}

.sf-formula {
  padding: 26px;
  border-top: 4px solid var(--sf-blue);
}

.sf-formula h3 {
  margin: 0 0 13px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
}

.sf-formula > code {
  display: block;
  padding: 17px 18px;
  color: #fff;
  background: #263b48;
  font-size: 1.28rem;
  font-weight: 780;
  line-height: 1.5;
  white-space: normal;
}

.sf-formula dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 0;
}

.sf-formula dl > div {
  min-height: 104px;
  padding: 15px;
  border-left: 4px solid var(--sf-green);
  background: var(--sf-ground);
}

.sf-formula dl > div:nth-child(2) {
  border-left-color: var(--sf-red);
}

.sf-formula dl > div:nth-child(3) {
  border-left-color: var(--sf-gold);
}

.sf-formula dl > div:nth-child(4) {
  border-left-color: var(--sf-violet);
}

.sf-formula dt {
  color: var(--sf-muted);
  font-size: 0.98rem;
  font-weight: 740;
}

.sf-formula dd {
  margin: 7px 0 0;
  color: var(--sf-red);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.75rem;
  font-weight: 700;
}

.sf-score-bands {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0 0 36px;
  border: 1px solid var(--sf-line);
  background: var(--sf-paper);
}

.sf-score-bands > div {
  min-width: 0;
  min-height: 155px;
  padding: 17px;
  border-right: 1px solid var(--sf-line);
  border-top: 5px solid var(--sf-red);
}

.sf-score-bands > div:nth-child(2) {
  border-top-color: var(--sf-gold);
}

.sf-score-bands > div:nth-child(3) {
  border-top-color: var(--sf-blue);
}

.sf-score-bands > div:nth-child(4) {
  border-top-color: var(--sf-green);
}

.sf-score-bands > div:nth-child(5) {
  border-top-color: var(--sf-violet);
  border-right: 0;
}

.sf-score-bands strong,
.sf-score-bands span,
.sf-score-bands small {
  display: block;
}

.sf-score-bands strong {
  color: var(--sf-red);
  font-size: 1.3rem;
}

.sf-score-bands span {
  margin: 5px 0;
  font-weight: 780;
  line-height: 1.4;
}

.sf-score-bands small {
  color: var(--sf-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.sf-role-table-shell {
  width: 100%;
  margin: 0 0 30px;
  border: 1px solid var(--sf-line);
  background: var(--sf-paper);
  overflow-x: auto;
}

.sf-role-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}

.sf-role-table th,
.sf-role-table td {
  padding: 14px 15px;
  border-bottom: 1px solid var(--sf-line);
  text-align: left;
  vertical-align: middle;
}

.sf-role-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  color: #fff;
  background: #263b48;
  font-size: 0.92rem;
  font-weight: 780;
}

.sf-role-table tbody tr:last-child td {
  border-bottom: 0;
}

.sf-role-table tbody tr:hover {
  background: #f7faf9;
}

.sf-role-name {
  max-width: 270px;
}

.sf-role-name strong,
.sf-role-name small {
  display: block;
}

.sf-role-name strong {
  color: var(--sf-ink);
  font-size: 1.05rem;
}

.sf-role-name small {
  margin-top: 4px;
  color: var(--sf-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.sf-role-score strong {
  display: block;
  color: var(--sf-red);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
}

.sf-role-score small {
  color: var(--sf-muted);
  white-space: nowrap;
}

.sf-mini-bins {
  display: grid;
  grid-template-columns: repeat(5, 30px);
  gap: 3px;
  align-items: end;
  height: 48px;
}

.sf-mini-bins i {
  display: block;
  min-height: 3px;
  background: var(--sf-blue);
}

.sf-direction {
  width: 160px;
}

.sf-direction-track {
  display: flex;
  width: 100%;
  height: 12px;
  overflow: hidden;
  background: #e4e9eb;
}

.sf-direction-track i:first-child {
  background: var(--sf-green);
}

.sf-direction-track i:last-child {
  background: var(--sf-gold);
}

.sf-direction small {
  display: block;
  margin-top: 6px;
  color: var(--sf-muted);
  font-size: 0.86rem;
}

.sf-confidence {
  display: inline-flex;
  min-width: 92px;
  justify-content: center;
  padding: 5px 8px;
  color: #175341;
  background: #e7f5f0;
  border: 1px solid #b8ded1;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 760;
}

.sf-word-profiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 0 0 36px;
}

.sf-word-profiles > section {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--sf-line);
  border-top: 4px solid var(--sf-green);
  background: var(--sf-paper);
}

.sf-word-profiles > section:last-child {
  border-top-color: var(--sf-gold);
}

.sf-word-profiles header {
  display: flex;
  gap: 10px;
  align-items: center;
}

.sf-word-profiles header svg {
  width: 26px;
  height: 26px;
  color: var(--sf-red);
}

.sf-word-profiles h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
}

.sf-word-profiles > section > p {
  color: var(--sf-muted);
}

.sf-word-profiles ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 24px;
  margin: 18px 0 0;
  padding-left: 26px;
}

.sf-word-profiles li {
  min-width: 0;
  padding: 5px 0;
  border-bottom: 1px solid #e6ebed;
}

.sf-word-profiles li strong,
.sf-word-profiles li span {
  overflow-wrap: anywhere;
}

.sf-word-profiles li span {
  float: right;
  color: var(--sf-red);
  font-weight: 780;
}

.sf-local-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 0 0 26px;
}

.sf-local-card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--sf-line);
  border-left: 5px solid var(--sf-blue);
  background: var(--sf-paper);
}

.sf-local-card:nth-child(2n) {
  border-left-color: var(--sf-violet);
}

.sf-local-card h3 {
  margin: 0 0 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
}

.sf-local-card > p {
  margin: 0 0 16px;
  color: var(--sf-muted);
}

.sf-local-bars {
  display: grid;
  gap: 10px;
}

.sf-local-bar {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(120px, 1fr) 90px;
  gap: 10px;
  align-items: center;
}

.sf-local-bar > span {
  font-size: 0.94rem;
  font-weight: 730;
}

.sf-local-bar > i {
  display: block;
  height: 12px;
  background: linear-gradient(to right, var(--sf-green) var(--bar), #e3e8ea var(--bar));
}

.sf-local-bar > b {
  color: var(--sf-red);
  font-size: 0.95rem;
  text-align: right;
}

.sf-constraint-note,
.sf-information-flow {
  margin: 0 0 34px;
}

.sf-constraint-note {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 22px 24px;
  border-left: 5px solid var(--sf-gold);
  background: #fff7e3;
}

.sf-constraint-note > svg {
  flex: 0 0 auto;
  width: 29px;
  height: 29px;
  color: var(--sf-gold);
}

.sf-constraint-note h3 {
  margin: 0 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.42rem;
}

.sf-constraint-note p {
  margin: 0;
}

.sf-information-flow {
  display: grid;
  grid-template-columns: repeat(9, auto);
  gap: 10px;
  align-items: center;
  padding: 22px;
  border: 1px solid var(--sf-line);
  background: var(--sf-paper);
  overflow-x: auto;
}

.sf-information-flow article {
  width: 200px;
  min-height: 166px;
  padding: 18px;
  border-top: 4px solid var(--sf-blue);
  background: var(--sf-ground);
}

.sf-information-flow article:nth-of-type(2) {
  border-top-color: var(--sf-green);
}

.sf-information-flow article:nth-of-type(3) {
  border-top-color: var(--sf-red);
}

.sf-information-flow article:nth-of-type(4) {
  border-top-color: var(--sf-gold);
}

.sf-information-flow article:nth-of-type(5) {
  border-top-color: var(--sf-violet);
}

.sf-information-flow article svg {
  width: 29px;
  height: 29px;
  color: var(--sf-red);
}

.sf-information-flow strong,
.sf-information-flow span {
  display: block;
}

.sf-information-flow strong {
  margin: 10px 0 5px;
  font-size: 1.04rem;
}

.sf-information-flow span {
  color: var(--sf-muted);
  font-size: 0.94rem;
  line-height: 1.5;
}

.sf-information-flow > svg {
  width: 22px;
  height: 22px;
  color: var(--sf-muted);
}

.sf-model-card {
  border-top: 4px solid var(--sf-cyan);
}

.sf-chart-grid {
  align-items: stretch;
}

.sf-chart-grid > .bg-chart-block {
  min-width: 0;
}

.sf-chart-stage {
  width: 100%;
  min-width: 0;
  min-height: 370px;
  background: #fafcfb;
  overflow-x: auto;
  overflow-y: hidden;
}

.sf-chart-stage > svg {
  display: block;
  width: 100%;
  min-width: 660px;
  height: 370px;
}

.sf-chart-stage[data-sf-chart="sei-gauge"] > svg,
.sf-chart-stage[data-sf-chart="formula-components"] > svg,
.sf-chart-stage[data-sf-chart="order-space"] > svg {
  min-width: 520px;
}

.sf-chart-stage .sf-axis {
  stroke: #aeb9bf;
  stroke-width: 1;
}

.sf-chart-stage .sf-grid {
  stroke: #e2e8ea;
  stroke-width: 1;
}

.sf-chart-stage text {
  fill: var(--sf-muted);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 13px;
}

.sf-chart-stage .sf-label {
  fill: var(--sf-ink);
  font-size: 14px;
  font-weight: 720;
}

.sf-chart-stage .sf-value {
  fill: var(--sf-red);
  font-size: 14px;
  font-weight: 800;
}

.sf-chart-stage .sf-empty {
  display: flex;
  min-height: 370px;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: var(--sf-muted);
  text-align: center;
}

.sf-witness-status {
  color: var(--sf-cyan) !important;
  font-weight: 760;
}

.sf-loading {
  min-height: 100px;
  margin: 0;
  padding: 30px;
  color: var(--sf-muted);
}

.sf-live-error {
  color: #7d251f !important;
  font-weight: 760;
}

@media (max-width: 1180px) {
  .sf-live-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sf-score-bands {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sf-score-bands > div:nth-child(3) {
    border-right: 0;
  }

  .sf-score-bands > div:nth-child(4),
  .sf-score-bands > div:nth-child(5) {
    border-top: 1px solid var(--sf-line);
  }

  .sf-score-bands > div:nth-child(4) {
    grid-column: 1 / 2;
  }
}

@media (max-width: 900px) {
  .sf-principle-band,
  .sf-formula dl,
  .sf-local-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sf-principle-band > div:nth-child(2) {
    border-right: 0;
  }

  .sf-principle-band > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--sf-line);
  }

  .sf-index-overview,
  .sf-word-profiles {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .sf-page > .bg-breadcrumb {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .sf-page > .bg-breadcrumb > span[aria-hidden="true"] {
    display: none;
  }

  .sf-page > .bg-breadcrumb > span:last-child {
    flex-basis: 100%;
    padding-left: 29px;
  }

  .sf-live-metrics,
  .sf-principle-band,
  .sf-formula dl,
  .sf-score-bands,
  .sf-local-grid {
    grid-template-columns: 1fr;
  }

  .sf-live-metrics div {
    min-height: 82px;
  }

  .sf-principle-band > div,
  .sf-score-bands > div,
  .sf-score-bands > div:nth-child(3),
  .sf-score-bands > div:nth-child(5) {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--sf-line);
  }

  .sf-score-bands > div:nth-child(4) {
    grid-column: auto;
  }

  .sf-index-overview {
    gap: 14px;
  }

  .sf-gauge {
    min-height: 300px;
  }

  .sf-gauge > strong {
    top: 122px;
    font-size: 2.8rem;
  }

  .sf-formula {
    padding: 19px;
  }

  .sf-formula > code {
    font-size: 1.05rem;
  }

  .sf-word-profiles ol {
    grid-template-columns: 1fr;
  }

  .sf-local-card {
    padding: 18px;
  }

  .sf-local-bar {
    grid-template-columns: 1fr 80px;
  }

  .sf-local-bar > i {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .sf-chart-stage {
    min-height: 340px;
  }

  .sf-chart-stage > svg {
    height: 340px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sf-gauge-value {
    transition: none;
  }
}
