@font-face {
  font-family: "Readex Pro";
  src: url("/ReadexPro.ttf") format("truetype");
  font-weight: 160 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: "Readex Pro", "Segoe UI", Tahoma, sans-serif;
  color: #22233a;
  background: #f5f5fa;
  --line: #e4e4ee;
  --muted: #565870;
  --accent: #5611d9;
  --tint: #f0e8ff;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button, select, input, textarea { border: 1px solid var(--line); border-radius: 8px; background: white; }
button, select { min-height: 42px; padding: 7px 12px; }
button { cursor: pointer; }
button:hover { border-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:disabled { opacity: .55; cursor: wait; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.55rem, 4vw, 2rem); }
h2 { font-size: 1.08rem; }
h3 { font-size: 1rem; }
small, .caption, dt { color: var(--muted); font-size: .83rem; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px clamp(12px, 4vw, 48px); background: #17131e; color: white; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 1.4rem; white-space: nowrap; }
.top .caption, .role { color: #dcd5f4; }
.mark { display: grid; place-items: center; border-radius: 12px; width: 38px; height: 38px; background: #d9cdfd; color: #28204b; }
.role { display: flex; gap: 8px; align-items: center; font-size: .8rem; }
.role select { color: #17131e; max-width: 150px; }
main { max-width: 1536px; margin: auto; padding: 24px clamp(12px, 3vw, 42px); }
.heading, .chathead, .task { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.heading .caption { margin-block-end: 4px; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: .78rem; background: var(--tint); color: #3e3087; white-space: nowrap; }
.badge[hidden] { display: none; }
.late { background: #ffebeb; color: #952f37; }
nav { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
nav button, .tabs button { border-color: transparent; background: transparent; }
[aria-current="page"], .tabs [aria-pressed="true"] { background: var(--tint); color: var(--accent); font-weight: 700; }
#notice { min-height: 27px; padding-top: 4px; color: var(--accent); font-size: .85rem; }
.inbox { display: grid; grid-template-columns: minmax(225px, 1fr) minmax(320px, 2fr) minmax(200px, .85fr); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: white; min-height: 565px; }
.queue, .chat { min-width: 0; border-inline-end: 1px solid var(--line); }
.panelhead, .chathead, .profile, .composer { padding: 15px; }
.panelhead, .chathead { border-bottom: 1px solid var(--line); }
.tabs, .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.panelhead .tabs { margin-top: 8px; }
.row { display: flex; align-items: center; gap: 10px; text-align: start; width: 100%; padding: 13px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.row:hover, .selected { background: #f5f2ff; }
.queue-heading, .row-heading, .row-meta { display: flex; align-items: center; gap: 8px; }
.queue-heading, .row-heading { justify-content: space-between; }
#queue-result-count, .row-heading time { color: var(--muted); font-size: .75rem; flex-shrink: 0; }
.queue-search { display: flex; align-items: center; gap: 6px; margin-top: 12px; padding-inline: 10px 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--tint); }
.queue-search > span { font-size: 1.3rem; color: var(--accent); }
.queue-search input { width: 100%; min-width: 0; min-height: 44px; padding: 0 4px; border: 0; background: transparent; font-size: 16px; }
.queue-search input::-webkit-search-cancel-button { display: none; }
.queue-search:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.queue-search input:focus-visible { outline: 0; }
#clear-search { min-width: 44px; min-height: 44px; padding: 0; border: 0; background: transparent; font-size: 1.25rem; }
.queue-filters { display: flex; flex-wrap: wrap; gap: 6px; padding-block: 10px 4px; }
.queue-filters button { border-radius: 999px; min-height: 44px; padding-inline: 10px; white-space: nowrap; font-size: .85rem; }
.queue-filters [aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--tint); font-weight: 700; }
.filter-count { font-variant-numeric: tabular-nums; margin-inline-start: 2px; }
#owner-filter { margin-top: 6px; min-height: 44px; max-width: 100%; }
.row-heading strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.needs-reply .row-heading time, .reply-tag, .row-meta .handoff-tag { color: var(--accent); font-weight: 700; }
.reply-tag, .row-meta .handoff-tag { font-size: .73rem; border-radius: 999px; background: var(--tint); padding: 2px 7px; white-space: nowrap; }
.row-meta { min-width: 0; }
.queue-empty { display: grid; justify-items: start; gap: 12px; padding: 24px 15px; color: var(--muted); }
[data-theme="dark"] .queue-search input { background: transparent; }
.selected { box-shadow: inset -3px 0 var(--accent); }
.avatar { flex: 0 0 auto; display: grid; place-items: center; width: 39px; height: 39px; border-radius: 50%; font-weight: 700; }
.tone0 { background: #dff1ed; color: #225e52; }
.tone1 { background: #e9e0fc; color: #50408c; }
.tone2 { background: #fcebdc; color: #794122; }
.summary { min-width: 0; flex: 1; display: grid; gap: 3px; }
.summary small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { background: var(--accent); width: 8px; height: 8px; border-radius: 50%; }
.chat { display: flex; flex-direction: column; }
.chathead { justify-content: flex-start; }
.timeline { background: #fbfaff; padding: 16px; flex: 1; min-height: 210px; max-height: 435px; overflow: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.timeline > * { flex-shrink: 0; }
.timeline .entry { white-space: normal; }
.message-body { white-space: pre-wrap; }
[data-swipe-reply] { touch-action: pan-y pinch-zoom; -webkit-touch-callout: none; }
.message-actions { display: grid; gap: 8px; }
.message-actions > button { min-height: 44px; text-align: start; }
.pinned-banner { display: flex; align-items: center; gap: 8px; padding: 5px 12px; background: var(--tint); border-bottom: 1px solid var(--line); flex-shrink: 0; }
.pinned-banner button { min-height: 44px; }
.pinned-preview { display: grid; flex: 1; min-width: 0; text-align: start; border: 0; padding: 3px 5px; background: transparent; font-size: .8rem; }
.pinned-preview span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pinned-preview strong { color: var(--accent); }
.reaction-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); gap: 5px; }
.reaction-picker button { min-height: 44px; padding: 0 4px; font-size: 1.25rem; }
.reaction-picker [aria-pressed="true"] { border-color: var(--accent); background: var(--tint); }
.message-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.reaction-summary { min-height: 44px; border-radius: 999px; background: var(--tint); font-size: .85rem; }
.reaction-people { list-style: none; margin: 0; padding: 0; }
.reaction-people li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-block: 8px; border-bottom: 1px solid var(--line); }
.reaction-people small { margin-inline-start: 6px; }
.reaction-person-emoji { font-size: 1.25rem; }
.deleted-message, .edited-message { color: var(--muted); font-size: .82rem; }
.deleted-message { font-style: italic; }
.danger-text { color: #a92d40; }
.danger-button { background: #a92d40; border-color: #a92d40; color: white; font-weight: 700; }
[data-theme="dark"] .danger-text { color: #ffb4c1; }
[data-theme="dark"] .danger-button { background: #a92d40; }
.message-action-feedback:empty { display: none; }
@media (pointer: coarse) {
  [data-swipe-reply] { -webkit-user-select: none; user-select: none; }
}
.entry.is-swiping { transform: translateX(var(--reply-swipe, 0px)); }
.entry.swipe-ready { box-shadow: 0 0 0 2px var(--accent); }
.timeline > :is(.handoff-banner, .automatic-draft) { align-self: stretch; border-radius: 10px; }
.quote-action { display: block; min-height: 44px; padding-inline: 4px; margin-block-start: 3px; border: 0; background: transparent; color: var(--accent); font-size: .78rem; }
.message-quote { display: grid; gap: 2px; width: 100%; min-width: 0; min-height: 0; padding: 6px 8px; border: 0; border-inline-start: 3px solid var(--accent); border-radius: 5px; background: var(--tint); text-align: start; font-size: .8rem; }
.message-quote span, .message-quote strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry .message-quote { margin-block-end: 6px; }
.entry:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.composer-quote { display: flex; gap: 6px; align-items: stretch; margin-block-start: 5px; }
.composer-quote button { min-width: 44px; min-height: 44px; padding: 0; }
.entry { max-width: 90%; padding: 9px 12px; border: 1px solid var(--line); background: white; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.entry small { display: block; margin-block-end: 3px; }
.reply { align-self: flex-end; background: var(--tint); }
.note { background: #fff6dc; border-color: #f0dfae; }
.event { align-self: center; background: transparent; font-size: .85rem; }
.composer { border-top: 1px solid var(--line); }
textarea { resize: vertical; width: 100%; min-height: 68px; padding: 10px; margin: 7px 0; }
.actions { justify-content: flex-end; }
.primary { background: var(--accent); border-color: var(--accent); color: white; font-weight: 700; }
.primary:hover { background: #36287e; }
.wide { width: 100%; margin-bottom: 16px; }
.identity { display: grid; justify-items: start; gap: 6px; padding-block: 14px; border-bottom: 1px solid var(--line); }
dd { margin: 0 0 10px; }
.mini { display: grid; gap: 4px; padding-block: 8px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.empty { padding: 18px; color: var(--muted); }
.board { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.board > .caption { margin: 6px 0 14px; }
.task { padding: 14px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.task h3 { margin-block: 5px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.metric { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.metric strong { color: var(--accent); font-size: 1.8rem; }
dialog { width: min(440px, calc(100% - 24px)); border: 1px solid var(--line); border-radius: 14px; padding: 18px; color: inherit; }
dialog::backdrop { background: #17131e80; }
dialog form { display: grid; gap: 12px; }
dialog label { display: grid; gap: 4px; }
dialog input { padding: 9px; width: 100%; min-width: 0; }
.snippet { text-align: start; }
.hilal-panel { display: grid; gap: 12px; }
.hilal-draft { border: 1px solid var(--line); background: var(--tint); border-radius: 10px; padding: 12px; line-height: 1.7; }
.report-detail .hilal-draft { white-space: pre-wrap; overflow-wrap: anywhere; }
.report-record > button { justify-self: start; }
.coverage-filter { display: grid; gap: 5px; }
.hilal-report .metric h4 { margin: 0; font-size: .95rem; }
.knowledge-priorities { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }
.knowledge-priorities button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: start; }
.knowledge-priorities button > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.knowledge-priorities .badge { flex-shrink: 0; }
.comparison-list { margin-block-start: 8px; }
.handoff-banner { background: var(--tint); padding: 10px 15px; font-size: .9rem; line-height: 1.6; }
.simulation-bar { padding: 8px 15px; border-bottom: 1px solid var(--line); }
.automatic-draft { display: grid; justify-items: start; gap: 6px; padding: 12px 15px; background: var(--tint); line-height: 1.6; }
.knowledge-article p { white-space: pre-wrap; line-height: 1.6; }
.knowledge-article ul { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 8px 0 0; list-style: none; }
.knowledge-article .badge { white-space: normal; }
.knowledge-article > button { flex-shrink: 0; }
.summary .handoff-tag { color: var(--accent); font-weight: 700; }
#form-error { color: #952f37; }
.back { display: none; }
.profile-toggle, #chat-notice, #profile-notice { display: none; }
.chat-identity { min-width: 0; flex: 1; }
.chat-identity h2, .chat-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-stage { background: var(--tint); border-radius: 999px; padding: 2px 8px; }
.composer-line { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 6px; }
.composer-line textarea { grid-column: 1 / -1; }
.composer-line { grid-template-columns: auto 1fr auto; }
.media-tools, .media-draft, .recording-bar { display: flex; align-items: center; gap: 5px; min-width: 0; }
.media-tools button { min-width: 44px; min-height: 44px; padding: 0; font-size: 1.16rem; }
.voice-tool { touch-action: none; user-select: none; -webkit-touch-callout: none; }
.media-draft { justify-content: space-between; margin-block: 4px; }
.media-draft img { width: auto; max-width: 95px; max-height: 62px; object-fit: contain; border-radius: 8px; }
.media-draft audio, .entry audio { max-width: 100%; }
.voice-preview { flex: 1; min-width: 0; }
.voice-player:not([hidden]) { display: flex; align-items: center; gap: 6px; direction: ltr; }
.voice-player button { min-height: 44px; }
.voice-player .voice-speed { min-width: 44px; padding-inline: 4px; font-size: .8rem; }
.entry .voice-player .voice-time { color: inherit; }
.entry.reply .voice-wave { color: inherit; }
.voice-time { font-size: .72rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.voice-scrubber { flex: 1; min-width: 0; position: relative; height: 44px; }
.voice-wave { position: absolute; inset: 9px 0; display: flex; align-items: center; gap: 2px; pointer-events: none; color: var(--accent); }
.voice-wave i { flex: 1; background: currentColor; border-radius: 3px; opacity: .45; }
.voice-wave i.played { opacity: 1; }
.voice-scrubber input { position: absolute; inset: 0; width: 100%; height: 44px; margin: 0; opacity: .35; accent-color: var(--accent); }
.voice-scrubber input:focus-visible { opacity: 1; }
#voice-mini:not([hidden]) { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 4px 8px; position: fixed; z-index: 11;
  inset-inline: max(10px, calc((100vw - 520px) / 2)); bottom: max(10px, env(safe-area-inset-bottom));
  padding: 7px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 4px 18px #0002; }
#voice-mini button { min-width: 44px; min-height: 44px; }
#mini-open { display: grid; flex: 1; min-width: 0; text-align: start; }
#mini-contact { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mini-transport { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; direction: ltr; }
.mini-queue:not([hidden]) { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .8rem; }
body:has(#voice-mini:not([hidden]) #mini-queue:not([hidden])) main { padding-bottom: 164px; }
#mini-seek { width: 100%; min-height: 28px; direction: ltr; accent-color: var(--accent); }
#mini-time { direction: ltr; justify-self: start; font-variant-numeric: tabular-nums; }
.mini-voice-list { display: grid; gap: 6px; list-style: none; margin: 0; padding: 0; }
.mini-voice-list button { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: start; }
.mini-voice-list button > span:first-child { display: grid; gap: 3px; }
.voice-list-meta { display: grid; justify-items: end; gap: 3px; }
.voice-list-duration { direction: ltr; font-variant-numeric: tabular-nums; }
.voice-list-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.voice-list-filters button { min-height: 44px; border-radius: 999px; }
.voice-list-filters [aria-pressed="true"] { background: var(--tint); border-color: var(--accent); color: var(--accent); }
[data-theme="dark"] #voice-mini { background: #231c34; }
body:has(#voice-mini:not([hidden])) main { padding-bottom: 118px; }
body:has(.inbox.detail) #voice-mini { bottom: max(84px, calc(env(safe-area-inset-bottom) + 72px)); }
.media-draft button { min-width: 44px; }
.recording-bar { color: #9d2545; flex-wrap: wrap; justify-content: flex-end; font-size: .85rem; }
#voice-clock { font-variant-numeric: tabular-nums; direction: ltr; font-weight: 700; }
[data-theme="dark"] .recording-bar { color: #ffb3c2; }
.chat-photo { padding: 0; display: block; border: 0; background: transparent; }
.chat-photo img, .photo-viewer img { display: block; max-width: 100%; max-height: 60dvh; object-fit: contain; border-radius: 10px; }
.chat-photo img { max-height: 230px; }
.photo-viewer { display: grid; gap: 10px; }
.composer-tools, .send-arrow { display: none; }
.quote-action { font-size: 1.1rem; min-width: 44px; }
.profile-header { display: flex; align-items: center; gap: 10px; }
.top-tools, .filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.top-tools > button { background: #352a55; border-color: #6b5b90; color: white; }
.login { max-width: 420px; margin: 40px auto; }
.login form, .login label { display: grid; gap: 8px; }
.login form { gap: 14px; margin-top: 18px; }
.login input { width: 100%; min-height: 44px; padding: 8px; }
#login-error { color: #952f37; }
[data-theme="dark"] #login-error { color: #ffb4bc; }
.filters { margin-top: 8px; }
.filters input { padding: 9px; width: 100%; min-height: 42px; }
.filters select { width: 100%; }
.task-tabs { margin: 10px 0; }
.report-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-block: 12px 16px; }
.report-filters label { display: grid; gap: 4px; font-size: .88rem; }
.report-filters input { min-height: 42px; padding: 7px; }
.staff-report { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 10px; }
.staff-report dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin: 0; }
.staff-report dd { margin: 0; font-weight: 700; }
.report-summary { margin-block: 18px 10px; }
.hilal-report { display: grid; gap: 10px; padding-block: 6px 18px; }
.hilal-report dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin: 0; }
.hilal-report dd { margin: 0; font-weight: 700; }
.report-count { justify-self: start; color: var(--accent); font-weight: 700; min-width: 44px; }
.report-detail, .report-conversation, .report-record { display: grid; gap: 9px; }
.report-conversation { border-top: 1px solid var(--line); padding-top: 10px; }
.report-conversation > button { justify-self: start; }
.reply-comparison { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 8px; }
.reply-comparison section { border: 1px solid var(--line); border-radius: 8px; padding: 8px; min-width: 0; }
.reply-comparison h4 { margin: 0 0 6px; }
.reply-comparison p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.customer-filter { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.customer-details { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.customer-details small { display: block; margin-block-end: 4px; }
.customer-details .badge { margin-block-start: 4px; }
dialog { max-height: calc(100dvh - 24px); overflow: auto; }
.catalog-search { width: min(100%, 380px); padding: 10px; min-height: 42px; margin-bottom: 16px; }
.catalog { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr)); gap: 12px; }
.channel-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.channel-card p { font-size: .88rem; margin-bottom: 8px; }
.channel-card button { margin-top: auto; }
.channel-badges { justify-content: flex-start; margin-bottom: 4px; }
.board > .heading { margin-bottom: 12px; }
[data-theme="dark"] {
  color-scheme: dark;
  color: #f2ecff;
  background: #151222;
  --line: #494059;
  --muted: #c6bad8;
  --accent: #c4b2ff;
  --tint: #352955;
}
[data-theme="dark"] :is(button, select, input, textarea, .inbox, .board, .entry) { background: #231c34; }
[data-theme="dark"] :is(.timeline, .top) { background: #1b152b; }
[data-theme="dark"] :is(.row:hover, .selected, .reply, .badge, [aria-current="page"], [aria-pressed="true"]) { background: var(--tint); color: #eee5ff; }
[data-theme="dark"] .role select { color: #eee5ff; }
[data-theme="dark"] .primary { background: #baa5ff; color: #211937; }
[data-theme="dark"] .primary:hover { background: #d5c6ff; }
[data-theme="dark"] .note { background: #3b2e1c; border-color: #765938; }
[data-theme="dark"] .late { background: #512534; color: #ffd0d6; }
[data-theme="dark"] #form-error { color: #ffb4bc; }
@media (max-width: 1199px), (max-width: 1400px) and (pointer: coarse) {
  .inbox { display: block; min-height: 0; }
  .inbox:not(.detail) { overflow: visible; }
  .inbox:not(.detail) .panelhead { position: sticky; top: 0; z-index: 2; background: white; border-radius: 14px 14px 0 0; }
  [data-theme="dark"] .inbox:not(.detail) .panelhead { background: #231c34; }
  .queue-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; padding-inline: 2px; }
  .queue-filters button { flex-shrink: 0; }
  .queue .row { min-height: 76px; }
  .queue .row:last-child { border-radius: 0 0 14px 14px; }
  .queue .avatar { width: 46px; height: 46px; }
  .queue .row { border-bottom-color: transparent; }
  .queue .row:not(:hover):not(:focus-visible) { background: transparent; box-shadow: none; }
  .inbox .chat, .inbox .profile, .detail .queue { display: none; }
  body:has(.inbox.detail) { overflow: hidden; }
  body:has(.inbox.detail) :is(.top, #workspace > .heading, #nav, #notice) { visibility: hidden; }
  .inbox.detail {
    position: fixed; inset: var(--chat-viewport-top, 0px) 0 auto; z-index: 10; height: var(--chat-viewport-height, 100dvh);
    border: 0; border-radius: 0; overflow: hidden;
    padding-inline: env(safe-area-inset-right) env(safe-area-inset-left);
    padding-top: env(safe-area-inset-top);
  }
  .detail .chat { display: flex; height: 100%; min-height: 0; }
  .detail.profile-open .chat { display: none; }
  .detail.profile-open .profile { display: block; height: 100%; overflow: auto; padding-bottom: max(15px, env(safe-area-inset-bottom)); }
  .chathead { padding: 8px 12px; gap: 8px; flex-shrink: 0; }
  .chathead .profile-toggle { border: 0; color: var(--accent); }
  .profile-header { margin-bottom: 10px; }
  .profile-toggle, .back { display: block; min-height: 44px; }
  .back { min-width: 44px; font-size: 1.15rem; }
  .profile-toggle { white-space: nowrap; }
  #chat-notice:not(:empty), #profile-notice:not(:empty) { display: block; padding: 6px 12px; color: var(--accent); font-size: .84rem; }
  .simulation-bar { padding: 4px 12px; }
  .simulation-bar button { min-height: 36px; font-size: .83rem; }
  .timeline { min-height: 0; max-height: none; overflow-y: auto; overscroll-behavior: contain; padding: 12px; }
  .timeline .entry { flex-shrink: 0; }
  .composer { flex-shrink: 0; padding: 8px 12px max(8px, env(safe-area-inset-bottom)); }
  .composer textarea { min-height: 48px; max-height: 20dvh; margin-block: 5px; font-size: 16px; }
  .composer .tabs button, .composer .actions button { min-height: 44px; }
  .detail .timeline { background: #fff; gap: 12px; }
  .detail .entry.incoming { background: #f0f2f5; border-color: transparent; }
  .detail .entry.reply { background: #5611d9; color: white; border-color: transparent; }
  .detail .entry.reply > small, .detail .entry.reply .quote-action { color: #edf5ff; }
  .detail .entry.reply .message-quote { color: #1c2940; }
  [data-theme="dark"] .detail .timeline { background: #1b152b; }
  [data-theme="dark"] .detail .entry.incoming { background: #322943; }
  [data-theme="dark"] .detail .entry.reply .message-quote { color: #f5efff; }
  .detail .composer-desktop, .detail .simulation-bar, .detail .send-label { display: none; }
  .detail .composer-line { grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: end; gap: 8px; }
  .detail .composer-line:has(.media-tools) { grid-template-columns: 44px minmax(0, 1fr) auto 44px; }
  .detail .composer:not(.has-media):not(.composer-note) .composer-line:has(.voice-tool):has(textarea:placeholder-shown) {
    grid-template-columns: 44px minmax(0, 1fr) auto;
  }
  .detail .composer:not(.has-media) .composer-line:has(.voice-tool):has(textarea:placeholder-shown) .composer-send { display: none; }
  .detail .composer.has-media .voice-tool, .detail .composer-line:has(textarea:not(:placeholder-shown)) .voice-tool { display: none; }
  .detail .media-tools button { border: 0; color: var(--accent); }
  .detail .composer-line textarea { grid-column: auto; margin: 0; min-height: 44px; resize: none; border-radius: 22px; padding: 10px 14px; background: #f0f2f5; }
  .detail .composer-note textarea { background: #fff5d9; }
  [data-theme="dark"] .detail .composer-line textarea { background: #322943; }
  [data-theme="dark"] .detail .composer-note textarea { background: #48381b; }
  .detail .composer-tools, .detail .send-arrow { display: block; }
  .detail .composer-tools, .detail .composer-send { min-width: 44px; min-height: 44px; border-radius: 50%; padding: 0; font-size: 1.3rem; }
  .detail .composer-tools { color: var(--accent); }
  .detail .composer-send { background: #5611d9; border-color: #5611d9; color: white; }
  .detail .entry { position: relative; padding: 8px 11px; }
  .detail .entry:not(:has(audio)) { max-width: min(84%, 560px); }
  .detail .entry:has(audio) { width: min(90%, 330px); }
  .detail .message-controls { gap: 3px; }
  .detail .quote-action:not(:focus-visible) { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; min-height: 0; min-width: 0; overflow: hidden; }
  .detail .message-controls:not(.has-reactions):not(:focus-within) { height: 0; }
  .detail .reaction-summary { margin-top: 4px; }
  .queue, .chat { border-inline-end: 0; }
  .keyboard-tight .detail .simulation-bar { display: none; }
  .keyboard-tight .detail .composer { padding-block-start: 3px; }
  .keyboard-tight .detail .composer textarea { min-height: 42px; max-height: 56px; }
}
@media (max-width: 1199px) and (max-height: 480px) {
  .composer { padding-block-start: 3px; }
  .composer textarea { min-height: 42px; }
  .composer .tabs button, .composer .actions button { min-height: 38px; }
}
@media (max-width: 500px) {
  .brand .caption, .role { font-size: 0; }
  .role select { font-size: .85rem; }
  .task { align-items: flex-start; flex-direction: column; }
  .task .actions { width: 100%; }
  .top-tools { justify-content: flex-end; }
  .top-tools > button { font-size: .8rem; }
  nav { flex-wrap: wrap; }
}

/* Moon identity */
.mark {
  position: relative;
  flex: 0 0 38px;
  background: #5611d9;
  color: #39f6cf;
}
.mark::before, .mark::after {
  content: "";
  position: absolute;
  inset-block-start: 10px;
  width: 17px;
  height: 17px;
  border: 1px solid currentColor;
  border-radius: 50%;
}
.mark::before { inset-inline-start: 6px; }
.mark::after { inset-inline-end: 6px; border-width: 2px; }
.moon-label { color: #62f4d4; font-size: .7rem; font-weight: 600; letter-spacing: .13em; }
.login { border-block-start: 3px solid #5611d9; }
.entry { overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .queue-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .queue-filters button { flex-shrink: 0; }
}

.ui-icon { width: 21px; height: 21px; flex: none; vertical-align: middle; pointer-events: none; }
.queue-search > .ui-icon { color: var(--muted); }
.queue-search { background: transparent; }
.queue-filters button { border-color: transparent; background: transparent; }
.queue-filters [aria-pressed="true"] { border-color: transparent; }
.row { padding-block: 12px; }
.row.selected { box-shadow: inset -3px 0 var(--accent); }
#nav { gap: 4px; border-block-end: 1px solid var(--line); padding-block-end: 8px; }
#nav button { white-space: nowrap; }
.chathead button:has(.ui-icon), .composer button:has(.ui-icon) { line-height: 1; }
@media (max-width: 900px) {
  #nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  #nav button { flex-shrink: 0; }
  .detail .composer-line:has(.media-tools) { gap: 4px; }
}

.work-list > h2:not(:first-child) { margin-block-start: 20px; }
.work-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; padding: 0; list-style: none; }
.work-counts li { display: flex; justify-content: space-between; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.work-counts strong { color: var(--accent); }
.chat-results { display: grid; gap: 6px; max-height: 45dvh; overflow-y: auto; }
.chat-results button { display: grid; text-align: start; gap: 4px; overflow-wrap: anywhere; }
#typing-status:not([hidden]), .snooze-status { padding: 4px 12px; color: var(--accent); font-size: .8rem; }
.chat-identity { min-width: 0; }
@media (max-width: 480px) {
  .detail .chathead { gap: 5px; }
  .detail .chathead button { padding-inline: 5px; font-size: .73rem; }
  .detail .chathead .avatar { display: none; }
  .work-list .task { flex-wrap: wrap; }
}

/* Channel setup extends the existing Wasla RTL card/form design. */
.channel-section { margin-block-end: 24px; }
.channel-section > .caption { margin-block: 8px 14px; }
.channel-setup-panel { display: grid; gap: 14px; }
.channel-setup-panel ol, .channel-setup-panel ul { padding-inline-start: 22px; margin-block: 0; }
.channel-setup-panel li { margin-block: 6px; overflow-wrap: anywhere; }
.channel-setup-panel select { width: 100%; min-width: 0; }
.channel-setup-panel a { color: var(--accent); }
.channel-setup-panel .caption { line-height: 1.8; }
.channel-setup-panel :is(h2, h3, p) { margin-block: 0; }
.channel-setup-panel label { min-width: 0; }
.channel-setup-panel [role="alert"]:empty { display: none; }
@media (max-width: 480px) {
  .channel-setup-panel { gap: 12px; }
  .channel-setup-panel .actions > button { flex: 1 1 auto; }
}
.channel-card h3 { overflow-wrap: anywhere; }
.channel-card .actions { margin-block-start: auto; }
.channel-card .actions button { margin-top: 0; }
.channel-steps { font-size: .87rem; }
.channel-setup-error { color: #a5233d; }
[data-theme="dark"] .channel-setup-error { color: #ffabb8; }
.emoji-panel,.call-panel { width:min(100%,420px); max-height:75dvh; overflow:auto; overscroll-behavior:contain; }
.emoji-panel label,.inbox-scope label { display:grid; gap:5px; margin-block:10px; min-width:0; }
.emoji-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(44px,1fr)); gap:6px; margin-block:12px; }
.emoji-grid button { min-height:44px; font-size:1.5rem; padding:6px; }
.emoji-grid button:focus-visible { outline:2px solid currentColor; outline-offset:2px; }
.inbox-scope { padding:10px 14px; border-block-end:1px solid #8884; }
.inbox-scope summary { cursor:pointer; padding-block:8px; }
.inbox-scope input,.inbox-scope select { width:100%; min-width:0; box-sizing:border-box; }
.inbox-scope p { font-size:.8rem; }
.contact-photo { width:100%; height:100%; object-fit:cover; border-radius:inherit; }
.call-preview-actions { display:flex; flex-wrap:wrap; gap:8px; margin-block:14px; }
.call-preview-actions button { min-height:44px; }
.analytics-panel { max-width:min(94vw,720px); overflow:auto; }
.analytics-panel table { width:100%; border-collapse:collapse; font-size:.85rem; }
.analytics-panel td,.analytics-panel th { padding:8px; border-bottom:1px solid #8884; text-align:start; }
.activity-chart { display:grid; gap:5px; margin-block:14px; }
.activity-chart label { display:flex; align-items:center; gap:8px; }
.activity-chart meter { flex:1; height:18px; }

/* Reference lock 64: extend Wasla's existing tokens and 900px chat breakpoint. */
#mobile-nav { display:none; }
.more-menu { display:grid; gap:10px; max-height:75dvh; overflow:auto; overscroll-behavior:contain; }
.more-menu button { text-align:start; min-height:44px; }
button, a { touch-action:manipulation; -webkit-tap-highlight-color:#5611d922; }
dialog { overscroll-behavior:contain; }
@media (max-width:900px) {
  :root { --mobile-nav-height:82px; --mobile-nav-space:calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px)); }
  #workspace { padding-bottom:calc(var(--mobile-nav-space) + 16px); }
  #nav { display:none; }
  #mobile-nav:not([hidden]) {
    display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:2px;
    position:fixed; inset:auto 0 0; z-index:12; margin:0;
    height:var(--mobile-nav-space); padding:4px max(4px,env(safe-area-inset-right)) env(safe-area-inset-bottom) max(4px,env(safe-area-inset-left));
    background:#fff; border-top:1px solid var(--line); overflow:visible;
  }
  [data-theme="dark"] #mobile-nav { background:#231c34; }
  #mobile-nav button { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px; min-width:0; min-height:44px; padding:3px 1px; border:0; border-radius:8px; background:transparent; font-size:.7rem; line-height:1.5; }
  #mobile-nav [aria-current="page"] { color:var(--accent); background:var(--tint); box-shadow:inset 0 3px var(--accent); font-weight:600; }
  #mobile-nav .nav-symbol { font-size:1.25rem; line-height:1; }
  #mobile-nav small { font-size:.58rem; white-space:nowrap; }
  .inbox.detail { height:calc(var(--chat-viewport-height, 100dvh) - var(--mobile-nav-space)); }
  .keyboard-open #mobile-nav { display:none; }
  .keyboard-open .inbox.detail { height:var(--chat-viewport-height,100dvh); }
  .keyboard-open #workspace { padding-bottom:16px; }
  #voice-mini { bottom:calc(var(--mobile-nav-space) + 8px); }
  body:has(.inbox.detail) #voice-mini { bottom:calc(var(--mobile-nav-space) + 84px); }
  .keyboard-open #voice-mini:not([hidden]) { display:none; }
  .timeline { overscroll-behavior:contain; }
}
