.next-start {
  padding-inline: var(--section-padding-x);
  padding-bottom: var(--section-spacing);
}
@media (max-width: 988px) {
  .next-start { padding-inline: var(--section-padding-x-mobile); }
}

.next-start__subtitle {
  margin: 0;
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: clamp(16px, calc(10.324px + 0.81081vw), 22px);
  line-height: 1.3;
  color: var(--color-text);
}

.next-start__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "widgets image"
    "panel image";
  gap: clamp(10px, calc(0.541px + 1.35135vw), 20px);
  margin-top: var(--section-name-to-section);
}

/* ---- calendar widgets: everything in cqw of the widgets ROW (both
   widgets are 315/650 of it in both frames): Figma px / 650 * 100, so
   the widget scales as one piece. Below 700 the type drops to the
   mobile frame's fixed sizes (her call). The container must be the row,
   not the widget — cqw on the container itself falls back to the
   viewport. ---- */

.next-start__widgets {
  grid-area: widgets;
  container-type: inline-size;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(10px, calc(0.541px + 1.35135vw), 20px);
}

.next-start__widget {
  aspect-ratio: 315 / 318;
  /* Stretch ignores aspect-ratio; this keeps the pair equal when one
     outgrows the ratio at the small end. */
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--color-cards-bg);
  border-radius: var(--radius-medium);
  font-family: var(--font-primary);
  color: var(--color-text);
}
@media (max-width: 988px) {
  .next-start__widget { border-radius: var(--radius-medium-mobile); }
}

.next-start__day { padding: 4.483cqw; }
.next-start__month {
  justify-content: flex-start;
  padding: 4.075cqw 4.075cqw 3.26cqw;
}

.next-start__overline {
  font-weight: 500;
  font-size: 2.242cqw;
  line-height: normal;
}
.next-start__overline--day { color: #54b604; }

.next-start__day-head {
  display: flex;
  flex-direction: column;
  gap: 0.408cqw;
}

.next-start__day-number {
  font-weight: 400;
  font-size: 8.966cqw;
  line-height: 1.1;
}

.next-start__events {
  display: flex;
  flex-direction: column;
  gap: 2.038cqw;
}

.next-start__event {
  display: flex;
  flex-direction: column;
  gap: 0.408cqw;
  padding: 1.223cqw 2.038cqw;
  border-left: 0.815cqw solid var(--color-accent-buttons);
  border-radius: 1.631cqw;
  background: #ecffdd;
  color: #5cba0f;
}
.next-start__event-title {
  font-weight: 700;
  font-size: 2.445cqw;
  line-height: normal;
}
.next-start__event-time {
  font-weight: 600;
  font-size: 2.242cqw;
  line-height: normal;
  opacity: 0.8;
}

.next-start__more {
  display: flex;
  align-items: center;
  gap: 1.631cqw;
  font-weight: 500;
  font-size: 2.445cqw;
  line-height: normal;
  color: #8e8e93;
}
.next-start__more::before {
  content: '';
  flex: none;
  width: 0.815cqw;
  height: 2.846cqw;
  border-radius: 0.408cqw;
  background: #ffbc1f;
}

.next-start__weekdays,
.next-start__grid {
  display: grid;
  grid-template-columns: repeat(7, 4.891cqw);
  justify-content: space-between;
  font-size: 2.038cqw;
  line-height: normal;
  color: #8e8e93;
}
.next-start__weekdays {
  margin-top: 3.308cqw;
  font-weight: 700;
}
.next-start__weekdays span,
.next-start__cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 4.075cqw;
}
.next-start__weekdays span { height: 3.668cqw; }
.next-start__grid {
  margin-top: 3.308cqw;
  row-gap: 0.815cqw;
  font-weight: 500;
}
.next-start__cell {
  border-radius: 999px;
}
.next-start__cell.is-start {
  font-weight: 700;
  background: #aae779;
  color: var(--color-text);
}

/* ---- image card + badges (her call: badges under the card at every
   width, white, stretching across it like Hero's mobile badges) ---- */

.next-start__image-card {
  grid-area: image;
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  /* Same gap as between the cards around it — her call. */
  gap: clamp(10px, calc(0.541px + 1.35135vw), 20px);
}

.next-start__image-body {
  position: relative;
  padding: clamp(59px, calc(34.405px + 3.51351vw), 85px) clamp(30px, calc(1.622px + 4.05405vw), 60px) 24px;
  background: var(--color-cards-bg);
  border-radius: var(--radius-medium);
}

.next-start__laptop {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 530 / 384.2;
  object-fit: cover;
}

/* Scales with the card (cqw of its width): centre 207.6/650 in,
   94.7/650 down, 65.9/650 tall; the mobile frame's own proportions
   below 700. */
.next-start__soon {
  position: absolute;
  left: 31.94%;
  top: 14.57cqw;
  transform: translate(-50%, -50%) rotate(-18.74deg);
  font-family: var(--font-family-accent);
  font-weight: 400;
  font-size: 10.138cqw;
  line-height: 1;
  text-align: center;
  text-transform: lowercase;
  white-space: nowrap;
  color: var(--color-text);
}

.next-start__badges {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  /* Hero's badge-row gap; the frame's 7→15 read as too loose — her call. */
  gap: 10px;
}
.next-start__badge {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  gap: clamp(6px, calc(5.054px + 0.13514vw), 7px);
  height: 34px;
  padding: 8px 14.9px;
  border-radius: var(--radius-label);
  background: var(--color-cards-bg);
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: clamp(14px, calc(12.108px + 0.27027vw), 16px);
  line-height: normal;
  white-space: nowrap;
  color: var(--color-text);
}
.next-start__badge img {
  display: block;
  width: clamp(10px, calc(7.257px + 0.39189vw), 12.9px);
  height: clamp(9px, calc(6.211px + 0.39865vw), 11.9px);
}

/* ---- sign-up panel ---- */

.next-start__panel {
  grid-area: panel;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  padding: 30px;
  background: var(--color-cards-bg);
  border-radius: var(--radius-medium);
}

.next-start__panel-text {
  margin: 0;
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: clamp(20px, calc(16.216px + 0.54054vw), 24px);
  line-height: 1.2;
  color: var(--color-text);
  /* 446px at the real 24px: the frame's longest line ("количество
     людей в группе ограничено"), 0.76 of the panel — her call. */
  max-width: 29ch;
}

.next-start__action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 22px;
}

.next-start__button {
  display: flex;
  align-items: center;
  justify-content: center;
  /* Grows from its label up to Figma's width, so the avatars stay on
     the same line as long as the label fits. */
  flex: 1 1 auto;
  max-width: clamp(186.8px, calc(140.27px + 6.64865vw), 236px);
  height: 45px;
  border-radius: 60px;
  background: var(--color-accent-buttons);
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: clamp(16px, calc(14.108px + 0.27027vw), 18px);
  color: var(--color-text);
  text-decoration: none;
}
/* The roll fills the pill so the whole button triggers the shared roll
   hover; the label's width still sets the pill's minimum. */
.next-start__button .roll {
  width: 100%;
  height: 100%;
}
.next-start__button .roll__mask {
  height: 100%;
}
.next-start__button .roll__line {
  justify-content: center;
}

.next-start__avatars {
  display: flex;
}
.next-start__avatars img {
  display: block;
  width: clamp(24.84px, calc(15.229px + 1.37297vw), 35px);
  height: clamp(24.84px, calc(15.229px + 1.37297vw), 35px);
  border-radius: 50%;
  border: 1px solid #fff;
  object-fit: cover;
}
.next-start__avatars img + img {
  margin-left: clamp(-6px, calc(-2.614px - 0.23514vw), -4.26px);
}

/* ---- stacked: widgets, image, panel (the mobile frame) ---- */
@media (max-width: 1019.98px) {
  .next-start__layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas:
      "widgets"
      "image"
      "panel";
  }
  /* The mobile frame's event strip has no time line. */
  .next-start__event-time { display: none; }
}

/* Mobile frame's fixed type sizes and sticker proportion. */
@media (max-width: 699.98px) {
  .next-start__overline { font-size: 14px; }
  .next-start__day-number { font-size: 54px; }
  .next-start__event-title { font-size: 12px; }
  .next-start__more { font-size: 10px; }
  .next-start__weekdays,
  .next-start__grid { font-size: 10px; }
  .next-start__soon {
    left: 29.1%;
    top: 19.29cqw;
    font-size: 8.571cqw;
  }
}
