/* ═══════════════════════════════════════════════════════
   DASHBOARD LAYOUT — Overflow Guard & Card Stability
   ═══════════════════════════════════════════════════════ */

html,
body,
body.home-mode,
body.home-mode .main-content,
body.home-mode .alive-home {
  overflow-x: hidden !important;
}

body.home-mode .alive-home,
body.home-mode .alive-home > *,
body.home-mode .an-dashboard-grid,
body.home-mode .an-dashboard-grid > div,
body.home-mode .an-journeys-grid,
body.home-mode .an-journeys-grid > * {
  min-width: 0 !important;
  box-sizing: border-box !important;
}

/* ── Cards fill their column, not the whole page ── */
body.home-mode .aw-container,
body.home-mode .an-score-section,
body.home-mode #waterReminderWidget,
body.home-mode #googleFitWidget {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

body.home-mode .an-news-container {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

/* ── Card minimize behavior ── */
body.home-mode .dashboard-card {
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  overflow: hidden !important;
  transition: max-height 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease !important;
}

body.home-mode .dashboard-card-head,
body.home-mode .dashboard-card-body {
  width: 100% !important;
  box-sizing: border-box !important;
}

body.home-mode .dashboard-card-body {
  min-height: 0 !important;
}

body.home-mode .dashboard-card.is-minimized,
body.home-mode .dashboard-card.minimized {
  max-height: 60px !important;
  overflow: hidden !important;
}

body.home-mode .dashboard-card.is-minimized .dashboard-card-body,
body.home-mode .dashboard-card.minimized .dashboard-card-body {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════
   COLUMN ALIGNMENT — Match reference screenshot
   ═══════════════════════════════════════════════════════ */

/* Left column: stack weather + health + water */
body.home-mode .an-dash-col-left {
  display: grid !important;
  gap: 16px !important;
  align-items: stretch !important;
}

/* Center column: rings centered */
body.home-mode .an-dash-col-center {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  padding-top: 12px !important;
}

/* Right column: news at top */
body.home-mode .an-dash-col-right {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
}

body.home-mode .an-dash-col-left > .an-accordion,
body.home-mode .an-dash-col-right > .an-accordion {
  height: 100% !important;
  margin: 0 !important;
}

body.home-mode .an-dash-col-left > .an-accordion > .an-accordion-content,
body.home-mode .an-dash-col-right > .an-accordion > .an-accordion-content {
  height: calc(100% - 48px) !important;
}

body.home-mode .an-dash-col-center > .dashboard-card,
body.home-mode .an-dash-col-right .dashboard-card,
body.home-mode .an-dash-col-left .dashboard-card {
  height: 100% !important;
}

body.home-mode .an-home-dashboard-shell > .an-accordion {
  margin: 0 !important;
}

body.home-mode .an-home-dashboard-shell .an-learning-section > .an-accordion-content {
  padding-top: 12px !important;
}

@media (max-width: 1199px) {
  body.home-mode .alive-home .an-dash-col-center {
    padding-top: 0 !important;
  }
}

@media (max-width: 899px) {
  body.home-mode .alive-home .an-news-container {
    min-height: auto !important;
  }
}
