/* Operational inbox: fixed reading region, stable composer, no ornamental dashboard. */
.view.inbox-active { padding: 24px; max-width: none; }
.view.inbox-active + .workspace-footer { display: none; }
/* The page fills the screen and the grid takes what the heading leaves, down to its minimum height. Below that the
   page grows (min-content; the grid's content does not count) and scrolls, so a wrapped heading never clips the
   composer and the view keeps its bottom padding. */
.inbox-page { color: #24212d; min-width: 0; display: flex; flex-direction: column; height: calc(100dvh - 99px); min-height: min-content; }
.inbox-heading { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; margin: 0 0 18px; }
.inbox-heading.has-presence { flex-wrap: wrap; }
.inbox-heading h1 { margin: 0; font-size: 28px; line-height: 1.2; letter-spacing: -.035em; }
.inbox-heading p { margin: 6px 0 0; color: #656171; font-size: 14px; }
.inbox-sync { font-size: 12px; color: #696475; white-space: nowrap; }
.inbox-heading-side { display: flex; align-items: center; gap: 16px; min-width: 0; margin-left: auto; }
.inbox-presence { flex: none; display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 8px; row-gap: 3px; }
.inbox-presence label { margin: 0; font-size: 12px; font-weight: 600; color: #4d4858; }
.inbox-presence select { width: auto; min-width: 9.5rem; min-height: 36px; padding: 6px 30px 6px 10px; border: 1px solid #cfcad8; border-radius: 9px; background: #fff; color: #24212d; font: inherit; font-size: 13px; }
.inbox-presence select:focus-visible { outline: 3px solid #8b7bd866; outline-offset: 2px; }
.inbox-presence-status { grid-column: 1 / -1; font-size: 12px; color: #696475; display: flex; align-items: center; gap: 6px; }
.inbox-presence-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #a39fae; flex: none; }
.inbox-presence-status[data-tone="online"]::before { background: #1f9d63; }
.inbox-presence-status[data-tone="busy"]::before { background: #c98a16; }
.inbox-presence-status[data-tone="unknown"] { color: #a33a2f; font-weight: 600; }
.inbox-presence-status[data-tone="unknown"]::before { background: #c8473a; }
.inbox-grid { flex: 1 1 0; contain: size; display: grid; grid-template-columns: minmax(265px, 340px) minmax(0, 1fr); min-height: 580px; border: 1px solid #dedbe5; border-radius: 16px; overflow: hidden; background: #fff; box-shadow: 0 8px 30px #241c3010; }
.inbox-list-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; border-right: 1px solid #e5e1e9; background: #fbfafc; }
.inbox-list-tools { padding: 17px 15px 10px; border-bottom: 1px solid #e9e5ed; }
.inbox-filter-row { display: grid; grid-template-columns: 1.3fr .7fr 1fr 1fr; gap: 3px; margin: 0 0 14px; background: #efedf3; padding: 4px; border-radius: 10px; }
.inbox-filter-row button { border: 0; border-radius: 7px; background: transparent; padding: 9px 3px; font-size: 11px; line-height: 1.3; font-weight: 650; color: #665e76; cursor: pointer; }
.inbox-filter-row button[aria-pressed="true"] { background: #fff; color: #241f30; box-shadow: 0 1px 4px #19132114; }
#inbox-search { width: 100%; margin: 0; border: 1px solid #dfdae6; border-radius: 9px; background: #fff; padding: 10px 12px; font-size: 13px; }
.inbox-list-meta { display: flex; align-items: center; justify-content: space-between; color: #736c81; font-size: 11px; margin: 7px 0 0; }
.inbox-list-meta .icon-button { width: 30px; height: 28px; font-size: 19px; }
.inbox-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 7px; }
.inbox-list:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.inbox-row { display: flex; align-items: flex-start; gap: 10px; width: 100%; border: 1px solid transparent; background: transparent; border-radius: 10px; text-align: left; padding: 13px 10px; cursor: pointer; color: inherit; margin: 0 0 4px; }
.inbox-row:hover { background: #f0edf5; }
.inbox-row.selected { background: #ece7f6; border-color: #d5cae9; }
.inbox-avatar { flex: 0 0 32px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: #695780; background: #e8e2ef; font-size: 13px; }
.inbox-row-copy { min-width: 0; flex: 1; }
.inbox-row-top { display: flex; align-items: baseline; gap: 8px; }
.inbox-row-top strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; font-size: 12px; }
.inbox-row-top time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.inbox-snippet { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #6e657a; font-size: 12px; line-height: 1.5; margin: 4px 0 10px; }
.inbox-row-foot { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.inbox-state { display: inline-flex; align-items: center; color: var(--muted); font-size: 11px; }
.inbox-state.waiting { color: #734f0a; background: #fff0c6; border-radius: 5px; padding: 3px 5px; }
.inbox-unread { font-size: 11px; color: #6c4d95; font-weight: 700; }
.inbox-pager { display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 10px 12px; border-top: 1px solid #e6e1ec; }
.inbox-pager .btn { font-size: 11px; min-height: 32px; padding: 6px 9px; }
#inbox-page-label { font-size: 11px; color: #6a6473; }
.inbox-thread-pane { min-width: 0; min-height: 0; background: #fff; container-type: inline-size; }
.inbox-no-selection { display: flex; height: 100%; flex-direction: column; justify-content: center; align-items: center; padding: 32px; text-align: center; }
.inbox-no-selection .icon { width: 44px; height: 44px; color: #a093b4; margin-bottom: 18px; }
.inbox-no-selection h2 { font-size: 21px; margin: 0 0 10px; }
.inbox-no-selection p { color: #766f7f; max-width: 310px; line-height: 1.6; }
.inbox-thread { display: grid; grid-template-columns: minmax(0, 1fr); height: 100%; min-height: 0; position: relative; }
/* If wrapped controls and the composer exceed a short pane, keep its tail reachable by wheel and keyboard. */
.inbox-thread-main { display: flex; flex-direction: column; height: 100%; min-height: 0; min-width: 0; overflow-y: auto; }
.inbox-thread-header { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 18px 22px; border-bottom: 1px solid #e8e3ee; }
.inbox-thread-identity { min-width: 0; flex: 1 1 160px; }
.inbox-thread-identity h2 { margin: 0; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.inbox-thread-identity p { margin: 5px 0 0; font-size: 11px; color: #726a7c; }
.inbox-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.inbox-actions .btn { min-height: 34px; font-size: 11px; padding: 7px 10px; border-color: #d9d1e3; color: #41344f; }
#inbox-back { display: none; }
.inbox-details { flex: 0 0 auto; padding: 10px 22px; background: #fbfafc; border-bottom: 1px solid #eeeaf3; max-height: 260px; overflow-y: auto; font-size: 12px; }
.inbox-details summary { cursor: pointer; color: #665a75; font-weight: 600; }
.inbox-details h3 { font-size: 12px; margin: 16px 0 9px; }
.inbox-details dl { display: grid; grid-template-columns: 130px 1fr; gap: 7px; }
.inbox-details dt { color: #797184; }
.inbox-details dd { margin: 0; overflow-wrap: anywhere; }
.inbox-private-note { margin: 8px 0; padding: 10px 12px; background: #fff6d7; border: 1px solid #eee0b6; border-radius: 7px; color: #5f532f; white-space: pre-wrap; overflow-wrap: anywhere; }
.inbox-messages { flex: 1 1 180px; min-height: 100px; overflow-y: auto; overscroll-behavior: contain; padding: 26px 26px 15px; }
.inbox-message { max-width: 86%; margin: 0 0 23px; width: fit-content; min-width: 120px; }
.inbox-message.customer { margin-left: auto; }
.inbox-message-meta { display: flex; align-items: baseline; gap: 15px; margin-bottom: 7px; color: #7b7286; font-size: 11px; }
.inbox-message-meta strong { color: #554961; font-weight: 650; }
.inbox-message.customer .inbox-message-meta { justify-content: flex-end; }
.inbox-bubble { background: #f4f1f7; color: #332a3f; padding: 12px 16px; border-radius: 2px 13px 13px 13px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.65; }
.inbox-message.customer .inbox-bubble { background: #f1f0ed; border-radius: 13px 2px 13px 13px; }
.inbox-message.human .inbox-bubble { background: #edf2e6; }
.inbox-message.system { max-width: 100%; width: 100%; }
.inbox-message.system .inbox-bubble { background: transparent; border: 1px dashed #e2dce9; color: #796f85; font-size: 12px; }
.inbox-message-card { display: flex; gap: 9px; border: 1px solid #ddd5e7; background: #fff; padding: 10px; border-radius: 7px; margin: 6px 0 0; font-size: 12px; }
.inbox-message-card small { display: block; color: #786e84; font-size: 11px; margin-top: 3px; }
.inbox-new-messages { align-self: center; border: 1px solid #d8c9e9; background: #f3edf9; color: #5d3b83; font-size: 12px; padding: 7px 12px; border-radius: 20px; cursor: pointer; margin-bottom: 5px; }
.inbox-composer { flex: 0 0 auto; padding: 15px 22px 12px; border-top: 1px solid #e7e0ee; background: #fff; }
.inbox-compose-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 7px; }
.inbox-compose-tools > label { font-size: 11px; font-weight: 650; margin: 0; color: #51475c; }
.inbox-compose-tools .btn { min-height: 30px; font-size: 11px; padding: 5px 10px; }
#inbox-reply { width: 100%; resize: vertical; min-height: 80px; max-height: 210px; padding: 12px 13px; border: 1px solid #ddd5e7; border-radius: 9px; margin: 0; line-height: 1.55; font-size: 14px; background: #fdfcfe; }
#inbox-reply:focus { outline: 2px solid #9980bd; outline-offset: 1px; }
#inbox-reply:disabled { opacity: 1; color: #79717f; background: #f6f4f8; }
.inbox-compose-bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; }
#inbox-draft-status { font-size: 11px; color: #73697f; max-width: 45%; }
.inbox-compose-bottom > div { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.inbox-composer .btn { min-height: 35px; font-size: 12px; padding: 8px 11px; }
#inbox-send { background: #24202e; color: #fff; }
#inbox-send:not(:disabled):hover { background: #40314f; }
.inbox-page button:disabled { cursor: not-allowed; opacity: .5; }
.inbox-page button:focus-visible, .inbox-page a:focus-visible { outline: 2px solid #9370bc; outline-offset: 2px; }
.inbox-reply-help { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.inbox-alert { padding: 11px 13px; background: #fff3d9; color: #75510c; border: 1px solid #efdca8; border-radius: 6px; font-size: 12px; line-height: 1.5; margin: 8px 12px; }
.inbox-composer .inbox-alert { margin: 9px 0; }
.inbox-draft-conflict { padding: 13px; background: #fff7df; border: 1px solid #eddba6; border-radius: 8px; margin-top: 10px; font-size: 12px; }
.inbox-draft-conflict p { margin: 6px 0; }
#inbox-remote-draft { max-height: 100px; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; background: #fff; padding: 9px; border-radius: 5px; }
.inbox-channel-notice { padding: 18px 22px; background: #faf7ef; font-size: 13px; border-top: 1px solid #e9e1d1; }
.inbox-empty { padding: 24px 18px; color: #766b82; text-align: center; font-size: 13px; line-height: 1.65; }
.inbox-empty strong { display: block; font-size: 14px; color: #4d415c; }
.inbox-empty p { margin: 7px 0; }
.inbox-page [hidden] { display: none !important; }
/* Conversation tools: header tools, tags, pop-overs, customer panel. */
.inbox-header-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.inbox-header-tools .btn { min-height: 34px; font-size: 11px; padding: 7px 10px; }
.inbox-assign { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: #665a75; }
.inbox-assign select { max-width: 190px; min-height: 34px; border: 1px solid #d9d1e3; border-radius: 8px; background: #fff; font-size: 12px; padding: 5px 8px; color: #2f2639; }
.inbox-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 9px 22px; border-bottom: 1px solid #eeeaf3; background: #fbfafc; font-size: 11px; min-height: 44px; }
.inbox-tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 9px; border-radius: 999px; background: #ece7f6; color: #4c3a66; font-weight: 600; max-width: 100%; overflow-wrap: anywhere; }
.inbox-tag button { border: 0; background: transparent; color: inherit; width: 20px; height: 20px; border-radius: 50%; cursor: pointer; font-size: 14px; line-height: 1; }
.inbox-tag button:hover { background: #dcd2ec; }
.inbox-tag-form input { width: 110px; border: 1px dashed #cdbfe0; border-radius: 999px; background: transparent; padding: 4px 10px; font-size: 11px; }
.inbox-tag-form input:focus { width: 160px; border-style: solid; background: var(--card, #fff); }
.inbox-pop-wrap { position: relative; }
.inbox-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: min(360px, 86vw); max-height: 360px; overflow-y: auto; background: #fff; border: 1px solid #ddd5e7; border-radius: 12px; box-shadow: 0 16px 40px #1d153024; padding: 10px; }
.inbox-pop.up { top: auto; bottom: calc(100% + 6px); }
.inbox-pop-title { margin: 2px 4px 8px; font-size: 11px; font-weight: 650; color: #665a75; }
.inbox-pop input[type=search] { width: 100%; margin: 0 0 8px; border: 1px solid #dfdae6; border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.inbox-pick-list { display: grid; gap: 4px; }
.inbox-pick { display: grid; gap: 3px; width: 100%; text-align: left; border: 1px solid transparent; background: #faf9fc; border-radius: 8px; padding: 9px 10px; cursor: pointer; color: #2f2639; font-size: 12px; }
.inbox-pick:hover, .inbox-pick:focus-visible { border-color: #d5cae9; background: #f3eff9; }
.inbox-pick small { color: #776d83; font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.inbox-pick code { font-size: 11px; background: #ece7f6; border-radius: 4px; padding: 1px 4px; color: #4c3a66; }
.inbox-side { position: absolute; inset: 0 0 0 auto; z-index: 15; width: min(380px, 100%); display: none; flex-direction: column; min-height: 0; background: #fbfafc; border-left: 1px solid #e5e1e9; box-shadow: -14px 0 40px #1d153020; }
.inbox-thread.side-open .inbox-side { display: flex; }
.inbox-side-head { display: flex; align-items: center; gap: 6px; padding: 10px 10px 8px; border-bottom: 1px solid #e9e5ed; }
.inbox-side-tab-nav { flex: 1; min-width: 0; }
.inbox-side-tabs { display: flex; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--muted) var(--surface-subtle); background: #efedf3; padding: 5px; border-radius: 9px; scroll-padding-inline: 5px; }
.inbox-side-tabs button { border: 0; border-radius: 7px; background: transparent; padding: 8px; flex: 1 0 auto; min-height: 44px; font-size: 13px; font-weight: 650; color: #665e76; cursor: pointer; white-space: nowrap; scroll-margin-inline: 5px; }
.inbox-scroll-hint { display: flex; align-items: baseline; gap: 6px; color: var(--muted); font-size: 13px; line-height: 1.45; margin: 6px 3px 0; }
.inbox-side-tabs button[aria-selected="true"] { background: #fff; color: #241f30; box-shadow: 0 1px 4px #19132114; }
#inbox-side-close { flex: 0 0 44px; width: 44px; height: 44px; font-size: 18px; align-self: flex-start; margin-top: 5px; }
.inbox-side-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px; font-size: 12px; color: #3a3046; }
.inbox-side-body h4 { display: flex; align-items: center; gap: 7px; margin: 0 0 8px; font-size: 12px; }
.inbox-side-body h4 .icon { width: 16px; height: 16px; color: #7c6a95; }
.inbox-side-sub { margin: 14px 0 6px; }
.inbox-side-card { background: #fff; border: 1px solid #e7e2ee; border-radius: 10px; padding: 11px; margin: 0 0 10px; }
.inbox-facts { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 5px 8px; margin: 0 0 10px; }
.inbox-facts dt { color: var(--muted); }
.inbox-facts dd { margin: 0; overflow-wrap: anywhere; }
.inbox-id { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; }
.inbox-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.inbox-kpis small { display: block; color: #797184; font-size: 11px; }
.inbox-kpis strong { font-size: 15px; }
.inbox-kpis p { grid-column: 1 / -1; margin: 0; color: #81778b; font-size: 11px; }
.inbox-lines { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.inbox-lines li { display: flex; justify-content: space-between; gap: 8px; }
.inbox-lines li span:first-child { min-width: 0; overflow-wrap: anywhere; }
.inbox-lines li span:last-child { white-space: nowrap; color: #5d536a; }
.inbox-side-note { color: var(--muted); font-size: 11px; line-height: 1.5; margin: 6px 0; }
.inbox-side-warn { display: grid; gap: 8px; padding: 9px 10px; background: #fff3d9; color: #75510c; border: 1px solid #efdca8; border-radius: 8px; font-size: 11px; line-height: 1.5; margin: 0 0 10px; }
.inbox-side-warn .btn { justify-self: start; min-height: 30px; font-size: 11px; padding: 5px 9px; }
.inbox-order { background: #fff; border: 1px solid #e7e2ee; border-radius: 10px; padding: 11px; margin: 0 0 10px; }
.inbox-order header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.inbox-order-meta { margin: 5px 0 0; color: #776d83; font-size: 11px; }
.inbox-pill { display: inline-flex; align-items: center; padding: 3px 7px; border-radius: 999px; background: #efedf3; color: #5d536a; font-size: 11px; font-weight: 650; white-space: nowrap; }
.inbox-pill.ok { background: #e4f2e2; color: #2c5e27; }
.inbox-pill.waiting { background: #fff0c6; color: #734f0a; }
.inbox-pill.bad { background: #fde4e1; color: #8a2a1e; }
.inbox-action { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: center; padding: 8px 0; border-top: 1px solid #f0ecf4; }
.inbox-action:first-of-type { border-top: 0; }
.inbox-action > p, .inbox-action > .inbox-action-buttons { grid-column: 1 / -1; }
.inbox-action-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.inbox-side-body .btn { min-height: 30px; font-size: 11px; padding: 5px 9px; }
.inbox-wide { width: 100%; justify-content: center; margin: 0 0 10px; }
.inbox-order-form, .inbox-note-form { display: grid; gap: 8px; margin-top: 10px; }
.inbox-order-form label, .inbox-note-form label { display: grid; gap: 4px; font-size: 11px; font-weight: 600; color: #51475c; }
.inbox-order-form textarea, .inbox-order-form input:not([type=checkbox]), .inbox-order-form select, .inbox-note-form textarea { width: 100%; border: 1px solid #ddd5e7; border-radius: 8px; padding: 7px 9px; font: inherit; font-size: 12px; font-weight: 400; background: #fff; }
.inbox-order-form .inbox-check { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.inbox-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.inbox-note-form .btn { justify-self: start; }
.inbox-history { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; margin: 0 0 6px; border: 1px solid #e7e2ee; border-radius: 9px; background: #fff; color: inherit; text-decoration: none; }
.inbox-history:hover { border-color: #d5cae9; }
.inbox-history span { min-width: 0; display: grid; gap: 2px; }
.inbox-history strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-history small { color: #776d83; font-size: 11px; }
.inbox-history .icon { width: 14px; height: 14px; flex: none; color: #8a7d9c; }
.inbox-crm { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.inbox-crm li { background: #fff; border: 1px solid #e7e2ee; border-radius: 9px; padding: 8px 10px; }
.inbox-crm small { display: block; color: #776d83; font-size: 11px; }
.inbox-crm p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
#inbox-notes .inbox-private-note:first-child { margin-top: 0; }
@container (min-width: 760px) {
  .inbox-thread { grid-template-columns: minmax(0, 1fr) clamp(296px, 36cqi, 340px); }
  .inbox-side { position: static; display: flex; width: auto; box-shadow: none; }
  #inbox-side-toggle, #inbox-side-close { display: none; }
}
@media (max-width: 1180px) {
  .view.inbox-active { padding: 18px; }
  .inbox-grid { grid-template-columns: 275px minmax(0, 1fr); }
  .inbox-actions { flex-basis: 100%; }
  .inbox-thread-header { padding: 14px 16px; }
  .inbox-composer { padding: 12px 16px; }
  .inbox-messages { padding: 22px 18px 12px; }
  .inbox-tags { padding: 8px 16px; }
}
@media (max-width: 760px) {
  .view.inbox-active { padding: 14px 10px; }
  .inbox-page { height: calc(100dvh - 111px); }
  .inbox-heading { align-items: flex-start; margin: 0 4px 13px; }
  .inbox-heading h1 { font-size: 25px; }
  .inbox-heading p { font-size: 12px; }
  .inbox-sync { font-size: 11px; white-space: normal; max-width: 85px; text-align: right; }
  .inbox-heading.has-presence .inbox-heading-side { width: 100%; justify-content: space-between; align-items: flex-start; gap: 10px; }
  .inbox-presence select { min-height: 40px; }
  .inbox-grid { display: block; min-height: 530px; border-radius: 11px; }
  .inbox-list-pane { height: 100%; border-right: 0; }
  .inbox-thread-pane { display: none; height: 100%; }
  .inbox-grid.has-selection .inbox-list-pane { display: none; }
  .inbox-grid.has-selection .inbox-thread-pane { display: block; }
  #inbox-back { display: grid; flex: 0 0 44px; width: 44px; height: 44px; }
  .inbox-actions { flex-basis: 100%; padding-left: 38px; }
  .inbox-thread-header { padding: 11px 12px; gap: 8px; }
  .inbox-thread-identity { flex: 1; }
  .inbox-thread-identity h2 { font-size: 14px; }
  .inbox-thread-identity p { font-size: 11px; }
  .inbox-tags { padding: 8px 12px; }
  /* One compact, wrapping tool row under the customer name keeps the messages visible on a phone. */
  .inbox-thread-header .inbox-actions, .inbox-header-tools { flex-basis: auto; padding-left: 0; }
  .inbox-header-tools .btn, .inbox-thread-header .inbox-actions .btn { min-height: 32px; padding: 6px 9px; }
  .inbox-assign span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .inbox-assign select { max-width: 140px; min-height: 32px; }
  .inbox-messages { padding: 18px 12px 8px; }
  .inbox-message { max-width: 94%; }
  .inbox-bubble { font-size: 13px; padding: 10px 12px; }
  .inbox-composer { padding: 11px 12px; }
  .inbox-compose-bottom { align-items: flex-start; flex-direction: column; gap: 7px; }
  #inbox-draft-status { max-width: 100%; }
  .inbox-compose-bottom > div { width: 100%; }
  #inbox-reply { min-height: 68px; max-height: 140px; font-size: 16px; }
  .inbox-actions .btn { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { .inbox-page * { scroll-behavior: auto !important; } }
/* New-message alerts next to the presence switch */
.inbox-heading.has-presence .inbox-heading-side { flex-wrap: wrap; justify-content: flex-end; row-gap: 8px; }
.inbox-alerts { flex: none; display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 6px; row-gap: 3px; }
.inbox-alert-toggle { min-height: 36px; padding: 6px 10px; border: 1px solid #cfcad8; border-radius: 9px; background: #fff; color: #4d4858; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.inbox-alert-toggle[aria-pressed="true"] { background: #efeafc; border-color: #8b7bd8; color: #3d2f7a; }
.inbox-alert-toggle:disabled { opacity: .55; cursor: not-allowed; }
.inbox-alert-toggle:focus-visible { outline: 3px solid #8b7bd866; outline-offset: 2px; }
.inbox-alert-status { grid-column: 1 / -1; font-size: 12px; color: #75510c; max-width: 22rem; }
.inbox-alert-status:empty { display: none; }
@media (max-width: 760px) {
  .inbox-heading.has-presence .inbox-heading-side { justify-content: space-between; }
  .inbox-alerts { flex: 1 1 100%; order: 3; grid-template-columns: 1fr 1fr; }
  .inbox-alert-status { max-width: none; }
  .inbox-alert-toggle { min-height: 40px; }
}
[data-theme="dark"] .inbox-alert-toggle { background: #191c27; color: #f1eef8; border-color: #51566b; }
[data-theme="dark"] .inbox-alert-toggle[aria-pressed="true"] { background: #2d2750; border-color: #8b7bd8; color: #e6defc; }
[data-theme="dark"] .inbox-alert-status { color: #f0c36a; }
[data-theme="dark"] .inbox-presence label, [data-theme="dark"] .inbox-presence-status { color: #c7bfda; }
[data-theme="dark"] .inbox-presence select { background: #191c27; color: #f1eef8; border-color: #51566b; }
[data-theme="dark"] .inbox-presence-status[data-tone="unknown"] { color: #ff9f94; }
/* Channel chip in the list and delivery state next to replies in e-mail and Meta conversations. */
.inbox-channel { font-size: 11px; font-weight: 650; color: #3d5a9a; background: #e9effc; border-radius: 6px; padding: 2px 6px; margin-right: 6px; }
.inbox-delivery { font-size: 11px; font-weight: 600; margin-left: 8px; }
.inbox-delivery.ok { color: #1c7a4f; }
.inbox-delivery.wait { color: #95650b; }
.inbox-delivery.bad { color: #b0362b; }
/* Cards in the timeline: files, products, orders, return cases, deleted messages. */
.inbox-card-copy { display: grid; gap: 2px; min-width: 0; }
.inbox-card-copy strong { overflow-wrap: anywhere; }
.inbox-card-copy a { color: #5a3d86; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; margin-top: 4px; }
.inbox-card-copy .btn { justify-self: start; min-height: 30px; font-size: 12px; padding: 5px 9px; margin-top: 6px; }
.inbox-file { flex-direction: column; align-items: stretch; gap: 8px; }
.inbox-file-row { display: flex; align-items: center; gap: 9px; min-width: 0; }
.inbox-file-copy { display: grid; gap: 2px; flex: 1; min-width: 0; }
.inbox-file-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-file-copy small { color: #786e84; font-size: 11px; }
.inbox-file-get { min-height: 30px; font-size: 12px; padding: 5px 10px; flex: none; }
.inbox-file-preview { display: block; color: #786e84; font-size: 12px; }
.inbox-file-preview.failed { color: #75510c; }
.inbox-file-thumb { display: block; padding: 0; border: 1px solid #ddd5e7; border-radius: 8px; background: #fff; cursor: zoom-in; max-width: 220px; overflow: hidden; }
.inbox-file-thumb img { display: block; max-width: 220px; max-height: 220px; object-fit: contain; }
.inbox-message.deleted .inbox-bubble, .inbox-deleted { font-style: italic; color: #7b7286; background: transparent; border: 1px dashed #ddd5e7; }
.inbox-message-delete { margin-left: auto; min-height: 26px; padding: 3px 9px; font-size: 11px; }
/* Side panel: files, return cases, events. */
.inbox-file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.inbox-file-list li { display: grid; gap: 6px; padding: 8px 0; border-top: 1px solid #f0ecf4; }
.inbox-file-list li:first-child { border-top: 0; padding-top: 0; }
.inbox-file-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.inbox-case-link { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; color: #5a3d86; font-weight: 650; font-size: 12px; }
.inbox-case-link .icon { width: 14px; height: 14px; }
.inbox-warn-text { color: #8a2a1e; }
.inbox-side-ok { padding: 9px 10px; background: #e4f2e2; color: #2c5e27; border: 1px solid #c6e2c1; border-radius: 8px; font-size: 12px; line-height: 1.5; margin: 0 0 10px; }
.inbox-return-form h4 { margin: 0; }
.inbox-events { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.inbox-events li { display: grid; gap: 2px; padding: 7px 10px; background: #fff; border: 1px solid #e7e2ee; border-radius: 9px; }
.inbox-events small { color: #776d83; font-size: 11px; }
/* Composer: file button, upload state. */
.inbox-compose-buttons { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.inbox-compose-buttons .btn { display: inline-flex; align-items: center; gap: 6px; }
.inbox-compose-buttons .btn .icon { width: 15px; height: 15px; }
.inbox-upload-status { margin: 8px 0 0; color: #5d536a; font-size: 12px; }
/* Thread "Więcej" menu and the moderation panel above the messages. */
.inbox-pick.danger span { color: #a3261a; }
.inbox-pick.armed { border-color: #d0b06a; background: #fff6d7; }
.inbox-moderation { flex: 0 0 auto; margin: 8px 12px; padding: 13px 14px; border: 1px solid #e3d6c2; border-radius: 10px; background: #fffaf0; font-size: 13px; max-height: 45%; overflow-y: auto; }
.inbox-moderation h3 { font-size: 15px; margin: 0 0 6px; }
.inbox-moderation p { margin: 0 0 8px; line-height: 1.5; }
.inbox-moderation .btn { min-height: 32px; font-size: 12px; padding: 6px 11px; }
.inbox-moderation .inbox-order-form label { font-size: 12px; }
.inbox-ban-history { margin-top: 10px; font-size: 12px; }
.inbox-ban-history summary { cursor: pointer; font-weight: 600; color: #665a75; }
.inbox-ban-history ul { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 6px; }
.inbox-ban-history p { margin: 2px 0 0; }
/* Image viewer. */
.inbox-lightbox { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; background: #110d18e6; }
.inbox-lightbox figure { margin: 0; display: grid; gap: 8px; justify-items: center; max-width: 100%; }
.inbox-lightbox img { max-width: min(92vw, 1100px); max-height: 75vh; object-fit: contain; border-radius: 8px; background: #fff; }
.inbox-lightbox figcaption { color: #f4f0fa; font-size: 13px; overflow-wrap: anywhere; text-align: center; }
.inbox-lightbox-actions { display: flex; gap: 8px; }
@media (max-width: 760px) {
  .inbox-moderation { margin: 6px 8px; }
  .inbox-file-thumb, .inbox-file-thumb img { max-width: 180px; }
}
/* Dark theme for the parts this file adds (shared rules live in theme-dark.css). */
[data-theme="dark"] .inbox-tag-form input { color: var(--ink); border-color: #6f608d; }
[data-theme="dark"] .inbox-tag-form input:focus { background: #272a37; border-color: #6f608d; }
[data-theme="dark"] .inbox-card-copy a, [data-theme="dark"] .inbox-case-link { color: #d5b6ff; }
[data-theme="dark"] .inbox-file-copy small, [data-theme="dark"] .inbox-file-preview, [data-theme="dark"] .inbox-events small, [data-theme="dark"] .inbox-upload-status { color: #bcc0d1; }
[data-theme="dark"] .inbox-file-preview.failed, [data-theme="dark"] .inbox-warn-text { color: #ffc9c1; }
[data-theme="dark"] .inbox-file-thumb { background: #242b36; border-color: #525669; }
[data-theme="dark"] .inbox-message.deleted .inbox-bubble, [data-theme="dark"] .inbox-deleted { color: #bcc0d1; border-color: #515166; background: transparent; }
[data-theme="dark"] .inbox-file-list li { border-color: var(--line); }
[data-theme="dark"] .inbox-events li { background: #242836; border-color: var(--line); }
[data-theme="dark"] .inbox-side-ok { background: #1f3b26; color: #bfe8c4; border-color: #2f5a39; }
[data-theme="dark"] .inbox-moderation { background: #2a2620; border-color: #5a4b33; color: var(--ink); }
[data-theme="dark"] .inbox-ban-history summary { color: #d3d6e3; }
[data-theme="dark"] .inbox-pick.danger span { color: #ffb4a9; }
[data-theme="dark"] .inbox-pick.armed { background: #44371e; border-color: #826737; }

