/* Track Mishnah UI 2.17.16
 * Compact dashboard stack, flowing My Learning actions, stronger feedback CTA.
 * Presentation-only: no database/schema, assignment, reminder, permission,
 * export, or messaging-data behavior changes.
 */

@media (min-width: 1220px) {
  /* Keep the four summary cards visible together. The right My Learning pane
   * remains the independently scrollable work surface; the left stack itself
   * should not need a scrollbar. */
  body.app-theme-jewel .dashboard-primary-workspace {
    --tm-dashboard-workspace-height: clamp(610px, calc(100vh - 42px), 710px);
    grid-template-columns: minmax(350px, .76fr) minmax(0, 2.18fr);
    gap: 9px;
  }

  body.app-theme-jewel .dashboard-primary-workspace > .project-overview {
    height: auto !important;
    min-height: 0;
    gap: 5px;
    overflow: visible !important;
    scrollbar-gutter: auto;
  }

  body.app-theme-jewel .dashboard-primary-workspace .project-overview-heading {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 4px 7px;
    padding: 7px 8px;
  }

  body.app-theme-jewel .dashboard-primary-workspace .project-overview-identity {
    gap: 7px;
  }

  body.app-theme-jewel .dashboard-primary-workspace .project-overview-photo {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 7px;
  }

  body.app-theme-jewel .dashboard-primary-workspace .project-context-row {
    gap: 3px 6px;
  }

  body.app-theme-jewel .dashboard-primary-workspace .project-overview h1 {
    font-size: 1.22rem;
    line-height: 1.03;
  }

  body.app-theme-jewel .dashboard-primary-workspace .project-memorial-name {
    margin-top: 1px;
    font-size: .74rem;
    line-height: 1.18;
  }

  body.app-theme-jewel .dashboard-primary-workspace .overview-start-date,
  body.app-theme-jewel .dashboard-primary-workspace .overview-deadline {
    margin-top: 2px;
    font-size: .54rem;
    line-height: 1.28;
  }

  body.app-theme-jewel .dashboard-primary-workspace .overview-deadline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1px 5px;
  }

  body.app-theme-jewel .dashboard-primary-workspace .deadline-pill {
    padding: 2px 5px;
  }

  body.app-theme-jewel .dashboard-primary-workspace .project-overview-heading > .button {
    min-height: 29px;
    margin: 0;
    padding: 4px 8px;
    font-size: .6rem;
    white-space: nowrap;
  }

  body.app-theme-jewel .dashboard-primary-workspace .dashboard-command-grid {
    gap: 5px;
  }

  body.app-theme-jewel .dashboard-primary-workspace .dashboard-command-card {
    gap: 3px;
    padding: 6px 8px;
  }

  body.app-theme-jewel .dashboard-primary-workspace .dashboard-card-heading {
    gap: 5px;
    margin: 0;
    padding-bottom: 3px;
  }

  body.app-theme-jewel .dashboard-primary-workspace .dashboard-card-heading h2 {
    font-size: .79rem;
    line-height: 1.08;
  }

  body.app-theme-jewel .dashboard-primary-workspace .dashboard-card-link-cue {
    font-size: .5rem;
  }

  body.app-theme-jewel .dashboard-primary-workspace .continue-learning-main {
    gap: 5px;
  }

  body.app-theme-jewel .dashboard-primary-workspace .continue-progress-number,
  body.app-theme-jewel .dashboard-primary-workspace .personal-progress-percent {
    font-size: 1.08rem;
    line-height: 1;
  }

  body.app-theme-jewel .dashboard-primary-workspace .continue-learning-copy {
    gap: 2px;
  }

  body.app-theme-jewel .dashboard-primary-workspace .continue-learning-copy h3 {
    font-size: .8rem;
    line-height: 1.05;
  }

  body.app-theme-jewel .dashboard-primary-workspace .continue-learning-copy p,
  body.app-theme-jewel .dashboard-primary-workspace .personal-progress-lead,
  body.app-theme-jewel .dashboard-primary-workspace .personal-goal-note,
  body.app-theme-jewel .dashboard-primary-workspace .progress-segment-legend,
  body.app-theme-jewel .dashboard-primary-workspace .progress-legend,
  body.app-theme-jewel .dashboard-primary-workspace .project-progress-primary span {
    font-size: .5rem;
    line-height: 1.2;
  }

  body.app-theme-jewel .dashboard-primary-workspace .continue-learning-copy .button {
    min-height: 28px;
    padding: 4px 8px;
    font-size: .57rem;
  }

  body.app-theme-jewel .dashboard-primary-workspace .continue-learning-stats,
  body.app-theme-jewel .dashboard-primary-workspace .personal-goal-stats {
    margin: 0;
  }

  body.app-theme-jewel .dashboard-primary-workspace .continue-learning-stats div,
  body.app-theme-jewel .dashboard-primary-workspace .personal-goal-stats div,
  body.app-theme-jewel .dashboard-primary-workspace .project-progress-card .progress-metrics article {
    padding: 3px 4px;
  }

  body.app-theme-jewel .dashboard-primary-workspace .continue-learning-stats dt,
  body.app-theme-jewel .dashboard-primary-workspace .personal-goal-stats dt,
  body.app-theme-jewel .dashboard-primary-workspace .project-progress-card .progress-metrics article span {
    font-size: .43rem;
  }

  body.app-theme-jewel .dashboard-primary-workspace .continue-learning-stats dd,
  body.app-theme-jewel .dashboard-primary-workspace .personal-goal-stats dd,
  body.app-theme-jewel .dashboard-primary-workspace .project-progress-card .progress-metrics article strong {
    margin-top: 1px;
    font-size: .66rem;
    line-height: 1;
  }

  body.app-theme-jewel .dashboard-primary-workspace .personal-dashboard-heading {
    gap: 5px;
  }

  body.app-theme-jewel .dashboard-primary-workspace .personal-dashboard-main,
  body.app-theme-jewel .dashboard-primary-workspace .personal-dashboard-details {
    gap: 3px !important;
  }

  body.app-theme-jewel .dashboard-primary-workspace .personal-goal-note {
    margin: 1px 0 0;
  }

  body.app-theme-jewel .dashboard-primary-workspace .progress-track,
  body.app-theme-jewel .dashboard-primary-workspace .personal-progress-track,
  body.app-theme-jewel .dashboard-primary-workspace .continue-progress-track {
    height: 5px;
  }

  body.app-theme-jewel .dashboard-primary-workspace .progress-segment-legend,
  body.app-theme-jewel .dashboard-primary-workspace .progress-legend {
    gap: 5px;
    margin-top: 1px;
  }

  body.app-theme-jewel .dashboard-primary-workspace .project-progress-primary p {
    gap: 1px;
    padding-block: 0 3px;
  }

  body.app-theme-jewel .dashboard-primary-workspace .project-progress-primary p + p {
    padding-left: 8px;
  }

  body.app-theme-jewel .dashboard-primary-workspace .project-progress-primary strong {
    font-size: 1.04rem;
  }

  body.app-theme-jewel .dashboard-primary-workspace .project-progress-card .progress-overview-row {
    margin: 0;
  }

  body.app-theme-jewel .dashboard-primary-workspace .project-progress-card .progress-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
  }

  /* Quick actions should belong to the card, not look like a permanent action
   * column. When there are no actions, no empty action space remains. */
  body.app-theme-jewel .dashboard-primary-workspace > #my-learning .claim-group-card-shell,
  body.app-theme-jewel .dashboard-primary-workspace > #my-learning .claim-group-card-shell:not(:has(.claim-group-card[open])) {
    position: relative;
    display: block !important;
    grid-template-columns: none !important;
  }

  body.app-theme-jewel .dashboard-primary-workspace > #my-learning .claim-group-quick-actions {
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 2;
    width: auto !important;
    min-width: 0 !important;
    max-width: min(48%, 330px);
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    padding: 0;
    border: 0 !important;
    border-radius: 0;
    background: transparent !important;
  }

  body.app-theme-jewel .dashboard-primary-workspace > #my-learning .claim-group-quick-actions form,
  body.app-theme-jewel .dashboard-primary-workspace > #my-learning .claim-group-quick-actions .button {
    width: auto !important;
    max-width: 100%;
  }

  body.app-theme-jewel .dashboard-primary-workspace > #my-learning .claim-group-quick-actions .button {
    min-height: 28px;
    padding: 4px 7px;
    white-space: nowrap;
    font-size: .55rem;
    line-height: 1.1;
  }

  body.app-theme-jewel .dashboard-primary-workspace > #my-learning .claim-group-card-shell:has(.claim-group-quick-actions) .claim-group-summary {
    padding-right: 116px;
    padding-bottom: 10px;
  }

  body.app-theme-jewel .dashboard-primary-workspace > #my-learning .claim-group-card-shell:has(.claim-group-quick-actions form + form) .claim-group-summary {
    padding-right: 248px;
  }

  /* Make the utility feedback action read as an intentional CTA instead of
   * one more quiet sidebar row. */
  body.app-theme-jewel .tm-sidebar-utilities > a.tm-sidebar-utility[href^="/feedback"] {
    color: #fff9ec;
    border-color: #d5af52;
    background: #956f18;
    box-shadow: 0 3px 10px rgb(0 0 0 / 16%);
    font-weight: 850;
  }

  body.app-theme-jewel .tm-sidebar-utilities > a.tm-sidebar-utility[href^="/feedback"] img {
    filter: brightness(0) invert(1) !important;
    opacity: 1;
  }

  body.app-theme-jewel .tm-sidebar-utilities > a.tm-sidebar-utility[href^="/feedback"]:hover,
  body.app-theme-jewel .tm-sidebar-utilities > a.tm-sidebar-utility[href^="/feedback"][aria-current="page"] {
    color: #fffdf8;
    border-color: #f0cf79;
    background: #ad8322;
    box-shadow: 0 4px 14px rgb(0 0 0 / 22%);
  }
}

/* Avoid bringing the desktop floating action treatment into narrower layouts;
 * those screens keep the existing stacked action block. */
@media (max-width: 1219px) {
  body.app-theme-jewel .dashboard-primary-workspace > #my-learning .claim-group-quick-actions {
    position: static;
  }
}
