.case-figure {
  margin: 28px 0 42px;
}

.case-shot {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(17, 38, 61, .1);
}

.case-shot img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform .25s ease, filter .25s ease;
}

.case-shot:hover img {
  transform: scale(1.012);
  filter: brightness(.96);
}

.case-shot:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

.case-shot-zoom {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 999px;
  background: rgba(14, 29, 49, .82);
  color: #fff;
  font: 700 11px/1 "JetBrains Mono", Consolas, monospace;
  letter-spacing: .04em;
  backdrop-filter: blur(8px);
}

.case-figure figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.process-flow {
  counter-reset: case-flow-step;
  display: grid;
  margin: 26px 0 38px;
  padding: 10px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(55, 108, 255, .07), transparent 48%),
    var(--surface-soft);
}

.case-flow-step {
  counter-increment: case-flow-step;
  position: relative;
  display: grid;
  min-height: 68px;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  padding: 12px 8px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 680;
  line-height: 1.4;
}

.case-flow-step::before {
  content: counter(case-flow-step, decimal-leading-zero);
  position: relative;
  z-index: 1;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--blue-dark);
  font: 750 11px/1 "JetBrains Mono", Consolas, monospace;
}

.case-flow-step:not(:last-child) {
  border-bottom: 1px solid var(--line);
}

.case-flow-step:not(:last-child)::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: 25px;
  top: 48px;
  bottom: -20px;
  width: 1px;
  background: var(--line);
}

.comparison-table-wrap {
  max-width: 100%;
  margin: 28px 0 40px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 14px 40px rgba(17, 38, 61, .07);
  scrollbar-width: thin;
}

.comparison-table-wrap:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.comparison-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  text-align: left;
  font-size: 15px;
  line-height: 1.5;
}

.comparison-table th,
.comparison-table td {
  width: 50%;
  padding: 16px 18px;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.comparison-table th {
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 750;
}

.comparison-table td:first-child {
  color: var(--muted);
}

.comparison-table tbody tr:nth-child(even) {
  background: var(--surface-soft);
}

.comparison-table tbody tr:last-child td {
  border-bottom: 0;
}
.article-action {
  margin: 30px 0 40px;
}

.telegram-cta-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 24px;
  margin-top: 26px;
}

.telegram-personal-link {
  color: inherit;
  font-weight: 750;
  text-underline-offset: 5px;
}

.case-lightbox {
  width: min(96vw, 1500px);
  max-width: none;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 18px;
  overflow: visible;
  background: transparent;
}

.case-lightbox::backdrop {
  background: rgba(5, 12, 22, .88);
  backdrop-filter: blur(7px);
}

.case-lightbox-frame {
  position: relative;
  margin: 0;
}

.case-lightbox img {
  display: block;
  width: auto;
  max-width: 96vw;
  max-height: 90vh;
  margin: auto;
  border-radius: 14px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, .45);
}

.case-lightbox-close {
  position: absolute;
  top: -18px;
  right: -2px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .3);
}

body.lightbox-open {
  overflow: hidden;
}

@media (max-width: 760px) {
  .case-figure {
    margin: 22px -12px 34px;
  }

  .case-shot {
    border-radius: 14px;
  }

  .case-shot-zoom {
    right: 9px;
    bottom: 9px;
  }

  .process-flow {
    padding: 8px 14px;
  }

  .case-flow-step {
    grid-template-columns: 44px minmax(0, 1fr);
    font-size: 15px;
  }

  .comparison-table-wrap {
    margin-right: -12px;
    margin-left: -12px;
    border-radius: 12px;
  }
  .case-lightbox-close {
    top: -48px;
    right: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .case-shot img {
    transition: none;
  }
}

/* Directional process and messenger conversation */
.process-flow {
  justify-items: stretch;
  margin: 30px 0 42px;
  padding: 24px;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(55, 108, 255, .1), transparent 44%), var(--surface-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}

.case-flow-step {
  min-height: 70px;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 12px 16px 12px 12px;
  border: 1px solid rgba(17, 38, 61, .1);
  border-radius: 16px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 8px 24px rgba(17, 38, 61, .06);
}

.case-flow-step::before {
  border-color: rgba(55, 108, 255, .22);
  border-radius: 12px;
  background: rgba(55, 108, 255, .09);
  color: var(--blue);
}

.case-flow-step:not(:last-child) {
  border-bottom: 1px solid rgba(17, 38, 61, .1);
}

.case-flow-step:not(:last-child)::after {
  display: none;
}

.case-flow-step:first-child,
.case-flow-step:last-child {
  border-color: rgba(55, 108, 255, .3);
}

.case-flow-step:first-child::after,
.case-flow-step:last-child::after {
  position: static;
  display: inline-block;
  width: auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(55, 108, 255, .09);
  color: var(--blue-dark);
  font: 750 9px/1 "JetBrains Mono", Consolas, monospace;
  letter-spacing: .08em;
}

.case-flow-step:first-child::after {
  content: "СТАРТ";
}

.case-flow-step:last-child::after {
  content: "ФИНИШ";
}

.case-flow-arrow {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  justify-self: start;
  margin: 2px 0 2px 15px;
  border: 1px solid rgba(55, 108, 255, .2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--blue);
  font: 800 17px/1 Arial, sans-serif;
  box-shadow: 0 5px 14px rgba(55, 108, 255, .12);
}

.case-chat-message {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  width: min(88%, 680px);
  margin: 16px 0;
}

.case-chat-message--client {
  justify-content: flex-end;
  margin-left: auto;
}

.case-chat-message--manager {
  margin-right: auto;
}

.case-chat-avatar {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font: 750 13px/1 "JetBrains Mono", Consolas, monospace;
  box-shadow: 0 6px 18px rgba(17, 38, 61, .16);
}

.case-chat-bubble {
  padding: 14px 17px 15px;
  border: 1px solid var(--line);
  border-radius: 18px 18px 18px 5px;
  background: var(--surface);
  box-shadow: 0 9px 26px rgba(17, 38, 61, .07);
}

.case-chat-message--client .case-chat-bubble {
  border-color: rgba(55, 108, 255, .24);
  border-radius: 18px 18px 5px 18px;
  background: rgba(55, 108, 255, .1);
}

.case-chat-author {
  display: block;
  margin-bottom: 5px;
  color: var(--blue-dark);
  font: 750 11px/1.2 "JetBrains Mono", Consolas, monospace;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.case-chat-bubble p {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
}

@media (max-width: 760px) {
  .process-flow {
    padding: 16px 12px;
  }

  .case-flow-step {
    min-height: 64px;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    padding: 11px 12px 11px 10px;
    font-size: 15px;
  }

  .case-flow-step:first-child::after,
  .case-flow-step:last-child::after {
    display: none;
  }

  .case-flow-arrow {
    margin-left: 13px;
  }

  .case-chat-message {
    width: 94%;
  }

  .case-chat-avatar {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
  }

  .case-chat-bubble {
    padding: 12px 14px 13px;
  }

  .case-chat-bubble p {
    font-size: 15px;
  }
}