/* Desktop reference cards: keep upload controls and selected media in separate, stable rows. */
@media (min-width: 900px) {
  body.ip-prism-theme.ip-infinite-theme .standalone-ref-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-items: stretch;
  }

  body.ip-prism-theme.ip-infinite-theme .standalone-ref {
    display: grid;
    align-content: start;
    gap: 10px;
    min-width: 0;
    min-height: 154px;
    padding: 14px;
    overflow: hidden;
    box-sizing: border-box;
  }

  body.ip-prism-theme.ip-infinite-theme .standalone-ref > header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
    flex-wrap: nowrap;
  }

  body.ip-prism-theme.ip-infinite-theme .standalone-ref > header > strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.ip-prism-theme.ip-infinite-theme .standalone-ref > header > .upload {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: end;
    flex: 0 0 auto;
    width: 82px;
    min-width: 82px;
    max-width: 100%;
    height: 30px;
    min-height: 30px;
    padding: 5px 8px;
    box-sizing: border-box;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
  }

  body.ip-prism-theme.ip-infinite-theme .standalone-ref > header > .upload input {
    z-index: 1;
    width: 100%;
    height: 100%;
  }

  body.ip-prism-theme.ip-infinite-theme .standalone-ref > small {
    display: block;
    min-width: 0;
    min-height: 18px;
    margin: 0;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.ip-prism-theme.ip-infinite-theme .standalone-ref > .standalone-ref-row {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 24px;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 48px;
    margin: 0;
    padding-top: 10px;
    overflow: hidden;
    position: relative;
    border-top: 1px solid var(--ip-line);
    box-sizing: border-box;
  }

  body.ip-prism-theme.ip-infinite-theme .standalone-ref > .standalone-ref-row > img,
  body.ip-prism-theme.ip-infinite-theme .standalone-ref > .standalone-ref-row > video,
  body.ip-prism-theme.ip-infinite-theme .standalone-ref > .standalone-ref-row > .candidate-image,
  body.ip-prism-theme.ip-infinite-theme .standalone-ref > .standalone-ref-row > .media-empty,
  body.ip-prism-theme.ip-infinite-theme .standalone-ref > .standalone-ref-row > .image-empty {
    display: block;
    width: 48px;
    min-width: 48px;
    height: 42px;
    min-height: 42px;
    margin: 0;
    object-fit: cover;
  }

  body.ip-prism-theme.ip-infinite-theme .standalone-ref > .standalone-ref-row > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
  }

  body.ip-prism-theme.ip-infinite-theme .standalone-ref > .standalone-ref-row > button {
    justify-self: end;
    width: 24px;
    min-width: 24px;
    height: 28px;
    padding: 0;
    position: relative;
    z-index: 2;
  }
}
