/* Compact mobile header: navigation left, brand centered, unread right. */
@media (max-width:720px), (max-width:1000px) and (max-height:500px) and (pointer:coarse) {
  html[data-theme="dark"] body .topbar #mobile-menu-toggle {
    position: absolute !important;
    left: 7px !important;
    top: 6px !important;
    margin: 0 !important;
    order: 0;
  }
  html[data-theme="dark"] body .topbar #new-qr-chat {
    position: absolute !important;
    left: 50px !important;
    top: 6px !important;
    margin: 0 !important;
    order: 1;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    font-size: 0 !important;
    line-height: 1 !important;
    overflow: hidden !important;
    white-space: nowrap !important;
  }
  html[data-theme="dark"] body .topbar #new-qr-chat::before {
    content: "+";
    color: currentColor;
    font-size: 24px;
    font-weight: 500;
    line-height: 1;
  }
  html[data-theme="dark"] body.crm-hierarchy-ready .topbar > .brand {
    width: clamp(132px, calc(100vw - 190px), 215px) !important;
    min-width: clamp(132px, calc(100vw - 190px), 215px) !important;
    max-width: clamp(132px, calc(100vw - 190px), 215px) !important;
  }
  html[data-theme="dark"] body .topbar .brand-logo {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 40px !important;
  }
  html[data-theme="dark"] body .topbar #unread-quick {
    position: absolute !important;
    right: 7px !important;
    top: 6px !important;
    margin: 0 !important;
    order: 3;
  }
  html[data-theme="dark"] body .inbox .inbox-mode-bar {
    gap: 7px;
    margin: 0 0 7px;
    padding-bottom: 7px;
    border-bottom: 1px solid var(--dina-border);
  }
  html[data-theme="dark"] body .inbox .inbox-modes {
    flex: 2 1 0;
    width: auto;
    min-width: 0;
  }
  html[data-theme="dark"] body .inbox .inbox-mode-bar > [data-queue-state="PENDING"] {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    padding: 7px 5px;
    border: 1px solid var(--dina-border);
    border-radius: 12px;
    background: var(--dina-surface-raised);
    color: var(--dina-text-main);
    font-size: 13px;
    cursor: pointer;
  }
  html[data-theme="dark"] body .inbox .inbox-mode-bar > [data-queue-state="PENDING"].active {
    background: var(--dina-selected);
    border-color: var(--dina-primary);
    color: var(--dina-primary);
  }
  html[data-theme="dark"] body .inbox .inbox-mode-bar > [data-queue-state="PENDING"] span {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 3px;
    margin-left: 2px;
    border-radius: 999px;
    background: var(--dina-subtle);
    font-size: 11px;
  }
  html[data-theme="dark"] body .inbox .inbox-mode-bar > [data-queue-state="PENDING"]:focus-visible {
    outline: 2px solid var(--dina-focus);
    outline-offset: 2px;
  }
  html[data-theme="dark"] body #team-toolbar {gap: 7px !important;}
  html[data-theme="dark"] body #team-toolbar .queue-tabs {margin-top: 4px !important;}
}
@media (max-width:360px) {
  html[data-theme="dark"] body .inbox .inbox-modes button,
  html[data-theme="dark"] body .inbox .inbox-mode-bar > [data-queue-state="PENDING"] {
    font-size: 12px;
    padding-inline: 4px;
    gap: 3px;
  }
  html[data-theme="dark"] body .inbox .inbox-modes .ui-icon {width: 16px;height: 16px;flex-basis: 16px;}
}
/* Center the mark in the free space between the QR action and unread control. */
@media (max-width:420px) {
  html[data-theme="dark"] body.crm-hierarchy-ready .topbar > .brand {
    left: calc(50% + 18px) !important;
  }
}
