/* ==========================================================================\n   Dashboard surgical bugfix — 2026-08-11\n   Scope: progress ring divider clearance + recent-artifacts header collision +\n          equal lower-card geometry. No other interface areas are changed.\n   ========================================================================== */

/* Keep the upper progress widget clear of its vertical divider. */
.progress-overview { min-width: 0; }
.progress-overview .progress-copy { min-width: 0; }
.progress-overview .ring-wrap {
  min-width: 0;
  box-sizing: border-box;
}

/* The three lower dashboard cards must share one baseline and one outer height. */
.dashboard-bottom {
  align-items: stretch !important;
}
.dashboard-bottom > .card {
  height: 100% !important;
  box-sizing: border-box;
}
.artifact-dashboard-card,
.dashboard-dossier-card {
  min-width: 0;
}

/* Compact desktop / laptop: the actual content width is constrained by sidebar. */
@media (min-width:1081px) and (max-width:1500px) {
  /* Progress: reserve a protected gutter between the copy divider and ring. */
  .progress-overview {
    grid-template-columns: minmax(0,.92fr) minmax(300px,1.08fr) !important;
  }
  .progress-overview .progress-copy {
    padding-right: 22px !important;
  }
  .progress-overview .ring-wrap {
    justify-content: flex-start !important;
    gap: 16px !important;
    padding-left: 24px !important;
  }
  .progress-overview .progress-ring {
    --size: 126px !important;
    flex: 0 0 var(--size) !important;
  }
  .progress-overview .ring-inner strong {
    font-size: 34px !important;
  }
  .progress-overview .legend {
    min-width: 104px;
    max-width: 122px;
    gap: 12px !important;
  }
  .progress-overview .legend-row {
    min-width: 0;
    line-height: 1.35;
  }

  /* Equal outer geometry for the three cards. */
  .dashboard-bottom > .card {
    min-height: 458px !important;
  }

  /* Recent artifacts: never allow the utility link to collide with the H2. */
  .artifact-dashboard-head {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) !important;
    grid-template-rows: auto auto !important;
    gap: 5px !important;
    margin-bottom: 12px !important;
  }
  .artifact-dashboard-head .card-title {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    max-width: none !important;
    padding-right: 0 !important;
    text-wrap: balance;
  }
  .artifact-all-link {
    grid-column: 1 !important;
    grid-row: 2 !important;
    justify-self: start !important;
    align-self: start !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 11.5px !important;
    line-height: 1.3 !important;
  }

  /* Build an identical vertical rhythm: header -> visual -> copy -> CTA. */
  .artifact-dashboard-card,
  .dashboard-dossier-card {
    display: flex !important;
    flex-direction: column !important;
  }
  .artifact-empty-content {
    flex: 1 1 auto !important;
    min-height: 0 !important;
  }
  .artifact-footer-link,
  .dashboard-dossier-action {
    margin-top: auto !important;
  }
  .dashboard-dossier-visual {
    flex: 1 1 auto !important;
  }
}

/* Narrower compact desktop: protect the ring even when the card loses width. */
@media (min-width:1081px) and (max-width:1220px) {
  .progress-overview {
    grid-template-columns: minmax(0,.88fr) minmax(278px,1.12fr) !important;
  }
  .progress-overview .ring-wrap {
    padding-left: 18px !important;
    gap: 12px !important;
  }
  .progress-overview .progress-ring { --size: 116px !important; }
  .progress-overview .ring-inner strong { font-size: 31px !important; }
  .progress-overview .legend { min-width: 96px; max-width: 108px; font-size: 10.5px !important; }
}

/* Wide desktop keeps the original reference header arrangement, but with a\n   guaranteed reserved column for the utility link. */
@media (min-width:1501px) {
  .artifact-dashboard-head {
    grid-template-columns: minmax(0,1fr) minmax(96px,auto) !important;
    column-gap: 14px !important;
  }
  .artifact-dashboard-head .card-title {
    max-width: 8.5ch !important;
  }
  .artifact-all-link {
    justify-self: end !important;
  }
}

