/*
 * v174 — Точная адаптивная верстка трех верхних блоков по согласованному референсу.
 * Этот файл подключается ПОСЛЕДНИМ и не влияет на «Мои миры», чат или сайдбар.
 */
#homeDashboard .home-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 2.85fr);
  grid-template-areas: "friends important" "tasks tasks";
  align-items: start;
  gap: 24px 14px;
  margin-bottom: 24px;
}
#homeDashboard .home-top-grid > .home-card {
  min-width: 0;
  min-height: 0;
  height: auto;
  padding: 0;
  margin: 0;
  overflow: visible;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
#homeDashboard .home-top-grid > .home-card::before,
#homeDashboard .home-top-grid > .home-card::after { display: none !important; }
#homeDashboard .home-card-friends { grid-area: friends; }
#homeDashboard .home-card-important { grid-area: important; }
#homeDashboard .home-card-tasks { grid-area: tasks; }
#homeDashboard .home-top-grid .home-card-head {
  height: 29px;
  min-height: 29px;
  margin: 0 3px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
}
#homeDashboard .home-top-grid .home-card-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
#homeDashboard .home-top-grid .home-card-title > .card-icon {
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
#homeDashboard .home-top-grid .home-card-title > .card-icon .ui-icon {
  width: 21px;
  height: 21px;
}
#homeDashboard .home-top-grid .home-card-title b {
  color: #737a90;
  font-size: 16px;
  font-weight: 790;
  line-height: 1.15;
}
#homeDashboard .home-top-grid .home-card-link {
  font-size: 11px;
  font-weight: 700;
  color: #79829a;
  padding: 5px 0;
}
#homeDashboard .home-top-grid .home-title-badge {
  background: linear-gradient(145deg, #ff7186, #fa3e65);
  color: #fff;
  border-radius: 999px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  box-shadow: 0 4px 10px rgba(255, 62, 101, .23);
}
/* Card surfaces.  Deliberately keeps the rest of the light page untouched. */
#homeDashboard .home-friends-summary-card,
#homeDashboard .home-important-summary-card,
#homeDashboard .home-task-summary-card {
  position: relative;
  isolation: isolate;
  width: 100%;
  overflow: hidden;
  cursor: pointer;
  color: #fff;
  border: 1px solid #7161cf;
  border-radius: 19px;
  background: linear-gradient(112deg, #31365a 0%, #312d52 53%, #483065 100%);
  box-shadow: 0 9px 20px rgba(51, 36, 89, .15), inset 0 1px 0 rgba(255,255,255,.10);
  text-align: left;
  transform: none;
  transition: filter .18s ease, box-shadow .18s ease;
}
#homeDashboard .home-friends-summary-card:hover,
#homeDashboard .home-important-summary-card:hover,
#homeDashboard .home-task-summary-card:hover {
  transform: none;
  filter: brightness(1.055);
  box-shadow: 0 11px 23px rgba(51,36,89,.20), inset 0 1px 0 rgba(255,255,255,.10);
}
#homeDashboard .home-friends-summary-card:focus-visible,
#homeDashboard .home-important-summary-card:focus-visible,
#homeDashboard .home-task-summary-card:focus-visible {
  outline: 3px solid #7f9eff;
  outline-offset: 3px;
}
#homeDashboard .home-friends-summary-card::before,
#homeDashboard .home-important-summary-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url('../images/ui/v174-summary-wave.svg') center / 100% 100% no-repeat;
}
#homeDashboard .home-friends-summary-card::after,
#homeDashboard .home-important-summary-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(ellipse at 56% -25%, rgba(172,131,255,.14), transparent 58%);
  transform: none;
  height: auto;
}
#homeDashboard .home-friends-summary-card > *,
#homeDashboard .home-important-summary-card > *,
#homeDashboard .home-task-summary-card > * { position: relative; z-index: 1; }
/* Друзья: число / разделитель / текст / реальные аватары / стрелка */
#homeDashboard .home-top-grid .home-friends-list { display: block; margin: 0; min-height: 0; }
#homeDashboard .home-friends-summary-card {
  display: grid;
  grid-template-columns: auto minmax(100px, 1fr) auto 15px;
  align-items: center;
  column-gap: 18px;
  min-height: 116px;
  height: 116px;
  padding: 14px 18px 14px 24px;
}
#homeDashboard .home-friends-summary-count {
  font-size: 53px;
  font-weight: 550;
  letter-spacing: -2px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #6de7f6;
  text-shadow: 0 2px 14px rgba(73,202,255,.16);
}
#homeDashboard .home-friends-summary-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 52px;
  padding-left: 18px;
  border-left: 1px solid rgba(220,218,254,.30);
}
#homeDashboard .home-friends-summary-copy b {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #fff;
  font-size: 15px;
  line-height: 1.15;
  font-weight: 820;
}
#homeDashboard .home-friends-summary-copy b i {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #52fba2;
  box-shadow: 0 0 9px 2px rgba(74, 245, 153, .65);
}
#homeDashboard .home-friends-summary-copy small {
  color: #c1c0dd;
  font-size: 12px;
  font-weight: 560;
}
#homeDashboard .home-friends-summary-avatars {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-left: 6px;
  min-width: 0;
}
#homeDashboard .home-friends-summary-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-left: -12px;
  border-radius: 50%;
  border: 3px solid #f4f3ff;
  background: #edf2fb;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(12,12,31,.18);
}
#homeDashboard .home-friends-summary-avatar:first-child { margin-left: 0; }
#homeDashboard .home-friends-summary-avatar .home-friend-avatar { width: 100% !important; height: 100% !important; }
#homeDashboard .home-friends-summary-placeholder {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(154,120,238,.2);
  color: #dec6ff;
}
#homeDashboard .home-friends-summary-arrow {
  color: #efedff;
  font-size: 27px;
  font-weight: 350;
  line-height: 1;
}
/* Важное: две настоящие отдельные карточки в одной секции */
#homeDashboard .home-top-grid .home-important-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
  margin: 0;
  min-height: 0;
}
#homeDashboard .home-important-summary-card {
  min-width: 0;
  min-height: 116px;
  height: 116px;
  display: grid;
  grid-template-columns: auto minmax(0,1fr) 48px 10px;
  align-items: center;
  gap: 13px;
  padding: 15px 13px 15px 17px;
  background: linear-gradient(110deg, #39335b, #382f56 63%, #51306c);
}
#homeDashboard .home-important-summary-count {
  display: block;
  color: #ffbf64;
  font-size: 48px;
  font-weight: 570;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
#homeDashboard .home-important-summary-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  min-height: 51px;
  padding-left: 14px;
  border-left: 1px solid rgba(229,222,255,.29);
}
#homeDashboard .home-important-summary-copy b {
  display: block;
  max-width: none;
  color: #fff;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 820;
  overflow-wrap: normal;
}
#homeDashboard .home-important-summary-art {
  position: relative;
  inset: auto;
  grid-column: 3;
  align-self: center;
  justify-self: end;
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  border: 1px solid rgba(216,160,255,.2);
  background: linear-gradient(150deg, rgba(166,97,232,.65), rgba(105,44,161,.64));
  color: #f2dcff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.13), 0 4px 10px rgba(30,18,49,.14);
  transform: none;
}
#homeDashboard .home-important-summary-art .ui-icon { width: 25px; height: 25px; }
#homeDashboard .home-important-summary-arrow {
  position: relative;
  inset: auto;
  grid-column: 4;
  color: #f4efff;
  font-size: 23px;
  line-height: 1;
  transform: none;
}
/* Задания: широкая лента / подарок из согласованного изображения / прогресс */
#homeDashboard .home-top-grid .home-tasks-list { display: block; margin: 0; min-height: 0; }
#homeDashboard .home-task-summary-card {
  display: grid;
  grid-template-columns: 108px minmax(0,1fr) 22px;
  align-items: center;
  gap: 16px;
  height: 140px;
  min-height: 140px;
  padding: 17px 20px 17px 22px;
  border: 1px solid #b454f0;
  border-radius: 20px;
  background: linear-gradient(105deg, #6d2d87 0%, #63267e 44%, #742fa0 74%, #51247b 100%);
  box-shadow: 0 10px 24px rgba(98,39,133,.23), inset 0 1px 0 rgba(255,255,255,.14);
}
#homeDashboard .home-task-summary-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background: url('../images/ui/v174-task-wave.svg') center / 100% 100% no-repeat;
}
#homeDashboard .home-task-summary-card::after {
  content: '';
  position: absolute;
  inset: 0;
  height: auto;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  transform: none;
  background: radial-gradient(ellipse at 55% -35%, rgba(213,135,255,.14), transparent 62%);
}
#homeDashboard .home-task-summary-visual {
  display: flex;
  width: 94px;
  height: 101px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  align-items: center;
  justify-content: center;
  transform: none;
}
#homeDashboard .home-task-summary-visual .home-task-gift-image {
  display: block;
  width: 93px;
  height: 99px;
  object-fit: contain;
  filter: drop-shadow(0 6px 8px rgba(28,12,59,.28));
}
#homeDashboard .home-task-summary-visual i { display: none; }
#homeDashboard .home-task-summary-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  gap: 7px;
}
#homeDashboard .home-task-summary-copy b {
  color: #fff;
  font-size: clamp(17px, 1.7vw, 25px);
  max-width: 100%;
  white-space: normal;
  overflow-wrap: break-word;
  font-weight: 830;
  line-height: 1.13;
  letter-spacing: -.3px;
}
#homeDashboard .home-task-summary-copy small {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 4px 12px;
  border: 1px solid rgba(239,211,255,.23);
  border-radius: 999px;
  background: rgba(44,22,76,.42);
  color: #fff;
  font-size: 11px;
  font-weight: 680;
  line-height: 1.15;
}
#homeDashboard .home-task-summary-track {
  display: block;
  width: min(420px, 95%);
  height: 7px;
  margin-top: 1px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(231,203,254,.35);
}
#homeDashboard .home-task-summary-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(180deg, #fff7ff, #ddb1ff);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
}
#homeDashboard .home-task-summary-arrow {
  color: #fff;
  font-size: 30px;
  justify-self: end;
  line-height: 1;
}
/* Medium widths: preserve the two summary cards side by side, give them enough text room. */
@media (max-width: 1380px) {
  #homeDashboard .home-top-grid { grid-template-columns: minmax(0, .95fr) minmax(0, 1.25fr); }
  #homeDashboard .home-friends-summary-card { column-gap: 10px; padding-left: 17px; }
  #homeDashboard .home-important-summary-card { gap: 8px; padding-right: 11px; }
  #homeDashboard .home-important-summary-copy { padding-left: 10px; }
  #homeDashboard .home-important-summary-count { font-size: 43px; }
  #homeDashboard .home-important-summary-copy b { font-size: 12px; }
  #homeDashboard .home-important-summary-art { width: 36px; height: 36px; }
}
@media (max-width: 1080px) {
  #homeDashboard .home-top-grid {
    grid-template-columns: minmax(0,1fr);
    grid-template-areas: "friends" "important" "tasks";
    gap: 19px;
  }
  #homeDashboard .home-friends-summary-card { min-height: 102px; height: 102px; }
  #homeDashboard .home-important-summary-card { min-height: 98px; height: 98px; }
}
@media (max-width: 720px) {
  #homeDashboard .home-top-grid { gap: 16px; margin-bottom: 22px; }
  #homeDashboard .home-top-grid .home-card-head { min-height: 25px; height: 25px; margin-bottom: 8px; }
  #homeDashboard .home-top-grid .home-card-title b { font-size: 14px; }
  #homeDashboard .home-friends-summary-card { min-height: 90px; height: 90px; border-radius: 16px; grid-template-columns: auto minmax(0,1fr) auto 10px; gap: 9px; padding: 12px 13px 12px 16px; }
  #homeDashboard .home-friends-summary-count { font-size: 45px; }
  #homeDashboard .home-friends-summary-copy { padding-left: 11px; min-height: 46px; }
  #homeDashboard .home-friends-summary-copy b { font-size: 13px; }
  #homeDashboard .home-friends-summary-copy small { font-size: 11px; }
  #homeDashboard .home-friends-summary-avatar { width: 39px; height: 39px; border-width: 2px; margin-left: -10px; }
  #homeDashboard .home-important-summary-card { min-height: 98px; height: 98px; border-radius: 16px; padding: 13px 11px; gap: 8px; grid-template-columns: auto minmax(0,1fr) 28px; }
  #homeDashboard .home-important-summary-count { font-size: 41px; }
  #homeDashboard .home-important-summary-copy { min-height: 40px; padding-left: 9px; }
  #homeDashboard .home-important-summary-copy b { font-size: 11px; }
  #homeDashboard .home-important-summary-art { grid-column: 3; width: 28px; height: 28px; border-radius: 9px; }
  #homeDashboard .home-important-summary-art .ui-icon { width: 18px; height: 18px; }
  #homeDashboard .home-important-summary-arrow { display: none; }
  #homeDashboard .home-task-summary-card { min-height: 124px; height: 124px; grid-template-columns: 78px minmax(0,1fr) 12px; gap: 10px; padding: 12px 14px; border-radius: 17px; }
  #homeDashboard .home-task-summary-visual { width: 70px; height: 79px; }
  #homeDashboard .home-task-summary-visual .home-task-gift-image { width: 70px; height: 75px; }
  #homeDashboard .home-task-summary-copy b { font-size: 15px; line-height: 1.17; }
  #homeDashboard .home-task-summary-track { width: min(260px,100%); }
  #homeDashboard .home-task-summary-arrow { font-size: 23px; }
}
@media (max-width: 390px) {
  #homeDashboard .home-friends-summary-avatar { width: 34px; height: 34px; }
  #homeDashboard .home-friends-summary-arrow { display: none; }
  #homeDashboard .home-friends-summary-card { grid-template-columns: auto minmax(0,1fr) auto; }
  #homeDashboard .home-top-grid .home-important-list { gap: 8px; }
  #homeDashboard .home-important-summary-card { grid-template-columns: auto minmax(0,1fr); }
  #homeDashboard .home-important-summary-art { display: none; }
  #homeDashboard .home-task-summary-card { grid-template-columns: 64px minmax(0,1fr); }
  #homeDashboard .home-task-summary-arrow { display: none; }
  #homeDashboard .home-task-summary-visual,
  #homeDashboard .home-task-summary-visual .home-task-gift-image { width: 62px; height: 69px; }
  #homeDashboard .home-task-summary-copy b { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  #homeDashboard .home-friends-summary-card,
  #homeDashboard .home-important-summary-card,
  #homeDashboard .home-task-summary-card { transition: none; }
}
