:root {
  --ff-header-bg: #0b1530;
  --ff-header-line: #1f2c4d;
  --ff-header-accent: #8fb1ff;
  --ff-page-bg: #eef2f7;
  --ff-surface: #ffffff;
  --ff-fg: #1d2b44;
  --ff-muted: #73839f;
  --ff-border: #d6deeb;
  --ff-accent: #2f69f8;
  --ff-accent-soft: #eaf0ff;
  --ff-danger: #df3f3f;
  --ff-success: #168255;
  --ff-radius: 3px;
  --ff-code-bg: #f4f7fd;
  --ff-code-font: ui-monospace, "Cascadia Code", "Source Code Pro", Consolas, monospace;
}

body.theme-public {
  --ff-shell-width: min(1320px, calc(100% - 40px));
  background: var(--ff-page-bg);
  color: var(--ff-fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.theme-public .site-shell-header {
  background: var(--ff-header-bg);
  border-bottom: 1px solid var(--ff-header-line);
  box-shadow: none;
  transition: transform 220ms ease;
  will-change: transform;
}

body.theme-public .site-shell-header.site-shell-header--sticky {
  position: sticky;
  top: 0;
  z-index: 90;
}

body.theme-public .site-shell-header.site-shell-header--sticky.is-mobile {
  position: fixed;
}

body.theme-public .site-shell-header.ff-header-hidden,
body.theme-public .site-shell-header.is-hidden-on-scroll {
  transform: translate3d(0, calc(-100% - 2px), 0);
}

body.theme-public .site-shell-header .shell--wide,
body.theme-public .page-stack {
  width: var(--ff-shell-width);
}

body.theme-public .site-shell-header .site-shell-brand,
body.theme-public .site-shell-header .site-mark__label,
body.theme-public .site-shell-nav-link {
  color: #f3f7ff;
}

body.theme-public .site-shell-header .site-mark__icon {
  border: 0;
  background: transparent;
  padding: 0;
}

body.theme-public .site-shell-header .site-mark__icon img {
  filter: brightness(0) invert(1);
}

body.theme-public .site-mark__label {
  font-weight: 800;
  letter-spacing: 0;
}

body.theme-public .site-shell-footer .site-shell-brand,
body.theme-public .site-shell-footer .site-mark__label {
  color: #17243a;
}

body.theme-public .site-shell-drawer .site-shell-brand,
body.theme-public .site-shell-drawer .site-mark__label {
  color: var(--ff-fg);
}

body.theme-public .site-shell-header .site-shell-nav-link {
  color: #f7faff;
}

body.theme-public .site-shell-header .site-shell-nav-link::after {
  background: var(--ff-header-accent);
}

body.theme-public .site-shell-header .site-shell-nav-link:hover,
body.theme-public .site-shell-header .site-shell-nav-link:focus-visible,
body.theme-public .site-shell-header .site-shell-nav-item.is-active > .site-shell-nav-link {
  color: var(--ff-header-accent);
}

body.theme-public .site-shell-header .site-shell-nav-link:focus-visible,
body.theme-public .site-shell-header .site-shell-toggle:focus-visible,
body.theme-public .site-shell-header .site-shell-search-trigger:focus-visible {
  outline: 2px solid var(--ff-header-accent);
  outline-offset: 2px;
}

body.theme-public .site-shell-header .site-shell-toggle {
  color: #f7faff;
}

body.theme-public .site-shell-header .site-shell-toggle:hover,
body.theme-public .site-shell-header .site-shell-toggle:focus-visible {
  color: var(--ff-header-accent);
}

body.theme-public .site-shell-header .site-shell-search-trigger {
  border-color: #435476;
  background: #17233e;
  box-shadow: none;
  color: #f7faff;
  border-radius: var(--ff-radius);
}

body.theme-public .site-shell-header .site-shell-search-trigger:hover,
body.theme-public .site-shell-header .site-shell-search-trigger:focus-visible {
  border-color: var(--ff-header-accent);
  background: #17233e;
  box-shadow: none;
  color: #ffffff;
  text-decoration: none;
}

body.theme-public .site-shell-header .site-shell-search-trigger-icon,
body.theme-public .site-shell-header .site-shell-search-trigger-label {
  color: inherit;
}

body.theme-public .site-shell-header .site-shell-search-trigger-shortcut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 22px;
  padding: 0;
  border: 1px solid #7d8da9;
  border-radius: 6px;
  background: #aeb9cc;
  color: #18233b;
  box-shadow: none;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

body.theme-public .page-stack {
  padding-top: 18px;
}

.ff-layout {
  display: grid;
  grid-template-columns: 282px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.ff-layout--article {
  grid-template-columns: 282px minmax(0, 1fr) 250px;
}

.ff-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
}

.ff-card {
  min-width: 0;
  background: var(--ff-surface);
  border: 1px solid var(--ff-border);
  border-radius: var(--ff-radius);
  padding: 16px 18px;
  overflow-wrap: anywhere;
}

.ff-sidebar,
.ff-toc-rail {
  position: sticky;
  top: 92px;
  align-self: start;
}

.ff-sidebar-panel,
.ff-toc-panel {
  max-height: calc(100vh - 110px);
  overflow: auto;
}

.ff-sidebar-title,
.ff-toc-title {
  margin: 0 0 8px;
  color: #22324f;
  font-size: 0.95rem;
}

.ff-sidebar-section + .ff-sidebar-section {
  border-top: 1px solid var(--ff-border);
  margin-top: 12px;
  padding-top: 12px;
}

.ff-sidebar-subtitle {
  margin: 0 0 8px;
  color: var(--ff-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.ff-link-list,
.ff-topic-list,
.ff-chip-list,
.ff-toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ff-link-list {
  display: grid;
  gap: 8px;
}

.ff-link-list a,
.ff-topic-link,
.ff-toc-list a {
  color: #2d3f60;
  text-decoration: none;
}

.ff-link-list a:hover,
.ff-topic-link:hover,
.ff-toc-list a:hover {
  color: var(--ff-accent);
}

.ff-topic-link,
.ff-toc-list a {
  display: block;
  border-left: 3px solid transparent;
  border-radius: var(--ff-radius);
  padding: 6px 10px;
  line-height: 1.35;
}

.ff-topic-link.is-active,
.ff-toc-list a.is-active {
  background: var(--ff-accent-soft);
  border-left-color: var(--ff-accent);
  color: var(--ff-accent);
  font-weight: 700;
}

.ff-breadcrumbs {
  color: var(--ff-muted);
  font-size: 0.86rem;
}

.ff-breadcrumbs a {
  color: #4a5d7f;
  text-decoration: none;
}

.ff-breadcrumbs span {
  margin: 0 6px;
}

.ff-hero,
.ff-archive-header,
.ff-article-header {
  display: grid;
  gap: 12px;
}

.ff-hero h1,
.ff-archive-header h1,
.ff-article-header h1 {
  margin: 0;
  color: #17243a;
  line-height: 1.08;
  letter-spacing: 0;
}

.ff-hero h1 {
  font-size: clamp(2rem, 4vw, 4.2rem);
}

.ff-article-header h1 {
  font-size: clamp(2rem, 3vw, 3.2rem);
}

.ff-summary,
.ff-entry-summary,
.ff-hero-copy {
  max-width: 78ch;
  margin: 0;
  color: #50627f;
  font-size: 1.05rem;
}

.ff-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ff-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ff-accent);
  border-radius: var(--ff-radius);
  background: var(--ff-accent);
  color: #fff;
  padding: 0 14px;
  text-decoration: none;
  font-weight: 700;
}

.ff-button--secondary {
  background: #fff;
  color: var(--ff-accent);
}

.ff-home-grid,
.ff-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.ff-home-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ff-home-grid--taxonomy {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ff-home-grid--tasks {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ff-list-card,
.ff-home-tile {
  display: grid;
  gap: 8px;
}

.ff-home-tasks,
.ff-task-tile {
  min-width: 0;
}

.ff-list-card h2,
.ff-list-card h3,
.ff-home-tile h3,
.ff-section-title {
  margin: 0;
  line-height: 1.25;
}

.ff-section-title + .ff-home-grid,
.ff-section-title + .ff-list,
.ff-section-title + .ff-prose,
.ff-section-title + .ff-fix-list,
.ff-section-title + .ff-related-list,
.ff-section-title + .public-search-page-results,
.ff-section-title + [data-public-search-page-results] {
  margin-top: 12px;
}

.ff-list-card a,
.ff-list-card h3 a,
.ff-home-tile a {
  color: #22344f;
  text-decoration: none;
}

.ff-list-card p,
.ff-home-tile p {
  margin: 0;
  color: #556684;
}

.ff-list-card h2,
.ff-list-card h3,
.ff-home-tile h3,
.ff-article-header h1,
.ff-summary,
.ff-entry-summary,
.ff-prose {
  overflow-wrap: anywhere;
}

.ff-tile-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.ff-tax-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--ff-accent-soft);
  color: var(--ff-accent);
  flex: 0 0 auto;
}

.ff-tax-icon svg,
.ff-tax-icon img {
  width: 22px;
  height: 22px;
  display: block;
}

.ff-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ff-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--ff-border);
  border-radius: 999px;
  color: #405372;
  font-size: 0.82rem;
  padding: 4px 10px;
  text-decoration: none;
}

.ff-chip--risk-low {
  border-color: #bce6d4;
  color: var(--ff-success);
}

.ff-chip--risk-medium {
  border-color: #f4d092;
  color: #8a5b00;
}

.ff-chip--risk-high {
  border-color: #f3b3b3;
  color: var(--ff-danger);
}

.ff-entry {
  display: grid;
  gap: 18px;
}

.ff-meta-groups,
.ff-section-heading {
  display: grid;
  gap: 10px;
}

.ff-start-here,
.ff-trust {
  display: grid;
  gap: 12px;
}

.ff-role-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ff-role-path {
  display: grid;
  gap: 6px;
  min-height: 128px;
  border: 1px solid var(--ff-border);
  border-radius: var(--ff-radius);
  background: #f8fbff;
  color: #243753;
  padding: 12px;
  text-decoration: none;
}

.ff-role-path:hover,
.ff-role-path:focus-visible {
  border-color: var(--ff-accent);
  color: #142949;
}

.ff-role-path span {
  color: var(--ff-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.ff-role-path strong {
  line-height: 1.25;
}

.ff-role-path em {
  color: #556684;
  font-style: normal;
}

.ff-trust-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.ff-trust-grid div {
  border: 1px solid var(--ff-border);
  border-radius: var(--ff-radius);
  padding: 10px 12px;
}

.ff-trust-grid dt {
  color: var(--ff-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.ff-trust-grid dd {
  margin: 4px 0 0;
  color: #263954;
}

.ff-hub-title {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.ff-prose {
  color: #263954;
}

.ff-prose > :first-child {
  margin-top: 0;
}

.ff-prose > :last-child {
  margin-bottom: 0;
}

.ff-prose h2 {
  margin-top: 1.6rem;
  color: #17243a;
}

.ff-prose h3 {
  margin-top: 1.2rem;
  color: #1f314f;
}

.ff-prose code {
  background: var(--ff-code-bg);
  border: 1px solid var(--ff-border);
  border-radius: var(--ff-radius);
  padding: 0.12em 0.35em;
  font-family: var(--ff-code-font);
  font-size: 0.9em;
}

.ff-prose pre {
  position: relative;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--ff-border);
  border-radius: var(--ff-radius);
  background: var(--ff-code-bg);
  padding: 1rem 1.25rem;
}

.ff-prose pre code {
  border: 0;
  padding: 0;
  background: transparent;
}

.ff-code-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 1px solid var(--ff-border);
  border-radius: var(--ff-radius);
  background: #fff;
  color: var(--ff-muted);
  cursor: pointer;
  padding: 6px 9px;
  font-size: 0.78rem;
}

.ff-fix-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ff-filter-button {
  border: 1px solid var(--ff-border);
  border-radius: var(--ff-radius);
  background: #fff;
  color: #405372;
  cursor: pointer;
  padding: 7px 10px;
  font: inherit;
}

.ff-filter-button[aria-pressed="true"] {
  border-color: var(--ff-accent);
  background: var(--ff-accent);
  color: #fff;
}

.ff-fix {
  padding: 0;
  overflow: hidden;
}

.ff-fix-header {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid var(--ff-border);
  padding: 16px 18px;
}

.ff-fix-header h3 {
  margin: 0;
  color: #1c2c46;
  font-size: 1.08rem;
}

.ff-fix-body,
.ff-fix-panels,
.ff-fix-feedback {
  padding: 16px 18px;
}

.ff-fix-panels {
  display: grid;
  gap: 10px;
  padding-top: 0;
}

.ff-fix-panel {
  border-left: 3px solid var(--ff-muted);
  padding-left: 12px;
  color: #536681;
}

.ff-fix-panel strong {
  display: block;
  color: #243753;
}

.ff-fix-feedback {
  border-top: 1px solid var(--ff-border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.ff-feedback-button {
  border: 1px solid var(--ff-border);
  border-radius: var(--ff-radius);
  background: #fff;
  color: #405372;
  cursor: pointer;
  padding: 7px 10px;
}

.ff-feedback-button[data-vote="helpful"] {
  border-color: var(--ff-accent);
  background: var(--ff-accent);
  color: #fff;
}

.ff-feedback-status {
  color: var(--ff-muted);
  min-height: 1.2em;
  font-size: 0.86rem;
}

.ff-faq-list {
  display: grid;
  gap: 10px;
}

.ff-faq-item {
  border: 1px solid var(--ff-border);
  border-radius: var(--ff-radius);
  padding: 12px;
}

.ff-faq-item summary {
  color: #1f314f;
  cursor: pointer;
  font-weight: 700;
}

.ff-faq-item div {
  margin-top: 8px;
}

.ff-faq-item h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.ff-empty {
  color: var(--ff-muted);
}

.ff-search-page {
  max-width: 860px;
  margin: 0 auto;
}

.ff-search-form {
  display: flex;
  align-items: end;
  gap: 10px;
}

.ff-search-field {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 6px;
}

.ff-search-field label {
  color: #273955;
  font-weight: 700;
}

.ff-search-form input {
  border: 1px solid var(--ff-border);
  border-radius: var(--ff-radius);
  padding: 11px 12px;
  font: inherit;
}

.ff-search-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 14px;
}

.ff-search-empty {
  display: grid;
  gap: 8px;
}

.ff-search-empty p,
.ff-search-empty ul {
  margin: 0;
}

.ff-search-result {
  border-bottom: 1px solid var(--ff-border);
  padding-bottom: 12px;
}

.ff-search-result:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.ff-result-meta {
  color: var(--ff-muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  font-weight: 700;
}

.ff-drawer-sidebar {
  display: none;
}

@media (max-width: 1100px) {
  body.theme-public {
    --ff-shell-width: min(100% - 28px, 960px);
  }

  body.theme-public .site-shell-header .site-shell-bar--mobile .site-shell-search-trigger {
    width: var(--site-shell-control-size);
    min-width: var(--site-shell-control-size);
    padding: 0;
    border-color: transparent;
    background: transparent;
    gap: 0;
    justify-content: center;
  }

  body.theme-public .site-shell-header .site-shell-bar--mobile .site-shell-search-trigger:hover,
  body.theme-public .site-shell-header .site-shell-bar--mobile .site-shell-search-trigger:focus-visible {
    border-color: transparent;
    background: transparent;
  }

  body.theme-public .site-shell-header .site-shell-bar--mobile .site-shell-search-trigger-label,
  body.theme-public .site-shell-header .site-shell-bar--mobile .site-shell-search-trigger-shortcut {
    display: none;
  }

  .ff-layout,
  .ff-layout--article {
    grid-template-columns: 1fr;
  }

  .ff-sidebar,
  .ff-toc-rail {
    position: static;
  }

  .ff-sidebar-panel,
  .ff-toc-panel {
    max-height: none;
  }

  body.ff-drawer-sidebar-ready .ff-layout > .ff-sidebar {
    display: none;
  }

  .ff-drawer-sidebar {
    display: grid;
    gap: 12px;
    border-top: 1px solid var(--ff-border);
    padding-top: 18px;
  }

  .ff-drawer-sidebar .ff-drawer-sidebar-panel {
    max-height: none;
    overflow: visible;
    border: 0;
    background: transparent;
    padding: 0;
  }

  .ff-drawer-sidebar .ff-sidebar-title {
    margin-bottom: 10px;
  }

  .ff-drawer-sidebar .ff-topic-link,
  .ff-drawer-sidebar .ff-toc-list a {
    padding: 8px 10px;
  }

  .ff-home-grid,
  .ff-home-grid--taxonomy,
  .ff-home-grid--tasks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ff-role-grid,
  .ff-trust-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body.theme-public {
    --ff-shell-width: min(100% - 20px, 560px);
  }

  .ff-home-grid,
  .ff-home-grid--taxonomy,
  .ff-home-grid--tasks {
    grid-template-columns: 1fr;
  }

  .ff-card {
    padding: 14px;
  }

  .ff-search-form {
    flex-direction: column;
    align-items: stretch;
  }

  .ff-search-form .ff-button {
    width: 100%;
  }
}
