/* today390: staff Today dashboard at phone width only. Desktop (>=391) is unchanged.
   Selectors are more specific than the JS-injected mk794/pgm5r7/ct1105 rules. */
@media (max-width: 390px) {
  html,
  body,
  html body #root {
    overflow-x: clip !important;
  }

  html body main.mk794-dm {
    overflow-x: clip !important;
    max-width: 100%;
    min-width: 0;
  }

  /* (1) Create Project stays in the header row or stacks below — never over the heading. */
  html body main.mk794-dm > section.mk794-dh {
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    row-gap: 10px !important;
    column-gap: 10px !important;
  }
  html body main.mk794-dm > section.mk794-dh > div:first-child {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    position: relative !important;
    z-index: 1;
    overflow: hidden;
  }
  html body main.mk794-dm > section.mk794-dh > button.cpb1101,
  html body main.mk794-dm > section.mk794-dh > button {
    position: static !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    inset: auto !important;
    float: none !important;
    z-index: auto !important;
    flex: 0 0 auto !important;
    margin-left: 0 !important;
    max-width: 100%;
  }

  /* (2) Stat tiles: 2x2, min-width 0, label under count, 12px, ellipsis. */
  html body main.mk794-dm > section.mk794-ds {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    gap: 8px !important;
  }
  html body main.mk794-dm > section.mk794-ds > button {
    min-width: 0 !important;
    max-width: 100% !important;
    width: auto !important;
    display: flex !important;
    flex-direction: column-reverse !important;
    align-items: center !important;
    overflow: hidden !important;
  }
  html body main.mk794-dm > section.mk794-ds > button > div:first-child {
    font-size: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-align: center;
  }
  html body main.mk794-dm > section.mk794-ds > button > div:first-child::after {
    content: attr(data-mk-s);
    display: block !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    letter-spacing: 0 !important;
    font-weight: 600;
    text-transform: none;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100%;
  }

  /* (3) Day chips: even columns, count inside each chip, selected chip not clipped. */
  html body main.mk794-dm > section.mk794-dc.pgm5r7-seg,
  html body main.mk794-dm > section.mk794-dc {
    display: flex !important;
    flex-direction: row-reverse !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }
  html body main.mk794-dm > section.mk794-dc.pgm5r7-seg > button.pgm5r7-sg,
  html body main.mk794-dm > section.mk794-dc > button {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    max-width: none !important;
    justify-content: center !important;
    overflow: hidden !important;
    padding: 8px 4px !important;
  }
  html body main.mk794-dm > section.mk794-dc .pgm5r7-sgl {
    min-width: 0 !important;
    max-width: 100%;
    overflow: hidden;
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
  }
  html body main.mk794-dm > section.mk794-dc .pgm5r7-sgc {
    display: inline-flex !important;
    flex: 0 0 auto;
    font-size: 11px !important;
    padding: 1px 6px !important;
  }

  /* (4) Projects-count line is full width above the controls. */
  html body .ct1105-bar {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
    column-gap: 8px !important;
    row-gap: 8px !important;
  }
  html body .ct1105-bar > div:first-child {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    white-space: normal !important;
  }
  html body .ct1105-bar .ct1105-actions {
    flex: 1 1 100% !important;
    width: 100% !important;
    justify-content: flex-end !important;
  }
}
