/* ==========================================================================
   TCN App — Chat tab (chats, Tsunami AI, inbox). Prefixes: ax-chat- / ax-ai- / ax-mail-
   ========================================================================== */

/* The screen body container also carries .ax-body (pre-wrap); reset it for our layouts. */
.ax-chat-screen .ax-body { white-space: normal; font-size: inherit; line-height: inherit; color: inherit; }
.ax-chat-screen .ax-badge.ax-blue { box-shadow: 0 0 10px rgba(31,143,255,.45); }

/* Fields embedded in custom chrome: undo the global tx-app input styling. */
html.tx-app input.ax-chat-bare.ax-chat-bare, html.tx-app textarea.ax-chat-bare.ax-chat-bare, html.tx-app input.ax-chat-bare.ax-chat-bare:focus, html.tx-app textarea.ax-chat-bare.ax-chat-bare:focus { border: 0 !important; border-radius: 0 !important; background: transparent !important; background-color: transparent !important; box-shadow: none !important; outline: none !important; }

/* --- Segmented control counts -------------------------------------------- */
.ax-chat-segn { font-style: normal; display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--tx-blue); color: #fff; font: 700 11px/1 var(--tx-font); }
.ax-chat-segn:empty { display: none; }
.ax-chat-seghost .ax-seg { margin-bottom: 12px; }

/* --- Search field --------------------------------------------------------- */
.ax-chat-search { position: relative; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; margin: 0 0 8px; border-radius: 12px; background: rgba(118,118,128,.22); color: var(--tx-label-3); cursor: text; }
.ax-chat-search svg { width: 18px; height: 18px; flex: none; }
.ax-chat-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: none; color: #fff; font: 400 16px/1.2 var(--tx-font); -webkit-appearance: none; appearance: none; }
.ax-chat-search input::placeholder { color: rgba(235,235,245,.42); }
.ax-chat-search input::-webkit-search-cancel-button { filter: invert(1) opacity(.5); }
.ax-chat-to > span { font: 500 16px/1 var(--tx-font); color: var(--tx-label-3); }

/* --- Conversation list (iMessage) ----------------------------------------- */
.ax-chat-list { margin: 0 -16px; }
.ax-chat-row { position: relative; display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 10px 16px 10px 22px; color: #fff; transition: background-color .15s; }
.ax-chat-row:active { background: rgba(255,255,255,.06); }
.ax-chat-row + .ax-chat-row::before { content: ""; position: absolute; top: 0; right: 0; left: 86px; height: .5px; background: rgba(255,255,255,.09); }
.ax-chat-udot { position: absolute; left: 7px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--tx-blue); box-shadow: 0 0 8px rgba(31,143,255,.8); opacity: 0; transform: scale(.4); transition: opacity .2s, transform .25s var(--tx-ease); }
.ax-chat-row.ax-unread .ax-chat-udot { opacity: 1; transform: none; }
.ax-chat-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ax-chat-row-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ax-chat-row-name { flex: 1; min-width: 0; font: 600 16.5px/1.2 var(--tx-font); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ax-chat-row.ax-unread .ax-chat-row-name { font-weight: 700; }
.ax-chat-row-time { flex: none; font-size: 14px; color: var(--tx-label-3); }
.ax-chat-row.ax-unread .ax-chat-row-time { color: var(--tx-cyan); }
.ax-chat-row-chev { width: 14px; height: 14px; flex: none; color: rgba(235,235,245,.25); stroke-width: 2.6; }
.ax-chat-row-bot { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.ax-chat-row-prev { flex: 1; min-width: 0; font-size: 14.5px; line-height: 1.32; color: var(--tx-label-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.ax-chat-row.ax-unread .ax-chat-row-prev { color: var(--tx-label-2); }
.ax-chat-row-bot .ax-badge { flex: none; margin-top: 1px; }
.ax-chat-mon { flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; color: var(--tx-label-3); }
.ax-chat-mon svg { width: 15px; height: 15px; }
.ax-chat-row.ax-monitor { opacity: .82; }
.ax-chat-allav { background: var(--tx-grad); box-shadow: 0 0 0 1.5px rgba(255,255,255,.12) inset, 0 6px 18px -6px rgba(176,40,255,.7); }

.ax-chat-skel { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.ax-chat-skel > i { width: 52px; height: 52px; border-radius: 50%; flex: none; }
.ax-chat-skel > span { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.ax-chat-skel b { height: 12px; border-radius: 6px; width: 45%; }
.ax-chat-skel b + b { width: 80%; }

/* --- Conversation screen ---------------------------------------------------- */
.ax-chat-convo .ax-content, .ax-ai-screen .ax-content { max-width: 760px; }
.ax-chat-thread { display: flex; flex-direction: column; padding: 4px 0 2px; }
.ax-chat-topnote { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 2px auto 6px; padding: 7px 12px; border-radius: 12px; font-size: 12.5px; color: var(--tx-label-3); background: rgba(255,255,255,.04); border: 1px solid var(--tx-line); text-align: center; }
.ax-chat-topnote[hidden] { display: none; }
.ax-chat-topnote svg { width: 14px; height: 14px; flex: none; }
.ax-chat-sep { text-align: center; font-size: 12px; color: var(--tx-label-3); margin: 18px 0 6px; }
.ax-chat-sep b { font-weight: 600; color: var(--tx-label-2); }
.ax-chat-sep:first-child { margin-top: 6px; }

.ax-chat-msg { display: flex; align-items: flex-end; gap: 8px; margin-top: 2px; }
.ax-chat-msg.ax-first { margin-top: 8px; }
.ax-chat-sep + .ax-chat-msg { margin-top: 0; }
.ax-chat-msg.ax-mine { justify-content: flex-end; }
.ax-chat-av { flex: none; width: 28px; height: 28px; visibility: hidden; margin-bottom: 1px; }
.ax-chat-msg.ax-last .ax-chat-av { visibility: visible; }
.ax-chat-col { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; max-width: min(78%, 540px); }
.ax-chat-msg.ax-mine .ax-chat-col { align-items: flex-end; }
.ax-chat-name { font-size: 12px; color: var(--tx-label-3); margin: 0 0 3px 12px; }

.ax-chat-bub { position: relative; max-width: 100%; padding: 8px 13px 9px; border-radius: 20px; font: 400 16.5px/1.32 var(--tx-font); letter-spacing: -.008em; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; color: #fff; text-align: left;
  background: linear-gradient(180deg, #2b2a37, #23222e); border: .5px solid rgba(255,255,255,.06); -webkit-user-select: text; user-select: text; -webkit-touch-callout: none; transition: transform .18s var(--tx-ease), filter .18s; }
.ax-chat-bub + .ax-chat-bub { margin-top: 2px; }
.ax-chat-msg.ax-mine .ax-chat-bub { background: linear-gradient(135deg, #c81cff 0%, #7a3dff 52%, #3a6bff 100%); border-color: transparent; box-shadow: 0 6px 18px -10px rgba(140,60,255,.8); }
.ax-chat-bub a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.ax-chat-msg:not(.ax-mine) .ax-chat-bub a { color: var(--tx-cyan); }
/* Run corners: tighter where bubbles from the same sender touch. */
.ax-chat-msg:not(.ax-mine):not(.ax-first) .ax-chat-bub { border-top-left-radius: 6px; }
.ax-chat-msg:not(.ax-mine):not(.ax-last) .ax-chat-bub { border-bottom-left-radius: 6px; }
.ax-chat-msg.ax-mine:not(.ax-first) .ax-chat-bub { border-top-right-radius: 6px; }
.ax-chat-msg.ax-mine:not(.ax-last) .ax-chat-bub { border-bottom-right-radius: 6px; }
.ax-chat-bub.ax-emoji { background: none !important; border: 0; box-shadow: none !important; padding: 0 2px; font-size: 44px; line-height: 1.12; }
.ax-chat-bub.ax-chat-imgb { padding: 0; overflow: hidden; background: rgba(255,255,255,.05) !important; box-shadow: none !important; border: .5px solid rgba(255,255,255,.08); cursor: zoom-in; display: block; }
.ax-chat-bub.ax-chat-imgb { width: 260px; max-width: 100%; }
.ax-chat-imgb img { display: block; width: 100%; height: auto; max-height: 340px; min-height: 80px; object-fit: cover; }
.ax-pressed.ax-chat-bub, .ax-chat-bub.ax-pressed { transform: scale(.96); filter: brightness(1.15); }
.ax-chat-meta { display: none; font-size: 11.5px; color: var(--tx-label-3); margin: 3px 6px 0; }
.ax-chat-msg.ax-show-time .ax-chat-meta, .ax-chat-msg.ax-failed .ax-chat-meta { display: block; }
.ax-chat-msg.ax-pending .ax-chat-bub { opacity: .62; }
.ax-chat-msg.ax-failed .ax-chat-meta { color: #ff6961; font-weight: 600; }
.ax-chat-msg.ax-failed .ax-chat-bub { opacity: .75; box-shadow: 0 0 0 1.5px rgba(255,69,58,.6); }
.ax-chat-in { animation: ax-chat-in .34s var(--tx-ease) both; }
.ax-chat-msg.ax-mine.ax-chat-in { transform-origin: 100% 100%; }
.ax-chat-msg.ax-chat-in { transform-origin: 0 100%; }
@keyframes ax-chat-in { from { opacity: 0; transform: translateY(10px) scale(.92); } }

.ax-chat-bskel { display: flex; margin: 8px 0; }
.ax-chat-bskel.ax-mine { justify-content: flex-end; }
.ax-chat-bskel i { height: 38px; border-radius: 19px; }

.ax-chat-hello { text-align: center; padding: 48px 20px 20px; color: var(--tx-label-3); }
.ax-chat-hello .ax-avatar { margin: 0 auto 12px; }
.ax-chat-hello h3 { margin: 0 0 6px; color: #fff; font: 700 20px/1.2 var(--tx-font-display); }
.ax-chat-hello p { margin: 0; font-size: 15px; }

/* --- Composer -------------------------------------------------------------- */
.ax-chat-composer { display: flex; align-items: flex-end; gap: 6px; max-width: 760px; margin: 0 auto; }
.ax-chat-field { flex: 1; min-width: 0; border-radius: 21px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.05); transition: border-color .2s; overflow: hidden; }
.ax-chat-field:focus-within { border-color: rgba(176,90,255,.55); }
.ax-chat-field textarea { scrollbar-width: none; display: block; width: 100%; min-height: 40px; max-height: 140px; padding: 9px 14px; border: 0; outline: none; resize: none; background: none; color: #fff; font: 400 16px/1.35 var(--tx-font); -webkit-appearance: none; appearance: none; }
.ax-chat-field textarea::-webkit-scrollbar { display: none; }
.ax-chat-field textarea::placeholder { color: rgba(235,235,245,.36); }
.ax-chat-pending { padding: 8px 8px 0; }
.ax-chat-pending[hidden] { display: none; }
.ax-chat-pthumb { position: relative; display: inline-block; }
.ax-chat-pthumb img { display: block; max-height: 110px; max-width: 160px; border-radius: 14px; }
.ax-chat-pthumb button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.65); display: grid; place-items: center; }
.ax-chat-pthumb button svg { width: 14px; height: 14px; stroke-width: 2.6; }
.ax-chat-attach { flex: none; width: 44px; height: 44px; margin-bottom: -2px; border-radius: 50%; display: grid; place-items: center; color: var(--tx-label-2); }
.ax-chat-attach svg { width: 24px; height: 24px; }
.ax-chat-attach:active { color: #fff; }
.ax-chat-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ax-chat-send { flex: none; width: 44px; height: 44px; margin: 0 -4px -2px -2px; display: grid; place-items: center; }
.ax-chat-send > span { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--tx-grad); box-shadow: 0 6px 16px -6px rgba(176,40,255,.9), inset 0 1px 0 rgba(255,255,255,.35); transition: transform .22s var(--tx-ease), opacity .2s, filter .2s; }
.ax-chat-send svg { width: 20px; height: 20px; stroke-width: 2.6; }
.ax-chat-send:disabled > span { opacity: .3; transform: scale(.86); filter: grayscale(.8); box-shadow: none; }
.ax-chat-send:not(:disabled):active > span { transform: scale(.88); }
.ax-chat-readonly { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 4px 12px; max-width: 760px; margin: 0 auto; text-align: center; font-size: 14px; line-height: 1.35; color: var(--tx-label-3); }
.ax-chat-readonly svg { width: 16px; height: 16px; flex: none; }

/* --- Info sheet / new message ----------------------------------------------- */
.ax-chat-info-head { text-align: center; padding: 6px 0 4px; }
.ax-chat-info-head .ax-avatar { margin: 0 auto 10px; }
.ax-chat-info-head h3 { margin: 0; color: #fff; font: 700 20px/1.2 var(--tx-font-display); }
.ax-chat-info-head p { margin: 4px 0 0; color: var(--tx-label-3); font-size: 14px; }
.ax-chat-msgbtn { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(34,227,255,.12); color: var(--tx-cyan); }
.ax-chat-msgbtn svg { width: 17px; height: 17px; }
.ax-row[disabled] { cursor: default; }
.ax-row[disabled]:active { background: none; }
.ax-chat-newgroup { margin: 4px 0 0; }
.ax-chat-busy { opacity: .5; pointer-events: none; }
.ax-chat-gsearch { margin: 12px 0 6px; }
.ax-chat-gcount { font-size: 13px; color: var(--tx-label-3); margin: 8px 4px; }
.ax-chat-pickrow .ax-chat-check { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.28); display: grid; place-items: center; flex: none; transition: background .15s, border-color .15s; }
.ax-chat-pickrow .ax-chat-check svg { width: 15px; height: 15px; stroke-width: 3; opacity: 0; }
.ax-chat-pickrow.ax-on .ax-chat-check { background: var(--tx-grad); border-color: transparent; }
.ax-chat-pickrow.ax-on .ax-chat-check svg { opacity: 1; }
.ax-chat-pick .ax-row + .ax-row::before { left: 62px; }

/* --- Image viewer ----------------------------------------------------------- */
.ax-chat-viewer { position: fixed; inset: 0; z-index: 130; display: grid; place-items: center; background: rgba(0,0,0,.94); opacity: 0; transition: opacity .25s; padding: calc(var(--tx-safe-t) + 50px) 8px calc(var(--tx-safe-b) + 24px); }
.ax-chat-viewer.ax-open { opacity: 1; }
.ax-chat-viewer img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; transform: scale(.94); transition: transform .35s var(--tx-ease-drawer); }
.ax-chat-viewer.ax-open img { transform: none; }
.ax-chat-viewer-x { position: absolute; top: calc(var(--tx-safe-t) + 10px); right: 14px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.14); color: #fff; }
.ax-chat-viewer-x svg { width: 20px; height: 20px; stroke-width: 2.4; }

/* --- Tsunami AI ------------------------------------------------------------- */
.ax-ai-hero { padding: 22px 20px 20px; }
.ax-ai-hero .ax-h2 { margin: 2px 0 6px; font-size: 25px; }
.ax-ai-hero .ax-sub { margin: 0; font-size: 15px; color: var(--tx-label-2); }
.ax-ai-orb { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 14px; color: #fff; background: var(--tx-grad); box-shadow: 0 12px 30px -10px rgba(176,40,255,.9), inset 0 1px 0 rgba(255,255,255,.35); animation: ax-ai-glow 3.2s ease-in-out infinite; }
.ax-ai-orb svg { width: 30px; height: 30px; stroke-width: 1.8; }
@keyframes ax-ai-glow { 50% { box-shadow: 0 12px 36px -6px rgba(34,227,255,.7), inset 0 1px 0 rgba(255,255,255,.35); } }
.ax-ai-meter { margin-top: 16px; }
.ax-ai-meter[hidden], .ax-ai-note[hidden] { display: none; }
.ax-ai-meter span { display: block; margin-top: 7px; font-size: 13px; color: var(--tx-label-3); }
.ax-ai-note { margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.06); font-size: 14px; line-height: 1.4; color: var(--tx-label-2); }
.ax-ai-go { margin-top: 14px; }
.ax-ai-av { background: var(--tx-grad); color: #fff; box-shadow: 0 4px 12px -4px rgba(176,40,255,.8); }
.ax-ai-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ax-ai-chip { display: flex; align-items: flex-start; gap: 8px; min-height: 64px; padding: 12px; border-radius: 16px; text-align: left; font: 600 14.5px/1.3 var(--tx-font) !important; color: #fff !important; background: var(--tx-raised); border: 1px solid var(--tx-line); transition: transform .16s var(--tx-ease), background-color .15s; }
.ax-ai-chip svg { width: 16px; height: 16px; flex: none; margin-top: 1px; color: #d38bff; }
.ax-ai-chip:active { transform: scale(.97); background: var(--tx-raised-2); }

.ax-ai-usage { display: flex; align-items: center; justify-content: center; gap: 6px; width: max-content; max-width: 100%; margin: 0 auto 6px; padding: 5px 11px; border-radius: 999px; font: 600 12px/1 var(--tx-font); color: var(--tx-label-3); background: rgba(255,255,255,.05); border: 1px solid var(--tx-line); }
.ax-ai-usage[hidden] { display: none; }
.ax-ai-usage svg { width: 13px; height: 13px; color: #d38bff; }
.ax-ai-thread .ax-chat-msg.ax-first { margin-top: 12px; }
.ax-ai-thread .ax-chat-av { visibility: visible; }
.ax-chat-bub.ax-ai-md { white-space: normal; }
.ax-ai-md p { margin: 0 0 8px; }
.ax-ai-md ul, .ax-ai-md ol { margin: 2px 0 8px; padding-left: 20px; }
.ax-ai-md li { margin: 3px 0; }
.ax-ai-md > :last-child { margin-bottom: 0; }
.ax-ai-md strong { color: #fff; font-weight: 700; }
.ax-ai-start { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: 12px 0 4px 36px; }
.ax-ai-start .ax-ai-chip { min-height: 44px; align-items: center; padding: 10px 14px; border-radius: 22px; }
.ax-chat-bub.ax-ai-typing { display: flex; align-items: center; gap: 5px; padding: 13px 15px; }
.ax-ai-typing i { width: 8px; height: 8px; border-radius: 50%; background: rgba(235,235,245,.55); animation: ax-ai-dot 1.25s infinite ease-in-out; }
.ax-ai-typing i:nth-child(2) { animation-delay: .16s; }
.ax-ai-typing i:nth-child(3) { animation-delay: .32s; }
@keyframes ax-ai-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }
.ax-ai-err { display: flex; align-items: flex-start; gap: 8px; margin: 10px auto 2px; max-width: 92%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.4; color: #ffb1ab; background: rgba(255,69,58,.1); border: 1px solid rgba(255,69,58,.22); }
.ax-ai-err svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.ax-ai-off svg { color: #d38bff; }

/* --- Inbox list ------------------------------------------------------------- */
.ax-mail-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 4px; }
.ax-mail-folderbtn { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 12px 0 10px; border-radius: 12px; background: rgba(118,118,128,.2); font: 600 15px/1 var(--tx-font) !important; color: #fff !important; }
.ax-mail-folderbtn:active { background: rgba(118,118,128,.32); }
.ax-mail-folderbtn svg { width: 17px; height: 17px; }
.ax-mail-ficon { display: inline-grid; color: var(--tx-cyan); }
.ax-mail-folderbtn > svg { width: 15px; height: 15px; color: var(--tx-label-3); stroke-width: 2.4; }
.ax-mail-sum { font-size: 13px; color: var(--tx-label-3); }
.ax-mail-list { margin: 0 -16px; }
.ax-mail-row { position: relative; display: flex; width: 100%; padding: 12px 16px 12px 26px; text-align: left; color: #fff; -webkit-touch-callout: none; transition: background-color .15s; }
.ax-mail-row:active, .ax-mail-row.ax-pressed { background: rgba(255,255,255,.06); }
.ax-mail-row + .ax-mail-row::before { content: ""; position: absolute; top: 0; right: 0; left: 26px; height: .5px; background: rgba(255,255,255,.09); }
.ax-mail-dot { position: absolute; left: 9px; top: 18px; width: 10px; height: 10px; border-radius: 50%; background: var(--tx-blue); box-shadow: 0 0 8px rgba(31,143,255,.8); opacity: 0; }
.ax-mail-row.ax-unread .ax-mail-dot { opacity: 1; }
.ax-mail-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ax-mail-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ax-mail-from { flex: 1; min-width: 0; font: 600 16px/1.25 var(--tx-font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ax-mail-row.ax-unread .ax-mail-from { font-weight: 700; }
.ax-mail-from em { font-style: normal; color: #ff6961; }
.ax-mail-n { flex: none; font-size: 12px; font-weight: 600; color: var(--tx-label-3); padding: 2px 6px; border-radius: 8px; background: rgba(255,255,255,.08); }
.ax-mail-ic { width: 14px; height: 14px; flex: none; color: var(--tx-label-3); }
.ax-mail-ic.ax-mail-flag { color: #ff9f0a; fill: rgba(255,159,10,.35); }
.ax-mail-time { flex: none; font-size: 14px; color: var(--tx-label-3); }
.ax-mail-chev { width: 14px; height: 14px; flex: none; color: rgba(235,235,245,.25); stroke-width: 2.6; }
.ax-mail-subj { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 15px; line-height: 1.3; color: #fff; }
.ax-mail-subjt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ax-mail-row:not(.ax-unread) .ax-mail-subj { color: var(--tx-label-2); }
.ax-mail-inv { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; font: 700 11px/1.4 var(--tx-font); color: #d1a6ff; background: rgba(176,90,255,.16); border: 1px solid rgba(176,90,255,.28); }
.ax-mail-inv svg { width: 12px; height: 12px; }
.ax-mail-prev { font-size: 14.5px; line-height: 1.35; color: var(--tx-label-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.ax-mail-curck { width: 20px; height: 20px; color: var(--tx-cyan); stroke-width: 2.6; flex: none; }

/* --- Mail thread ------------------------------------------------------------ */
.ax-mail-screen .ax-nav:not(.ax-solid) .ax-nav-t { opacity: 0; }
.ax-mail-subject { margin: 2px 2px 6px; font: 800 26px/1.2 var(--tx-font-display); letter-spacing: -.02em; color: #fff; word-break: break-word; }
.ax-mail-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 2px 14px; font-size: 13px; color: var(--tx-label-3); }
.ax-mail-sub:empty { display: none; }
.ax-mail-flagpill { display: inline-flex; align-items: center; gap: 4px; color: #ff9f0a; font-weight: 600; }
.ax-mail-flagpill svg { width: 13px; height: 13px; fill: rgba(255,159,10,.35); }
.ax-mail-card { border-radius: 18px; background: var(--tx-raised); border: 1px solid var(--tx-line); overflow: hidden; }
.ax-mail-card + .ax-mail-card { margin-top: 10px; }
.ax-mail-chead { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 14px 12px; text-align: left; color: #fff; }
.ax-mail-cmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ax-mail-ctop { display: flex; align-items: baseline; gap: 8px; }
.ax-mail-ctop b { flex: 1; min-width: 0; font: 700 16px/1.25 var(--tx-font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ax-mail-ctop time { flex: none; font-size: 13px; color: var(--tx-label-3); }
.ax-mail-csnip { font-size: 14px; color: var(--tx-label-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ax-mail-card.ax-open .ax-mail-csnip { display: none; }
.ax-mail-cbody { display: none; padding: 0 16px 16px; }
.ax-mail-card.ax-open .ax-mail-cbody { display: block; }
.ax-mail-cto { display: inline-flex; align-items: center; gap: 3px; min-height: 30px; margin: -6px 0 8px 52px; font-size: 13.5px; color: var(--tx-label-3); }
.ax-mail-cto svg { width: 13px; height: 13px; stroke-width: 2.4; }
.ax-mail-details { margin: -2px 0 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.04); font-size: 13.5px; line-height: 1.45; color: var(--tx-label-2); }
.ax-mail-details div { display: flex; gap: 10px; }
.ax-mail-details b { flex: none; width: 40px; color: var(--tx-label-3); font-weight: 600; }
.ax-mail-details span { min-width: 0; word-break: break-word; }
.ax-mail-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.5; color: rgba(255,255,255,.9); }
.ax-mail-text a, .ax-mail-html a { color: var(--tx-cyan); text-decoration: underline; text-underline-offset: 2px; }
.ax-mail-quoted { margin-top: 8px; padding-left: 12px; border-left: 2px solid rgba(176,90,255,.45); font-size: 14.5px; color: var(--tx-label-3); }
.ax-mail-qt { min-height: 36px; margin-top: 6px; font: 600 13.5px/1 var(--tx-font) !important; color: var(--tx-cyan) !important; }
.ax-mail-html { font-size: 15.5px; line-height: 1.5; color: rgba(255,255,255,.9); overflow-x: auto; overflow-wrap: anywhere; }
.ax-mail-html img { max-width: 100%; height: auto; }
.ax-mail-html table { border-collapse: collapse; max-width: 100%; }
.ax-mail-html td, .ax-mail-html th { padding: 4px 8px; border-bottom: 1px solid rgba(255,255,255,.08); text-align: left; vertical-align: top; }
.ax-mail-imgatt { display: block; margin-top: 14px; border-radius: 14px; overflow: hidden; border: 1px solid var(--tx-line); background: rgba(255,255,255,.03); width: 100%; text-align: left; cursor: zoom-in; }
.ax-mail-imgatt img { display: block; width: 100%; max-height: 420px; object-fit: contain; background: #000; }
.ax-mail-imgatt span { display: flex; align-items: center; gap: 6px; padding: 9px 12px; font-size: 13px; color: var(--tx-label-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ax-mail-imgatt span svg { width: 14px; height: 14px; flex: none; }
.ax-mail-file { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px; min-height: 56px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid var(--tx-line); color: #fff; }
.ax-mail-file:active { background: rgba(255,255,255,.09); }
.ax-mail-fileic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--tx-grad-soft); color: var(--tx-cyan); flex: none; }
.ax-mail-fileic svg { width: 18px; height: 18px; }
.ax-mail-filenm { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ax-mail-filenm b { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ax-mail-filenm small { font-size: 12.5px; color: var(--tx-label-3); }
.ax-mail-fileext { width: 18px; height: 18px; color: var(--tx-label-3); flex: none; }

/* Meeting invite card */
.ax-mail-meet { margin: 0 0 14px; padding: 14px; border-radius: 16px; background: linear-gradient(160deg, rgba(139,61,255,.2), rgba(31,143,255,.1) 60%, rgba(34,227,255,.06)); border: 1px solid rgba(176,90,255,.3); }
.ax-mail-meet.ax-cancel { background: rgba(255,69,58,.08); border-color: rgba(255,69,58,.25); }
.ax-mail-meet-top { display: flex; align-items: center; gap: 12px; }
.ax-mail-meet-top > span:last-child { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ax-mail-meet-top small { font: 700 11px/1 var(--tx-font); letter-spacing: .05em; text-transform: uppercase; color: #d1a6ff; }
.ax-mail-meet-top b { font: 700 17px/1.25 var(--tx-font-display); color: #fff; }
.ax-mail-meet-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--tx-grad); color: #fff; box-shadow: 0 8px 20px -8px rgba(176,40,255,.9); }
.ax-mail-meet-ic svg { width: 22px; height: 22px; }
.ax-mail-meet-rows { margin-top: 12px; display: flex; flex-direction: column; gap: 7px; font-size: 14px; line-height: 1.35; color: var(--tx-label-2); }
.ax-mail-meet-rows div { display: flex; gap: 8px; }
.ax-mail-meet-rows svg { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--tx-label-3); }
.ax-mail-rsvp { display: flex; gap: 8px; margin-top: 14px; }
.ax-mail-rsvp button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 44px; border-radius: 12px; font: 700 15px/1 var(--tx-font) !important; color: #fff !important; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.1); transition: transform .15s var(--tx-ease), background-color .15s; }
.ax-mail-rsvp button:active { transform: scale(.96); }
.ax-mail-rsvp button:disabled { opacity: .5; }
.ax-mail-rsvp button svg { width: 16px; height: 16px; stroke-width: 2.6; }
.ax-mail-rsvp button.ax-accepted { background: rgba(48,209,88,.2); border-color: rgba(48,209,88,.45); color: #30d158 !important; }
.ax-mail-rsvp button.ax-tentative { background: rgba(255,179,26,.18); border-color: rgba(255,179,26,.4); color: #ffc04d !important; }
.ax-mail-rsvp button.ax-declined { background: rgba(255,69,58,.18); border-color: rgba(255,69,58,.4); color: #ff6961 !important; }
.ax-mail-meet-st { margin-top: 10px; font-size: 13px; color: var(--tx-label-3); }

/* Thread toolbar (footer) */
.ax-mail-toolbar { display: flex; justify-content: space-around; max-width: 680px; margin: 0 auto; }
.ax-mail-toolbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 48px; padding: 4px 0; font: 600 11px/1 var(--tx-font) !important; color: var(--tx-cyan) !important; border-radius: 12px; }
.ax-mail-toolbar button:active { background: rgba(255,255,255,.06); }
.ax-mail-toolbar svg { width: 24px; height: 24px; }
.ax-mail-toolbar button.ax-on { color: #ff9f0a !important; }
.ax-mail-toolbar button.ax-on svg { fill: rgba(255,159,10,.35); }
.ax-mail-toolbar button[data-t="delete"] { color: #ff6961 !important; }

/* --- Compose sheet ---------------------------------------------------------- */
.ax-mail-compose { display: flex; flex-direction: column; min-height: 100%; margin: -8px -16px 0; }
.ax-mail-cf { position: relative; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 16px; border-bottom: .5px solid rgba(255,255,255,.1); }
.ax-mail-cf[hidden] { display: none; }
.ax-mail-cl { flex: none; font: 400 16px/1 var(--tx-font); color: var(--tx-label-3); }
.ax-mail-chips { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ax-mail-chips input, .ax-mail-subjin { flex: 1; min-width: 90px; height: 34px; border: 0; outline: none; background: none; color: #fff; font: 400 16px/1.2 var(--tx-font); -webkit-appearance: none; appearance: none; }
.ax-mail-chip { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 0 2px 0 10px; height: 30px; border-radius: 15px; background: rgba(31,143,255,.2); color: #8fc8ff; font: 600 14px/1 var(--tx-font); white-space: nowrap; }
.ax-mail-chip button { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: inherit; }
.ax-mail-chip button svg { width: 13px; height: 13px; stroke-width: 2.6; }
.ax-mail-cctog { flex: none; min-height: 34px; padding: 0 8px; font: 600 14px/1 var(--tx-font) !important; color: var(--tx-cyan) !important; }
.ax-mail-cctog[hidden] { display: none; }
.ax-mail-sug { padding: 4px 8px; border-bottom: .5px solid rgba(255,255,255,.1); background: rgba(255,255,255,.03); }
.ax-mail-sug[hidden] { display: none; }
.ax-mail-sug button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 8px; border-radius: 12px; text-align: left; color: #fff; }
.ax-mail-sug button:active { background: rgba(255,255,255,.07); }
.ax-mail-sug button > span:last-child { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ax-mail-sug b { font-weight: 600; font-size: 15px; }
.ax-mail-sug small { font-size: 12.5px; color: var(--tx-label-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ax-mail-distros { display: flex; align-items: flex-start; gap: 8px; padding: 10px 16px; border-bottom: .5px solid rgba(255,255,255,.1); }
.ax-mail-distros[hidden] { display: none; }
.ax-mail-distros .ax-mail-cl { padding-top: 7px; }
.ax-mail-distros > div { display: flex; flex-wrap: wrap; gap: 6px; }
.ax-mail-distros .ax-pill { min-height: 32px; }
.ax-mail-bodyin { flex: 1; width: 100%; min-height: 48vh; padding: 14px 16px; border: 0; outline: none; resize: none; background: none; color: #fff; font: 400 16px/1.5 var(--tx-font); -webkit-appearance: none; appearance: none; }
.ax-mail-bodyin::placeholder, .ax-mail-chips input::placeholder { color: rgba(235,235,245,.32); }

@media (prefers-reduced-motion: reduce) {
  .ax-chat-in, .ax-ai-orb, .ax-ai-typing i { animation: none; }
}
