.portfolio-project__content .flexible-builder-case h2 { font-size: var(--font-size-title); }
.portfolio-project__content .flexible-builder-case h3 { font-size: var(--font-size-subheading); }
.portfolio-project-page--flexible .portfolio-project__facts,
.portfolio-project-page--flexible .portfolio-project__facts > div { align-content: start; }
.flexible-builder-case { --fc-case-nav-height: 68px; }
.flexible-builder-case .portfolio-article-lead { max-width: 1120px; }
.flexible-builder-case :is(p, li) { overflow-wrap: anywhere; }
.fc-case-nav {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 12;
  gap: 24px;
  margin: 40px 0 44px;
  padding: 12px 0;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
  background: #000;
  border-block: 1px solid rgba(255,255,255,.2);
}
.fc-case-nav.is-stuck { box-shadow: 0 12px 24px rgba(0,0,0,.65); }
.fc-case-nav a { flex: 0 0 auto; padding-block: 8px; border-bottom: 2px solid transparent; color: #9b9b98; font-size: 16px; line-height: 1.5; white-space: nowrap; text-decoration: none; transition: color .15s, border-color .15s; }
.fc-case-nav a:is(:hover, :focus-visible, .is-active) { color: #fff; }
.fc-case-nav a.is-active { border-bottom-color: #fff; }
.flexible-builder-case [id] { scroll-margin-top: calc(var(--fc-case-nav-height) + 24px); }
.fc-case-benefits {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 30px;
  margin: 36px 0;
}
.fc-case-benefits > div { padding-top: 24px; border-top: 1px solid rgba(255,255,255,.28); }
.portfolio-project__content .fc-case-benefits h3 { margin: 0 0 16px; }
.portfolio-project__content .fc-case-benefits p { margin: 0; }
.portfolio-project__content .fc-case-note {
  max-width: 1080px;
  padding-left: 22px;
  border-left: 2px solid #a0ad91;
  font-size: 17px;
  line-height: 1.65;
  color: #bdbfb8;
}
.fc-case-process-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: clamp(32px,4vw,64px);
  align-items: start;
  margin-top: 36px;
}
.fc-case-process-row + .fc-case-process-row { margin-top: 48px; }
.fc-case-process-shots { display: grid; gap: 20px; min-width: 0; }
.fc-case-shot figcaption { min-height: 50px; align-items: center; }
.fc-case-shot .portfolio-site-shot__viewport { height: auto; max-height: 540px; background: #ece9e4; }
.fc-case-shot .portfolio-site-shot__viewport img { width: 100%; height: auto; }
.fc-case-shot .portfolio-site-shot__open { top: 12px; }
.portfolio-project__content .fc-case-shot-note { margin: 0; font-size: 16px; line-height: 1.5; color: #a5a79f; }
.fc-case-block-gallery { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 40px 28px; margin: 36px 0; }
.fc-case-editor-example { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 28px; margin: 30px 0 36px; align-items: start; }
.fc-case-editor-example > * { min-width: 0; }
.fc-case-block-gallery > div { min-width: 0; }
.fc-case-block-gallery .portfolio-site-shot__viewport { height: 340px; }
.portfolio-project__content .fc-case-block-gallery p { margin: 18px 0 0; font-size: 18px; line-height: 1.6; }
.fc-case-comparison { margin: 30px 0; }
.fc-case-comparison__head, .fc-case-comparison__row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.fc-case-comparison [role="columnheader"] { padding: 0 0 16px; font-size: 14px; line-height: 1.5; font-family: var(--font-matter); font-weight: 500; color: #aaa; }
.fc-case-comparison [role="cell"] { padding: 20px 0; min-width: 0; }
.fc-case-comparison__row { border-top: 1px solid rgba(255,255,255,.16); }
.fc-case-comparison [role="row"] { column-gap: 48px; }
.portfolio-project__content .flexible-builder-case .fc-case-comparison h3 { margin: 0 0 6px;
  font-family: var(--font-heading);
  font-size: var(--font-size-body);
  font-weight: 700;
  line-height: var(--line-height-body);
  letter-spacing: 0;
  text-transform: none;
}
.portfolio-project__content .fc-case-comparison p { margin: 0; font-size: 16px; line-height: 1.6; }
.fc-case-comparison [role="cell"]:last-child { color: #a8a8a4; }
.portfolio-project__content .fc-case-scenario { max-width: 960px; padding-left: 26px; margin: 24px 0 32px; }
.fc-case-scenario li { padding-left: 8px; line-height: 1.65; }
.fc-case-flow { margin: 36px 0; padding: 28px; border: 1px solid rgba(255,255,255,.22); border-radius: 12px; }
.fc-case-flow__lane + .fc-case-flow__lane { margin-top: 32px; padding-top: 28px; border-top: 1px solid rgba(255,255,255,.16); }
.portfolio-project__content .flexible-builder-case .fc-case-flow h3 { margin: 0 0 20px;
  font-family: var(--font-heading);
  font-size: var(--font-size-body);
  font-weight: 700;
  line-height: var(--line-height-body);
  letter-spacing: 0;
  text-transform: none;
}
.portfolio-project__content .fc-case-flow__steps { display: grid; gap: 32px; width: 100%; max-width: none; margin: 0; padding: 0; list-style: none; align-items: stretch; }
.portfolio-project__content .fc-case-flow__steps li { margin: 0; }
.fc-case-flow__steps--save { grid-template-columns: repeat(3,minmax(0,1fr)); }
.fc-case-flow__steps--render { grid-template-columns: repeat(4,minmax(0,1fr)); }
.fc-case-flow__steps li { position: relative; min-width: 0; padding: 20px; border: 1px solid rgba(255,255,255,.18); background: #1b1c19; border-radius: 8px; }
.fc-case-flow__steps li:not(:last-child)::after { content: '→'; position: absolute; right: -26px; top: 22px; color: #a9afa1; font-size: 22px; line-height: 1; }
.fc-case-flow__steps strong { display: block; margin-bottom: 12px; font-size: 18px; line-height: 1.45; font-weight: 600; }
.fc-case-flow__steps span { display: block; color: #c2c4bd; font-size: 16px; line-height: 1.6; }
.flexible-builder-case code { font-size: .88em; overflow-wrap: anywhere; }
.fc-case-flow figcaption { margin-top: 24px; color: #a9ada3; font-size: 15px; line-height: 1.6; }
.fc-case-technical-details { margin-bottom: 30px; }
.fc-case-tabs { margin: 30px 0; min-width: 0; }
.fc-case-tabs__list { display: flex; gap: 24px; overflow-x: auto; margin-bottom: 32px; border-bottom: 1px solid rgba(255,255,255,.2); scrollbar-width: thin; }
.fc-case-tabs__list[hidden], .fc-case-tabs__panel[hidden], .fc-case-tabs.is-enhanced .fc-case-tabs__fallback-title { display: none; }
.fc-case-tabs__list button { flex: 0 0 auto; margin: 0; padding: 12px 0 16px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #9b9b98; font: inherit; font-size: 16px; line-height: 1.5; white-space: nowrap; cursor: pointer; }
.fc-case-tabs__list button:is(:hover, :focus-visible, [aria-selected="true"]) { color: #fff; }
.fc-case-tabs__list button[aria-selected="true"] { border-bottom-color: #fff; }
.fc-case-tabs__list button:focus-visible { outline: 1px solid #aaa; outline-offset: -4px; }
.fc-case-tabs__panel + .fc-case-tabs__panel { margin-top: 40px; }
.fc-case-tabs.is-enhanced .fc-case-tabs__panel { margin-top: 0; }
.fc-case-tabs__layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.1fr); gap: 48px; align-items: start; }
.portfolio-project__content .fc-case-catalog { margin: 0; min-width: 0; }
.fc-case-catalog > div { padding: 18px 0; border-bottom: 1px solid rgba(255,255,255,.16); }
.fc-case-catalog > div:first-child { padding-top: 0; }
.fc-case-catalog dt { margin-bottom: 6px; color: #f5f5f3; font-size: 16px; font-weight: 600; line-height: 1.5; }
.fc-case-catalog dd { margin: 0; color: #b5b5b1; font-size: 16px; line-height: 1.6; }
.fc-case-tabs__images { display: grid; gap: 24px; min-width: 0; }
.fc-case-tabs__images .portfolio-site-shot__viewport { max-height: 360px; }
@media (max-width: 1000px) {
  .fc-case-benefits { grid-template-columns: minmax(0,1fr); gap: 24px; }
  .fc-case-process-row { grid-template-columns: minmax(0,1fr); gap: 24px; }
  .fc-case-process-shots { grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; }
  .fc-case-process-shots > :only-child { grid-column: 1/-1; }
  .fc-case-process-shots .fc-case-shot-note { grid-column: 1/-1; }
  .fc-case-tabs__layout { gap: 28px; }
  .fc-case-flow__steps--save, .fc-case-flow__steps--render { grid-template-columns: minmax(0,1fr); }
  .fc-case-flow__steps li:not(:last-child)::after { content: '↓'; top: auto; bottom: -27px; right: auto; left: calc(50% - 7px); }
}
@media (max-width: 580px) {
  .portfolio-project__content .flexible-builder-case h2 { font-size: var(--font-size-title); }
  .portfolio-project__content .flexible-builder-case h3 { font-size: var(--font-size-subheading); }
  .fc-case-nav { gap: 20px; margin-block: 28px 36px; padding-right: 72px; }
  .fc-case-tabs__layout { grid-template-columns: minmax(0,1fr); }
  .fc-case-tabs__list { gap: 20px; margin-bottom: 24px; }
  .fc-case-process-shots, .fc-case-block-gallery, .fc-case-editor-example { grid-template-columns: minmax(0,1fr); }
  .fc-case-shot .portfolio-site-shot__viewport { max-height: 440px; }
  .fc-case-block-gallery .portfolio-site-shot__viewport { height: auto; max-height: 340px; }
  .fc-case-comparison__head { display: none; }
  .fc-case-comparison__row { grid-template-columns: minmax(0,1fr); }
  .fc-case-comparison [role="cell"] { padding: 18px 0 0; }
  .fc-case-comparison [role="cell"]:last-child { padding: 10px 0 18px; }
  .fc-case-comparison [role="cell"]:last-child::before { content: 'В Битриксе: '; font-size: 14px; color: #888; }
  .flexible-builder-case:lang(en) .fc-case-comparison [role="cell"]:last-child::before { content: 'In Bitrix: '; }
  .fc-case-comparison [role="cell"]:last-child p { display: inline; }
  .portfolio-project__content .fc-case-comparison p { font-size: 16px; }
  .fc-case-flow { padding: 20px; }
  .fc-case-flow__steps li { padding: 18px; }
}
