/* Stage 1 changes are restricted to the desktop presentation. */
.desktop-inbox-only { display: none; }

@media (min-width: 761px) {
  .desktop-inbox-only { display: block; }
  .desktop-inbox-only[hidden],
  .desktop-queue-tabs [hidden],
  .desktop-queue-unread-count[hidden],
  .desktop-filter-count[hidden] { display: none; }
  #inbound-view > .inbound-header { display: none; }
  #inbound-view .conversation-sidebar-heading { padding: 15px 14px 11px; background: #fff; border-bottom: 0; }
  #inbound-view .desktop-inbox-title { margin: 0 0 3px; font-size: 1.25rem; letter-spacing: -.025em; }
  #inbound-view .conversation-sidebar-heading h2 { color: var(--muted); font-size: .7rem; }
  #inbound-view .conversation-sidebar-heading .inbox-compose-button { position: absolute; top: 14px; right: 95px; margin: 0; }
  #inbound-view .conversation-unread-total { display: none; }
  .desktop-conversation-more { display: inline; }

  .desktop-queue-tabs {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: 3px; min-width: 0;
    padding: 0 10px 10px; border-bottom: 1px solid var(--dialog-line);
  }
  .desktop-queue-tabs button {
    display: inline-flex; align-items: center; justify-content: flex-start; gap: 4px;
    min-width: 0; min-height: 33px; padding: 6px 7px; border: 0;
    border-radius: 8px; background: transparent; color: #697188;
    font: inherit; font-size: .72rem; white-space: nowrap; cursor: pointer;
  }
  .desktop-queue-tabs button:hover { background: #f5f4fe; color: #4f4abb; }
  .desktop-queue-tabs button[aria-pressed="true"] { background: #efedff; color: #514bd1; font-weight: 700; }
  .desktop-queue-unread-count {
    display: inline-grid; min-width: 18px; height: 18px; padding: 0 5px;
    place-items: center; border-radius: 999px; background: #ebe8ff;
    color: #554ddd; font-size: .64rem; font-weight: 700;
  }
  #inbound-view .conversation-sidebar { position: relative; }
  #inbound-view .conversation-tools {
    position: absolute; z-index: 12; top: 14px; right: 12px;
    align-items: center; margin: 0;
  }
  #inbound-view .conversation-filter-menu { flex: 0 0 36px; }
  #inbound-view .conversation-filter-menu > summary {
    position: relative; display: grid; width: 36px; height: 34px; padding: 0;
    place-items: center; border-color: #e3e5ef; border-radius: 8px;
    color: #4e5570; background: #fff; list-style: none;
  }
  #inbound-view .conversation-filter-menu > summary::-webkit-details-marker { display: none; }
  #inbound-view .conversation-filter-menu > summary:hover,
  #inbound-view .conversation-filter-menu[open] > summary { background: #f2f0ff; color: #554ddd; }
  #inbound-view .conversation-filter-menu > summary svg.desktop-inbox-only {
    display: block; width: 17px; height: 17px; fill: none;
    stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round;
  }
  #inbound-view #conversation-filter-label {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  .desktop-filter-count {
    position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px;
    padding: 1px 3px; border-radius: 999px; background: #6659e5;
    color: #fff; font-size: .58rem; line-height: 14px; text-align: center;
  }
  #inbound-view .conversation-filter-options { left: auto; right: 0; width: 255px; }
  #inbound-view .desktop-inbox-popover { left: auto; right: 0; width: 255px; }
  .desktop-active-filters {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    margin: -2px 12px 9px; padding: 6px 9px; border-radius: 7px;
    background: #f6f4ff; color: #5550b5; font-size: .68rem;
  }
  .desktop-active-filters span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .desktop-active-filters button { border: 0; background: transparent; color: #514bd1; cursor: pointer; font: inherit; white-space: nowrap; }
  #inbound-view .conversation-item { grid-template-columns: 38px minmax(0, 1fr); min-height: 75px; gap: 10px; padding: 10px 12px; }
  #inbound-view .conversation-item-avatar { width: 38px; height: 38px; font-size: .72rem; box-shadow: none; }
  #inbound-view .conversation-item-heading strong { font-size: .79rem; font-weight: 650; }
  #inbound-view .conversation-item.is-unread .conversation-item-heading strong { font-weight: 750; }
  #inbound-view .conversation-item-heading time { font-size: .65rem; }
  #inbound-view .conversation-item-preview { margin-top: 3px; font-size: .73rem; }
  #inbound-view .conversation-item-badges { margin-top: 5px; gap: 4px; }
  #inbound-view .conversation-crm-badge,
  #inbound-view .conversation-channel-badge,
  #inbound-view .conversation-status-label { height: 17px; padding-inline: 5px; font-size: .61rem; }
  #inbound-view .conversation-status-label.needs-reply { border-color: #f2e2ba; background: #fff8e8; color: #896116; }
  #inbound-view .conversation-item.is-unread .conversation-item-badges { padding-right: 25px; }
  #inbound-view .conversation-unread-badge { right: 12px; bottom: 10px; box-shadow: none; }
  .desktop-queue-tabs button:focus-visible,
  .desktop-active-filters button:focus-visible,
  #inbound-view .conversation-filter-menu > summary:focus-visible { outline: 2px solid #6459e5; outline-offset: 2px; }

  .desktop-inbox-menu { flex: 0 0 34px; }
  .desktop-inbox-menu > summary {
    display: grid; place-items: center; min-height: 29px; border: 1px solid var(--line);
    border-radius: 8px; font-size: 20px; line-height: 1; cursor: pointer; list-style: none;
  }
  .desktop-inbox-menu > summary::-webkit-details-marker { display: none; }
  .desktop-inbox-menu[open] > summary { background: var(--dialog-accent-soft); color: var(--dialog-accent-strong); }
  .desktop-inbox-popover {
    position: absolute; z-index: 8; top: calc(100% + 5px); left: 0; right: 0;
    padding: 6px; background: white; border: 1px solid var(--line); border-radius: 10px;
    box-shadow: 0 8px 24px rgb(54 52 103 / 12%);
  }
  #inbound-view .desktop-inbox-popover .button {
    width: 100%; min-height: 38px; padding: 9px; border: 0; border-radius: 7px;
    justify-content: flex-start; text-align: left; white-space: normal; font-size: .78rem;
  }
  .desktop-inbox-popover .button:hover { background: var(--dialog-accent-soft); }
  .desktop-inbox-popover svg { display: none; }
  .desktop-bulk-read-hint { padding: 4px 9px 8px; margin: 0; font-size: .7rem; line-height: 1.45; }
  .desktop-inbox-popover #mark-all-inbound-read[hidden] + .desktop-bulk-read-hint { display: none; }

  #inbox-preferences-dialog { width: min(660px, calc(100vw - 48px)); max-height: calc(100dvh - 48px); }
  #inbox-preferences-dialog .dialog-card { padding: 24px; gap: 12px; }
  #inbox-preferences-dialog h2 { font-size: 1.35rem; margin-bottom: 8px; }
  #inbox-preferences-dialog .desktop-preferences-intro { margin: 0 0 4px; font-size: .8rem; line-height: 1.5; }
  .desktop-preference-sections { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  .desktop-preference-sections button { padding: 9px 12px; border: 0; border-radius: 8px; background: #f5f5f8; color: var(--muted); font: inherit; font-size: .82rem; cursor: pointer; }
  .desktop-preference-sections button[aria-pressed="true"] { background: #efedff; color: #554ddd; }
  #inbox-preferences-dialog .desktop-preference-inactive,
  #inbox-preferences-dialog #working-hours-open { display: none; }
  #inbox-preferences-dialog .check-field { margin: 0; padding: 6px 0; }
  #inbox-preferences-dialog .check-field small { line-height: 1.45; }
  #inbox-preferences-dialog .notification-colors-settings { margin: 6px 0 0; }
  #inbox-preferences-dialog .notification-color-row { grid-template-columns: minmax(130px, .9fr) 42px minmax(0, 1.5fr); font-size: .8rem; }
  #inbox-preferences-dialog .notification-color-preview { grid-column: auto; }
  #inbox-preferences-dialog #inbox-notifications-toggle { margin: 8px 0; padding: 9px 12px; font-size: .85rem; }
  #inbox-preferences-dialog #desktop-inbox-notifications-status { margin: 0 0 22px; font-size: .8rem; line-height: 1.5; }
  #inbox-preferences-dialog form > button[type="submit"] { margin-top: 18px; }
  .desktop-school-hours { margin-top: 16px; }
}

@media (min-width: 761px) and (max-width: 1000px) {
  .desktop-queue-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; }
  .desktop-queue-tabs button { justify-content: flex-start; }
}
