.mobile-back,
.mobile-details,
.mobile-details-close {
  display: none;
}

.details-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.details-heading h2 {
  margin: 0;
}

.queue > *,
.panel-heading,
.filters,
.conversation-list,
.conversation-card,
.card-top,
.card-meta {
  min-width: 0;
  max-width: 100%;
}

.filters {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.filters input,
.filters select {
  width: 100%;
  min-width: 0;
}

.conversation-list,
.conversation-card {
  width: 100%;
}

.card-origin {
  flex: 1 1 auto;
}

.mini-status {
  max-width: 52%;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 721px) {
  .app {
    height: 100vh;
    min-height: 0;
  }

  .workspace {
    height: auto;
    min-height: 0;
  }
}

@media (max-width: 1200px) and (min-width: 721px) {
  .workspace {
    grid-template-columns: minmax(280px, 330px) minmax(420px, 1fr);
  }

  .details {
    display: none;
  }
}

@media (max-width: 720px) {
  body {
    height: 100dvh;
    overflow: hidden;
    background: #fff;
  }

  .app {
    height: 100dvh;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  .topbar {
    min-height: 62px;
    align-items: center;
    padding: 9px 12px;
  }

  .topbar .eyebrow {
    font-size: 9px;
  }

  .topbar h1 {
    font-size: 17px;
  }

  .topbar nav {
    font-size: 12px;
  }

  .workspace {
    height: auto;
    min-height: 0;
    display: block;
    overflow: hidden;
    background: #fff;
  }

  .queue {
    display: grid;
    height: 100%;
    max-height: none;
    border: 0;
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .panel-heading {
    padding: 13px 14px;
  }

  .filters {
    padding: 10px;
  }

  .conversation-list {
    max-height: none;
    min-height: 0;
    overflow: auto;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .conversation {
    display: none;
    height: 100%;
    min-height: 0;
  }

  .workspace.show-conversation .queue {
    display: none;
  }

  .workspace.show-conversation .conversation {
    display: grid;
  }

  .conversation-content {
    height: 100%;
    min-height: 0;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }

  .conversation-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 10px 12px;
    padding: 10px 12px;
  }

  .conversation-header > div:first-of-type {
    min-width: 0;
  }

  .conversation-header h2 {
    font-size: 17px;
  }

  .conversation-header p {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .conversation-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-start;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 2px;
    flex-wrap: nowrap;
  }

  .conversation-actions > * {
    flex: 0 0 auto;
  }

  .status-pill {
    width: auto;
  }

  .mobile-back,
  .mobile-details,
  .mobile-details-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-back {
    border: 0;
    background: #edf4f8;
    color: var(--navy);
    border-radius: 10px;
    padding: 8px 9px;
    font-weight: 800;
    cursor: pointer;
  }

  .quote-summary {
    padding: 7px 10px;
  }

  .messages {
    min-height: 0;
    padding: 11px 10px 16px;
  }

  .message-bubble {
    max-width: 90%;
  }

  .composer {
    position: sticky;
    bottom: 0;
    padding: 9px 10px calc(9px + env(safe-area-inset-bottom));
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
  }

  .composer textarea {
    min-height: 46px;
    max-height: 110px;
    resize: none;
  }

  .composer span {
    line-height: 1.35;
  }

  .details {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 30;
    background: #fff;
    padding: 18px 16px calc(24px + env(safe-area-inset-bottom));
    overflow: auto;
  }

  .workspace.show-details .details {
    display: block;
  }

  .details-heading {
    position: sticky;
    top: -18px;
    background: #fff;
    padding: 14px 0 10px;
    z-index: 1;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 420px) {
  .topbar nav {
    gap: 8px;
  }

  .topbar nav a {
    display: none;
  }

  .topbar .text-button {
    padding: 7px;
  }

  .conversation-actions .primary,
  .conversation-actions .secondary {
    padding: 8px 9px;
    font-size: 11px;
  }

  .message-bubble {
    max-width: 94%;
  }

  .composer button {
    padding: 10px 12px;
  }

  .filters {
    grid-template-columns: minmax(0, 1fr);
  }
}
