/* Phone-only presentation. Desktop rules and existing visibility permissions
   remain owned by the original stylesheets. phone-ui.js supplies the measured
   visual viewport without subtracting the keyboard a second time. */
@media (max-width: 720px) {
  :root {
    --phone-panel: var(--native-panel, var(--theme-panel, #fff));
    --phone-soft: var(--native-soft, var(--theme-raised, #f5f8f7));
    --phone-line: var(--native-line, var(--line));
    --phone-ink: var(--native-ink, var(--ink));
    --phone-muted: var(--native-muted, var(--muted));
    --phone-accent: var(--native-accent, var(--accent));
    --phone-active: var(--native-active, var(--accent-soft));
    --phone-safe-top: env(safe-area-inset-top, 0px);
    --phone-safe-bottom: var(--native-safe-bottom, env(safe-area-inset-bottom, 0px));
  }
  html.native-android { --phone-safe-top: 0px; }

  html.phone-ui:has(#app:not([hidden])),
  html.phone-ui:has(#app:not([hidden])) body {
    width: 100%; height: 100%; min-width: 0; overflow: hidden;
    overscroll-behavior: none;
  }
  html.phone-ui #app.app-shell {
    position: fixed; top: var(--phone-viewport-top, 0px); left: 0; right: 0;
    width: 100%; height: var(--phone-viewport-height, 100dvh);
    min-height: 0; max-height: none; overflow: hidden; padding-top: var(--phone-safe-top);
  }
  #app .main-shell {
    min-width: 0; min-height: 0; flex: 1 1 0; overflow: hidden;
  }
  #app #inbox-view {
    min-width: 0; min-height: 0; flex: 1 1 0; height: auto; overflow: hidden;
  }
  #app #conversation-list-panel {
    min-width: 0; min-height: 0; flex: 1 1 0; overflow: hidden;
    background: var(--phone-panel); border: 0;
  }
  #app #inbox-view.show-chat #chat-panel {
    min-width: 0; min-height: 0; height: 100%; overflow: hidden;
  }
  #app #chat-content {
    height: 100%; min-height: 0; min-width: 0; overflow: hidden;
  }
  #app .main-shell > .page-view {
    min-width: 0; min-height: 0; flex: 1 1 0; overflow: auto;
    overscroll-behavior: contain; scroll-padding-block: 16px;
  }
  #app :is(#conversation-list, #messages) {
    flex: 1 1 0; min-height: 0; min-width: 0; overflow-y: auto; overflow-x: hidden;
    overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    scroll-padding-block: 12px; scrollbar-width: thin;
  }

  /* Comfortable, consistent controls without changing their destinations. */
  #app #mobile-nav {
    gap: 6px; min-height: 66px; padding: 5px 10px calc(5px + var(--phone-safe-bottom));
    border-top: 1px solid var(--phone-line); background: var(--phone-panel);
  }
  #app #mobile-nav > button {
    flex: 1; min-width: 0; max-width: 180px; min-height: 52px;
    padding: 6px 8px; gap: 4px; border-radius: 14px; font-size: 11px;
    color: var(--phone-muted);
  }
  #app #mobile-nav > button svg { width: 22px; height: 22px; stroke-width: 1.8; }
  #app #mobile-nav > button.active { color: var(--phone-accent); background: var(--phone-active); }
  #app.mobile-chat #mobile-nav { display: none; }
  #app :is(.page-heading, .shipping-header) .icon-button {
    width: 44px; height: 44px; min-width: 44px; min-height: 44px; border-radius: 12px;
  }
  #app .page-view :is(.primary-button, .outline-button) { border-radius: 11px; }
  #app .page-view .settings-card { border-radius: 15px; }
  #app :is(.page-view, #customer-details) :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    font-size: 16px;
  }

  #app #conversation-list-panel .list-heading {
    flex: none; min-height: 68px; padding: 12px 14px 8px; gap: 8px;
    background: var(--phone-panel);
  }
  #app #conversation-list-panel .list-heading h2 {
    margin: 0; min-width: 0; font-size: 22px; line-height: 30px;
    color: var(--phone-ink); font-weight: 700;
  }
  #app #conversation-list-panel .list-heading :is(.icon-button, #show-filters, #mobile-list-options) {
    width: 44px; height: 44px; min-width: 44px; min-height: 44px; flex: 0 0 44px;
    padding: 0; border: 1px solid var(--phone-line); border-radius: 13px;
    color: var(--phone-muted); background: var(--phone-soft); gap: 0;
  }
  #app #conversation-list-panel .list-heading :is(.icon-button, #show-filters, #mobile-list-options) svg {
    width: 21px; height: 21px; stroke-width: 1.8;
  }
  #app #show-filters > span:not([data-icon]) { display: none; }
  #app #conversation-list-panel #mobile-list-options[aria-expanded="true"] {
    background: var(--phone-active); color: var(--phone-accent); border-color: var(--phone-accent);
  }
  #app #conversation-list-panel > .search-field {
    flex: none; min-height: 46px; margin: 0 14px 10px; padding: 0 13px;
    border: 1px solid var(--phone-line); border-radius: 14px; background: var(--phone-soft);
  }
  #app #conversation-list-panel > .search-field:focus-within { border-color: var(--phone-accent); }
  #app #conversation-list-panel .search-field input {
    min-width: 0; padding: 11px 0; font-size: 16px; line-height: 23px;
    color: var(--phone-ink); background: transparent;
  }
  #app #conversation-list-panel .search-field svg { width: 19px; height: 19px; color: var(--phone-muted); }
  #app #list-options {
    flex: none; margin: 0 14px 10px; padding: 10px; max-height: min(260px, 38dvh);
    overflow: auto; overscroll-behavior: contain; border: 1px solid var(--phone-line);
    border-radius: 14px; background: var(--phone-soft);
  }
  #app #list-options .list-controls { padding: 0; gap: 8px; }
  #app #list-options :is(select, .small-check) { min-height: 44px; font-size: 14px; }
  #app #list-options select { min-width: 0; border-radius: 10px; }
  #app #list-options .list-tools { padding: 4px 2px 0; }
  #app #active-filters { flex: none; min-height: 40px; margin-inline: 14px; border-radius: 10px; }
  #app #active-filters button { min-height: 44px; }
  #app #conversation-list { padding: 0 8px 8px; overflow-anchor: none; }
  #app #conversation-list .conversation-row {
    align-items: center; min-height: 94px; padding: 13px 8px; gap: 12px;
    border-bottom: 1px solid var(--phone-line); border-radius: 0;
    text-align: start; direction: rtl; box-shadow: none;
  }
  #app #conversation-list .conversation-row.selected { border-radius: 12px; }
  #app #conversation-list .conversation-row > .avatar {
    width: 48px; height: 48px; flex: 0 0 48px; margin: 0; font-size: 16px; border-radius: 50%;
  }
  #app #conversation-list .row-top { gap: 8px; margin-bottom: 5px; }
  #app #conversation-list .row-top b { font-size: 15px; line-height: 22px; }
  #app #conversation-list .row-top time { font-size: 10px; line-height: 22px; }
  #app #conversation-list .row-bottom p { font-size: 13px; line-height: 21px; }
  #app #conversation-list .row-labels { margin-top: 5px; gap: 5px; min-height: 17px; }
  #app #conversation-list .row-pin { width: 17px; height: 17px; }
  #app #conversation-list .row-pin svg { width: 16px; height: 16px; }
  #app #conversation-list-panel .list-footer { flex: none; min-height: 31px; padding-inline: 16px; }

  /* Keep the identity readable; actions have a genuine 44px touch target. */
  #app #chat-panel .chat-header.chat-header-v2 {
    display: grid; grid-template-columns: 44px minmax(0, 1fr) auto;
    grid-template-areas: "back identity actions" "back identity timer";
    grid-template-rows: 44px 14px; align-items: center; gap: 0 4px;
    min-height: 74px; flex: 0 0 auto; margin: 0; padding: 8px;
    border: 0; border-bottom: 1px solid var(--phone-line); border-radius: 0;
    background: var(--phone-panel); color: var(--phone-ink); box-shadow: none;
  }
  #app #chat-panel .chat-header-v2 #back-to-list {
    grid-area: back; display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 48px; min-width: 44px; min-height: 44px;
    margin: 0; padding: 0; border: 0; border-radius: 12px; color: var(--phone-muted);
  }
  #app #chat-panel .chat-header-v2 #back-to-list svg { width: 23px; height: 23px; }
  #app #chat-panel .chat-header-v2 #chat-identity { grid-area: identity; min-width: 0; gap: 8px; }
  #app #chat-panel .chat-header-v2 #show-details.customer-avatar-button {
    width: 44px; height: 48px; min-width: 44px; min-height: 44px;
    padding: 0; border: 0; border-radius: 50%; background: transparent;
  }
  #app #chat-panel .chat-header-v2 #show-details #chat-avatar { width: 40px; height: 40px; font-size: 14px; }
  #app #chat-panel .chat-header-v2 .chat-person { display: block; min-width: 0; flex: 1; }
  #app #chat-panel .chat-header-v2 .chat-person #chat-name {
    font-size: 15px; line-height: 22px; font-weight: 700; color: var(--phone-ink);
  }
  #app #chat-panel .chat-header-v2 #chat-customer-badges { margin-top: 3px; }
  #app #chat-panel .chat-header-v2 .customer-badges { gap: 3px; }
  #app #chat-panel .chat-header-v2 .customer-badge { font-size: 9px; line-height: 14px; padding: 1px 5px; }
  #app #chat-panel .chat-header-v2 #chat-actions {
    grid-area: actions; width: auto; flex-direction: row; flex-wrap: nowrap;
    gap: 0; padding: 0; margin: 0; border: 0; justify-self: end;
  }
  #app #chat-panel .chat-header-v2 #chat-actions > .icon-button {
    width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 10px;
    border: 0; border-radius: 12px; background: transparent; color: var(--phone-muted);
  }
  #app #chat-panel .chat-header-v2 #chat-actions > .icon-button svg { width: 21px; height: 21px; }
  #app #chat-panel .chat-header-v2 #chat-actions > #chat-more { background: var(--phone-active); color: var(--phone-accent); }
  #app #chat-panel .chat-header-v2 #chat-context {
    grid-area: timer; width: auto; min-width: 0; justify-content: center;
    justify-self: center; margin: 0; padding: 0; border: 0;
  }
  #app #chat-panel .chat-header-v2 #reply-window {
    font-size: 10px; line-height: 14px; letter-spacing: .2px;
    font-variant-numeric: tabular-nums; color: var(--phone-muted);
  }
  #app #chat-panel .chat-header-v2 #reply-window.expired { color: var(--theme-warning, #b67d35); }
  #app #chat-panel .chat-header-v2 #chat-action-menu {
    max-width: calc(100vw - 24px); max-height: calc(var(--phone-viewport-height, 100dvh) - 100px);
    overflow-y: auto; overscroll-behavior: contain; border-radius: 16px;
  }
  #app #chat-panel .chat-header-v2 #chat-action-menu > button { min-height: 58px; }
  #app #chat-panel .chat-header-v2 #chat-actions #chat-action-menu #close-conversation {
    display: flex; width: 100%; height: auto; min-height: 52px; padding: 10px;
    justify-content: flex-start; gap: 12px; border: 0; background: transparent;
    color: var(--native-danger, #d77288); border-radius: 10px; font-size: 13px;
  }
  #app .phone-close-label { font-weight: 600; }

  #app #messages { padding: 16px 12px; gap: 16px; }
  #app #messages .message-line { max-width: 96%; }
  #app #messages .bubble { font-size: 15px; line-height: 1.75; padding: 9px 12px; }
  #app #messages .voice-card { max-width: 100%; width: min(280px, 78vw); }
  #app #messages .message-tools button { min-width: 38px; min-height: 36px; }
  #app #messages :is(.load-older, .audio-play) { min-height: 44px; }
  #app #message-search-bar { flex: none; padding: 8px 10px; gap: 5px; }
  #app #message-search-bar .icon-button { width: 44px; height: 44px; min-width: 44px; }
  #app #permission-notice { flex: none; }

  /* The text owns a full row: toolbar icons cannot squeeze the writing area. */
  #app #composer-area {
    flex: 0 0 auto; min-width: 0; padding: 7px 9px calc(7px + var(--phone-safe-bottom));
    border-top: 1px solid var(--phone-line); background: var(--phone-panel);
  }
  #app #composer {
    display: grid; grid-template-columns: repeat(5, 44px) minmax(44px, 1fr);
    grid-template-areas: "input input input input input input" "emoji sticker quick template image action";
    gap: 0 2px; align-items: end; padding: 3px 5px; border: 1px solid var(--phone-line);
    border-radius: 18px; background: var(--phone-soft); overflow: visible;
  }
  /* The existing phone layout moves ready replies into customer details. */
  #app #composer:not(:has(#quick-toggle)) {
    grid-template-columns: repeat(4, 44px) minmax(44px, 1fr);
    grid-template-areas: "input input input input input" "emoji sticker template image action";
  }
  #app #composer:focus-within { border-color: var(--phone-accent); }
  #app #composer #message-input {
    grid-area: input; width: 100%; min-width: 0; min-height: 44px;
    max-height: min(120px, calc(var(--phone-viewport-height, 100dvh) * .23));
    padding: 9px 8px 7px; border: 0; border-radius: 0;
    font-size: 16px; line-height: 25px; color: var(--phone-ink); background: transparent;
    resize: none; overflow-y: auto; overscroll-behavior: contain;
  }
  #app #composer #message-input::placeholder { font-size: 15px; color: var(--phone-muted); opacity: 1; }
  #app #composer .composer-actions { display: contents; }
  #app #composer .composer-actions :is(#emoji-toggle, #sticker-toggle, #quick-toggle, #template-toggle, #attach-image) {
    position: static; display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; margin: 0;
    border: 0; border-radius: 12px; color: var(--phone-muted); background: transparent; font-size: 0;
  }
  #app #composer .composer-actions :is(#emoji-toggle, #sticker-toggle, #quick-toggle, #template-toggle, #attach-image) svg {
    width: 21px; height: 21px; stroke-width: 1.8;
  }
  #app #composer .composer-actions :is(#record-audio, #send-message) {
    justify-self: end; width: 44px; height: 44px; min-width: 44px; min-height: 44px;
    margin: 0; padding: 0; border-radius: 14px; color: var(--phone-panel); background: var(--phone-accent);
  }
  #app #composer:not(.has-text) #send-message,
  #app #composer.has-text #record-audio,
  #app #composer-area.has-attachment > #composer { display: none; }
  #app #composer-area :is(.quick-menu, .emoji-menu, .sticker-picker) {
    bottom: calc(100% + 5px); left: 9px; right: 9px; width: auto;
    max-height: min(360px, calc(var(--phone-viewport-height, 100dvh) * .5));
    overflow-y: auto; overscroll-behavior: contain; border-radius: 16px;
  }
  #app #composer-area .attachment-preview {
    max-height: calc(var(--phone-viewport-height, 100dvh) * .58);
    overflow-y: auto; overscroll-behavior: contain; border-radius: 16px;
  }
  #app #composer-area :is(.attachment-image-wrap, .attachment-image-wrap img, .attachment-video-wrap video) {
    max-height: calc(var(--phone-viewport-height, 100dvh) * .28);
  }
  #app #composer-area .message-draft-status { margin: 4px 8px 0; font-size: 10px; line-height: 15px; }
  #app #composer-area .connection-retry { min-height: 44px; }
  html.phone-keyboard-open #app #composer-area { padding-bottom: 6px; }
  html.phone-keyboard-open #app #composer { border-radius: 15px; }

  /* Sheets remain independently scrollable, including while an input is open. */
  #app #customer-details {
    max-height: calc(var(--phone-viewport-height, 100dvh) - 12px);
    overflow-y: auto; overscroll-behavior: contain;
  }
  #app #inbox-sidebar { overscroll-behavior: contain; }
  #mobile-more-menu {
    max-height: calc(var(--phone-viewport-height, 100dvh) - 16px);
    overflow-y: auto; overscroll-behavior: contain;
  }
  #action-dialog, #action-form {
    max-height: calc(var(--phone-viewport-height, 100dvh) - 12px);
  }
  #dialog-fields { overscroll-behavior: contain; scroll-padding-block: 16px; }

  /* A physical rightward swipe reveals pinning without moving the list itself. */
  #app #conversation-list .conversation-row { touch-action: pan-y pinch-zoom; overflow: hidden; }
  #app #conversation-list .conversation-row.phone-swipe-active > :not(.phone-swipe-hint) {
    position: relative; z-index: 1; translate: var(--phone-swipe-offset, 0px) 0;
  }
  #app #conversation-list .phone-swipe-hint {
    position: absolute; left: 0; top: 0; bottom: 0; z-index: 0; width: 80px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    padding: 8px; border-radius: 12px; background: var(--phone-active); color: var(--phone-accent);
    font-size: 11px; line-height: 17px; text-align: center; pointer-events: none; opacity: 0;
  }
  #app #conversation-list .phone-swipe-hint svg { width: 22px; height: 22px; stroke-width: 1.9; }
  #app #conversation-list .phone-swipe-active .phone-swipe-hint { opacity: 1; }
  #app #conversation-list .phone-swipe-ready .phone-swipe-hint { background: var(--phone-accent); color: var(--phone-panel); }
}

/* The native wrapper already has its own compact visuals through 940px.
   Only viewport containment and the same gesture affordance extend to it. */
@media (min-width: 721px) and (max-width: 940px) {
  html.native-android.phone-ui #app.app-shell {
    position: fixed; top: var(--phone-viewport-top, 0px); left: 0; right: 0;
    width: 100%; height: var(--phone-viewport-height, var(--native-viewport-height, 100dvh));
    min-height: 0; overflow: hidden;
  }
  html.native-android.phone-ui #app .main-shell { min-height: 0; overflow: hidden; }
  html.native-android.phone-ui #conversation-list .conversation-row { touch-action: pan-y pinch-zoom; overflow: hidden; }
  html.native-android.phone-ui #conversation-list .conversation-row.phone-swipe-active > :not(.phone-swipe-hint) {
    position: relative; z-index: 1; translate: var(--phone-swipe-offset, 0px) 0;
  }
  html.native-android.phone-ui #conversation-list .phone-swipe-hint {
    position: absolute; left: 0; top: 0; bottom: 0; width: 80px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    padding: 8px; border-radius: 12px; background: var(--native-active); color: var(--native-accent);
    font-size: 11px; line-height: 17px; text-align: center; pointer-events: none; opacity: 0;
  }
  html.native-android.phone-ui #conversation-list .phone-swipe-hint svg { width: 22px; height: 22px; }
  html.native-android.phone-ui #conversation-list .phone-swipe-active .phone-swipe-hint { opacity: 1; }
  html.native-android.phone-ui #conversation-list .phone-swipe-ready .phone-swipe-hint { background: var(--native-accent); color: var(--native-panel); }
}

/* Phone "more" sheet: one tidy, grouped list (owner request 31 Oct 2026). Visual only. */
@media (max-width: 940px) {
  #mobile-more-menu:not([hidden]) { display: flex !important; max-height: calc(100dvh - 70px); overflow-y: auto; overscroll-behavior: contain; z-index: 2147483000 !important; flex-flow: row wrap; align-content: flex-start; gap: 4px; padding: 6px 14px calc(18px + env(safe-area-inset-bottom, 0px)) !important; direction: rtl; }
  #mobile-more-menu > * { order: 50; }
  #mobile-more-menu > .mobile-menu-heading { order: 0; flex: 0 0 100%; display: flex; align-items: center; justify-content: space-between; margin: 0 0 6px; padding: 14px 8px 12px; border-bottom: 1px solid rgba(255,255,255,.07); position: relative; background: transparent !important; }
  #mobile-more-menu > .mobile-menu-heading::before { content: ""; position: absolute; top: 6px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 4px; background: rgba(255,255,255,.18); }
  #mobile-more-menu > .mobile-menu-heading b { font-size: 19px; font-weight: 800; }
  /* Work tools first, then team settings, then the three quick toggles, then the account. */
  #mobile-more-menu > [data-view="products"] { order: 10; }
  #mobile-more-menu > [data-view="companyStore"] { order: 11; }
  #mobile-more-menu > [data-view="cash"] { order: 12; }
  #mobile-more-menu > #storefront-workspace-mobile { order: 13; }
  #mobile-more-menu > [data-view="team"] { order: 20; }
  #mobile-more-menu > [data-view="reports"] { order: 21; }
  #mobile-more-menu > [data-view="replies"] { order: 22; }
  #mobile-more-menu > [data-view="automations"] { order: 23; }
  #mobile-more-menu > [data-view="connection"] { order: 24; }
  #mobile-more-menu > #intercom-toggle { order: 30; }
  #mobile-more-menu > #workspace-music-toggle { order: 31; }
  #mobile-more-menu > #theme-toggle { order: 32; }
  #mobile-more-menu > #mobile-account { order: 40; }
  /* Rows */
  #mobile-more-menu > button:not(#intercom-toggle):not(#workspace-music-toggle):not(#theme-toggle) {
    flex: 0 0 100%; width: 100% !important; min-height: 48px; display: flex !important; align-items: center; justify-content: flex-start !important; gap: 14px;
    padding: 4px 10px !important; margin: 0; border: 0; border-radius: 14px; background: transparent; font-size: 16px; font-weight: 600; text-align: right; position: relative;
  }
  #mobile-more-menu > button:not(#intercom-toggle):not(#workspace-music-toggle):not(#theme-toggle)::after {
    content: ""; position: absolute; left: 14px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); opacity: .35;
  }
  #mobile-more-menu > button > svg, #mobile-more-menu > button > span[data-icon] {
    flex: none; display: grid; place-items: center; width: 38px !important; height: 38px !important; padding: 8px; box-sizing: border-box; border-radius: 12px; background: rgba(144,239,212,.09); color: #92e5cb; margin: 0 !important;
  }
  #mobile-more-menu > button > span[data-icon] > svg { width: 22px; height: 22px; }
  #mobile-more-menu > [data-view="products"]::before {
    content: ""; flex: none; width: 38px; height: 38px; border-radius: 12px;
    background: rgba(144,239,212,.09) center/22px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2392e5cb' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7.5 7h9a4.5 4.5 0 0 1 4.4 5.4l-.8 4a2.6 2.6 0 0 1-4.6 1.1L14 16h-4l-1.5 1.5a2.6 2.6 0 0 1-4.6-1.1l-.8-4A4.5 4.5 0 0 1 7.5 7z'/%3E%3Cpath d='M7.5 10.5v3M6 12h3'/%3E%3Ccircle cx='15.5' cy='11' r='.6' fill='%2392e5cb'/%3E%3Ccircle cx='17' cy='13' r='.6' fill='%2392e5cb'/%3E%3C/svg%3E");
  }
  /* Group separators */
  #mobile-more-menu > [data-view="team"] { margin-top: 10px !important; }
  #mobile-more-menu > [data-view="team"]::before {
    position: absolute; top: -8px; right: 10px; left: 10px; height: 1px; background: rgba(255,255,255,.07); content: "";
  }
  #mobile-more-menu > :is(#intercom-toggle, #workspace-music-toggle, #theme-toggle) { margin-top: 12px !important; align-self: stretch; }
  /* Three quick toggles as equal tiles */
  #mobile-more-menu > :is(#intercom-toggle, #workspace-music-toggle, #theme-toggle) {
    flex: 1 1 0; min-width: 0; width: auto !important; min-height: 76px; display: flex !important; flex-direction: column; align-items: center; justify-content: center !important; gap: 7px;
    padding: 10px 4px !important; margin: 0; border: 1px solid rgba(255,255,255,.08) !important; border-radius: 16px; background: rgba(255,255,255,.04) !important; font-size: 13px; font-weight: 700; position: relative; box-shadow: none !important;
  }
  #mobile-more-menu > :is(#intercom-toggle, #workspace-music-toggle, #theme-toggle) > :is(svg, span[data-icon]) { width: 26px !important; height: 26px !important; padding: 0; background: none; border-radius: 0; }
  #mobile-more-menu > :is(#intercom-toggle, #workspace-music-toggle, #theme-toggle) :is(.intercom-label, .music-label, .theme-toggle-label) { display: block !important; position: static !important; color: inherit !important; font-size: 13px; line-height: 1.2; white-space: nowrap; }
  #mobile-more-menu > #intercom-toggle i { position: absolute; top: 10px; left: 12px; right: auto; }
  #mobile-more-menu > #mobile-account { margin-top: 8px; border: 1px solid rgba(255,255,255,.08); }
}
@media (max-width: 940px) {
  html[data-theme="light"] #mobile-more-menu > button > :is(svg, span[data-icon]), html[data-theme="light"] #mobile-more-menu > [data-view="products"]::before { background-color: rgba(31,120,95,.1); color: #1f785f; }
  html[data-theme="light"] #mobile-more-menu > :is(#intercom-toggle, #workspace-music-toggle, #theme-toggle) { background: rgba(0,0,0,.035) !important; border-color: rgba(0,0,0,.08) !important; }
  html[data-theme="light"] #mobile-more-menu > .mobile-menu-heading, html[data-theme="light"] #mobile-more-menu > [data-view="team"]::before { border-color: rgba(0,0,0,.08); background-color: rgba(0,0,0,.08); }
  
}

/* Phone chat header: timer centered, purple bolt like desktop, ⋮ menu (owner request 31 Oct 2026). Visual only. */
#phone-chat-dots, #phone-chat-dots-menu { display: none; }
/* Computer: keep the phone-only dots button hidden; the chat header shows every .icon-button (owner request, 6 Nov 2026) */
.chat-header-v2 #chat-actions > #phone-chat-dots { display: none; }
@media (max-width: 720px) {
  #app #chat-panel .chat-header.chat-header-v2 {
    position: relative; grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: "back identity actions";
    grid-template-rows: 52px; min-height: 0; padding: 6px 8px; gap: 0 6px;
  }
  #app #chat-panel .chat-header-v2 .chat-person #chat-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #app #chat-panel .chat-header-v2 #chat-identity { min-width: 0; max-width: calc(50vw - 80px); }
  #app #chat-panel .chat-header-v2 #show-details.customer-avatar-button { width: 36px; min-width: 36px; height: 40px; }
  #app #chat-panel .chat-header-v2 #show-details #chat-avatar { width: 36px; height: 36px; font-size: 13px; }
  #app #chat-panel .chat-header-v2 .chat-person { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
  #app #chat-panel .chat-header-v2 #chat-customer-badges { margin-top: 1px; max-width: 100%; overflow: hidden; }
  #app #chat-panel .chat-header-v2 #chat-context { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); margin: 0; padding: 0; grid-area: auto; z-index: 1; }
  html[data-theme] #app #chat-panel .chat-header-v2 .header-reply-window,
  #app #chat-panel .chat-header-v2 .header-reply-window {
    display: flex; align-items: center; min-width: 0; height: 32px; padding: 0 10px; gap: 5px; direction: ltr;
    border: 1px solid rgba(144,239,212,.2); border-radius: 12px; background: rgba(144,239,212,.06); box-shadow: none; color: #9fb8b2;
  }
  #app #chat-panel .chat-header-v2 .header-reply-window > span[data-icon] { display: flex !important; }
  #app #chat-panel .chat-header-v2 .header-reply-window > span[data-icon] svg { width: 14px; height: 14px; }
  #app #chat-panel .chat-header-v2 .header-reply-window > div { display: grid; justify-items: center; gap: 0; direction: rtl; }
  #app #chat-panel .chat-header-v2 #reply-window-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  html[data-theme] #app #chat-panel .chat-header-v2 #reply-window,
  #app #chat-panel .chat-header-v2 #reply-window { font-size: 14px; line-height: 18px; font-weight: 750; letter-spacing: .4px; color: #e6f4f0; }
  html[data-theme] #app #chat-panel .chat-header-v2 #reply-window.expired,
  #app #chat-panel .chat-header-v2 #reply-window.expired { font-size: 11px; font-weight: 600; color: var(--theme-warning, #e0b06a); white-space: nowrap; }
  #app #chat-panel .chat-header-v2 #chat-actions { position: relative; align-self: center; gap: 6px; }
  #app #chat-panel .chat-header-v2 #chat-actions > #search-chat { display: none !important; }
  /* Bolt menu keeps only codes + QR; the rest lives in the ⋮ menu (owner request). */
  #app #chat-panel .chat-header-v2 #chat-action-menu > :is(#transfer-conversation, #close-conversation, #pin-conversation, #interactive-toggle) { display: none !important; }
  #app #chat-panel .chat-header-v2 #phone-chat-dots-menu > button[data-target="close-conversation"]:not([hidden]) { color: #e0768e; }
  #app #chat-panel .chat-header-v2 #phone-chat-dots-menu > button[data-target="close-conversation"] .phone-dots-icon { background: rgba(239,143,163,.1); color: #ef8fa3; }
  #app #chat-panel .chat-header-v2 #chat-actions > .icon-button { width: 40px; height: 40px; min-width: 40px; min-height: 40px; padding: 9px; border-radius: 12px; }
  #app #chat-panel .chat-header-v2 #chat-actions > #chat-more { background: #332153; color: #d1b1ff; border: 1px solid #7051a1; }
  #app #chat-panel .chat-header-v2 #chat-actions > #chat-more[aria-expanded="true"] { background: #543480; border-color: #b297dc; }
  #app #chat-panel .chat-header-v2 #chat-actions > #phone-chat-dots { display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 1px solid rgba(255,255,255,.1); color: var(--phone-muted, #9fb3b0); }
  #app #chat-panel .chat-header-v2 #chat-actions > #phone-chat-dots[aria-expanded="true"] { background: rgba(255,255,255,.06); }
  #app #chat-panel .chat-header-v2 #phone-chat-dots-menu:not([hidden]) {
    display: block; position: absolute; top: calc(100% + 10px); left: 0; z-index: 30; width: 250px; padding: 6px;
    border: 1px solid #345360; border-radius: 16px; background: #102b36; box-shadow: 0 14px 40px #00101b66; direction: rtl;
  }
  #app #chat-panel .chat-header-v2 #phone-chat-dots-menu > button:not([hidden]) {
    display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 6px 8px; border: 0; border-radius: 12px;
    background: transparent; color: #edf7fb; font: inherit; font-size: 14.5px; font-weight: 600; text-align: right;
  }
  #app #chat-panel .chat-header-v2 #phone-chat-dots-menu > button:active { background: rgba(255,255,255,.06); }
  #app #chat-panel .chat-header-v2 .phone-dots-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: rgba(144,239,212,.09); color: #92e5cb; flex: none; }
  html[data-theme="light"] #app #chat-panel .chat-header-v2 .header-reply-window { border-color: rgba(31,120,95,.22); background: rgba(31,120,95,.06); color: #5b7060; }
  html[data-theme="light"] #app #chat-panel .chat-header-v2 #reply-window { color: #1d3d34; }
  html[data-theme="light"] #app #chat-panel .chat-header-v2 #chat-actions > #chat-more { background: #e9e0f7; color: #6a439c; border-color: #c6afe6; }
  html[data-theme="light"] #app #chat-panel .chat-header-v2 #chat-actions > #phone-chat-dots { border-color: rgba(0,0,0,.1); color: #4d625b; }
  html[data-theme="light"] #app #chat-panel .chat-header-v2 #phone-chat-dots-menu:not([hidden]) { background: #fff; border-color: #d9e4de; box-shadow: 0 14px 40px rgba(20,50,40,.16); }
  html[data-theme="light"] #app #chat-panel .chat-header-v2 #phone-chat-dots-menu > button:not([hidden]) { color: #1d3d34; }
  html[data-theme="light"] #app #chat-panel .chat-header-v2 .phone-dots-icon { background: rgba(31,120,95,.1); color: #1f785f; }
}

/* Phone chat: one-line composer like WhatsApp; reply assistant bar hidden on phone only (owner request 31 Oct 2026). */
@media (max-width: 720px) {
  #app #chat-panel #reply-assistant-chat { display: none !important; }
  #app #composer-area { padding: 6px 8px calc(6px + var(--phone-safe-bottom)); }
  html.phone-keyboard-open #app #composer-area { padding-bottom: 5px; }
  #app #composer, #app #composer:not(:has(#quick-toggle)) {
    grid-template-columns: minmax(0, 1fr) repeat(4, 32px) 42px;
    grid-template-areas: "input emoji sticker template image action";
    gap: 0 1px; align-items: end; padding: 2px 3px 2px 4px; border-radius: 23px;
  }
  #app #composer:has(#quick-toggle) {
    grid-template-columns: minmax(0, 1fr) repeat(5, 32px) 42px;
    grid-template-areas: "input emoji sticker quick template image action";
  }
  html.phone-keyboard-open #app #composer { border-radius: 23px; }
  #app #composer #message-input { min-height: 42px; padding: 9px 10px 8px 4px; line-height: 24px; }
  #app #composer #message-input::placeholder { font-size: 15px; }
  #app #composer .composer-actions :is(#emoji-toggle, #sticker-toggle, #quick-toggle, #template-toggle, #attach-image) {
    width: 32px; height: 42px; min-width: 32px; min-height: 42px; border-radius: 10px;
  }
  #app #composer .composer-actions :is(#emoji-toggle, #sticker-toggle, #quick-toggle, #template-toggle, #attach-image) svg { width: 20px; height: 20px; }
  #app #composer .composer-actions #emoji-toggle { grid-area: emoji; }
  #app #composer .composer-actions #sticker-toggle { grid-area: sticker; }
  #app #composer .composer-actions #quick-toggle { grid-area: quick; }
  #app #composer .composer-actions #template-toggle { grid-area: template; }
  #app #composer .composer-actions #attach-image { grid-area: image; }
  #app #composer .composer-actions :is(#record-audio, #send-message) {
    grid-area: action; width: 40px; height: 40px; min-width: 40px; min-height: 40px; margin: 1px 0; border-radius: 50%;
  }
  #app #composer .composer-actions :is(#record-audio, #send-message) svg { width: 20px; height: 20px; }
  #app #composer .composer-actions #send-message > span:not([data-icon]) { display: none; }
}

/* Phone chat: tighter message spacing and badge under the name (owner request 31 Oct 2026). Phone only. */
@media (max-width: 720px) {
  #app #messages { gap: 6px; padding: 10px 10px; }
  #app #messages .message-tools { margin-top: 1px; gap: 2px; min-height: 0; }
  #app #messages .message-tools button { min-width: 30px; min-height: 26px; height: 26px; padding: 0 6px; font-size: 11.5px; line-height: 26px; }
  #app #messages .message-tools button svg { width: 14px; height: 14px; }
  #app #messages .bubble { padding: 7px 11px; }
  #app #messages .message-meta { margin-top: 1px; }
  #app #chat-panel .chat-header-v2 .chat-person #chat-name { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; overflow: hidden; }
  #app #chat-panel .chat-header-v2 #chat-name .chat-name-text { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #app #chat-panel .chat-header-v2 #chat-name .meta-ad-badge { font-size: 9px; line-height: 13px; padding: 0 5px; margin: 0; }
}

/* TaysLink interaction polish 2026-11-07 */
/* Last-loaded customer action presentation. The original trigger and all
   company visibility/permission rules remain owned by the application. */
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready {
  --tl-menu-ease:var(--ui-ease-out,cubic-bezier(.23,1,.32,1));
  position:fixed;inset:auto;z-index:10000;isolation:isolate;box-sizing:border-box;
  width:min(382px,calc(100vw - 24px));max-width:calc(100vw - 24px);
  margin:0;padding:0 8px 8px;overflow:auto;overscroll-behavior:contain;
  scrollbar-width:thin;scrollbar-color:var(--chat-ui-line) transparent;
  border:1px solid var(--chat-ui-line);border-radius:18px;
  color:var(--chat-ui-ink);background:var(--chat-ui-surface);
  box-shadow:var(--chat-ui-edge),var(--chat-ui-popup-shadow);
  direction:rtl;text-align:right;font:inherit;line-height:1.6;
  transform-origin:var(--cam-origin,62px -12px);filter:none;
  opacity:1;scale:1;translate:0 0;
  transition:opacity 200ms var(--tl-menu-ease),scale 200ms var(--tl-menu-ease),translate 200ms var(--tl-menu-ease),display 200ms allow-discrete;
}
html[data-theme="dark"] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready {
  background:linear-gradient(155deg,#90efd40d 0%,transparent 40%),linear-gradient(180deg,#163037f5,#10252bf2 48%,#0f2229f0);
  -webkit-backdrop-filter:blur(16px) saturate(140%);backdrop-filter:blur(16px) saturate(140%);
}
html[data-theme="light"] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready {
  background:linear-gradient(150deg,#fffffff5,#fbfefdf2 44%,#f1f9f6f0);
  -webkit-backdrop-filter:blur(16px) saturate(140%);backdrop-filter:blur(16px) saturate(140%);
}
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready[hidden] {
  display:none;opacity:0;scale:.97;translate:0 -5px;filter:none;pointer-events:none;
  transition:opacity 125ms var(--tl-menu-ease),scale 125ms var(--tl-menu-ease),translate 125ms var(--tl-menu-ease),display 125ms allow-discrete;
}
@starting-style {
  html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready:not([hidden]) {opacity:0;scale:.97;translate:0 -5px;filter:none}
}
#chat-action-menu.tl-menu-ready *,#chat-action-menu.tl-menu-ready *::before,#chat-action-menu.tl-menu-ready *::after {box-sizing:border-box}
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready .tl-menu-heading {
  position:relative;z-index:1;padding:17px 12px 14px 54px;margin:0 -8px 0;
  border-bottom:1px solid var(--chat-ui-line);color:var(--chat-ui-ink);
}
#chat-action-menu.tl-menu-ready .tl-menu-heading strong {display:block;font-size:16px;font-weight:650;line-height:1.5}
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready .tl-menu-customer {
  margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:var(--chat-ui-muted);
}
#chat-action-menu.tl-menu-ready .tl-menu-group-label {
  position:relative;z-index:1;padding:13px 12px 5px;font-size:11px;font-weight:500;color:var(--chat-ui-muted);
}
#chat-action-menu.tl-menu-ready .tl-menu-group-label[hidden] {display:none}
#chat-action-menu.tl-menu-ready .tl-menu-highlight {
  position:absolute;inset:0 8px auto;z-index:0;pointer-events:none;opacity:0;
  border-radius:12px;background:var(--chat-ui-soft);
  transition:transform 160ms var(--ui-ease-out,cubic-bezier(.23,1,.32,1)),opacity 125ms ease;
}
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready>button.tl-menu-row {
  position:relative;z-index:1;display:flex;align-items:center;justify-content:flex-start;
  width:100%;min-height:67px;height:auto;margin:0;padding:10px 12px;gap:11px;
  border:0!important;border-radius:12px;background:transparent!important;color:var(--chat-ui-ink)!important;
  box-shadow:none!important;font:inherit;text-align:right;line-height:1.6;white-space:normal;
  transform:none;scale:1;transition:scale 160ms var(--ui-ease-out,cubic-bezier(.23,1,.32,1));
  -webkit-tap-highlight-color:transparent;touch-action:manipulation;
}
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready>button.tl-menu-row[hidden] {display:none}
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready #transfer-conversation:is(:hover,:focus-visible) {background:transparent!important}
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready>button.tl-menu-row:disabled {opacity:.45;cursor:not-allowed}
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready>button.tl-menu-row b {font-size:14px;font-weight:600;line-height:1.65}
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready>button.tl-menu-row small {font-size:12px;color:var(--chat-ui-muted);line-height:1.6;margin-top:1px}
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready .chat-action-symbol {
  display:grid;place-items:center;flex:none;width:31px;height:34px;border-radius:9px;
  color:var(--chat-ui-accent);background:transparent;filter:none;transition:none;
}
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready .chat-action-symbol svg {width:20px;height:20px}
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready .chat-action-arrow {display:inline-flex;translate:none;transition:none;color:var(--chat-ui-muted)}
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready .chat-action-arrow svg {width:14px;height:14px;color:inherit}
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready .tl-menu-chevron svg {transform:none}
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready>button.tl-menu-highlighted :is(b,.chat-action-symbol,.chat-action-arrow) {color:var(--chat-ui-accent)}
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready>button#close-conversation,
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready>button#close-conversation :is(b,.chat-action-symbol,.chat-action-arrow) {color:var(--chat-ui-error)!important}
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready>button.tl-menu-row:active:not(:disabled) {scale:.985;background:var(--chat-ui-hover)!important;transition-duration:100ms}
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready>button:focus-visible {outline:2px solid var(--chat-ui-accent);outline-offset:-2px}
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready>button.tl-menu-close {
  position:absolute;z-index:2;top:11px;left:8px;display:grid;place-items:center;
  width:44px;min-width:44px;height:44px;min-height:44px;margin:0;padding:0;
  border:0;border-radius:12px;box-shadow:none;background:transparent;color:var(--chat-ui-muted);
  scale:1;transition:scale 160ms var(--ui-ease-out,cubic-bezier(.23,1,.32,1));
}
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready>button.tl-menu-close svg {width:18px;height:18px}
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready>button.tl-menu-close:active {scale:.97;transition-duration:100ms}
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-more {transition:scale 160ms var(--ui-ease-out,cubic-bezier(.23,1,.32,1)),background-color 160ms ease,border-color 160ms ease}
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-more:active:not(:disabled) {scale:.97;transition-duration:100ms}
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-keyboard,
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-keyboard *,
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-more.tl-menu-keyboard {transition:none!important;animation:none!important}
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-keyboard {scale:1;translate:none}
html[data-theme] dialog.tl-customer-dialog {border-color:var(--chat-ui-line);border-radius:18px;box-shadow:var(--chat-ui-popup-shadow)}
html[data-theme] dialog.tl-customer-dialog .tl-dialog-return {display:flex;flex:0 0 auto;align-items:center;justify-content:space-between;gap:12px;padding:8px 14px;border-bottom:1px solid var(--fz-line,var(--chat-ui-line));color:var(--fz-muted,var(--chat-ui-muted));background:var(--fz-panel,var(--chat-ui-panel));font-size:12px;direction:rtl}
html[data-theme] dialog.tl-customer-dialog .tl-dialog-return>span {overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html[data-theme] dialog.tl-customer-dialog .tl-dialog-return button {display:flex;align-items:center;gap:6px;flex:none;min-height:44px;padding:8px;border:0;border-radius:10px;background:transparent;color:var(--fz-accent,var(--chat-ui-accent));font:inherit;font-weight:600;cursor:pointer}
html[data-theme] dialog.tl-customer-dialog .tl-dialog-return svg {width:18px;height:18px}
html[data-theme] dialog.tl-customer-dialog .tl-dialog-return button:focus-visible {outline:2px solid var(--chat-ui-accent);outline-offset:1px}
@media (hover:hover) and (pointer:fine) {
  html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready>button.tl-menu-close:hover {background:var(--chat-ui-input);color:var(--chat-ui-ink)}
  html[data-theme] dialog.tl-customer-dialog .tl-dialog-return button:hover {background:var(--chat-ui-soft)}
}
@media (prefers-reduced-motion:reduce) {
  html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready,
  html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready *,
  html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-more {transition:none!important;animation:none!important}
  html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready {scale:1;translate:none}
  html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready>button:active,
  html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-more:active:not(:disabled) {scale:1!important}
}
@media (prefers-reduced-transparency:reduce),(prefers-contrast:more) {
  html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu.tl-menu-ready {background:var(--chat-ui-panel);backdrop-filter:none;-webkit-backdrop-filter:none}
}
@media (prefers-contrast:more) {#chat-action-menu.tl-menu-ready .tl-menu-highlight {box-shadow:inset 0 0 0 1px var(--chat-ui-accent)}}


/* Desktop rail only. The app keeps its existing mobile/native navigation. */
.tays-nav-label{display:none}
.tays-nav-active,.tays-nav-hover{position:absolute;left:0;top:0;width:44px;height:44px;border-radius:13px;pointer-events:none;z-index:0;opacity:0;transition:transform 200ms var(--ui-ease-out,cubic-bezier(.23,1,.32,1)),opacity 125ms var(--ui-ease-out,cubic-bezier(.23,1,.32,1))}
.tays-nav-active{background:var(--chat-ui-nav-fill);box-shadow:inset 0 0 0 1px var(--chat-ui-nav-edge),inset 0 1px 1px var(--chat-ui-nav-sheen),0 3px 8px #001c251c}
.tays-nav-active:after{content:"";position:absolute;left:0;top:calc(50% - 7px);width:2px;height:14px;background:var(--chat-ui-nav-ink);border-radius:2px;opacity:.9}
.tays-nav-hover{background:var(--chat-ui-hover)}
.tays-nav-tooltip{position:fixed;z-index:600;pointer-events:none;visibility:hidden;opacity:0;transform:translateX(-5px) scale(.97);transform-origin:left center;transition:transform 125ms var(--ui-ease-out,cubic-bezier(.23,1,.32,1)),opacity 125ms var(--ui-ease-out,cubic-bezier(.23,1,.32,1)),visibility 125ms;max-width:min(280px,calc(100vw - 90px));padding:12px 15px;border:1px solid var(--chat-ui-line);border-radius:14px;background:var(--chat-ui-panel);color:var(--chat-ui-ink);box-shadow:var(--chat-ui-popup-shadow),var(--chat-ui-edge);font-family:inherit;text-align:right}
.tays-nav-tooltip[data-open=true]{visibility:visible;opacity:1;transform:translateX(0) scale(1);pointer-events:auto}
.tays-nav-tooltip[data-instant=true]{transition:none}
.tays-nav-tooltip strong{display:block;font-size:13px;font-weight:650;line-height:1.7}
.tays-nav-tooltip small{display:block;font-size:11px;color:var(--chat-ui-muted);line-height:1.7;margin-top:2px}
.navigation[data-nav-input=keyboard] :is(.tays-nav-active,.tays-nav-hover,.nav-item,.nav-item svg){transition:none!important}
@media(min-width:721px){
 html[data-theme] #app.tays-nav-polished{--rail:68px}
 html[data-theme] #app.tays-nav-polished .navigation{width:var(--rail);flex:0 0 var(--rail);padding:18px 11px 13px;position:relative;isolation:isolate;overflow:visible}
 html[data-theme] #app.tays-nav-polished .navigation .brand{flex-shrink:0;margin-bottom:22px}
 html[data-theme] #app.tays-nav-polished .navigation nav{position:relative;isolation:isolate;display:flex;flex-direction:column;gap:6px;align-items:center;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:none;padding:2px 0;flex-shrink:1}
 #app.tays-nav-polished .navigation nav::-webkit-scrollbar{display:none}
 html[data-theme] #app.tays-nav-polished .navigation .nav-item{height:44px;min-height:44px;width:44px;flex-shrink:0;border:0;border-radius:13px;text-decoration:none;outline-offset:3px;position:relative;z-index:2;transition:transform 160ms var(--ui-ease-out,cubic-bezier(.23,1,.32,1));touch-action:manipulation;-webkit-tap-highlight-color:transparent}
 html[data-theme] #app.tays-nav-polished .navigation[data-nav-ready=true] .nav-item:is(.active,:hover,:active){background:transparent;box-shadow:none;scale:1}
 html[data-theme] #app.tays-nav-polished .navigation .nav-item.active{color:var(--chat-ui-nav-ink)}
 html[data-theme] #app.tays-nav-polished .navigation .nav-item:active:not(:disabled){transform:scale(.95);transition-duration:100ms}
 html[data-theme] #app.tays-nav-polished .navigation .nav-item svg{width:21px;height:21px;transition:transform 160ms var(--ui-ease-out,cubic-bezier(.23,1,.32,1))}
 html[data-theme] #app.tays-nav-polished .navigation :is(.nav-item,.brand):focus-visible{outline:2px solid var(--chat-ui-accent);outline-offset:-2px}
 html[data-theme] #app.tays-nav-polished .navigation .nav-divider{width:24px;height:1px;min-height:1px;margin:10px 0;opacity:.7}
 html[data-theme] #app.tays-nav-polished .navigation .rail-bottom{width:44px;flex-shrink:0;gap:7px;padding-top:14px;background:transparent}
 html[data-theme] #app.tays-nav-polished .navigation .rail-bottom>button{width:44px;min-height:44px;border-radius:12px}
 html[data-theme] #app.tays-nav-polished .navigation .rail-bottom #profile-button{width:44px;height:44px;margin-top:3px}
}
@media(min-width:721px) and (max-height:760px){
 html[data-theme] #app.tays-nav-polished .navigation{padding-top:12px;padding-bottom:8px}
 html[data-theme] #app.tays-nav-polished .navigation .brand{margin-bottom:12px}
 html[data-theme] #app.tays-nav-polished .navigation nav{gap:3px}
 html[data-theme] #app.tays-nav-polished .navigation .nav-divider{margin-top:5px;margin-bottom:5px}
 html[data-theme] #app.tays-nav-polished .navigation .rail-bottom{gap:3px;padding-top:8px}
}
@media(hover:hover) and (pointer:fine){
 html[data-theme] #app.tays-nav-polished .navigation .nav-item:not(.active):hover{color:var(--chat-ui-ink)}
 html[data-theme] #app.tays-nav-polished .navigation .nav-item:hover svg{transform:translateX(1px)}
}
@media(max-width:720px){.tays-nav-tooltip{display:none!important}}
@media(max-width:940px){html.native-android #app.tays-nav-polished{--rail:0px}html.native-android .tays-nav-tooltip{display:none!important}}
@media(prefers-reduced-motion:reduce){
 #app.tays-nav-polished .navigation :is(.nav-item,.nav-item svg,.tays-nav-active,.tays-nav-hover),.tays-nav-tooltip{transition:none!important}
 html[data-theme] #app.tays-nav-polished .navigation .nav-item:active,html[data-theme] #app.tays-nav-polished .navigation .nav-item:hover svg{transform:none!important}
}


/* Conversation navigation: immediate row-owned feedback, with no traveling
   overlay, inherited geometry variables, row scaling or animation queue.
   Existing text, alignment, row dimensions and native Android stay unchanged. */
html:not(.native-android)[data-theme] #inbox-view #conversation-list[data-conversation-polish="ready"] {
  position:relative;
  isolation:isolate;
}
html:not(.native-android)[data-theme] #inbox-view #conversation-list[data-conversation-polish="ready"]::before,
html:not(.native-android)[data-theme] #inbox-view #conversation-list[data-conversation-polish="ready"]::after {
  content:none;
  display:none;
}
html:not(.native-android)[data-theme] #inbox-view #conversation-list[data-conversation-polish="ready"] > .conversation-row {
  position:relative;
  z-index:1;
  background:transparent;
  border-color:transparent;
  box-shadow:none;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
  transform:none;
  transition:none;
  animation:none;
}
@media (hover:hover) and (pointer:fine) {
  html:not(.native-android)[data-theme] #inbox-view #conversation-list[data-conversation-polish="ready"] > .conversation-row:not(.selected):hover {
    background:var(--chat-ui-hover,var(--list-hover));
  }
}
html:not(.native-android)[data-theme] #inbox-view #conversation-list[data-conversation-polish="ready"] > .conversation-row.selected {
  background:var(--chat-ui-selected,var(--list-selected));
  box-shadow:inset 0 0 0 1px var(--chat-ui-selected-line,var(--list-selected-border));
}
html:not(.native-android)[data-theme] #inbox-view #conversation-list[data-conversation-polish="ready"] > .conversation-row.selected::before { content:none; }
html:not(.native-android)[data-theme] #inbox-view #conversation-list[data-conversation-polish="ready"] > .conversation-row:active {
  transform:none;
}
html:not(.native-android)[data-theme] #inbox-view #conversation-list[data-conversation-polish="ready"] > .conversation-row:focus-visible {
  outline:2px solid var(--chat-ui-accent,var(--accent));
  outline-offset:-3px;
}

/* Conversation dividers 2026-11-08 */
/* Restore visible row boundaries using each live theme's existing line color. */
html:not(.native-android)[data-theme] #inbox-view #conversation-list[data-conversation-polish="ready"] > .conversation-row:not([hidden]):has(~ .conversation-row:not([hidden]))::after {
  content:"";
  position:absolute;
  inset-inline:13px;
  bottom:0;
  height:1px;
  background:var(--chat-ui-line,var(--line));
  pointer-events:none;
}
