/* Композиции главной. Стили экранов приложения и их состояний задают *-live.css. */
body {
  --home-line: #e0e1e4;
  --home-gray: #f5f5f7;
  --header-paper: var(--paper);
  background: var(--canvas);
}

body::before,
.journey-live::before,
.kids-live::before,
.tool-card::before,
.tool-art::before {
  content: none;
}

.hh-scene .stage-orb,
.start-orb {
  display: none;
}

.hero,
.journey,
.more-tools,
.template-teaser,
.start-card,
.tool-card {
  border-color: var(--home-line);
  background: var(--white);
  box-shadow: none;
}

.hh-scene,
.journey-live,
.kids-live {
  border-color: var(--home-line);
  background: var(--home-gray);
  box-shadow: none;
}

.hh-scene { background: #f0efea; }
.kids-live { background: var(--blue-100); }
.start-card { background: var(--paper); }

/* У статичных карточек текст и иллюстрация занимают свои строки.
   Высота текста может меняться независимо от ширины экрана. */
.tools-grid .tool-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(20rem, 1fr);
  min-height: 0;
}

.tools-grid .tool-copy {
  align-self: center;
  max-width: none;
  padding: clamp(24px, 2.8vw, 40px);
  padding-inline-end: max(64px, 3.2vw);
}

.tools-grid .tool-art {
  position: relative;
  inset: auto;
  min-width: 0;
  height: auto;
}

.tools-grid .tool-card-kb {
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  grid-template-rows: minmax(21rem, auto);
}

.tool-art-chat { background: var(--blue-100); }
.tool-art-payments { background: var(--navy); }
.tool-art-kb { background: var(--home-gray); }

.template-teaser::after,
.tool-card-link::after {
  z-index: 4;
  border-color: var(--home-line);
  background: var(--white);
  box-shadow: none;
}

/* Уступ оставляет видимыми обе звёздные плашки и обе кнопки дела. */
.ft-rewards {
  --reward-offset: clamp(16px, 5%, 26px);
  justify-self: center;
  justify-items: start;
  gap: 12px;
  width: min(100%, 410px);
}

.ft-rewards > .ft-card {
  width: calc(100% - var(--reward-offset));
  box-shadow: 0 6px 20px rgba(18, 27, 52, .07);
}

.ft-rewards > .ft-card + .ft-card {
  justify-self: end;
  margin: 0;
}

.ft-rewards > .ft-toast {
  position: relative;
  inset: auto;
  width: fit-content;
  max-width: calc(100% - 12px);
  margin: 0 0 0 12px;
  box-shadow: 0 4px 12px rgba(18, 27, 52, .12);
}

@media (min-width: 761px) {
  .ft-rewards { padding-block-start: 58px; }
  .ft-rewards .ft-float {
    top: 0;
    right: 0;
    width: 76px;
    height: 76px;
  }
}

.home-wish-collection {
  display: flex;
  gap: 8px;
  margin-block-start: 24px;
}

.home-wish-collection img {
  width: clamp(58px, 7vw, 96px);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 16px;
}

.ft-wishlist::before {
  position: absolute;
  z-index: -1;
  inset: -10px -12px;
  border-radius: 26px;
  background: var(--home-gray);
  content: "";
  pointer-events: none;
}

.template-teaser-notes { background: var(--paper); }

.seo-faq {
  --seo-line: var(--home-line);
  --seo-surface: var(--white);
}

.seo-faq__item { box-shadow: none; }

@media (max-width: 1180px) {
  .template-teaser.media-action-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "label" "heading" "visual" "description" "actions";
    gap: 0;
  }

  .template-teaser-wishlist.media-action-layout {
    grid-template-areas: "label" "heading" "collection" "visual" "description" "actions";
  }

  .template-teaser .template-teaser-copy { display: contents; }
  .template-teaser-copy > span:first-child { grid-area: label; padding-inline-end: 2.5rem; }
  .template-teaser-copy h2 { grid-area: heading; margin: 14px 0 24px; }
  .template-teaser-copy p { grid-area: description; margin: 20px 0 0; }
  .template-teaser > .media-action { margin-block-start: 20px; }

  .template-teaser-rewards .template-teaser-copy h2,
  .template-teaser-rewards .template-teaser-copy > span:first-child {
    justify-self: center;
    text-align: center;
  }

  .template-teaser-rewards .template-teaser-copy > span:first-child { padding-inline: 32px; }
  .template-teaser-rewards > .media-action { justify-self: center; }

  .home-wish-collection {
    grid-area: collection;
    justify-content: center;
    margin: 0 0 14px;
  }
}

@media (max-width: 820px) {
  .tools-grid .tool-card-kb {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(18rem, 1fr);
  }
}

@media (max-width: 580px) {
  .template-teaser { padding: 40px 24px 28px; }
  .template-teaser-kids .kids-live {
    margin-inline: -24px;
    border-inline: 0;
    border-radius: 0;
  }

  .template-teaser-notes .ft-notes { width: auto; margin-inline: -8px; }
  .template-teaser::after,
  .tool-card-link::after { top: 16px; right: 16px; }

  .tools-grid .tool-copy { padding: 24px 20px; }
  .tool-copy .tool-label { display: block; padding-inline-end: 36px; }
}

@media (max-width: 360px) {
  .ft-rewards .ft-row-body strong { white-space: normal; }
}

/* Карточки — обычные ссылки. Свайп и клавиатурный фокус прокручивают
   эту полосу нативно, каждая ссылка открывается как и в полной сетке. */
@media (max-width: 580px) and (pointer: coarse) {
  .tools-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 86%;
    gap: 12px;
    margin-inline: -24px;
    padding: 6px 24px 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 24px;
  }

  .tools-grid .tool-card {
    grid-column: auto;
    grid-template-rows: auto minmax(17rem, 1fr);
    scroll-snap-align: start;
  }
}
