/* Разборы кейсов с цифрами из Директа (секция #direct-cases, между кейсами и калькулятором). */
.kdc { padding: clamp(40px, 6vw, 96px) 0; }
.kdc-head { max-width: 760px; margin: 0 0 clamp(20px, 3vw, 32px); }
.kdc-title {
  margin: 0 0 12px;
  font-family: 'Seenonim', sans-serif;
  font-weight: 400;
  font-size: clamp(28px, 3.2vw, 48px);
  line-height: 1.08;
  color: #0c0d0e;
  text-wrap: balance;
}
.kdc-sub { margin: 0; font-size: 16px; line-height: 1.5; color: rgba(12, 13, 14, 0.66); text-wrap: pretty; }

/* Вкладки */
.kdc-tabs { position: relative; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.kdc-tab {
  flex: 1 1 calc(25% - 8px);
  min-width: 180px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  box-sizing: border-box; padding: 13px 18px;
  border: 1px solid rgba(12, 13, 14, 0.1); border-radius: 18px;
  background: #fff; color: #0c0d0e; text-align: left; cursor: pointer;
  font: inherit; transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
@media (hover: hover) and (pointer: fine) {
  .kdc-tab:hover { border-color: rgba(12, 13, 14, 0.45); }
}
.kdc-tab:focus-visible, .kdc-panel:focus-visible, .kdc-shot:focus-visible { outline: 3px solid #0c0d0e; outline-offset: 3px; }
.kdc-tab[aria-selected="true"] { background: #0c0d0e; border-color: #0c0d0e; color: #fff; }
.kdc-tab-name { font-family: 'Seenonim', sans-serif; font-size: 17px; line-height: 1.15; }
.kdc-tab-range { font-size: 13px; line-height: 1.3; color: rgba(12, 13, 14, 0.52); font-variant-numeric: tabular-nums; }
.kdc-tab[aria-selected="true"] .kdc-tab-range { color: rgba(255, 255, 255, 0.62); }

/* Панель */
.kdc-panel {
  box-sizing: border-box; min-width: 0;
  padding: clamp(20px, 3vw, 40px);
  border: 1px solid rgba(12, 13, 14, 0.06); border-radius: 32px;
  background: #fff; box-shadow: 0 1px 2px rgba(12, 13, 14, 0.04), 0 18px 50px rgba(12, 13, 14, 0.07);
}
.kdc-panel[hidden] { display: none; }
.kdc-meta { margin: 0 0 8px; font-size: 14px; line-height: 1.4; color: rgba(12, 13, 14, 0.55); }
.kdc-intro {
  margin: 0; max-width: 780px;
  font-size: clamp(18px, 1.6vw, 22px); line-height: 1.4; color: #0c0d0e; text-wrap: pretty;
}

/* Главные цифры: строкой, без плашек */
.kdc-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 28px; margin: 28px 0 4px; }
.kdc-kpi { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 6px; min-width: 0; padding-top: 14px; border-top: 1px solid rgba(12, 13, 14, 0.12); }
.kdc-kpi dd { margin: 0; font-family: 'Seenonim', sans-serif; font-size: clamp(28px, 2.6vw, 40px); line-height: 1.05; color: #0c0d0e; font-variant-numeric: tabular-nums; }
.kdc-kpi dt { margin: 0; font-size: 14px; line-height: 1.35; color: rgba(12, 13, 14, 0.6); text-wrap: pretty; }
.kdc-kpi.is-key { border-top-color: #f55c36; }
.kdc-kpi.is-key dd { color: #b83a15; }

/* Карточки проектов: лента */
.kdc-cases {
  display: flex; flex-wrap: nowrap; align-items: stretch; gap: 16px;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
  margin-top: 32px; padding: 2px 0 8px;
}
.kdc-nav:not(.is-static) + .kdc-cases { margin-top: 0; }
.kdc-cases::-webkit-scrollbar { display: none; }
.kdc-cases:focus { outline: none; }
.kdc-cases > .kdc-case { flex: 0 0 calc((100% - 32px) / 3); min-width: 300px; scroll-snap-align: start; }

/* Навигация по карточкам: счётчик и стрелки */
.kdc-nav { display: flex; align-items: center; gap: 12px; margin: 32px 0 12px; }
.kdc-nav.is-static { display: none; }
.kdc-nav-hint { display: none; font-size: 13px; color: rgba(12, 13, 14, 0.56); }
.kdc-nav-hint::after { content: " →"; }
.kdc-nav-count { margin-left: auto; font-size: 14px; color: rgba(12, 13, 14, 0.6); font-variant-numeric: tabular-nums; }
.kdc-nav-btns { display: inline-flex; gap: 8px; }
.kdc-nav-btn {
  width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 1px solid rgba(12, 13, 14, 0.14);
  background: #fff; color: #0c0d0e; font-size: 18px; line-height: 1; cursor: pointer; font-family: inherit;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, opacity .2s ease;
}
@media (hover: hover) and (pointer: fine) {
  .kdc-nav-btn:hover:not(:disabled) { background: #0c0d0e; border-color: #0c0d0e; color: #fff; }
}
.kdc-nav-btn:focus-visible { outline: 3px solid #0c0d0e; outline-offset: 3px; }
.kdc-nav-btn:disabled { opacity: 0.35; cursor: default; }

.kdc-case { display: flex; flex-direction: column; box-sizing: border-box; min-width: 0; padding: 22px; border-radius: 24px; background: #f5f5f3; }
.kdc-case-head { margin: 0 0 14px; }
.kdc-case-num { display: block; margin: 0 0 6px; font-size: 13px; line-height: 1; color: rgba(12, 13, 14, 0.42); font-variant-numeric: tabular-nums; }
.kdc-case-name { margin: 0 0 4px; font-family: 'Seenonim', sans-serif; font-weight: 400; font-size: 19px; line-height: 1.2; color: #0c0d0e; overflow-wrap: break-word; text-wrap: balance; }
.kdc-case-meta { margin: 0; font-size: 13.5px; line-height: 1.35; color: rgba(12, 13, 14, 0.58); overflow-wrap: anywhere; }

/* Цифры проекта: строки, как в отчёте */
.kdc-metrics { margin: 0; border-top: 1px solid rgba(12, 13, 14, 0.1); }
.kdc-metric { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(12, 13, 14, 0.1); }
.kdc-metric dt { margin: 0; min-width: 0; font-size: 14px; line-height: 1.3; color: rgba(12, 13, 14, 0.62); }
.kdc-metric dd { margin: 0; flex: 0 1 auto; text-align: right; font-family: 'Seenonim', sans-serif; font-size: 15.5px; line-height: 1.25; color: #0c0d0e; font-variant-numeric: tabular-nums; }
.kdc-metric.is-key dt { color: #0c0d0e; }
.kdc-metric.is-key dd { font-size: 17px; color: #b83a15; }
.kdc-case-note { margin: 14px 0 0; font-size: 14px; line-height: 1.5; color: rgba(12, 13, 14, 0.74); text-wrap: pretty; }

/* Скриншоты внутри карточки проекта */
.kdc-card-shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 14px 0 0; list-style: none; }
.kdc-card-shots[data-count="1"] { grid-template-columns: minmax(0, 1fr); }
.kdc-card-shots[data-count="3"] li:first-child { grid-column: 1 / -1; }
.kdc-shot--card { border-radius: 12px; }
.kdc-shot--card img { max-height: 120px; }
.kdc-card-shots[data-count="1"] .kdc-shot--card img { max-height: 170px; }
.kdc-shot--card .kdc-shot-cap { display: none; }

/* Ниши с одним проектом: текст и цифры слева, скриншоты справа */
@media (min-width: 992px) {
  .kdc-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 40px; align-items: start; }
  .kdc-split .kdc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 28px; }
  .kdc-split .kdc-shots-block { margin: 0; }
  .kdc-split .kdc-shots { grid-template-columns: minmax(0, 1fr); }
  .kdc-split .kdc-shot img { max-height: 420px; }
}

/* Таблица по неделям */
.kdc-table-title { margin: 28px 0 10px; font-family: 'Seenonim', sans-serif; font-weight: 400; font-size: 18px; line-height: 1.25; color: #0c0d0e; }
.kdc-table-wrap { overflow-x: auto; border-radius: 18px; border: 1px solid rgba(12, 13, 14, 0.08); }
.kdc-table-wrap:focus-visible { outline: 3px solid #0c0d0e; outline-offset: 3px; }
.kdc-table { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 15px; }
.kdc-table th, .kdc-table td { padding: 11px 16px; text-align: right; border-top: 1px solid rgba(12, 13, 14, 0.07); font-weight: 400; font-variant-numeric: tabular-nums; }
.kdc-table thead th { background: rgba(12, 13, 14, 0.035); font-size: 13px; color: rgba(12, 13, 14, 0.62); }
.kdc-table th:first-child, .kdc-table td:first-child { text-align: left; }
.kdc-table tbody th { color: #0c0d0e; }

/* Скриншоты */
.kdc-shots-block { margin: 28px 0 0; }
.kdc-shots-title { margin: 0 0 10px; font-size: 14px; font-weight: 400; line-height: 1.3; color: rgba(12, 13, 14, 0.55); }
.kdc-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.kdc-shot {
  display: flex; flex-direction: column; height: 100%; box-sizing: border-box; overflow: hidden;
  border-radius: 16px; border: 1px solid rgba(12, 13, 14, 0.1); background: #fff; color: inherit; text-decoration: none; cursor: zoom-in;
  transition: border-color .2s ease, box-shadow .2s ease;
}
@media (hover: hover) and (pointer: fine) {
  .kdc-shot:hover { border-color: rgba(12, 13, 14, 0.4); box-shadow: 0 8px 24px rgba(12, 13, 14, 0.08); }
}
.kdc-shot img { display: block; width: 100%; height: auto; max-height: 170px; object-fit: contain; object-position: center; background: #fff; }
.kdc-shot-cap { display: block; padding: 10px 12px 12px; border-top: 1px solid rgba(12, 13, 14, 0.06); font-size: 13px; line-height: 1.4; color: rgba(12, 13, 14, 0.62); }

/* Один призыв на весь блок */
.kdc-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin: 20px 0 0; padding: 22px 26px; border-radius: 24px; background: #f5f5f3; }
.kdc-cta-text { margin: 0; flex: 1 1 360px; font-size: 17px; line-height: 1.45; color: #0c0d0e; text-wrap: pretty; }
.kdc-foot { margin: 14px 4px 0; font-size: 13px; line-height: 1.45; color: rgba(12, 13, 14, 0.55); }

@media (max-width: 991px) {
  .kdc-cases > .kdc-case { flex-basis: calc((100% - 16px) / 2); }
  .kdc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; }
}
@media (max-width: 767px) {
  .kdc-tabs { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 2px 16px 8px; scrollbar-width: none; }
  .kdc-tabs::-webkit-scrollbar { display: none; }
  .kdc-tab { flex: 0 0 auto; min-width: 200px; }
  .kdc-panel { border-radius: 24px; }
  .kdc-intro { font-size: 17px; }
  .kdc-kpis { gap: 18px 16px; margin-top: 22px; }
  .kdc-kpi dd { font-size: 24px; }
  .kdc-kpi dt { font-size: 13px; }
  .kdc-cta { padding: 20px; }
  .kdc-cta-text { font-size: 16px; flex-basis: 100%; }
  .kdc-cta .kh-btn { width: 100%; }

  /* Ленты, которые листаются вбок: карточки проектов и скриншоты */
  .kdc-shots, .kdc-cases {
    display: flex; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory; scroll-padding-inline: 16px;
    gap: 10px; margin-inline: calc(clamp(20px, 3vw, 40px) * -1); padding: 2px clamp(20px, 3vw, 40px) 10px;
    scrollbar-width: none;
  }
  .kdc-cases::-webkit-scrollbar, .kdc-shots::-webkit-scrollbar { display: none; }
  .kdc-cases { gap: 12px; align-items: stretch; }
  .kdc-cases > .kdc-case { flex: 0 0 90%; min-width: 0; scroll-snap-align: center; padding: 18px; }
  .kdc-case-name { font-size: 17px; overflow-wrap: anywhere; hyphens: auto; }
  .kdc-case-meta { font-size: 13px; }
  .kdc-card-shots, .kdc-card-shots[data-count] { grid-template-columns: minmax(0, 1fr); }
  .kdc-card-shots li:first-child { grid-column: auto; }
  .kdc-shot--card img, .kdc-card-shots[data-count="1"] .kdc-shot--card img { max-height: 150px; }
  .kdc-shots > li { flex: 0 0 86%; scroll-snap-align: start; }
  .kdc-shot img { max-height: 200px; }
  .kdc-nav-hint { display: inline; }
  .kdc-nav-btns { display: none; }
  .kdc-nav { margin: 24px 0 8px; }
}

/* Лайтбокс на телефоне: отчёт целиком на экране, приблизить можно пальцами */
@media (max-width: 767px) {
  .kubik-lightbox-modal.kdc-report .kubik-lightbox-dialog { max-width: 100vw !important; width: 100% !important; }
  .kubik-lightbox-modal.kdc-report .kubik-lightbox-content img { max-width: calc(100vw - 16px) !important; max-height: 72vh !important; border-radius: 10px !important; }
  .kubik-lightbox-modal.kdc-report .kubik-lightbox-caption { max-width: calc(100vw - 32px); padding: 0 4px; }
  .kubik-lightbox-modal.kdc-report .kubik-lightbox-close { top: -52px !important; right: 12px !important; }
}
