/* Keep desktop's anchored account menu; the same native dialog becomes a sheet. */
#inbox-tools-open,
.inbox-tools-menu button > span,
.account-menu-heading,
.account-menu-hint,
.account-option-state,
.account-option-check {
  display: none;
}

.inbox-tools-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}
.inbox-tools-menu .icon-button svg,
#new-chat svg,
#inbox-tools-open svg,
.workspace-mobile-nav svg,
.account-menu-search svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
dialog.account-menu {
  margin: 0;
  width: 100%;
  max-width: none;
  color: var(--ink);
}
#account-menu-options [role="option"] {
  width: 100%;
}
.account-menu-empty {
  padding: 18px 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.account-menu-empty[hidden] {
  display: none;
}
.account-menu-platforms button {
  display: flex;
  align-items: center;
  gap: 6px;
}
.account-menu-platforms button[hidden] {
  display: none;
}

/* Separate platform controls from the horizontally scrollable chat folders. */
.workspace {
  --inbox-safe-top: env(safe-area-inset-top, 0px);
  --inbox-safe-bottom: env(safe-area-inset-bottom, 0px);
}
.account-compact-label,
#inbox-search-summary {
  display: none;
}
#workspace .filter-tabs button .chat-filter-name {
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}
#inbox-folder-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}
#inbox-folder-toggle > svg {
  display: none;
}
#inbox-folder-toggle:disabled {
  color: inherit;
  opacity: 1;
  cursor: default;
}
.inbox-tools-dialog:not([open]) {
  display: none;
}

@media (max-width: 720px) {
  #dialog {
    /* The keyboard can pan the visual viewport without resizing the page. */
    --panel-top: calc(
      env(safe-area-inset-top, 0px) + var(--assistant-viewport-top, 0px)
    );
    --panel-keyboard-bottom: max(
      0px,
      calc(
        100dvh - var(--assistant-viewport-height, 100dvh) -
          var(--assistant-viewport-top, 0px)
      )
    );
    --panel-bottom: var(--panel-keyboard-bottom);
    --panel-available-height: calc(
      100dvh - var(--panel-top) - var(--panel-bottom)
    );
  }
  /* Full-screen assistant/order headers and the export sheet already reserve the top inset. */
  #dialog[open]:not(
      .assistant-dialog,
      .order-center-dialog,
      .customer-export-dialog
    ) {
    top: var(--panel-top);
    bottom: var(--panel-bottom);
    max-height: min(
      var(--panel-height-limit, 94dvh),
      var(--panel-available-height)
    );
  }
  #dialog .dialog-header #dialog-close {
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    margin-inline-start: auto;
    border: 1px solid #456071;
    border-radius: 10px;
    background: #2b4352;
    color: var(--text);
    font-size: 24px;
    line-height: 1;
  }
  #dialog .dialog-header,
  .workspace-more-menu {
    touch-action: pan-y pinch-zoom;
  }
  .workspace > .inbox {
    position: relative;
    padding-top: var(--inbox-safe-top);
    background: #12212b;
  }
  .inbox-top {
    display: grid;
    grid-template-columns: 188px minmax(0, 1fr);
    gap: 4px 10px;
    padding: 0 12px;
  }
  .inbox-top > .inbox-header {
    position: relative;
    grid-area: 1 / 1 / 2 / -1;
    min-height: 44px;
    gap: 8px;
  }
  .inbox-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
  }
  .inbox-top .inbox-header h1 {
    font-size: 24px;
    line-height: 1.25;
    flex: none;
  }
  #inbox-folder-toggle {
    min-height: 44px;
    max-width: 132px;
  }
  .inbox-folder-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .inbox-heading #connection {
    min-width: 0;
    color: var(--green);
    font-size: 10px;
    line-height: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .inbox-heading #connection.offline {
    color: var(--danger);
  }
  .inbox-heading #connection i {
    width: 6px;
    height: 6px;
    flex: none;
    background: currentColor;
  }
  .inbox-top .header-actions {
    flex: none;
    gap: 0;
  }
  #inbox-tools-open {
    display: inline-grid;
    place-items: center;
  }
  .inbox-top .new-chat {
    background: transparent;
    color: #75e9bd;
  }
  .inbox-top > .inbox-channel-filter {
    grid-area: 2 / 1;
  }
  .inbox-channel-filter {
    display: grid;
    grid-template-columns: repeat(4, minmax(44px, 1fr));
    gap: 4px;
    margin: 0;
  }
  .inbox-channel-filter button {
    width: 100%;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    justify-content: center;
    font-size: 13px;
  }
  .inbox-channel-filter button > span {
    display: none;
  }
  .inbox-channel-filter .platform-icon {
    width: 23px;
    height: 23px;
  }
  .inbox-channel-filter button[aria-pressed="true"] {
    border-color: #385d55;
    background: #203d36;
    color: #93efca;
    font-weight: 750;
  }
  .inbox-top > .account-filter {
    grid-area: 2 / 2;
  }
  .inbox-top > .account-filter,
  #mobile-tools-filters-slot > .account-filter {
    display: block;
    min-width: 0;
    padding: 0;
  }
  :is(.inbox-top, #mobile-tools-filters-slot) #account-filter-button {
    position: relative;
    width: 100%;
    height: 44px;
    min-height: 44px;
    padding: 0 10px;
    gap: 5px;
    border: 1px solid #304956;
    border-radius: 10px;
    background: #1b2e39;
    justify-content: space-between;
    font-size: 13px;
  }
  :is(.inbox-top, #mobile-tools-filters-slot)
    #account-filter-button
    .account-avatar {
    display: none;
  }
  :is(.inbox-top, #mobile-tools-filters-slot)
    #account-filter-button
    .account-option-info {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .account-compact-label {
    display: flex;
    align-items: baseline;
    min-width: 0;
    gap: 5px;
    white-space: nowrap;
  }
  .account-compact-label > span { overflow: hidden; text-overflow: ellipsis; }
  .account-compact-label small { flex: none; color: var(--muted); font-size: 12px; }
  .account-filter > .account-presence {
    display: none;
  }
  .inbox > .filter-tabs {
    height: 57px;
    min-height: 57px;
    gap: 4px;
    padding: 6px 12px;
    align-items: center;
  }
  .inbox .filter-tabs .chat-filter-scroll {
    gap: 8px;
    padding: 0;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    scroll-padding-inline: 2px;
  }
  .inbox .chat-filter-scroll::-webkit-scrollbar {
    display: none;
  }
  .inbox .filter-tabs [data-filter] {
    min-height: 44px;
    max-width: 72vw;
    padding: 6px 12px;
    border: 1px solid transparent;
    border-radius: 22px;
    background: #1c303c;
    color: #b6cad8;
    font-size: 12px;
  }
  .inbox .filter-tabs [data-filter].selected {
    border-color: #3e7664;
    background: #214b3d;
    color: #9af0cd;
  }
  .inbox .filter-tabs .chat-filter-name {
    min-width: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .inbox .filter-tabs button.selected span {
    background: #0c6e5540;
    color: inherit;
  }
  .inbox .filter-tabs .chat-list-add {
    display: none;
  }
  #inbox-search-summary:not([hidden]) {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: center;
    gap: 8px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: #b5f3da;
  }
  #inbox-search-summary [data-inbox-search-label] {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0;
    background: transparent;
    color: inherit;
    font-size: 12px;
  }
  #inbox-search-summary #inbox-search-clear {
    width: 44px;
    min-height: 44px;
    padding: 0;
    font-size: 22px;
  }
  .inbox[data-search-active="true"] > .filter-tabs > .chat-filter-scroll {
    display: none;
  }
  .inbox[data-short-screen="true"] #inbox-folder-toggle > svg {
    display: block;
    width: 16px;
    height: 16px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
  }
  .inbox[data-short-screen="true"] .inbox-top {
    row-gap: 2px;
  }
  .inbox[data-short-screen="true"] > .filter-tabs {
    display: none;
    position: absolute;
    top: calc(var(--inbox-safe-top) + 98px);
    right: 10px;
    left: 10px;
    z-index: 40;
    height: auto;
    min-height: 56px;
    padding: 6px;
    border: 1px solid #375260;
    border-radius: 12px;
    background: #1b303d;
    box-shadow: 0 10px 24px #0006;
  }
  .inbox[data-short-screen="true"][data-folder-open="true"] > .filter-tabs {
    display: flex;
  }
  .inbox[data-tiny-screen="true"] > .filter-tabs {
    top: calc(var(--inbox-safe-top) + 48px);
  }
  .inbox[data-short-screen="true"][data-search-active="true"]
    .inbox-folder-title::after {
    content: " · 搜索";
    font-size: 11px;
  }
  .inbox > .inbox-footer {
    min-height: 0;
    padding: 0;
  }
  .inbox .conversation-item {
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }
  .inbox .conversation-list {
    --conversation-row-height: 80px;
    padding: 0 8px;
  }
  .inbox .conversation-window .conversation-item {
    padding: 7px 8px;
    gap: 11px;
    border-radius: 0;
    border-bottom: 1px solid #263c48;
    align-items: center;
  }
  .inbox .conversation-item .contact-avatar {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }
  .inbox .conversation-line strong {
    font-size: 15px;
  }
  .inbox .conversation-preview {
    font-size: 13px;
  }
  .inbox .conversation-line time {
    font-size: 11px;
  }
  .inbox .conversation-account {
    font-size: 11px;
    margin-top: 2px;
  }
  .inbox .conversation-account > span:first-child {
    display: block;
    line-height: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
  }
  .workspace-mobile-nav {
    height: calc(50px + var(--inbox-safe-bottom));
    padding: 2px 8px calc(3px + var(--inbox-safe-bottom));
    background: #14232d;
    border-color: #2c4350;
  }
  .workspace-mobile-nav button {
    min-height: 44px;
    gap: 2px;
    font-size: 10px;
  }
  .workspace-mobile-nav button.active {
    color: #75e9bd;
  }
  .workspace-mobile-nav svg {
    width: 20px;
    height: 20px;
  }
  .inbox-tools-dialog {
    position: fixed;
    inset: auto 0 var(--inbox-sheet-bottom, 0px);
    width: 100%;
    max-width: 560px;
    max-height: calc(var(--inbox-sheet-height, 100dvh) - 16px);
    margin: 0 auto;
    padding: 10px 16px max(12px, env(safe-area-inset-bottom));
    border: 1px solid #304956;
    border-bottom: 0;
    border-radius: 20px 20px 0 0;
    background: #192d38;
    color: var(--ink);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .inbox-tools-dialog::backdrop {
    background: #060d14ad;
  }
  .inbox-tools-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 0 0 12px;
  }
  .inbox-tools-heading h2 {
    margin: 0;
    font-size: 20px;
  }
  #inbox-tools-close {
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    font-size: 27px;
  }
  .inbox-tools-search {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  #mobile-tools-search-slot {
    min-width: 0;
    flex: 1;
  }
  #mobile-tools-search-slot .search {
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0 10px;
    gap: 7px;
    border: 1px solid #385462;
    border-radius: 10px;
    background: #213945;
  }
  #mobile-tools-search-slot .search svg {
    width: 18px;
    height: 18px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
  }
  #mobile-tools-search-slot input {
    min-width: 0;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--ink);
    font-size: 16px;
  }
  #inbox-tools-search-submit {
    height: 44px;
    min-width: 56px;
    padding: 0 12px;
  }
  #mobile-tools-filters-slot:empty {
    display: none;
  }
  #mobile-tools-filters-slot:not(:empty) {
    display: grid;
    grid-template-columns: 188px minmax(0, 1fr);
    gap: 8px;
    margin-top: 12px;
  }
  .inbox-tools-section-label {
    margin: 18px 0 10px;
    color: #9bb3c1;
    font-size: 12px;
  }
  #mobile-tools-actions-slot {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  #mobile-tools-actions-slot .icon-button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    min-height: 58px;
    height: auto;
    padding: 12px;
    border: 1px solid #304956;
    border-radius: 12px;
    background: #203642;
  }
  #mobile-tools-actions-slot .icon-button.hidden {
    display: none;
  }
  #mobile-tools-actions-slot .icon-button > span {
    display: inline;
    white-space: nowrap;
    font-size: 14px;
  }
  #mobile-tools-actions-slot svg,
  #inbox-tools-list-manage svg {
    width: 21px;
    height: 21px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  #inbox-tools-list-manage {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 64px;
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid #304956;
    border-radius: 12px;
    background: #203642;
    text-align: left;
  }
  #inbox-tools-list-manage > span:first-of-type {
    min-width: 0;
    flex: 1;
    display: grid;
    gap: 3px;
  }
  #inbox-tools-list-manage strong {
    font-size: 14px;
    font-weight: 600;
  }
  #inbox-tools-list-manage small {
    font-size: 11px;
    color: #9bb3c1;
  }
  .inbox-tools-connection {
    margin: 16px 0 0;
    font-size: 11px;
    color: #75e9bd;
  }
  .inbox-tools-connection.offline {
    color: var(--danger);
  }
  #mobile-tools-extra-slot:empty {
    display: none;
  }
  #mobile-tools-extra-slot
    :is(.archive-entry, #install-button):not([hidden]):not(.hidden) {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    margin-top: 10px;
    padding: 8px 12px;
    text-align: left;
    border: 1px solid #304956;
    border-radius: 10px;
    background: #203642;
  }
  dialog.account-menu {
    position: fixed;
    top: auto;
    right: 0;
    bottom: var(--inbox-sheet-bottom, 0px);
    left: 0;
    width: 100%;
    max-width: 560px;
    max-height: min(calc(var(--inbox-sheet-height, 100dvh) * 0.88), 900px);
    margin: 0 auto;
    padding: 0 0 env(safe-area-inset-bottom);
    border: 1px solid #304956;
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
    background: #192d38;
    box-shadow: 0 -8px 40px #0005;
    overflow: hidden;
  }
  dialog.account-menu[open] {
    display: flex;
    flex-direction: column;
  }
  dialog.account-menu::backdrop {
    background: #060d14ad;
  }
  .account-menu .account-menu-heading {
    display: block;
    flex: none;
    padding: 10px 16px 8px;
  }
  .account-sheet-handle {
    display: block;
    width: 40px;
    height: 4px;
    margin: 0 auto 8px;
    border-radius: 4px;
    background: #68808f;
  }
  .account-menu-heading > div:first-of-type {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .account-menu-heading h2 {
    margin: 0;
    font-size: 21px;
    font-weight: 650;
  }
  .account-menu #account-menu-close {
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
    font-size: 27px;
  }
  .account-menu-heading > p {
    margin: 0 0 12px;
    color: #9bb3c1;
    font-size: 12px;
  }
  .account-menu .account-menu-search {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid #304956;
    border-radius: 10px;
    background: #213945;
  }
  .account-menu-search input {
    min-width: 0;
    width: 100%;
    padding: 10px 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: #ecf3f7;
    font-size: 16px;
  }
  .account-menu .account-menu-platforms {
    display: grid;
    grid-template-columns: repeat(
      var(--account-platform-count, 4),
      minmax(0, 1fr)
    );
    gap: 6px;
    margin-top: 10px;
  }
  .account-menu-platforms button {
    justify-content: center;
    min-height: 44px;
    padding: 7px;
    border: 1px solid #304956;
    border-radius: 9px;
    background: #203642;
    font-size: 13px;
  }
  .account-menu-platforms [aria-pressed="true"] {
    border-color: #65dfad;
    background: #65dfad;
    color: #09271c;
    font-weight: 750;
  }
  .account-menu #account-menu-options {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 16px;
    scroll-padding: 6px;
  }
  #account-menu-options [role="option"] {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 20px;
    gap: 4px 12px;
    min-height: 80px;
    padding: 12px 0;
    border-radius: 0;
    border-bottom: 1px solid #2b424f;
    align-items: center;
  }
  #account-menu-options [role="option"] > .account-avatar {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }
  #account-menu-options [role="option"] > .account-option-info {
    grid-column: 2;
    grid-row: 1;
    gap: 4px;
  }
  #account-menu-options .account-option-info strong {
    font-size: 15px;
    line-height: 1.4;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  #account-menu-options .account-option-info small {
    font-size: 12px;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  #account-menu-options .account-option-state {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
  }
  #account-menu-options .account-option-state > span:last-child::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 5px;
    border-radius: 50%;
    background: currentColor;
  }
  #account-menu-options .account-option-check {
    grid-column: 3;
    grid-row: 1 / 3;
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border: 1px solid #678393;
    border-radius: 50%;
    color: #14232d;
    font-size: 12px;
  }
  #account-menu-options [aria-selected="true"] {
    border-radius: 10px;
    padding-right: 8px;
    padding-left: 8px;
    background: #25443f;
    color: #b1f4d9;
    box-shadow: none;
  }
  #account-menu-options [aria-selected="true"] .account-option-check {
    border-color: #65dfad;
    background: #65dfad;
  }
  .account-menu-hint {
    display: block;
    flex: none;
    margin: 0;
    padding: 10px 16px;
    color: #9bb3c1;
    font-size: 11px;
    text-align: center;
  }
}

@media (max-width: 720px) {
  dialog.account-menu[data-compact-viewport="true"] {
    max-height: calc(var(--inbox-sheet-height, 100dvh) - 8px);
  }
  .account-menu[data-compact-viewport="true"] .account-sheet-handle,
  .account-menu[data-compact-viewport="true"] #account-menu-count,
  .account-menu[data-compact-viewport="true"] .account-menu-hint {
    display: none;
  }
  .account-menu[data-compact-viewport="true"] .account-menu-heading {
    padding: 4px 12px 6px;
  }
  .account-menu[data-compact-viewport="true"] .account-menu-platforms {
    margin-top: 6px;
  }
}

.toast.feature-loading {
  pointer-events: none;
}
@media (max-width: 720px) {
  .toast.feature-loading {
    bottom: calc(76px + env(safe-area-inset-bottom));
  }
}

/* Platform and account scope share one compact row. */
#workspace .inbox-top {
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 8px;
  row-gap: 6px;
}
#workspace .inbox-top > .inbox-header {
  grid-column: 1 / -1;
}
#workspace .inbox-top > .inbox-channel-filter {
  grid-area: 2 / 1;
  display: flex;
  gap: 4px;
  align-items: center;
}
#workspace .inbox-top > .account-filter {
  grid-area: 2 / 2;
  min-width: 0;
}
#workspace .inbox-top > .search {
  grid-column: 1 / -1;
}
.inbox-channel-filter [data-channel-filter=""],
.account-menu-platforms [data-account-platform=""] {
  display: none !important;
}
.inbox-channel-filter .channel-full-label {
  display: none !important;
}
#workspace .inbox-channel-filter button {
  flex: none;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 8px;
}
#workspace .inbox-channel-filter .platform-icon {
  width: 21px;
  height: 21px;
}
#runtime-open svg {
  width: 21px;
  height: 21px;
}
.account-menu-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.account-menu-toolbar .account-menu-platforms {
  display: flex;
  flex: none;
  gap: 5px;
  margin: 0;
}
.account-menu-toolbar .account-menu-platforms button {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 7px;
  justify-content: center;
}
#account-menu-all-row {
  min-width: 0;
  flex: 1;
}
#account-menu-all-row .account-option-info {
  flex: 1;
  min-width: 0;
}
#account-menu-all-row .account-option-info small {
  display: none;
}
#account-menu-all {
  min-height: 38px;
  padding: 8px 10px;
  gap: 8px;
}
#account-menu-all-row .account-option-check {
  display: block;
  color: var(--green);
  margin-left: auto;
}
@media (min-width: 721px) {
  .account-menu-toolbar {
    padding: 2px 4px 6px;
    border-bottom: 1px solid var(--line);
  }
}
@media (max-width: 720px) {
  #workspace .inbox-top {
    column-gap: 7px;
    row-gap: 4px;
  }
  #workspace .inbox[data-short-screen="true"] .inbox-top {
    row-gap: 2px;
  }
  #workspace .inbox-channel-filter button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }
  #workspace .inbox-channel-filter .platform-icon {
    width: 23px;
    height: 23px;
  }
  .account-menu-toolbar {
    padding: 0 16px 10px;
    gap: 8px;
  }
  .account-menu .account-menu-toolbar .account-menu-platforms {
    display: flex;
    gap: 6px;
    margin: 0;
  }
  .account-menu-toolbar .account-menu-platforms button {
    width: 44px;
    min-height: 44px;
    height: 44px;
  }
  .account-menu-toolbar #account-menu-all {
    height: 44px;
    padding: 8px 12px;
    border: 1px solid #304956;
    border-radius: 9px;
    background: #203642;
  }
  .account-menu-toolbar #account-menu-all[aria-selected="true"] {
    background: #25443f;
    color: #b1f4d9;
    border-color: #65dfad;
  }
  .account-menu-toolbar #account-menu-all .account-option-info strong {
    font-size: 14px;
  }
  #mobile-tools-filters-slot:not(:empty) {
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 7px;
  }
}

/* A quieter mobile surface: readable messages and one consistent accent. */
@media (max-width: 720px) {
  #workspace {
    --selection: #203c36;
    --selection-edge: #78d9b9;
  }
  #workspace > .inbox,
  #workspace .inbox-top,
  #workspace .inbox > .filter-tabs {
    background: #111c22;
  }
  #workspace .inbox-top {
    padding-inline: 16px;
  }
  #workspace .inbox-top .inbox-header {
    min-height: 44px;
  }
  #workspace .inbox-top .inbox-header h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
  }
  #workspace .inbox-heading #connection {
    color: #9bc2b2;
    font-size: 11px;
  }
  #workspace .inbox-heading #connection.offline {
    color: var(--danger);
  }
  #workspace .inbox-top #account-filter-button {
    background: #1d2b32;
    border-color: #2c3b41;
    border-radius: 12px;
    font-size: 14px;
  }
  #workspace .inbox-channel-filter button[aria-pressed="true"] {
    background: #203c34;
    border-color: #37584c;
    border-radius: 12px;
  }
  #workspace .inbox > .filter-tabs {
    padding-inline: 16px;
    border-bottom: 1px solid #ffffff09;
  }
  #workspace .inbox .filter-tabs [data-filter] {
    background: #1c2a30;
    border-color: transparent;
    font-size: 13px;
    color: #b9c7cb;
  }
  #workspace .inbox .filter-tabs [data-filter].selected {
    background: #25483c;
    color: #a8efd2;
    border-color: #3b6757;
  }
  #workspace .inbox .conversation-list {
    padding-inline: 6px;
  }
  #workspace .inbox .conversation-window .conversation-item {
    border: 0;
    border-bottom: 1px solid #ffffff0a;
    border-radius: 12px;
    padding: 8px 10px;
    gap: 12px;
  }
  #workspace .inbox .conversation-item.selected {
    background: #203932;
    box-shadow: inset 3px 0 0 #78d9b9;
  }
  #workspace .inbox .conversation-item.selected .conversation-line strong {
    color: #e7f7ef;
  }
  #workspace
    .inbox
    .conversation-item.selected
    :is(.conversation-preview, .conversation-account, time) {
    color: #b8d4c8;
  }
  #workspace .inbox .conversation-item .contact-avatar {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }
  #workspace .inbox .conversation-line strong {
    font-size: 15px;
    font-weight: 650;
    line-height: 21px;
  }
  #workspace
    .inbox
    .conversation-item:is(.selected, .unread)
    .conversation-line
    strong {
    font-weight: 700;
  }
  #workspace .inbox .conversation-preview {
    font-size: 14px;
    color: #b5c1c6;
    line-height: 20px;
    margin-top: 2px;
  }
  #workspace .inbox .conversation-item.unread .conversation-preview {
    color: #e5eeeb;
  }
  #workspace .inbox .conversation-account {
    color: #8fa5aa;
    font-size: 10px;
  }
  #workspace .inbox .current-conversation {
    color: #bce8d6;
    border-color: #426659;
    background: #2b4c3e;
  }
  #workspace .workspace-mobile-nav {
    background: #111c22;
    border-color: #ffffff0d;
  }
  #workspace .workspace-mobile-nav button {
    color: #96a8b0;
    font-size: 11px;
  }
  #workspace .workspace-mobile-nav button.active {
    color: #9ae7c8;
  }
  #workspace .workspace-mobile-nav button.active svg {
    background: #254137;
    border-radius: 8px;
    box-shadow: 0 0 0 5px #254137;
  }
  #workspace .chat-header {
    background: #142127;
    border-bottom: 1px solid #ffffff0b;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    padding-right: 12px;
  }
  #workspace .chat-header .chat-heading .chat-name {
    font-size: 16px;
    line-height: 21px;
    font-weight: 650;
  }
  #workspace .chat-header .chat-heading .chat-subtitle {
    color: #a0b9b1;
    font-size: 11px;
    line-height: 16px;
  }
  #workspace .chat-header .secondary {
    background: #20333a;
    color: #d4e7df;
    border: 1px solid #ffffff0a;
    border-radius: 12px;
    font-size: 11px;
    max-width: 78px;
    white-space: nowrap;
  }
  #workspace .messages {
    padding: 16px 12px;
  }
  #workspace .message-row {
    margin-bottom: 12px;
  }
  #workspace .message-row > .bubble:not(.sticker-bubble) {
    background: #273338;
    border-radius: 16px 16px 16px 5px;
    border-color: transparent;
    box-shadow: 0 1px 1px #0002;
    padding: 10px 12px 8px;
  }
  #workspace .message-row.out > .bubble:not(.sticker-bubble) {
    background: #1b493d;
    border-radius: 16px 16px 5px 16px;
  }
  #workspace .message-row > .album-bubble {
    padding: 5px;
  }
  #workspace .message-role {
    color: #a5bbb5;
    font-size: 10px;
    font-weight: 500;
    margin-bottom: 5px;
  }
  #workspace .message-secondary {
    border-color: #ffffff12;
    margin-top: 7px;
    padding-top: 7px;
  }
  #workspace .message-language-label {
    color: #a0b2b7;
  }
  #workspace .message-meta {
    color: #a9c0b7;
    margin-top: 5px;
  }
  #workspace .date-separator {
    width: fit-content;
    max-width: 100%;
    margin: 8px auto 18px;
    padding: 5px 10px;
    color: #adbfba;
    background: #14221ed9;
    border-radius: 12px;
    font-size: 11px;
  }
  #workspace .composer {
    background: #142127;
    border-top: 1px solid #ffffff09;
  }
  #workspace .composer #composer {
    background: #26373f;
    border-color: transparent;
    border-radius: 22px;
    color: #eef5f1;
  }
  #workspace .composer #composer::placeholder {
    color: #acbac0;
  }
  #workspace .composer #send-button {
    background: #83dfba;
    color: #103428;
    box-shadow: none;
  }
  #workspace .coach-reference-bar {
    background: #142127;
    border-color: #ffffff0a;
    color: #a8b9b7;
    padding-inline: 12px;
  }
  #workspace .coach-reference-bar button {
    color: #9bdebf;
  }
}
