/* Phone inbox: one screen at a time. Desktop rules remain in styles.css. */
.mobile-only { display: none; }
.conversation-scroll-area { display: contents; }

@media (max-width: 760px) {
  .mobile-only { display: block; }
  .desktop-only { display: none; }
  body.inbox-open { overflow: hidden; background: #fff; }
  body.inbox-open .noise { display: none; }
  body.inbox-open main { padding: 0; }
  body.inbox-open .topbar {
    position: fixed; inset: auto 0 0; z-index: 30; width: 100%; height: auto;
    padding: 0; border: 0; background: #fff; backdrop-filter: none;
  }
  body.inbox-open .topbar > .brand,
  body.inbox-open .topbar-actions > :not(#main-nav) { display: none; }
  body.inbox-open .topbar-actions { display: block; width: 100%; }
  body.inbox-open #main-nav {
    display: flex; width: 100%; max-width: none; gap: 0; margin: 0;
    padding: 5px 4px max(6px, env(safe-area-inset-bottom)); border: 0;
    border-top: 1px solid #e8edf4; border-radius: 0; background: #ffffff;
    overflow: visible; box-shadow: 0 -4px 20px #17365705;
  }
  body.inbox-open #main-nav .section-nav-button {
    position: relative; display: flex; flex: 1; min-width: 0; min-height: 52px;
    flex-direction: column; justify-content: center; align-items: center; gap: 4px;
    padding: 4px 1px; border-radius: 0; background: transparent; box-shadow: none;
    color: #77859d; font-size: 10px; font-weight: 600;
  }
  body.inbox-open #main-nav .section-nav-button::before {
    content: ''; width: 22px; height: 22px; background: currentColor;
    mask: var(--nav-icon) center / contain no-repeat;
  }
  #main-nav [data-view="overview"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m3 10 9-7 9 7v11h-7v-7h-4v7H3Z' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'/%3E%3C/svg%3E"); }
  #main-nav [data-view="statistics"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 20V10m8 10V4m8 16V8' stroke='black' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E"); }
  #main-nav [data-view="inbound"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21 11a9 9 0 0 1-9 9H4l-3 3 2-7a9 9 0 1 1 18-5Z' fill='black'/%3E%3C/svg%3E"); order: -1; }
  #main-nav [data-view="calls"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 3 4 5-3 3a16 16 0 0 0 6 6l3-3 5 4c-1 7-9 3-13-1S0 4 6 3Z' fill='black'/%3E%3C/svg%3E"); }
  #main-nav [data-view="settings"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 6h16M4 12h16M4 18h16' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }
  body.inbox-open #main-nav .is-active { color: #2485fa; }
  body.inbox-open #main-nav .section-nav-button > span {
    position: absolute; top: -1px; left: 53%; min-width: 18px; padding: 2px 4px;
    border-radius: 10px; background: #2584f8; color: white; font-size: 10px;
  }
  body.mobile-inbox-chat .topbar { display: none; }
  body.inbox-open #inbound-view {
    --dialog-accent: #2787fa; --dialog-accent-strong: #1977eb;
    --dialog-accent-soft: #e8f2ff; --dialog-accent-faint: #f3f8ff; --dialog-line: #e7edf5;
    position: fixed; inset: var(--mobile-top, 0px) 0 auto;
    display: flex; flex-direction: column; width: 100%;
    height: calc(var(--mobile-height, 100dvh) - 64px - env(safe-area-inset-bottom));
    min-height: 0; margin: 0; transform: none; gap: 0; background: white;
    padding-top: env(safe-area-inset-top); color: #17233d;
  }
  body.inbox-open #inbound-view[data-mobile-screen="chat"] { height: var(--mobile-height, 100dvh); }
  #inbound-view > .inbound-safety-note,
  #inbound-view > .inbound-diagnostics { display: none; }
  #inbound-view .inbound-header {
    display: flex; flex-direction: row; align-items: center; justify-content: space-between; flex: 0 0 auto;
    padding: 6px 12px; gap: 4px; min-height: 56px; flex-wrap: nowrap;
  }
  #inbound-view .inbound-header > div:first-child { display: flex; flex: 1; flex-wrap: nowrap; align-items: center; gap: 7px; }
  #inbound-view .inbound-header h1 { font-size: 22px; letter-spacing: -.6px; line-height: 1.15; }
  #inbound-view .inbound-header .lead,
  #inbound-view .inbound-header-actions { display: none; }
  .mobile-inbox-caption { margin: 0; color: #8090a7; font-size: 11px; white-space: nowrap; }
  .mobile-inbox-caption[hidden] { display: none; }
  #mobile-header-tools { display: flex; align-items: center; flex: 0 0 auto; gap: 0; }
  #mobile-header-tools > button { display: flex; align-items: center; justify-content: center; width: 42px; height: 44px; padding: 9px; border: 0; border-radius: 12px; background: transparent; color: #2584f8; cursor: pointer; }
  #mobile-header-tools > button svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
  #mobile-header-tools > .inbox-compose-button { background: #2584f8; color: #fff; width: 34px; height: 34px; padding: 0; margin: 5px 3px; font-size: 24px; box-shadow: none; }
  #mobile-header-tools > button[hidden] { display: none; }
  #mobile-header-tools > #mobile-work-add-chat { position: relative; margin: 5px 3px; }
  #mobile-header-tools > #mobile-work-add-chat[hidden] { display: none !important; }
  #mobile-work-add-chat > summary { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 12px; background: #2584f8; color: white; font-size: 24px; line-height: 1; list-style: none; cursor: pointer; }
  #mobile-work-add-chat > summary::-webkit-details-marker { display: none; }
  #mobile-work-add-chat > div { position: absolute; z-index: 40; top: 42px; right: 0; display: grid; min-width: 164px; padding: 5px; border: 1px solid #e7edf5; border-radius: 12px; background: white; box-shadow: 0 12px 28px #21325730; }
  #mobile-work-add-chat > div button { padding: 10px; border: 0; border-radius: 8px; background: transparent; color: #17233d; text-align: left; font: inherit; cursor: pointer; }
  #mobile-work-add-chat > div button:hover { background: #eef5ff; }
  #inbound-view .mobile-work-tab-settings { display: none; }
  #inbound-view.work-mode .mobile-work-tab-settings:not([hidden]) { display: flex; }
  #inbound-view.work-mode #work-inbox-menu { display: none; }
  #mobile-header-tools #mobile-search-close { font-size: 28px; font-weight: 400; }
  #mobile-search-slot { display: none; min-width: 0; }
  #inbound-view.mobile-search-open .inbound-header > div:first-child,
  #inbound-view.mobile-search-open #mobile-search-toggle,
  #inbound-view.mobile-search-open #mobile-inbox-menu { display: none; }
  #inbound-view.mobile-search-open #mobile-search-slot { display: block; flex: 1; }
  #mobile-active-filters { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; order: 1; min-height: 34px; padding: 0 12px 4px; color: #456080; font-size: 12px; }
  #mobile-active-filter-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #mobile-filters-reset { min-height: 32px; padding: 4px 8px; border: 0; border-radius: 8px; color: #2485fa; background: #edf5ff; cursor: pointer; }
  #inbound-view[data-mobile-screen="chat"] #mobile-active-filters { display: none; }
  #inbound-view > .data-freshness { order: 1; flex: 0 0 auto; margin: 0 12px 6px; padding: 8px; font-size: 12px; }
  #inbound-view > .inbox-layout {
    display: flex; flex: 1; height: auto; min-height: 0; gap: 0; overflow: hidden;
  }
  #inbound-view .inbox-layout > .panel { border: 0; border-radius: 0; box-shadow: none; }
  #inbound-view .conversation-sidebar { width: 100%; height: 100%; max-height: none; }
  #inbound-view .conversation-sidebar-heading { display: none; }
  #inbound-view .conversation-search-field { display: block; margin: 0; padding: 0; }
  #inbound-view #conversation-search {
    height: 42px; width: 100%; padding: 10px 12px; border: 0; border-radius: 13px;
    background: #f1f4f8; color: #243752; font-size: 16px;
  }
  #inbound-view #conversation-search::placeholder { color: #8795ad; font-size: 14px; }
  #inbound-view .conversation-tools { display: none; }
  #inbound-view .conversation-filter-menu > summary {
    position: relative; display: flex; align-items: center; justify-content: center;
    width: 42px; height: 44px; padding: 9px; border: 0; border-radius: 12px;
    background: transparent; color: #2584f8; list-style: none;
  }
  #conversation-filter-summary::-webkit-details-marker { display: none; }
  #conversation-filter-label { display: none; }
  #conversation-filter-summary svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; }
  #mobile-filter-count { position: absolute; top: 1px; right: 0; min-width: 15px; height: 15px; padding: 1px 3px; border-radius: 8px; background: #2584fa; color: white; font-size: 10px; text-align: center; }
  #inbound-view .conversation-filter-menu[open] > summary { background: #edf5ff; }
  #inbound-view .conversation-filter-menu { flex: 0 0 auto; }
  #inbound-view .conversation-filter-options { top: 54px; width: min(320px, calc(100vw - 24px)); max-height: 60dvh; overflow: auto; z-index: 25; left: auto; right: 12px; padding: 14px; border-radius: 16px; }
  #inbound-view .conversation-filter-options .conversation-filters { gap: 12px; margin-bottom: 12px; }
  #inbound-view .conversation-filter-options .conversation-filters:last-child { margin-bottom: 0; }
  #inbound-view .conversation-filter-options .conversation-unread-filter { min-height: 36px; font-size: 13px; }
  #inbound-view .conversation-filter-options select { font-size: 16px; }
  #inbound-view .conversation-scroll-area { display: block; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; overflow-anchor: none; }
  #inbound-view .conversation-list { flex: none; overflow: visible; border: 0; }
  #inbound-view .conversation-item {
    grid-template-columns: 46px minmax(0, 1fr); align-items: center; gap: 10px; padding: 12px;
    border-color: #eef1f6; min-height: 72px;
  }
  #inbound-view .conversation-item-avatar { width: 46px; height: 46px; font-size: 17px; font-weight: 500; box-shadow: none; }
  #inbound-view .conversation-item-heading strong { font-size: 15px; font-weight: 500; line-height: 20px; letter-spacing: -.2px; }
  #inbound-view .conversation-item.is-unread .conversation-item-heading strong { font-weight: 600; }
  #inbound-view .conversation-item-heading time { font-size: 11px; color: #8190a7; }
  #inbound-view .conversation-item-preview { margin-top: 4px; padding-right: 0; font-size: 13px; line-height: 20px; color: #7a89a0; }
  #inbound-view .conversation-item.is-unread .conversation-item-preview { padding-right: 30px; }
  #inbound-view .conversation-item-badges { display: none; }
  .mobile-preview-channel { display: inline; margin-right: 5px; padding: 2px 4px; border-radius: 5px; background: #edf1f6; color: #6c829b; font-size: 9px; font-weight: 600; vertical-align: 1px; }
  .mobile-preview-channel[data-channel="telegram"] { color: #2e8ec7; background: #e8f5ff; }
  .mobile-preview-channel[data-channel="max"] { color: #7960cf; background: #f0ecff; }
  #inbound-view .conversation-item-heading { justify-content: flex-start; gap: 5px; }
  #inbound-view .conversation-item-heading time { margin-left: auto; }
  .mobile-crm-mark { display: inline; flex: 0 0 auto; padding: 2px 4px; border-radius: 5px; color: #18875f; background: #e5f7ee; font-size: 9px; font-weight: 600; white-space: nowrap; }
  #inbound-view .conversation-unread-badge { right: 12px; bottom: 12px; min-width: 21px; height: 21px; font-size: 11px; box-shadow: none; background: #2584fb; }
  #inbound-view .conversation-item.is-selected { background: #edf5ff; box-shadow: none; }
  #inbound-view .inbox-more-button { width: 100%; min-height: 44px; border: 0; border-top: 1px solid #eef1f6; border-radius: 0; color: #2485fa; }
  #inbound-view[data-mobile-screen="list"] .conversation-chat { display: none; }
  #inbound-view[data-mobile-screen="chat"] .conversation-sidebar,
  #inbound-view[data-mobile-screen="chat"] > .inbound-header { display: none; }
  #inbound-view .conversation-chat { width: 100%; height: 100%; min-height: 0; }
  #inbound-view .conversation-chat-header {
    display: flex; flex-wrap: nowrap; gap: 9px; padding: 9px 10px 10px 4px;
    min-height: 72px; background: white; border-bottom: 1px solid #e8edf4;
  }
  #inbound-view .conversation-chat-header > div:nth-child(2) { flex: 1; min-width: 0; }
  #inbound-view .conversation-chat-header h2 { margin: 0; font-size: 16px; line-height: 1.4; letter-spacing: -.3px; }
  #inbound-view .conversation-title-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
  #inbound-view .conversation-title-line h2 { flex: 0 1 auto; min-width: 0; }
  #inbound-view #mobile-chat-crm { display: inline-flex; flex: 0 0 auto; font-size: 9px; padding: 3px 5px; }
  #inbound-view .conversation-chat-header p { font-size: 11px; }
  #inbound-view .conversation-chat-header .conversation-response-time { white-space: normal; font-size: 10px; }
  #inbound-view .conversation-avatar { width: 40px; height: 40px; font-size: 14px; box-shadow: none; }
  #inbound-view #back-to-contact-list { display: flex; order: -1; width: 34px; min-width: 34px; min-height: 44px; padding: 0; align-items: center; justify-content: center; color: #2485fa; }
  #back-to-contact-list .mobile-only { font-size: 42px; line-height: 30px; font-weight: 300; }
  #inbound-view #open-contact-panel { display: block; position: absolute; top: calc(8px + env(safe-area-inset-top)); left: 45px; width: calc(100% - 95px); height: 54px; font-size: 0; background: transparent; border: 0; }
  #inbound-view #open-contact-panel:focus-visible { outline: 2px solid #2485fa; border-radius: 8px; }
  .mobile-actions-menu { position: relative; flex: 0 0 auto; z-index: 20; }
  .mobile-actions-menu summary { display: flex; align-items: center; justify-content: center; list-style: none; width: 42px; height: 42px; color: #2584f8; cursor: pointer; font-size: 19px; letter-spacing: 2px; border-radius: 12px; }
  .mobile-actions-menu summary::-webkit-details-marker { display: none; }
  .mobile-actions-menu summary svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; }
  .mobile-actions-menu[open] summary { background: #edf5ff; }
  .mobile-actions-popover {
    position: absolute; top: 46px; right: 0; display: flex; flex-direction: column; gap: 5px;
    width: min(285px, calc(100vw - 32px)); max-height: 65dvh; overflow: auto;
    padding: 10px; border: 1px solid #e8edf4; border-radius: 16px; background: white;
    box-shadow: 0 12px 45px #172e5626;
  }
  #inbound-view .mobile-actions-popover button { flex: none; width: 100%; min-height: 44px; margin: 0; padding: 10px 12px; border: 0; border-radius: 8px; background: #f5f7fb; color: #314967; font-size: 13px; text-align: left; white-space: normal; }
  #inbound-view .mobile-actions-popover svg { width: 17px; height: 17px; fill: none; stroke: currentColor; }
  #inbound-view .mobile-actions-popover .capture-only-banner { display: block; margin: 0; padding: 10px; font-size: 12px; }
  #inbound-view .conversation-message-list { padding: 16px 12px; background-color: #edf4fc; overscroll-behavior: contain; }
  #inbound-view .conversation-message { margin-bottom: 10px; }
  #inbound-view .conversation-bubble { max-width: 88%; padding: 9px 12px 6px; border: 0; border-radius: 16px 16px 16px 4px; box-shadow: 0 2px 4px #284d7310; }
  #inbound-view .conversation-message.is-outbound .conversation-bubble { border-radius: 16px 16px 4px 16px; background: #d6e9ff; }
  #inbound-view .conversation-bubble p { font-size: 15px; line-height: 1.45; }
  #inbound-view .conversation-message-author { font-size: 10px; margin-bottom: 3px; }
  #inbound-view .conversation-bubble footer { font-size: 10px; color: #7d8da5; gap: 6px; margin-top: 4px; }
  #inbound-view .message-reaction-toolbar { display: none; }
  #inbound-view .message-reactions { gap: 3px; }
  #inbound-view .message-reaction { min-height: 19px; }
  .message-reaction-dialog {
    position: fixed; inset: auto 0 0; box-sizing: border-box;
    width: 100vw; max-width: 100vw; max-height: min(76dvh, 650px);
    margin: 0; padding: 18px 16px max(20px, env(safe-area-inset-bottom));
    overflow-y: auto; border-radius: 20px 20px 0 0;
  }
  .message-reaction-options { gap: 4px; }
  .message-reaction-options button { min-height: 42px; font-size: 1.38rem; }
  .message-reaction-sheet-actions { display: grid; gap: 3px; margin-top: 14px; padding-top: 8px; border-top: 1px solid #e4e5ef; }
  .message-reaction-sheet-actions button { min-height: 42px; padding: 9px 10px; border: 0; border-radius: 9px; background: transparent; color: #383a55; font: inherit; font-size: 14px; text-align: left; }
  .message-reaction-sheet-actions button:active { background: #f0efff; }
  #inbound-view .conversation-bubble:has(.mobile-message-menu) footer { padding-right: 22px; }
  #inbound-view .mobile-message-menu { position: absolute; right: 5px; bottom: 4px; width: fit-content; margin: 0; }
  #inbound-view .mobile-message-menu > summary { display: grid; width: 23px; height: 23px; place-items: center; color: #73809b; font-size: 18px; list-style: none; cursor: pointer; }
  #inbound-view .mobile-message-menu > summary::-webkit-details-marker { display: none; }
  #inbound-view .mobile-message-menu .conversation-message-actions { position: absolute; z-index: 9; right: 0; bottom: 100%; display: grid; gap: 0; width: max-content; min-width: 130px; margin: 0; padding: 4px; border: 1px solid #e4e5ef; border-radius: 9px; background: #fff; box-shadow: 0 8px 20px #28304a26; justify-content: stretch; justify-items: stretch; }
  #inbound-view .mobile-message-menu .conversation-message-actions button { display: block; width: 100%; padding: 9px 10px; color: #383a55; font-size: 13px; text-align: left; }
  #inbound-view .mobile-message-menu.is-flipped .conversation-message-actions { left: 0; right: auto; }
  #inbound-view .mobile-message-menu.is-below .conversation-message-actions { bottom: auto; top: calc(100% + 3px); }
  #inbound-view .conversation-composer {
    position: relative; display: flex; flex-direction: column; align-items: stretch;
    padding: 6px 8px max(6px, env(safe-area-inset-bottom)); gap: 4px;
    border: 0; border-radius: 14px 14px 0 0; box-shadow: 0 -4px 18px #1e41630a;
  }
  #inbound-view.mobile-keyboard-open .conversation-composer,
  #inbound-view.mobile-composer-focused .conversation-composer { padding-bottom: 6px; }
  #mobile-compose-row { display: flex; align-items: flex-end; gap: 6px; min-width: 0; order: 1; }
  #mobile-compose-action { position: relative; order: 3; flex: 0 0 44px; width: 44px; height: 44px; }
  #inbound-view .conversation-composer textarea {
    flex: 1; width: 0; min-width: 0; height: 40px; min-height: 40px; max-height: 106px;
    align-self: center; padding: 9px 12px; border: 0; border-radius: 20px; background: #f1f4f8;
    font-size: 16px; line-height: 22px; resize: none; margin: 0;
  }
  #inbound-view .conversation-composer-actions,
  #inbound-view .conversation-send-actions { display: none; }
  #inbound-view #conversation-send-button { flex: 0 0 44px; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 10px; border: 0; border-radius: 50%; background: #2584fa; box-shadow: none; }
  #inbound-view #conversation-send-button svg { width: 23px; height: 23px; }
  #inbound-view #conversation-send-button span { display: none; }
  #inbound-view #conversation-send-button:disabled { opacity: .45; }
  #inbound-view .mobile-actions-popover .conversation-channel-picker { display: flex; flex-direction: column; align-items: stretch; gap: 5px; margin: 0; padding: 8px; }
  #inbound-view .conversation-channel-picker span { font-size: 12px; color: #7a89a0; }
  #inbound-view .conversation-channel-picker select { width: 100%; min-width: 0; min-height: 44px; padding: 6px 8px; border: 0; border-radius: 9px; background: #f1f6fd; font-size: 16px; color: #385c8a; }
  #inbound-view #conversation-message-segments { order: 2; font-size: 10px; margin: 0 6px; }
  #inbound-view #conversation-attachment-menu-wrap { flex: 0 0 40px; }
  #inbound-view .conversation-icon-button { width: 40px; min-width: 40px; height: 44px; min-height: 44px; padding: 10px; border: 0; background: transparent; border-radius: 12px; color: #426b9b; }
  #inbound-view #mobile-compose-action > button { position: absolute; inset: 0; transition: opacity 180ms ease, transform 180ms ease, visibility 180ms; transform-origin: center; }
  #inbound-view #conversation-voice-button { display: inline-flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; pointer-events: none; transform: scale(.65) rotate(-25deg); width: 44px; min-width: 44px; }
  #inbound-view .conversation-composer.can-record:not(.has-text) #conversation-voice-button,
  #inbound-view .conversation-composer.is-recording #conversation-voice-button { opacity: 1; visibility: visible; pointer-events: auto; transform: scale(1) rotate(0); }
  #inbound-view .conversation-composer.can-record:not(.has-text) #conversation-send-button,
  #inbound-view .conversation-composer.is-recording #conversation-send-button { opacity: 0; visibility: hidden; pointer-events: none; transform: scale(.65) rotate(25deg); }
  #inbound-view #conversation-send-button { opacity: 1; visibility: visible; transform: scale(1) rotate(0); }
  #inbound-view #quick-replies-open { order: -1; }
  #inbound-view #quick-replies-open b { font-weight: 500; }
  @media (prefers-reduced-motion: reduce) { #inbound-view #mobile-compose-action > button { transition: none; } }
  #inbound-view #conversation-voice-button.is-recording { color: #c83832; background: #fff0ef; }
  #inbound-view #conversation-voice-status { order: 2; margin: 0 6px; font-size: 11px; }
  #inbound-view #conversation-presence { order: 3; margin: 0; padding: 3px 6px; font-size: 11px; }
  /* Draft persistence remains announced without adding a permanent visible row. */
  #inbound-view #conversation-draft-status { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  #inbound-view .conversation-composer .form-error { order: 4; }
  #inbound-view .conversation-attachment-menu { right: auto; left: 0; width: min(290px, calc(100vw - 16px)); max-height: calc(var(--mobile-height, 100dvh) - 145px); overflow-y: auto; }
  body.work-mobile-chat .topbar { display: none; }
  #inbound-view.work-mode[data-work-mobile-screen="chat"] { height: var(--mobile-height, 100dvh); }
  #inbound-view.work-mode[data-work-mobile-screen="chat"] > .inbound-header { display: none; }
  #inbound-view.work-mode .mobile-actions-menu,
  #inbound-view.work-mode #mobile-active-filters { display: none; }
  #inbound-view.work-mode #mobile-inbox-menu { display: block; }
  #inbound-view.work-mode #mobile-inbox-menu .mobile-actions-popover > :not(.mobile-work-tab-settings) { display: none; }
  #inbound-view.work-mode #mobile-header-tools > button[hidden] { display: none; }
  #inbound-view.work-mode.work-search-open .inbound-header > div:first-child { display: none; }
  #inbound-view.work-mode.work-search-open #mobile-search-slot { display: block; flex: 1; }
  #inbound-view.work-mode #mobile-search-slot .conversation-search-field { display: none; }
  #inbound-view.work-mode #work-chat-search { display: block; width: 100%; height: 42px; min-height: 42px; margin: 0; padding: 9px 12px; border: 0; border-radius: 13px; background: #f1f4f8; font-size: 16px; }
  #inbound-view.work-mode > .work-inbox-layout { display: flex; flex: 1; height: auto; min-height: 0; gap: 0; overflow: hidden; }
  #inbound-view.work-mode .work-inbox-layout > .panel { border: 0; border-radius: 0; box-shadow: none; }
  #inbound-view.work-mode .work-chat-sidebar { width: 100%; height: 100%; max-height: none; min-height: 0; flex: 1; }
  #inbound-view.work-mode .work-chat-sidebar-heading { display: none; }
  #inbound-view.work-mode .inbox-folder-bar { flex: 0 0 auto; }
  #inbound-view.work-mode #work-chat-list,
  #inbound-view.work-mode #work-vk-post-list { flex: 1; max-height: none; overflow-y: auto; border-top: 0; }
  #inbound-view.work-mode .work-chat-item { grid-template-columns: 46px minmax(0,1fr); align-items: center; min-height: 72px; padding: 12px; gap: 10px; border-color: #eef1f6; }
  #inbound-view.work-mode .work-chat-item[data-vk-post] { grid-template-columns: 46px minmax(0,1fr); }
  #inbound-view.work-mode .work-chat-avatar { width: 46px; height: 46px; font-size: 17px !important; font-weight: 500; }
  #inbound-view.work-mode .work-chat-item-heading { gap: 5px; }
  #inbound-view.work-mode .work-chat-item-heading strong { font-size: 15px; font-weight: 500; line-height: 20px; letter-spacing: -.2px; }
  #inbound-view.work-mode .work-chat-item-heading time { margin-left: auto; font-size: 11px; color: #8190a7; }
  #inbound-view.work-mode .work-chat-item-preview { margin-top: 4px; font-size: 13px; line-height: 20px; color: #7a89a0; }
  #inbound-view.work-mode .work-chat-unread { right: 12px; bottom: 12px; min-width: 21px; height: 21px; background: #2584fb; font-size: 11px !important; }
  #inbound-view.work-mode .work-chat-item.is-selected { background: #edf5ff; box-shadow: none; }
  #inbound-view.work-mode[data-work-mobile-screen="list"] .work-chat-panel { display: none; }
  #inbound-view.work-mode[data-work-mobile-screen="chat"] .work-chat-sidebar { display: none; }
  #inbound-view.work-mode .work-chat-panel { width: 100%; height: 100%; min-height: 0; flex: 1; }
  #inbound-view.work-mode .work-chat-panel > .panel-heading { display: flex; flex: 0 0 auto; min-height: 72px; padding: 9px 10px 10px 4px; gap: 9px; }
  #inbound-view.work-mode .work-chat-panel > .panel-heading > .work-chat-title-block { flex: 1; min-width: 0; }
  #inbound-view.work-mode .work-chat-header-avatar { width: 40px; height: 40px; font-size: 14px; box-shadow: none; }
  #inbound-view.work-mode .work-chat-header-actions { flex: 0 0 auto; }
  #inbound-view.work-mode #work-chat-folder-menu > summary { display: grid; width: 42px; height: 42px; min-height: 42px; padding: 0; place-items: center; border: 0; color: #2584f8; font-size: 18px; letter-spacing: 2px; }
  #inbound-view.work-mode .work-chat-header-actions #work-mark-read { min-height: 42px; padding: 0 6px; font-size: 11px; }
  #inbound-view.work-mode .work-chat-panel > .panel-heading h2 { font-size: 16px; line-height: 1.4; letter-spacing: -.3px; }
  #inbound-view.work-mode .work-chat-panel > .panel-heading p { font-size: 11px; }
  #inbound-view.work-mode .work-mobile-back { display: flex; flex: 0 0 34px; width: 34px; height: 44px; align-items: center; justify-content: center; padding: 0; border: 0; background: transparent; color: #2485fa; font-size: 40px; font-weight: 300; }
  #inbound-view.work-mode .work-chat-messages { flex: 1; max-height: none; padding: 16px 12px; background-color: #edf4fc; }
  #inbound-view.work-mode .work-message { max-width: 88%; padding: 9px 12px 6px; border: 0; box-shadow: 0 2px 4px #284d7310; }
  #inbound-view.work-mode .work-message p { font-size: 15px; line-height: 1.45; }
  #inbound-view.work-mode #work-chat-composer { padding: 6px 8px max(6px, env(safe-area-inset-bottom)); border-radius: 14px 14px 0 0; }
  #inbound-view.work-mode #work-chat-composer textarea { min-height: 42px; max-height: 106px; border: 0; border-radius: 20px; background: #f1f4f8; font-size: 16px; resize: none; }
  #inbound-view.work-mode #work-chat-composer .work-composer-actions { align-items: center; }
  #inbound-view.work-mode #work-chat-composer .work-composer-actions > button[type="submit"] { background: #2584fa; border: 0; border-radius: 18px; }
  #inbound-view.work-mode #work-vk-post-link { font-size: 12px; white-space: nowrap; }
  #contact-panel-dialog {
    position: fixed; inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: 100dvh;
    margin: 0; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
    border: 0; border-radius: 0; background: #f4f7fc;
  }
  #contact-panel-dialog .contact-panel-toolbar { padding: 12px 16px; min-height: 62px; color: #203652; }
  #close-contact-panel { min-height: 44px; color: #2485fa; }
  #contact-panel-content .conversation-contact { padding: 24px 18px; background: #f4f7fc; color: #203652; }
  #contact-panel-content .conversation-contact h2 { font-size: 25px; }
  .mobile-contact-avatar { display: flex; align-items: center; justify-content: center; width: 72px; height: 72px; margin-bottom: 18px; border-radius: 50%; color: white; background: linear-gradient(145deg, #ac83fa, #6451ee); font-size: 26px; }
  #contact-panel-content .conversation-contact-address { display: block; font: 14px var(--sans); margin: 12px 0 22px; overflow-wrap: anywhere; }
  #contact-panel-content .conversation-contact-details { padding: 8px 16px; border-radius: 18px; background: white; }
  #contact-panel-content .conversation-contact-details div { padding: 12px 0; }
  #contact-panel-content .conversation-contact-details dt,
  #contact-panel-content .conversation-contact-details dd { font-size: 13px; }
  #contact-panel-content input, #contact-panel-content select { font-size: 16px; min-height: 42px; }
  #contact-panel-content .button { min-height: 44px; }
}
