/*
 * Premium responsive home layout layer.
 * Final-pass, home-scoped CSS only. This avoids touching route logic,
 * assets, or existing card rendering while improving hierarchy and desktop fit.
 */

.home-premium-shell {
  --mba-home-max: 1180px;
  --mba-home-gutter: clamp(14px, 3vw, 28px);
}

.home-premium-shell .home-desktop-main {
  width: 100% !important;
  max-width: var(--mba-home-max) !important;
  margin-inline: auto !important;
  box-sizing: border-box !important;
}

.home-premium-shell .home-premium-workspace,
.home-premium-shell .home-dashboard-groups,
.home-premium-shell .home-recent-compact,
.home-premium-shell .home-footer-section {
  width: min(100%, var(--mba-home-max)) !important;
  max-width: var(--mba-home-max) !important;
  margin-inline: auto !important;
  box-sizing: border-box !important;
}

.home-premium-shell .home-dashboard-groups {
  padding-inline: var(--mba-home-gutter) !important;
}

.home-premium-shell .home-dashboard-group {
  scroll-margin-top: 96px;
}

.home-premium-shell .home-dashboard-group__head {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  justify-items: start !important;
  align-items: start !important;
  justify-content: start !important;
  gap: 4px !important;
  text-align: left !important;
}

.home-premium-shell .home-dashboard-group__head span,
.home-premium-shell .home-dashboard-group__head h2 {
  justify-self: start !important;
  max-width: min(100%, 760px) !important;
  text-align: left !important;
}

.home-premium-shell .home-dashboard-card,
.home-premium-shell .home-primary-action-card,
.home-premium-shell .home-special-card,
.home-premium-shell .home-snapshot-stat,
.home-premium-shell .home-search-command__result,
.home-premium-shell .home-continue-card__primary,
.home-premium-shell .home-continue-card__secondary {
  -webkit-tap-highlight-color: transparent !important;
  touch-action: manipulation !important;
}

.home-premium-shell .home-search-command__result {
  min-height: 44px !important;
}

.home-premium-shell .home-dashboard-card__title,
.home-premium-shell .home-special-card__title,
.home-premium-shell .home-primary-action-card__title {
  text-wrap: balance;
}

@media (max-width: 430px) {
  .home-premium-shell {
    --mba-home-gutter: 12px;
  }

  .home-premium-shell .home-dashboard-groups {
    gap: 16px !important;
  }

  .home-premium-shell .home-dashboard-group__head {
    justify-items: start !important;
    align-items: start !important;
    text-align: left !important;
  }

  .home-premium-shell .home-dashboard-group__head h2 {
    max-width: 100% !important;
  }

  .home-premium-shell .home-dashboard-card,
  .home-premium-shell .home-primary-action-card {
    min-height: 88px !important;
  }

  .home-premium-shell .home-special-card__cta {
    max-width: 86px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}

@media (min-width: 768px) {
  .home-premium-shell .home-premium-workspace {
    padding-inline: var(--mba-home-gutter) !important;
  }

  .home-premium-shell .home-dashboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-auto-rows: 92px !important;
    gap: 12px !important;
  }

  .home-premium-shell .home-special-cards {
    gap: 12px !important;
  }
}

@media (min-width: 1024px) {
  .home-premium-shell .home-hero-brand-media {
    padding-top: calc(72px + env(safe-area-inset-top)) !important;
  }

  .home-premium-shell .home-desktop-main .home-hero-media {
    max-width: 620px !important;
    min-height: 330px !important;
    max-height: 430px !important;
  }

  .home-premium-shell .home-premium-workspace {
    display: grid !important;
    grid-template-columns: minmax(0, 1.24fr) minmax(310px, 0.76fr) !important;
    align-items: start !important;
    gap: 18px !important;
    padding-top: 8px !important;
  }

  .home-premium-shell .home-premium-workspace__primary,
  .home-premium-shell .home-premium-workspace__secondary {
    min-width: 0 !important;
  }

  .home-premium-shell .home-premium-workspace__secondary {
    position: sticky !important;
    top: 88px !important;
    align-self: start !important;
  }

  .home-premium-shell .home-greeting-clock-wrap,
  .home-premium-shell .home-daily-quote-wrap,
  .home-premium-shell .home-search-command,
  .home-premium-shell .home-command-center,
  .home-premium-shell .home-continue-wrap,
  .home-premium-shell .home-snapshot-wrap,
  .home-premium-shell .home-special-cards {
    padding-inline: 0 !important;
    width: 100% !important;
    max-width: none !important;
  }

  .home-premium-shell .home-dashboard-groups {
    gap: 22px !important;
    padding-top: 20px !important;
  }

  .home-premium-shell .home-dashboard-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-auto-rows: 96px !important;
    gap: 14px !important;
  }

  .home-premium-shell .home-dashboard-card {
    grid-template-columns: 40px minmax(0, 1fr) auto 10px !important;
    gap: 9px !important;
    padding: 12px !important;
    border-radius: 19px !important;
  }

  .home-premium-shell .home-dashboard-card__icon {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
  }

  .home-premium-shell .home-dashboard-card__icon svg,
  .home-premium-shell .home-dashboard-card__icon img {
    max-width: 40px !important;
    max-height: 40px !important;
  }

  .home-premium-shell .home-dashboard-card__title {
    font-size: 13.8px !important;
    line-height: 1.16 !important;
  }

  .home-premium-shell .home-dashboard-card__subtitle {
    font-size: 11.4px !important;
  }
}

@media (min-width: 1280px) {
  .home-premium-shell .home-dashboard-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }

  .home-premium-shell .home-dashboard-groups {
    padding-bottom: 10px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-premium-shell .home-premium-workspace__secondary {
    position: static !important;
  }
}
