:root {
  color-scheme: dark;
  --bg: #071217;
  --panel: #111c22;
  --panel-2: #1c2a31;
  --line: #263941;
  --muted: #a8b3b9;
  --text: #eef5f7;
  --bubble-in: #202d35;
  --bubble-out: #006b57;
  --accent: #00a884;
  --accent-2: #83d4c0;
  --danger: #ff6b6b;
  --wu-app-height: 100dvh;
  --wu-viewport-top: 0px;
  font-family: Arial, Helvetica, sans-serif;
}

@font-face {
  font-family: "WU Apple Color Emoji";
  src: url("/static/fonts/apple-emoji/AppleColorEmoji-Linux.ttf?v=macos-26-20260722") format("truetype");
  font-display: swap;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}
button, input, select { font: inherit; }

body.emoji-set-apple:not(.emoji-native-apple):not(.emoji-mobile-device) .emoji-font,
body.emoji-set-apple:not(.emoji-native-apple):not(.emoji-mobile-device) #emojiBtn,
body.emoji-set-apple:not(.emoji-native-apple):not(.emoji-mobile-device) .mobile-tool-emoji,
body.emoji-set-apple:not(.emoji-native-apple):not(.emoji-mobile-device) .emoji-quick-row button,
body.emoji-set-apple:not(.emoji-native-apple):not(.emoji-mobile-device) .emoji-grid button {
  font-family: "WU Apple Color Emoji", Arial, Helvetica, sans-serif;
}

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: #101b21; }
::-webkit-scrollbar-thumb { background: #4d5b62; border-radius: 8px; border: 3px solid #101b21; }
::-webkit-scrollbar-thumb:hover { background: #65747b; }

.app {
  display: grid;
  grid-template-columns: minmax(300px, 36vw) 1fr;
  height: 100vh;
  height: var(--wu-app-height, 100dvh);
  max-height: var(--wu-app-height, 100dvh);
  background: var(--bg);
  overflow: hidden;
}
.sidebar {
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  border-right: 1px solid var(--line);
  background: #0d1a20;
  display: grid;
  grid-template-rows: 54px 48px minmax(0, 1fr);
  overflow: hidden;
}
.sidebar-head {
  position: relative;
  height: 54px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1b2a31;
}
.instance-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.instance-title-stack {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.instance-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.evolution-status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: #ff4d4f;
  box-shadow: 0 0 0 2px rgba(255, 77, 79, .18);
}
.evolution-status-dot.live {
  background: #12c971;
  box-shadow: 0 0 0 2px rgba(18, 201, 113, .18);
}
.evolution-status-dot.disconnected {
  background: #ff4d4f;
  box-shadow: 0 0 0 2px rgba(255, 77, 79, .18);
}
.current-user-alias-badge {
  display: inline-grid;
  place-items: center;
  flex: 0 1 auto;
  max-width: 96px;
  height: 17px;
  padding: 0 7px;
  border: 1px solid rgba(255, 218, 74, .75);
  border-radius: 999px;
  background: rgba(255, 218, 74, .09);
  color: #ffda4a;
  font-size: 10px;
  line-height: 1.1;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.current-user-alias-badge[hidden] {
  display: none;
}
.instance-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  font-size: 12px;
}
.sidebar-head h1 {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
  letter-spacing: 0;
}
.instance-select {
  width: min(180px, 42vw);
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #0d171d;
  color: #dbe7eb;
  font-size: 11px;
  outline: none;
}
.instance-select[hidden] {
  display: none;
}
.search-box {
  height: 48px;
  padding: 7px 12px;
  display: flex;
  align-items: center;
}
.search-box input {
  width: 100%;
  height: 34px;
  border: 0;
  border-radius: 20px;
  padding: 0 16px 0 44px;
  color: var(--text);
  background: #273036;
  outline: 1px solid transparent;
}
.search-box input:focus { outline-color: var(--accent); }
.search-box .search-icon { position: absolute; margin-left: 16px; }
.chat-list {
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-color: #56636a #1b272d;
}
.chat-row {
  width: 100%;
  height: 76px;
  min-height: 76px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 14px 9px 10px;
  background: transparent;
  border: 0;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.chat-row:hover { background: #26333b; }
.chat-row.active,
.chat-row.active:hover { background: #12365d; }
.chat-row[data-chat="__wu_ask_ai__"] .avatar,
.avatar.ask-ai-avatar {
  background: #f7fafc;
  color: #0f172a;
}
.avatar.ask-ai-avatar img,
.chat-row[data-chat="__wu_ask_ai__"] .avatar img {
  width: 82%;
  height: 82%;
}
.chat-row[data-chat="__wu_ask_ai__"] .chat-meta strong {
  color: #ffd255;
}
.chat-row[data-chat="__wu_system_log__"] .avatar,
.avatar.system-log-avatar {
  background: #201823;
  color: #ff8dc7;
  border: 1px solid rgba(255, 141, 199, .45);
}
.chat-row[data-chat="__wu_system_log__"] .chat-meta strong {
  color: #ff8dc7;
}
.chat-row[data-chat="__wu_system_log__"] .avatar img,
.avatar.system-log-avatar img {
  width: 100%;
  height: 100%;
}
.chat-title strong.system-log-title {
  color: #ff8dc7;
}
.chat-load-more-row {
  display: grid;
  place-items: center;
  padding: 8px 10px 14px;
}
.load-more-chats {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(255, 210, 85, .75);
  border-radius: 8px;
  background: #1e2b33;
  color: #ffd255;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.load-more-chats:hover {
  background: #263740;
}
.load-more-chats:disabled {
  cursor: progress;
  opacity: .72;
}
.avatar {
  width: 48px;
  height: 48px;
  position: relative;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #006b4f;
  color: #d8fff2;
  font-weight: 800;
  font-size: 17px;
  overflow: hidden;
  flex: 0 0 auto;
}
.avatar img {
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
  z-index: 1;
  object-fit: contain;
  object-position: center;
  aspect-ratio: 1 / 1;
}
.avatar.photo-avatar,
.avatar:has(.avatar-photo) {
  background: #0b141a;
}
.avatar-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 0;
}
.avatar-photo-bg {
  position: absolute;
  inset: -8%;
  display: block;
  z-index: 1;
  background-position: center;
  background-size: cover;
  filter: blur(5px);
  transform: scale(1.08);
  opacity: .78;
}
.avatar-photo {
  z-index: 2;
  filter: none;
}
.chat-row[data-chat="__wu_ask_ai__"] .avatar-photo-bg,
.avatar.ask-ai-avatar .avatar-photo-bg,
.chat-row[data-chat="__wu_system_log__"] .avatar-photo-bg,
.avatar.system-log-avatar .avatar-photo-bg {
  display: none;
}
.chat-meta {
  display: grid;
  grid-template-rows: 20px 17px 18px;
  align-content: center;
  min-width: 0;
  height: 58px;
  overflow: hidden;
}
.chat-title-line {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  height: 20px;
  margin-bottom: 3px;
  overflow: hidden;
}
.chat-meta strong {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  height: 20px;
  line-height: 20px;
  font-size: 15px;
  margin-bottom: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-meta strong span,
.chat-meta strong .emoji-font {
  display: inline;
  white-space: inherit;
}
.chat-meta span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-meta .chat-phone {
  color: #d4dde1;
  font-size: 12px;
  height: 17px;
  line-height: 17px;
  margin-bottom: 0;
}
.chat-meta .chat-phone span,
.chat-meta .chat-phone .emoji-font {
  display: inline;
  white-space: inherit;
}
.chat-meta .chat-preview {
  max-width: 100%;
  height: 18px;
  line-height: 18px;
}
.chat-meta .chat-preview span,
.chat-meta .chat-preview .emoji-font {
  display: inline;
  white-space: inherit;
}
.chat-time {
  align-self: start;
  color: #c7d0d5;
  padding-top: 10px;
  font-size: 12px;
}
.labels {
  display: flex;
  flex: 0 1 auto;
  gap: 2px;
  min-width: 0;
  max-width: 36%;
  flex-wrap: nowrap;
  overflow: hidden;
}
.chat-title-line .new-chat-badge {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  height: 14px;
  padding: 0 5px;
  border: 1px solid rgba(255, 218, 74, 0.9);
  border-radius: 999px;
  background: rgba(255, 218, 74, 0.08);
  color: #ffda4a;
  font-size: 10px;
  line-height: 1.1;
  font-weight: 700;
  white-space: nowrap;
}
.chat-meta .label-badge,
.chat-title-line .label-badge,
.assignment-user-option .label-badge {
  display: inline-block;
  max-width: 46px;
  border-radius: 2px;
  padding: 0 2px;
  border: 1px solid rgba(184, 198, 207, 0.25);
  border-left: 4px solid var(--label-color, #ff7a1a);
  background: rgba(221, 230, 235, 0.07);
  color: lime;
  font-size: 10px;
  line-height: 1.1;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-title-line .assignment-badge,
.assignment-user-option .assignment-badge {
  background: rgba(8, 183, 137, 0.16);
  color: #d8fff2;
}
.chat-title-line .whatsapp-label-badge {
  padding-left: 8px;
  background:
    radial-gradient(circle at 4px 50%, #25d366 0 2px, transparent 2.5px),
    rgba(221, 230, 235, 0.07);
  color: #d8fff2;
}
.conversation {
  min-width: 0;
  display: grid;
  grid-template-rows: 54px minmax(0, 1fr) auto;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background: #07161b;
}
.conversation.system-log-conversation {
  grid-template-rows: 54px minmax(0, 1fr);
}
.chat-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px 0 18px;
  background: #1b2a31;
  border-bottom: 1px solid var(--line);
}
.chat-identity {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  border-radius: 8px;
  padding: 2px 4px;
  margin-left: -4px;
}
.chat-head .avatar {
  width: 40px;
  height: 40px;
  font-size: 14px;
}
.chat-identity:hover,
.chat-identity:focus-visible {
  background: rgba(255,255,255,.05);
  outline: none;
}
.chat-title { min-width: 0; flex: 1; }
.chat-title strong {
  display: block;
  font-size: 14px;
  line-height: 1.1;
}
.chat-title span {
  display: block;
  color: #c6d3d9;
  margin-top: 3px;
  font-size: 11px;
}
.head-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.ai-balance-badge {
  max-width: 138px;
  min-width: 68px;
  height: 24px;
  padding: 0 9px;
  border: 1px solid rgba(8, 183, 137, .85);
  border-radius: 999px;
  background: rgba(8, 183, 137, .12);
  color: #7dffd8;
  font-size: 11px;
  font-weight: 800;
  line-height: 22px;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.system-log-action {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border: 1px solid rgba(255, 210, 85, .62);
  border-radius: 7px;
  background: #20303a;
  color: #ffd255;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}
.system-log-action:hover {
  background: #2a3a45;
}
.system-log-action svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.device-kick-btn {
  min-height: 20px;
  margin-left: auto;
  border: 1px solid rgba(255, 92, 118, .6);
  border-radius: 5px;
  background: rgba(255, 92, 118, .12);
  color: #ffb8c4;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.device-kick-btn:disabled {
  opacity: .55;
  cursor: wait;
}
.ai-balance-badge:hover,
.ai-balance-badge:focus-visible {
  background: rgba(8, 183, 137, .2);
  outline: none;
}
.ai-balance-badge.low {
  border-color: rgba(255, 92, 118, .85);
  background: rgba(255, 92, 118, .12);
  color: #ffb8c4;
}
.ai-balance-badge.low:hover,
.ai-balance-badge.low:focus-visible {
  background: rgba(255, 92, 118, .2);
}
.ai-balance-badge.loading {
  opacity: .68;
  cursor: wait;
}
.ai-balance-badge.error {
  border-color: rgba(255,255,255,.32);
  background: rgba(255,255,255,.05);
  color: #c6d3d9;
}
.chat-search-panel {
  position: absolute;
  inset: 8px 12px;
  z-index: 18;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto 30px 30px 30px;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #1b2a31;
  box-shadow: 0 10px 24px rgba(0,0,0,.22);
}
.chat-search-panel[hidden] {
  display: none;
}
.chat-search-panel input {
  min-width: 0;
  height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  background: #2a3135;
  color: var(--text);
  outline: 1px solid transparent;
}
.chat-search-panel input:focus {
  outline-color: var(--accent);
}
.chat-search-count {
  min-width: 38px;
  color: #c6d3d9;
  font-size: 12px;
  line-height: 30px;
  text-align: center;
  white-space: nowrap;
}
.search-nav-btn {
  width: 30px;
  height: 30px;
  position: relative;
  padding: 0;
  line-height: 1;
}
.search-prev-icon::before,
.search-next-icon::before {
  content: "";
  width: 9px;
  height: 9px;
  border-top: 3px solid currentColor;
  border-left: 3px solid currentColor;
  border-radius: 1px;
}
.search-prev-icon::before {
  transform: translateY(3px) rotate(45deg);
}
.search-next-icon::before {
  transform: translateY(-3px) rotate(225deg);
}
.icon-btn {
  width: 36px;
  height: 36px;
  border: 0;
  color: var(--text);
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 18px;
}
.icon-btn:hover { color: var(--accent-2); }
.back-arrow-icon {
  position: relative;
  width: 20px;
  height: 20px;
  display: inline-block;
}
.back-arrow-icon::before,
.back-arrow-icon::after {
  content: "";
  position: absolute;
  display: block;
}
.back-arrow-icon::before {
  left: 5px;
  top: 9px;
  width: 13px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}
.back-arrow-icon::after {
  left: 4px;
  top: 5px;
  width: 9px;
  height: 9px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-radius: 1px;
  transform: rotate(45deg);
}
.search-icon {
  width: 18px;
  height: 18px;
  border: 2.5px solid currentColor;
  border-radius: 50%;
  color: #d8e1e5;
  display: inline-block;
  position: relative;
}
.search-icon::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 2.5px;
  background: currentColor;
  right: -8px;
  bottom: -5px;
  border-radius: 999px;
  transform: rotate(45deg);
}
.pdf-icon {
  position: relative;
  width: 18px;
  height: 22px;
  display: inline-block;
  border: 2px solid currentColor;
  border-radius: 2px;
  color: #c084fc;
}
.pdf-icon::before {
  content: "";
  position: absolute;
  top: -2px;
  right: -2px;
  width: 7px;
  height: 7px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  background: #1b2a31;
}
.pdf-icon::after {
  content: "PDF";
  position: absolute;
  left: 50%;
  bottom: 3px;
  transform: translateX(-50%);
  font-size: 6px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}
.vertical-dots-icon {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  background: currentColor;
  box-shadow: 0 -10px 0 currentColor, 0 10px 0 currentColor;
}
.back-btn, .mobile-menu { display: none; }
.menu {
  position: absolute;
  right: 18px;
  top: 72px;
  min-width: 230px;
  background: #202e35;
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
  padding: 8px;
  display: none;
  z-index: 20;
}
.menu.open { display: grid; }
.side-menu {
  right: 12px;
  top: 66px;
}
.menu button, .menu a {
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  padding: 14px 16px;
  cursor: pointer;
}
.menu button:hover, .menu a:hover { background: #2d3b43; }
.messages {
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 24px clamp(12px, 2.2vw, 34px);
  scrollbar-color: #56636a #101b21;
}
.load-more-row {
  display: grid;
  place-items: center;
  margin: 0 0 18px;
}
.load-more-messages {
  border: 1px solid rgba(255, 210, 85, .75);
  border-radius: 8px;
  background: #1e2b33;
  color: #ffd255;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.load-more-messages:hover {
  background: #263740;
}
.load-more-messages:disabled {
  cursor: progress;
  opacity: .72;
}
.date-pill {
  width: max-content;
  margin: 0 auto 22px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #1e2b33;
  color: #c9d4d8;
  font-size: 13px;
}
.bubble {
  position: relative;
  width: fit-content;
  max-width: min(820px, 88%);
  margin: 10px 0 16px;
  padding: 8px 10px 7px;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.28;
  overflow-wrap: anywhere;
}
.bubble.in { background: var(--bubble-in); }
.bubble.out {
  background: var(--bubble-out);
  margin-left: auto;
}
.bubble.has-reaction {
  margin-bottom: 24px;
}
.sticker-bubble {
  padding: 0;
  overflow: hidden;
}
.sticker-bubble .bubble-line {
  padding: 0 8px 7px;
}
.sticker-bubble .bubble-spacer {
  display: none;
}
.bubble.call {
  border-left: 4px solid var(--danger);
}
.bubble.call .bubble-text {
  color: #ffe7ec;
  font-weight: 700;
}
.bubble.deleted {
  background: #8f1d2c;
  color: #fff0f2;
  opacity: .86;
}
.bubble.deleted small {
  color: #ffd0d6;
}
.bubble.search-hit {
  outline: 1px solid rgba(255, 210, 85, .35);
}
.bubble.current-search-hit {
  outline: 2px solid #ffd255;
  box-shadow: 0 0 0 3px rgba(255, 210, 85, .14);
}
.messages.multi-remove-mode .bubble {
  cursor: pointer;
}
.bubble.multi-remove-selected {
  outline: 2px solid #00d084;
  box-shadow: 0 0 0 3px rgba(0, 208, 132, .14);
}
.note-bubble {
  max-width: min(620px, 82%);
  margin-left: auto;
  padding: 0;
  background: transparent;
  color: #3d3124;
}
.note-paper {
  position: relative;
  min-width: min(320px, 72vw);
  padding: 12px 14px 12px 24px;
  border: 1px solid #ddc898;
  border-radius: 6px;
  background:
    repeating-linear-gradient(to bottom, transparent 0, transparent 27px, rgba(166, 130, 62, .22) 28px),
    #f5e8c8;
  box-shadow: 0 8px 18px rgba(0,0,0,.16);
}
.note-paper::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(191, 87, 69, .34);
}
.note-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 7px;
  color: #7b5b21;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}
.note-heading small {
  flex: 0 0 auto;
  color: #4f4f4f;
  font-size: 11px;
}
.note-quoted-preview {
  width: 100%;
  margin: 0 0 8px;
  border-color: rgba(123, 91, 33, .36);
  background: rgba(255, 255, 255, .34);
  color: #4b3820;
}
.note-quoted-preview .quoted-author {
  color: #7b5b21;
}
.note-quoted-preview .quoted-text {
  color: #624b2c;
}
.note-text {
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.42;
}
.note-author {
  margin-top: 8px;
  color: #846b43;
  font-size: 11px;
  font-weight: 700;
  text-align: right;
}
.messages.ask-ai-thread {
  width: 100%;
  padding: 28px clamp(16px, 4vw, 52px);
  background: #101b21;
}
.ask-ai-empty {
  max-width: 980px;
  margin: 0 auto;
  min-height: 100%;
  display: grid;
  place-content: center;
  gap: 8px;
  color: #c8d5d9;
  text-align: center;
}
.ask-ai-empty strong {
  color: #ffd255;
  font-size: 24px;
}
.ask-ai-empty span {
  color: #9faeb5;
  font-size: 14px;
}
.ask-ai-message {
  width: 100%;
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
  padding: 18px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.ask-ai-message.user {
  color: #f4fafb;
}
.ask-ai-message.assistant {
  color: #d8e4e8;
}
.ask-ai-message.pending {
  color: #8f9ba1;
}
.ask-ai-role {
  margin-bottom: 8px;
  color: #ffd255;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.ask-ai-message.user .ask-ai-role {
  color: #20d47b;
}
.ask-ai-message.assistant .ask-ai-role {
  color: #b58cff;
}
.ask-ai-content {
  max-width: 82ch;
  font-size: 15px;
  line-height: 1.62;
  white-space: normal;
  overflow-wrap: anywhere;
}
.ask-ai-message.user .ask-ai-content {
  color: #f5fafb;
  font-weight: 650;
}
.ask-ai-content .message-link {
  color: #8fd8ff;
}
.messages.system-log-thread {
  width: 100%;
  padding: 18px clamp(10px, 2vw, 24px);
  background: #0d151a;
}
.system-log-empty strong {
  color: #ffd255;
}
.system-log-entry {
  width: 100%;
  margin: 0 0 8px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 7px;
  background: #131f26;
  color: #dce7eb;
}
.system-log-entry.critical {
  border-color: rgba(255, 93, 108, .72);
  background: rgba(93, 18, 28, .42);
}
.system-log-entry.critical .system-log-source,
.system-log-entry.critical pre {
  color: #ff9aa5;
}
.system-log-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 5px;
  color: #91a1aa;
  font-size: 11px;
  line-height: 1.2;
}
.system-log-time {
  font-weight: 400;
}
.system-log-source {
  color: #ffd255;
  font-weight: 800;
}
.system-log-entry pre {
  margin: 0;
  color: #d8e4e8;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.multi-remove-check {
  position: absolute;
  top: -8px;
  left: -8px;
  z-index: 2;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 2px solid #9fb4bd;
  border-radius: 50%;
  background: #111b21;
  color: #051b14;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}
.bubble.out .multi-remove-check {
  left: auto;
  right: -8px;
}
.bubble.multi-remove-selected .multi-remove-check {
  border-color: #00d084;
  background: #00d084;
}
.bubble.quote-pulse {
  animation: quotePulse 1.4s ease-out;
}
@keyframes quotePulse {
  0% {
    outline: 2px solid #00d084;
    box-shadow: 0 0 0 5px rgba(0, 208, 132, .2);
  }
  100% {
    outline: 0 solid transparent;
    box-shadow: none;
  }
}
.bubble mark,
.media-file mark,
.transcript mark,
.media-summary mark {
  padding: 0 2px;
  border-radius: 3px;
  background: #ffd255;
  color: #101820;
}
.group-sender {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
}
.group-sender span {
  margin-left: 6px;
  color: #9fb0b8;
  font-weight: 600;
}
.sticker-bubble .group-sender {
  margin: 7px 8px 4px;
}
.forwarded-from {
  margin: 0 0 5px;
  color: #aab8bd;
  font-size: 12px;
  font-style: italic;
  line-height: 1.2;
}
.forwarded-from strong {
  color: #dce8ec;
  font-style: normal;
  font-weight: 700;
}
.forwarded-from span {
  margin-left: 5px;
  color: #8fa1a8;
  font-style: normal;
}
.sticker-bubble .forwarded-from {
  margin: 7px 8px 5px;
}
.quoted-preview {
  width: 100%;
  min-width: min(230px, 62vw);
  max-width: 100%;
  display: grid;
  gap: 3px;
  margin: 0 0 6px;
  padding: 7px 9px 7px 10px;
  border: 0;
  border-left: 3px solid #08b789;
  border-radius: 6px;
  background: rgba(3, 15, 19, .28);
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.bubble.out .quoted-preview {
  border-left-color: #ff9f43;
  background: rgba(3, 15, 19, .22);
}
.sticker-bubble .quoted-preview {
  margin: 7px 8px 6px;
  width: calc(100% - 16px);
  min-width: 0;
}
.quoted-author {
  color: #ffae56;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
}
.bubble.in .quoted-author {
  color: #6dc6ff;
}
.quoted-text {
  min-width: 0;
  overflow: hidden;
  color: #d9e7e9;
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.deleted-marker {
  width: max-content;
  max-width: 100%;
  margin-bottom: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  color: #fff3f5;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}
.bubble-line {
  display: block;
  gap: 0;
  min-width: 0;
}
.bubble-line::after {
  content: "";
  display: block;
  clear: both;
}
.bubble-text {
  min-width: 0;
  white-space: pre-wrap;
}
.bubble.single-emoji {
  padding: 4px 8px 5px;
}
.bubble.single-emoji .bubble-line {
  display: flex;
  gap: 8px;
}
.bubble.single-emoji .bubble-text {
  font-size: 42px;
  line-height: 1;
}
.bubble.single-emoji small {
  float: none;
  align-self: flex-end;
  margin: 0 0 3px;
}
.bubble-text .message-link {
  color: #8bdcff;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}
.bubble-text .message-link:visited {
  color: #c5b6ff;
}
.bubble small {
  flex: 0 0 auto;
  float: right;
  margin: 4px 0 0 8px;
  color: #c8d4d4;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}
.message-ticks {
  margin-left: 2px;
  color: #c8d4d4;
  font-weight: 800;
  letter-spacing: -1px;
}
.message-ticks.read {
  color: #53bdeb;
}
.message-ticks.delivered,
.message-ticks.sent {
  color: #c8d4d4;
}
.message-ticks.pending {
  position: relative;
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-left: 4px;
  vertical-align: -1px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  color: #f3f6f7;
  opacity: .9;
  letter-spacing: 0;
}
.message-ticks.pending::before,
.message-ticks.pending::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.5px;
  border-radius: 2px;
  background: currentColor;
  transform-origin: 50% 100%;
}
.message-ticks.pending::before {
  height: 4px;
  transform: translate(-50%, -100%) rotate(0deg);
}
.message-ticks.pending::after {
  height: 3.5px;
  transform: translate(-50%, -100%) rotate(90deg);
}
.bubble.send-failed {
  box-shadow: inset 0 -2px 0 rgba(255, 92, 118, .7);
}
.send-error {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid rgba(255,255,255,.18);
  color: #ffd1d8;
  font-size: 12px;
  line-height: 1.25;
}
.sender-alias {
  display: block;
  margin: -8px -10px 6px;
  overflow: hidden;
  padding: 4px 10px 5px;
  border-bottom: 1px solid rgba(255, 255, 255, .24);
  border-radius: 8px 8px 0 0;
  background: rgba(0, 0, 0, .16);
  color: #ffea00;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.1;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}
.bubble.out .sender-alias {
  color: #ffea00;
}
.sticker-bubble .sender-alias {
  margin: 0 0 6px;
  padding: 5px 8px;
}
.bubble-spacer {
  width: 12px;
  min-height: 1px;
}
.message-context-menu {
  position: fixed;
  z-index: 80;
  min-width: 168px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111b21;
  box-shadow: 0 12px 34px rgba(0,0,0,.42);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
.message-context-menu[hidden] {
  display: none;
}
.message-context-menu button {
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  background: transparent;
  color: #dce8ec;
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.message-context-menu .menu-icon,
.ai-pop .menu-icon,
.mobile-tools-pop .menu-icon {
  width: 18px;
  height: 18px;
  color: #9fb4bd;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.message-context-menu button span {
  min-width: 0;
}
.message-context-menu .danger-action {
  color: #ffd8de;
}
.message-context-menu .summarise-action {
  color: #ffda4a;
}
.message-context-menu .danger-action .menu-icon {
  color: #ff8da0;
}
.message-context-menu .summarise-action .menu-icon {
  color: #ffda4a;
}
.message-context-menu button[hidden] {
  display: none;
}
.message-context-menu button:disabled {
  color: #6f8088;
  cursor: not-allowed;
  opacity: .58;
}
.message-context-menu button:disabled .menu-icon {
  color: #6f8088;
}
.message-context-menu button:hover,
.message-context-menu button:focus {
  background: #25343c;
  outline: none;
}
.message-context-menu button:disabled:hover,
.message-context-menu button:disabled:focus {
  background: transparent;
}
.message-context-menu button:hover .menu-icon,
.message-context-menu button:focus .menu-icon {
  color: #e7f3f6;
}
.message-context-menu .danger-action:hover,
.message-context-menu .danger-action:focus {
  background: rgba(255, 92, 118, .14);
}
.message-context-menu .summarise-action:hover,
.message-context-menu .summarise-action:focus {
  background: rgba(255, 218, 74, .12);
}
.message-context-menu button:disabled:hover,
.message-context-menu button:disabled:focus,
.message-context-menu .danger-action:disabled:hover,
.message-context-menu .danger-action:disabled:focus {
  background: transparent;
}
.message-context-menu .danger-action:hover .menu-icon,
.message-context-menu .danger-action:focus .menu-icon {
  color: #ffd8de;
}
.message-context-menu .summarise-action:hover .menu-icon,
.message-context-menu .summarise-action:focus .menu-icon {
  color: #ffef99;
}
.assignment-menu {
  position: fixed;
  z-index: 85;
  width: min(280px, calc(100vw - 16px));
  max-height: min(420px, calc(100vh - 16px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111b21;
  box-shadow: 0 12px 34px rgba(0,0,0,.42);
}
.assignment-menu[hidden] {
  display: none;
}
.assignment-menu-title {
  color: #f0f7f8;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}
.assignment-menu-chat {
  min-width: 0;
  overflow: hidden;
  color: #aebdc3;
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.assignment-user-list {
  min-height: 44px;
  overflow-y: auto;
  display: grid;
  gap: 3px;
  padding: 2px 0;
}
.assignment-user-option {
  min-height: 34px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 5px 7px;
  border-radius: 6px;
  color: #e4eff1;
  font-size: 14px;
  cursor: pointer;
}
.assignment-user-option:hover {
  background: #25343c;
}
.assignment-user-option input {
  width: 16px;
  height: 16px;
  accent-color: #08b789;
}
.assignment-user-option > span:not(.label-badge) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.assignment-user-option .label-badge {
  max-width: 100%;
  justify-self: start;
}
.assignment-menu footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.assignment-menu footer span {
  margin-right: auto;
  color: #aebdc3;
  font-size: 12px;
}
.assignment-menu button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  background: #25343c;
  color: #e4eff1;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.assignment-menu button[data-assignment-action="apply"] {
  background: #08b789;
  color: #06271f;
  font-weight: 800;
}
.assignment-menu button:disabled {
  opacity: .55;
  cursor: wait;
}
.assignment-empty,
.assignment-menu-loading,
.assignment-menu-error {
  padding: 12px 6px;
  color: #aebdc3;
  font-size: 13px;
}
.assignment-menu-error {
  color: #ffd8de;
}
.message-info-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 13, 17, .56);
}
.message-info-modal[hidden] {
  display: none;
}
.message-info-panel {
  width: min(460px, calc(100vw - 28px));
  max-height: min(680px, calc(100dvh - 28px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111b21;
  box-shadow: 0 22px 70px rgba(0,0,0,.45);
}
.message-info-panel .modal-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.message-info-panel h3,
.message-info-panel h4 {
  margin: 0;
}
.message-info-panel h3 {
  font-size: 16px;
}
.confirm-panel {
  width: min(420px, calc(100vw - 28px));
  grid-template-rows: auto auto auto;
}
.confirm-body {
  display: grid;
  gap: 8px;
  padding: 16px;
  color: #dce8ec;
  font-size: 14px;
  line-height: 1.35;
}
.confirm-body p {
  margin: 0;
}
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 16px 16px;
}
.confirm-actions button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: #25343c;
  color: #e7f3f6;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.confirm-actions .danger-action {
  background: #b42339;
  color: #fff;
}
.message-info-panel h4 {
  padding: 0 16px 8px;
  color: #dce8ec;
  font-size: 13px;
}
.message-info-body {
  overflow: auto;
  padding: 14px 0 16px;
}
.message-info-loading,
.message-info-empty {
  padding: 12px 16px;
  color: var(--muted);
  font-size: 13px;
}
.message-info-summary {
  padding: 0 16px 14px;
}
.message-info-summary dl {
  margin: 0;
  display: grid;
  gap: 8px;
}
.message-info-summary dl div,
.message-info-receipt {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}
.message-info-summary dt {
  color: var(--muted);
  font-size: 12px;
}
.message-info-summary dd {
  margin: 0;
  color: #e7f3f6;
  font-size: 13px;
  text-align: right;
}
.message-info-section {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.message-info-receipt {
  padding: 9px 16px;
}
.message-info-receipt strong,
.message-info-receipt span,
.message-info-receipt b,
.message-info-receipt small {
  display: block;
}
.message-info-receipt strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #e7f3f6;
  font-size: 13px;
}
.message-info-receipt span,
.message-info-receipt small {
  color: var(--muted);
  font-size: 12px;
}
.message-info-receipt b {
  color: #8ee7d2;
  font-size: 12px;
  text-align: right;
}
.multi-remove-bar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 85;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111b21;
  box-shadow: 0 12px 34px rgba(0,0,0,.42);
}
.multi-remove-bar[hidden] {
  display: none;
}
.multi-remove-bar strong {
  min-width: 88px;
  padding: 0 8px;
  color: #dce8ec;
  font-size: 13px;
  white-space: nowrap;
}
.multi-remove-bar button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: #25343c;
  color: #e7f3f6;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.multi-remove-bar button:disabled {
  cursor: not-allowed;
  opacity: .45;
}
.multi-remove-bar .danger-action {
  background: #b42339;
  color: #fff;
}
.message-reaction-picker {
  position: fixed;
  z-index: 81;
  display: grid;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #111b21;
  box-shadow: 0 12px 34px rgba(0,0,0,.42);
}
.reaction-cancel-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: transparent;
}
.reaction-cancel-layer[hidden] {
  display: none;
}
.message-reaction-picker[hidden] {
  display: none;
}
.message-reaction-row {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  max-width: calc(100vw - 24px);
}
.message-reaction-more {
  display: none;
  grid-template-columns: repeat(12, 34px);
  gap: 3px;
  max-width: calc(100vw - 24px);
  max-height: min(420px, calc(100vh - 118px));
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  scrollbar-color: #626a6c #111b21;
}
.message-reaction-picker.expanded .message-reaction-more {
  display: grid;
}
.message-reaction-picker button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.message-reaction-picker .reaction-more-toggle {
  color: #d8e1e5;
  font-size: 22px;
  font-weight: 700;
}
.message-reaction-picker .reaction-remove-toggle {
  box-sizing: border-box;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  align-self: center;
  border: 1px solid rgba(255,183,183,.52);
  color: #ffb7b7;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  background: rgba(255,107,107,.08);
}
.message-reaction-picker button:hover,
.message-reaction-picker button:focus {
  background: #25343c;
  outline: none;
}
.reaction-pill {
  position: absolute;
  left: 10px;
  bottom: -15px;
  z-index: 2;
  width: max-content;
  max-width: min(220px, 80%);
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #111b21;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 2px 5px rgba(0,0,0,.22);
  color: #eef6f8;
  font-size: 13px;
  line-height: 1.15;
  white-space: nowrap;
  cursor: pointer;
}
.reaction-pill:hover { background: #17252c; }
.bubble.out .reaction-pill {
  right: 10px;
  left: auto;
}
.forward-dialog {
  border: 0;
  padding: 0;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  overflow: hidden;
  background: transparent;
  color: var(--text);
}
.forward-dialog::backdrop {
  background: rgba(0,0,0,.48);
}
.forward-panel {
  width: min(420px, calc(100vw - 24px));
  max-height: min(640px, calc(100dvh - 24px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #111b21;
  box-shadow: 0 18px 50px rgba(0,0,0,.42);
}
.forward-panel header,
.forward-panel footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.forward-panel footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}
.forward-panel footer span {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
}
.forward-panel footer button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  padding: 0 13px;
  background: #25343c;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}
.forward-panel footer button:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.forward-panel #forwardSendBtn:not(:disabled) {
  background: var(--accent);
  color: #001b17;
}
.forward-search {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 10px 12px;
  padding: 0 10px;
  border-radius: 999px;
  background: #263238;
}
.forward-search input {
  height: 36px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
}
.forward-list {
  min-height: 0;
  max-height: min(420px, 54dvh);
  overflow-y: scroll;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #6f858e transparent;
  padding: 2px 6px 8px;
}
.forward-list::-webkit-scrollbar {
  width: 10px;
}
.forward-list::-webkit-scrollbar-thumb {
  border: 2px solid #111b21;
  border-radius: 999px;
  background: #6f858e;
}
.forward-list::-webkit-scrollbar-track {
  background: transparent;
}
.forward-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 9px;
  width: 100%;
  border: 0;
  border-radius: 6px;
  padding: 7px 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.forward-row:hover {
  background: #1b2a31;
}
.forward-row .avatar {
  width: 36px;
  height: 36px;
  font-size: 13px;
}
.forward-main {
  min-width: 0;
}
.forward-main strong,
.forward-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
.forward-main span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}
.forward-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #7f8f96;
}
.forward-row.selected .forward-check {
  border-color: var(--accent);
  background: radial-gradient(circle at center, var(--accent) 0 45%, transparent 48%);
}
.pdf-export-dialog {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}
.pdf-export-dialog::backdrop {
  background: rgba(0,0,0,.48);
}
.pdf-export-panel {
  width: min(420px, calc(100vw - 24px));
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #111b21;
  box-shadow: 0 18px 50px rgba(0,0,0,.42);
}
.pdf-export-panel header,
.pdf-export-panel footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.pdf-export-panel header {
  justify-content: space-between;
}
.pdf-export-panel footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}
.pdf-export-range {
  display: grid;
  gap: 10px;
  padding: 0 12px;
}
.pdf-export-range label {
  display: grid;
  gap: 6px;
  color: #c7d2d7;
  font-size: 12px;
  font-weight: 800;
}
.pdf-export-range input {
  min-width: 0;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #0d171d;
  color: var(--text);
  outline: none;
}
.pdf-export-range input:focus {
  border-color: var(--accent);
}
.pdf-export-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100% - 24px);
  margin: -2px 12px 0;
  color: #c7d2d7;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  cursor: pointer;
}
.pdf-export-option input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}
.pdf-export-note {
  min-height: 18px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.pdf-export-panel footer button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  padding: 0 13px;
  background: #25343c;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}
.pdf-export-panel footer button:disabled {
  opacity: .45;
  cursor: not-allowed;
}
#pdfExportDownloadBtn:not(:disabled) {
  background: var(--accent);
  color: #001b17;
}
.media-frame {
  display: block;
  max-width: min(460px, 76vw);
  margin-bottom: 7px;
  padding: 0;
  border: 0;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(0,0,0,.18);
  cursor: zoom-in;
}
.media-frame img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
}
.media-frame-missing {
  max-width: min(460px, 76vw);
  background: transparent;
  cursor: default;
}
.media-frame-missing .media-file {
  margin-bottom: 0;
}
.sticker-media {
  width: 196px;
  height: 196px;
  max-width: 196px;
  margin: 0;
  border-radius: 8px 8px 0 0;
  background: transparent;
}
.sticker-media img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
}
.media-video {
  display: block;
  width: min(460px, 76vw);
  max-height: 360px;
  margin-bottom: 7px;
  border-radius: 6px;
  background: #000;
}
.ptv-video {
  width: min(260px, 68vw);
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
}
.voice-note {
  --progress: 0%;
  display: grid;
  gap: 2px;
  width: min(340px, 68vw);
  min-width: min(230px, 68vw);
  margin: 0;
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
  color: var(--text);
}
.bubble.out .voice-note {
  justify-self: end;
}
.bubble.voice-wide-player .voice-note {
  width: 100%;
  min-width: 0;
  justify-self: stretch;
}
.voice-speaker {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
}
.voice-body {
  display: grid;
  grid-template-columns: 24px minmax(115px, 1fr) 34px;
  align-items: center;
  gap: 7px;
  min-width: 0;
  width: 100%;
}
.voice-play {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  position: relative;
}
.voice-play:disabled {
  cursor: not-allowed;
  opacity: .45;
}
.voice-play::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 6px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid #eef6f8;
}
.voice-play.playing::before {
  left: 7px;
  top: 7px;
  width: 4px;
  height: 11px;
  border: 0;
  background: #eef6f8;
  box-shadow: 6px 0 0 #eef6f8;
}
.voice-main {
  display: grid;
  grid-template-rows: 20px 14px;
  min-width: 0;
}
.voice-waveform {
  position: relative;
  width: 100%;
  height: 20px;
  --dot-size: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
}
.voice-waveform:disabled {
  cursor: not-allowed;
  opacity: .62;
}
.voice-bars {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 calc(var(--dot-size) / 2);
}
.voice-bar {
  flex: 1 1 0;
  min-width: 1px;
  min-height: 4px;
  border-radius: 999px;
  background: rgba(188, 202, 207, .72);
  transform: scaleX(.42);
}
.voice-bar.active {
  background: #00d084;
}
.voice-dot {
  position: absolute;
  left: clamp(calc(var(--dot-size) / 2), var(--progress), calc(100% - (var(--dot-size) / 2)));
  top: 50%;
  width: var(--dot-size);
  height: var(--dot-size);
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: #00d084;
  z-index: 1;
  box-shadow: 0 0 0 2px rgba(35, 43, 45, .9);
}
.voice-avatar {
  position: relative;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #007a5d;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  overflow: visible;
  flex: 0 0 auto;
  cursor: pointer;
  appearance: none;
}
.voice-avatar:disabled {
  cursor: default;
}
.voice-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.voice-speed-badge {
  position: absolute;
  right: -4px;
  top: -7px;
  min-width: 22px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #ffd84d;
  color: #052126;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 0 0 2px rgba(5, 18, 22, .88);
  pointer-events: none;
}
.voice-speed-badge:empty {
  display: none;
}
.voice-mic-badge {
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 9px;
  height: 14px;
  border-radius: 7px 7px 10px 10px;
  background: #00d084;
  border: 2px solid #263033;
}
.voice-mic-badge::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 2px;
  height: 6px;
  transform: translateX(-50%);
  background: #00d084;
}
.voice-mic-badge::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 9px;
  height: 2px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #00d084;
}
.voice-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 0;
  gap: 6px;
}
.voice-time {
  color: #b9c4c8;
  font-size: 11px;
  line-height: 1;
  text-align: left;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.voice-stamp {
  color: #b9c4c8;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.voice-audio {
  display: none;
}
.voice-note.missing {
  opacity: .82;
}
.voice-note.missing .voice-time {
  color: #f0b8c2;
}
.media-file {
  display: block;
  max-width: min(460px, 76vw);
  width: 100%;
  margin-bottom: 7px;
  padding: 9px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,.09);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
}
.media-visual-wrap {
  max-width: min(460px, 76vw);
  margin-bottom: 7px;
}
.media-size-label {
  margin-top: 4px;
  color: #b9c5ca;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}
.document-file {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: min(420px, 100%);
  min-width: 0;
  max-width: 100%;
  padding: 8px;
}
.file-icon {
  width: 42px;
  height: 42px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.13);
  color: #f2f7f8;
  font-size: 11px;
  font-weight: 900;
}
.file-info {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.file-info strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.2;
}
.file-info small {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #b9c5ca;
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-open {
  color: #dcebed;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.pdf-preview-file {
  display: block;
  box-sizing: border-box;
  width: 340px;
  max-width: calc(100vw - 64px);
  padding: 0;
  background: rgba(255,255,255,.08);
}
.pdf-preview-thumb {
  display: block;
  width: 100%;
  height: 118px;
  overflow: hidden;
  background: #eef2f3;
}
.pdf-preview-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.pdf-preview-thumb.empty {
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.13);
  color: #f2f7f8;
  font-size: 20px;
  font-weight: 900;
}
.pdf-preview-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px 10px;
}
.pdf-preview-file .file-info strong {
  font-size: 15px;
  line-height: 1.22;
}
.media-file.missing {
  color: var(--muted);
}
.transcript {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.18);
  color: #d8fff2;
  font-size: 13px;
}
.media-summary {
  width: 100%;
  max-width: none;
  margin: 8px 0 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,.18);
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  text-align: justify;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.media-summary.pending {
  color: #b9c5ca;
}
.media-summary.error {
  color: #ffd1d8;
}
.transcription-status {
  margin-top: 7px;
  color: #a9bcc2;
  font-size: 12px;
}
.transcription-status.error {
  color: #ffd1d8;
}
.empty-state {
  height: 100%;
  display: grid;
  place-content: center;
  gap: 8px;
  color: #c5d0d5;
  text-align: center;
}
.composer {
  position: relative;
  display: grid;
  grid-template-columns: 36px 36px 36px 36px minmax(0, 1fr) 36px 36px;
  gap: 5px;
  align-items: start;
  padding: 5px 8px;
  background: #1b2a31;
  border-top: 1px solid var(--line);
}
.composer[hidden] {
  display: none !important;
}
.composer [hidden] {
  display: none !important;
}
.mobile-tools-btn,
.mobile-tools-pop {
  display: none;
}
.reply-compose {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: calc(100% + 4px);
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr 30px;
  gap: 6px;
  padding: 6px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: #1b2a31;
}
.reply-compose[hidden] {
  display: none;
}
.reply-compose-main {
  min-width: 0;
  display: grid;
  gap: 2px;
  border: 0;
  border-left: 3px solid #08b789;
  border-radius: 7px;
  padding: 7px 10px;
  background: #22333a;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.reply-compose-author {
  color: #ffae56;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
}
.reply-compose-text {
  min-width: 0;
  overflow: hidden;
  color: #cbd9dd;
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reply-compose-cancel {
  width: 30px;
  height: 30px;
  align-self: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #d7e1e4;
  font-size: 18px;
  cursor: pointer;
}
.reply-compose-cancel:hover,
.reply-compose-cancel:focus {
  background: #2c3b42;
  outline: none;
}
.compose-icon { color: #f1f7fa; }
.composer .compose-icon,
.composer .send-btn {
  align-self: start;
}
.native-compose-icon {
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
}
.ai-compose-btn {
  display: grid;
  place-items: center;
}
.note-compose-btn {
  display: grid;
  place-items: center;
}
.ai-compose-btn:disabled {
  opacity: .42;
  cursor: not-allowed;
}
.note-compose-btn:disabled {
  opacity: .42;
  cursor: not-allowed;
}
.ai-compose-icon {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border: 1px solid #8fd8c6;
  border-radius: 50%;
  color: #c9fff0;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0;
}
.note-compose-icon {
  width: 20px;
  height: 20px;
  color: #f5e8c8;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ask-ai-new-btn {
  display: grid;
  place-items: center;
}
.mobile-tools-icon {
  position: relative;
  display: block;
  width: 21px;
  height: 21px;
  border: 1.8px solid currentColor;
  border-radius: 50%;
}
.mobile-tools-icon::before,
.mobile-tools-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 1.8px;
  border-radius: 2px;
  background: currentColor;
  transform: translate(-50%, -50%);
}
.mobile-tools-icon::after {
  width: 1.8px;
  height: 11px;
}
.ask-ai-new-icon {
  position: relative;
  display: block;
  width: 22px;
  height: 22px;
  border: 1.8px solid currentColor;
  border-radius: 50%;
}
.ask-ai-new-icon::before,
.ask-ai-new-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 1.8px;
  border-radius: 2px;
  background: currentColor;
  transform: translate(-50%, -50%);
}
.ask-ai-new-icon::after {
  width: 1.8px;
  height: 10px;
}
.composer.ask-ai-composer {
  grid-template-columns: 36px minmax(0, 1fr) 36px;
}
.attach-btn {
  display: grid;
  place-items: center;
}
.attach-icon {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mic-btn {
  display: grid;
  place-items: center;
}
.mic-icon {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.composer textarea {
  width: 100%;
  min-height: 34px;
  height: 34px;
  max-height: 126px;
  border: 0;
  border-radius: 17px;
  background: #2a3135;
  color: var(--text);
  padding: 7px 11px;
  font-family: inherit;
  font-size: 15px;
  line-height: 20px;
  outline: 1px solid transparent;
  resize: none;
  overflow-y: hidden;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  scrollbar-width: thin;
  display: block;
}
.composer textarea:focus { outline-color: var(--accent); }
.composer.ai-busy textarea {
  color: #8f9ba1;
  -webkit-text-fill-color: #8f9ba1;
}
.composer.ask-ai-busy textarea,
.composer.ask-ai-busy textarea::placeholder,
.composer.ai-busy textarea::placeholder {
  color: #8f9ba1;
  -webkit-text-fill-color: #8f9ba1;
  opacity: 1;
}
.send-btn {
  position: relative;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #233f7f;
  color: #ffffff;
  font-size: 0;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 1px 2px rgba(0,0,0,.18);
}
.send-btn::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M3.5 10.3 20.3 4.2 14.2 20.5 10.5 13.6 3.5 10.3Z' stroke='white' stroke-width='2.4' stroke-linejoin='round'/%3E%3Cpath d='M10.5 13.6 20.3 4.2' stroke='white' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E");
  transform: translate(-50%, -50%);
}
.send-btn::after {
  display: none;
}
.send-btn:disabled {
  background: #314047;
  color: #7d8b91;
  opacity: .72;
  cursor: not-allowed;
}
.emoji-pop {
  display: none;
  position: absolute;
  left: 8px;
  bottom: 46px;
  width: min(594px, calc(100vw - 20px));
  height: min(420px, calc(100vh - 118px));
  overflow: hidden;
  border-radius: 0 8px 8px 0;
  background: #1f2323;
  border: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 18px 48px rgba(0,0,0,.42);
  z-index: 25;
}
.emoji-pop.open {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.ai-pop {
  display: none;
  position: absolute;
  left: 78px;
  bottom: 46px;
  width: min(230px, calc(100vw - 20px));
  padding: 6px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  background: #1f2b31;
  box-shadow: 0 18px 44px rgba(0,0,0,.4);
  z-index: 28;
}
.ai-pop.open {
  display: grid;
  gap: 3px;
}
.ai-pop button {
  width: 100%;
  min-height: 34px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 6px;
  padding: 0 11px;
  background: transparent;
  color: #eef7f8;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.ai-pop button span {
  min-width: 0;
}
.ai-pop button:hover,
.ai-pop button:focus {
  background: #2c3b42;
  outline: none;
}
.ai-pop button:hover .menu-icon,
.ai-pop button:focus .menu-icon,
.mobile-tools-pop button:hover .menu-icon,
.mobile-tools-pop button:focus .menu-icon {
  color: #e7f3f6;
}
.ai-pop button:disabled {
  color: #829197;
  cursor: wait;
}
.ai-pop button:disabled .menu-icon {
  color: #6f7f86;
}
.ai-pop [data-ai-action="undo"],
.ai-pop [data-ai-action="prompt_response"],
.ai-pop [data-note-ai-action="undo"] {
  border-top: 1px solid rgba(255,255,255,.08);
  margin-top: 3px;
}
.mobile-tools-pop {
  position: absolute;
  left: 6px;
  bottom: 46px;
  width: min(122px, calc(100vw - 16px));
  padding: 5px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  background: #1f2b31;
  box-shadow: 0 18px 44px rgba(0,0,0,.4);
  z-index: 29;
}
.mobile-tools-pop.open {
  display: grid;
  gap: 3px;
}
.mobile-tools-pop button {
  width: 100%;
  min-height: 30px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 6px;
  padding: 0 8px;
  background: transparent;
  color: #eef7f8;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.mobile-tools-pop button:hover,
.mobile-tools-pop button:focus {
  background: #2c3b42;
  outline: none;
}
.mobile-tools-pop button:disabled {
  color: #829197;
  cursor: not-allowed;
}
.mobile-tools-pop .ai-compose-icon {
  width: 18px;
  height: 18px;
  font-size: 7px;
}
.mobile-tool-emoji {
  font-size: 16px;
  line-height: 1;
}
.emoji-quick-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, 38px);
  gap: 2px 4px;
  overflow: visible;
  padding: 10px 16px 9px 10px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 38px;
  gap: 2px 4px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 16px 12px 10px;
  scrollbar-color: #626a6c #1f2323;
}
.emoji-quick-row button,
.emoji-grid button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.emoji-quick-row button:hover,
.emoji-quick-row button:focus,
.emoji-grid button:hover,
.emoji-grid button:focus {
  background: #2a2f2f;
  outline: none;
}

.recording-dialog {
  width: min(390px, calc(100vw - 22px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111b21;
  color: var(--text);
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
}
.recording-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
}
.recording-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.recording-status {
  color: #b8c7cc;
  font-size: 13px;
}
.recording-timer {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.recording-dialog audio {
  width: 100%;
  height: 36px;
}
.recording-actions {
  display: grid;
  grid-template-columns: .9fr .9fr 1.25fr .9fr;
  gap: 5px;
}
.recording-actions button {
  min-height: 30px;
  min-width: 0;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0d171d;
  color: var(--text);
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.recording-actions button:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.record-main-btn.recording {
  border-color: rgba(255, 92, 118, .6);
  background: #8f1d2c;
}
.recording-actions #recordSendBtn:not(:disabled) {
  border-color: rgba(0, 168, 132, .75);
  background: #007a5d;
}
.recording-actions #recordTranscribeBtn:not(:disabled) {
  border-color: rgba(255, 210, 85, .72);
  background: #3b3217;
  color: #ffe08a;
}
.note-editor-dialog {
  width: min(460px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111b21;
  color: var(--text);
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
}
.note-editor-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
}
.note-editor-panel header,
.note-editor-panel footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.note-editor-panel h2 {
  margin: 0;
  font-size: 16px;
}
.note-editor-panel textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border: 1px solid #ddc898;
  border-radius: 6px;
  padding: 12px;
  background: #f5e8c8;
  color: #3d3124;
  font: inherit;
  line-height: 1.35;
}
.note-editor-panel textarea:focus {
  outline: 2px solid #ffd255;
  outline-offset: 2px;
}
.note-editor-panel textarea:disabled {
  opacity: .75;
  cursor: progress;
}
.note-editor-panel footer {
  position: relative;
  justify-content: space-between;
}
.note-editor-tools {
  position: relative;
  display: flex;
  align-items: center;
}
.note-editor-ai-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: #202e35;
}
.note-editor-ai-pop {
  left: 0;
  bottom: 42px;
}
.note-editor-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.note-editor-actions button,
.note-editor-ai-btn {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  background: #202e35;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}
.note-editor-actions button:disabled,
.note-editor-ai-btn:disabled {
  opacity: .62;
  cursor: progress;
}
.note-editor-actions button[type="submit"] {
  border-color: rgba(0, 168, 132, .72);
  background: #00a884;
  color: #061714;
}
.login-screen {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(2, 8, 12, .86);
  z-index: 100;
}
.login-screen.open { display: grid; }
.login-box, .panel {
  width: min(430px, calc(100vw - 34px));
  background: #17252c;
  border: 1px solid var(--line);
  padding: 24px;
}
.login-box h2, .panel h2 { margin: 0 0 18px; }
.login-box input, .panel input, .panel select {
  width: 100%;
  height: 46px;
  margin-bottom: 12px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #0d171d;
  color: var(--text);
}
.panel select {
  appearance: none;
}
.login-error {
  margin: 0 0 12px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 92, 118, .42);
  border-radius: 6px;
  background: rgba(255, 92, 118, .12);
  color: #ffd6dc;
  font-size: 14px;
  line-height: 1.3;
}
.login-error[hidden] {
  display: none;
}
.login-box button, .panel footer button {
  height: 44px;
  border: 0;
  padding: 0 18px;
  background: var(--accent);
  color: #061714;
  font-weight: 800;
}
.login-box p { color: var(--muted); margin-bottom: 0; }
dialog {
  border: 0;
  padding: 0;
  background: transparent;
}
dialog::backdrop { background: rgba(0,0,0,.58); }
.image-viewer {
  width: min(96vw, 1180px);
  max-width: 96vw;
  max-height: 94dvh;
  overflow: hidden;
  background: #05090c;
  border-radius: 8px;
}
.image-viewer::backdrop {
  background: rgba(0,0,0,.82);
}
.image-viewer img {
  display: block;
  width: 100%;
  max-height: calc(94dvh - 42px);
  object-fit: contain;
  background: #05090c;
}
.image-viewer-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(17,27,33,.82);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}
.image-viewer-caption {
  min-height: 42px;
  padding: 10px 48px 12px 14px;
  color: #d7e0e3;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reaction-viewer {
  width: min(300px, calc(100vw - 32px));
  max-height: min(420px, calc(100dvh - 48px));
  overflow: hidden;
  background: #111b21;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0,0,0,.42);
}
.reaction-viewer header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.reaction-viewer-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #202e35;
  color: var(--text);
  cursor: pointer;
}
.reaction-viewer-list {
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
}
.reaction-viewer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 6px;
}
.reaction-viewer-row:hover {
  background: #1b2a31;
}
.reaction-viewer-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reaction-viewer-row strong {
  font-size: 18px;
}
.profile-dialog {
  width: min(430px, calc(100vw - 24px));
  max-height: min(760px, calc(100dvh - 24px));
  overflow: hidden;
  background: #111b21;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0,0,0,.42);
}
.profile-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  max-height: min(760px, calc(100dvh - 24px));
}
.profile-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.profile-summary {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 16px 14px;
}
.profile-avatar {
  width: 68px;
  height: 68px;
  font-size: 20px;
}
.profile-summary h2 {
  margin: 0 0 5px;
  font-size: 20px;
  overflow-wrap: anywhere;
}
.profile-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.profile-fields {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px 12px;
  margin: 0;
  padding: 0 14px 14px;
  color: #d7e0e3;
  font-size: 13px;
}
.profile-fields dt {
  color: #91a0a7;
  font-weight: 800;
}
.profile-fields dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
.profile-members {
  min-height: 0;
  border-top: 1px solid var(--line);
}
.profile-members h3 {
  margin: 0;
  padding: 12px 14px 6px;
  font-size: 14px;
}
.profile-members-list {
  max-height: 430px;
  overflow-y: auto;
  padding: 4px 8px 10px;
}
.profile-member-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 8px 6px;
  border-radius: 6px;
}
.profile-member-row:hover {
  background: #1b2a31;
}
.profile-member-row .avatar {
  width: 42px;
  height: 42px;
  font-size: 14px;
}
.profile-member-main {
  min-width: 0;
}
.profile-member-main strong,
.profile-member-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-member-main span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}
.role-badge {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(0,168,132,.16);
  color: #8ee7d2;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.panel {
  width: min(700px, calc(100vw - 32px));
}
#settingsPanel {
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  overflow: hidden;
}
#settingsForm {
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
  padding: 14px;
  overflow: hidden;
  font-size: 13px;
}
#settingsForm header {
  margin-bottom: 2px;
}
#settingsForm header h2 {
  margin: 0;
  font-size: 17px;
}
#settingsForm label {
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
}
#settingsForm input,
#settingsForm select {
  height: 30px;
  margin: 3px 0 0;
  padding: 0 8px;
  font-size: 12px;
}
#settingsForm .check-setting {
  min-height: 26px;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}
#settingsForm .check-setting input {
  width: 14px;
  height: 14px;
  margin: 0;
  padding: 0;
}
.settings-instance-toggle-group {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}
.settings-instance-toggle-group h4 {
  margin: 0;
  color: #dbe7eb;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}
#settingsForm footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 3px;
}
#settingsForm footer button {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
}
#settingsForm footer .restart-action {
  border-color: rgba(255, 107, 107, .55);
  background: #b4232a;
  color: #fff;
}
#settingsForm footer .restart-action:hover {
  background: #d0363d;
}
#settingsForm footer .restart-action:disabled {
  opacity: .65;
  cursor: wait;
}
.settings-scroll-canvas {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 10px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111b21;
  scrollbar-gutter: stable;
}
.settings-scroll-canvas .settings-canvas-wide,
.settings-scroll-canvas .settings-preferences-canvas,
.settings-scroll-canvas .qr-box {
  grid-column: 1 / -1;
}
.settings-canvas {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255,255,255,.035);
}
.settings-canvas h3 {
  margin: 0;
  color: #ffda4a;
  font-size: 12px;
}
.settings-field-grid {
  display: grid;
  gap: 7px;
  min-width: 0;
}
.settings-field-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.settings-field-wide {
  grid-column: 1 / -1;
}
.settings-sync-action {
  display: grid;
  align-content: end;
  gap: 3px;
  min-width: 0;
}
.settings-sync-action button {
  width: 100%;
  height: 30px;
  border: 1px solid #7b5b16;
  border-radius: 6px;
  background: #49360f;
  color: #ffe6a0;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.settings-sync-action button:disabled {
  color: #9c8955;
  cursor: wait;
}
.settings-instance-action {
  display: grid;
  align-content: end;
  gap: 3px;
  min-width: 0;
}
.settings-action-buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.settings-action-buttons button {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0d171d;
  color: var(--text);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.settings-action-buttons button:disabled {
  color: #6f8086;
  cursor: wait;
}
.settings-action-buttons .danger-action {
  border-color: #7c2d2d;
  background: #351111;
  color: #ffd1d1;
}
.ai-model-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 8px;
  align-items: end;
}
.ai-model-row button {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #263942;
  color: var(--text);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.ai-model-row button:disabled {
  color: #7e8d93;
  cursor: wait;
}
.settings-toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 10px;
}
.settings-preferences-canvas h3 {
  white-space: nowrap;
}
.user-panel {
  width: min(1120px, calc(100vw - 24px));
  max-height: min(900px, calc(100dvh - 24px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}
.panel header, .panel footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel label {
  color: var(--muted);
  display: block;
}
.check-setting {
  display: flex !important;
  align-items: center;
  gap: 9px;
  min-height: 32px;
  color: #d8e4e8 !important;
}
.check-setting input {
  width: 18px;
  height: 18px;
  margin: 0;
}
.perm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.perm-grid label {
  display: flex;
  gap: 8px;
  align-items: center;
}
.perm-grid input { width: 18px; height: 18px; margin: 0; }
.perm-grid input:disabled {
  opacity: .7;
  cursor: not-allowed;
}
.perm-grid label:has(input:disabled) {
  color: #d0dee3;
}
.admin-user-tools {
  display: grid;
  grid-template-rows: minmax(220px, 1fr) auto;
  gap: 10px;
  min-height: 0;
}
.admin-user-tools[hidden],
.self-user-form[hidden] {
  display: none;
}
.user-table-wrap {
  max-height: min(560px, calc(100dvh - 330px));
  min-height: 260px;
  overflow-x: auto;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.user-table-wrap::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
.user-table-wrap::-webkit-scrollbar-track {
  background: #0b151a;
}
.user-table-wrap::-webkit-scrollbar-thumb {
  border: 3px solid #0b151a;
  border-radius: 999px;
  background: #73848b;
}
.user-table-wrap::-webkit-scrollbar-thumb:hover {
  background: #91a1a8;
}
.user-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}
.user-table th,
.user-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  text-align: left;
  vertical-align: middle;
}
.user-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #17252c;
  color: var(--muted);
  font-weight: 800;
}
.user-table tr:last-child td {
  border-bottom: 0;
}
.disabled-user td {
  color: #829198;
}
.table-link {
  border: 0;
  background: transparent;
  color: #d9f7ff;
  font: inherit;
  font-weight: 800;
  padding: 0;
  cursor: pointer;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}
.status-badge.on {
  background: rgba(0, 168, 132, .18);
  color: #8ff7dc;
}
.status-badge.off {
  background: rgba(255, 107, 107, .18);
  color: #ffb7b7;
}
.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.user-actions button {
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #0d171d;
  color: var(--text);
  padding: 0 7px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.user-editor footer button,
.self-user-form footer button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0d171d;
  color: var(--text);
  padding: 0 10px;
  font-weight: 800;
  cursor: pointer;
}
.user-actions button:disabled {
  opacity: .42;
  cursor: not-allowed;
}
.user-actions .danger-action {
  color: #ffb7b7;
}
.user-editor {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 8px 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111b21;
}
.user-editor h3 {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 14px;
}
.user-editor input {
  height: 36px;
  margin-bottom: 0;
}
.password-generate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
}
.password-generate-row input {
  width: 100%;
}
.password-generate-row button {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0d171d;
  color: var(--text);
  padding: 0 10px;
}
.password-generate-row button:hover,
.password-generate-row button:focus {
  background: #1f2c33;
}
.user-editor .perm-grid {
  grid-column: 1 / span 3;
  grid-template-columns: repeat(4, max-content);
  align-items: center;
  gap: 8px 14px;
  margin: 0;
}
.user-editor .perm-grid label {
  font-size: 13px;
  white-space: nowrap;
}
.instance-access-field {
  grid-column: 1 / span 3;
  display: grid;
  gap: 6px;
}
.instance-access-field[hidden] {
  display: none;
}
.instance-access-field select {
  width: 100%;
  height: 36px;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0d171d;
  color: var(--text);
  padding: 0 10px;
  outline: none;
}
.auto-transcription-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px 10px;
}
.auto-transcription-item {
  justify-content: start;
  min-width: 0;
  overflow: hidden;
}
.auto-transcription-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-editor footer {
  grid-column: 4;
  grid-row: 2 / span 3;
  align-self: stretch;
  flex-direction: column;
  justify-content: end;
  gap: 8px;
}
.user-editor footer button {
  width: 120px;
  min-height: 36px;
}
.self-user-form {
  display: grid;
  gap: 8px;
}
.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.settings-actions button {
  height: 42px;
  border: 1px solid var(--line);
  background: #0d171d;
  color: var(--text);
  padding: 0 12px;
}
.settings-note {
  min-height: 0;
  margin: -2px 0 3px;
  color: #b8c7cc;
  font-size: 11px;
  font-weight: 600;
}
.qr-box {
  min-height: 0;
  margin: 4px 0;
  color: var(--muted);
  overflow: auto;
}
.qr-box img {
  width: min(180px, 100%);
  display: block;
  margin: 6px auto;
  background: #fff;
  padding: 6px;
}
.qr-box pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 140px;
  overflow: auto;
  background: #0d171d;
  padding: 10px;
}

@media (max-width: 820px) {
  body { overflow: hidden; }
  .chat-row,
  .chat-row *,
  .bubble,
  .bubble * {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
  .composer,
  .composer *,
  #messageInput {
    -webkit-touch-callout: default;
    -webkit-user-select: text;
    user-select: text;
  }
  #settingsForm {
    width: min(520px, calc(100vw - 18px));
    max-height: calc(100dvh - 18px);
    padding: 12px;
  }
  .settings-scroll-canvas {
    grid-template-columns: 1fr;
    padding: 8px;
  }
  .settings-field-grid-2 {
    grid-template-columns: 1fr;
  }
  .ai-model-row {
    grid-template-columns: 1fr;
  }
  .settings-toggle-grid {
    grid-template-columns: 1fr;
  }
  .auto-transcription-list {
    grid-template-columns: 1fr;
  }
  .pdf-export-dialog {
    width: calc(100vw - 18px);
    max-width: calc(100vw - 18px);
  }
  .pdf-export-panel {
    width: 100%;
    max-height: calc(100dvh - 18px);
    gap: 8px;
    overflow-y: auto;
  }
  .pdf-export-panel header,
  .pdf-export-panel footer {
    padding: 8px 10px;
  }
  .pdf-export-panel header strong {
    font-size: 14px;
  }
  .pdf-export-panel header .icon-btn {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }
  .pdf-export-range {
    gap: 8px;
    padding: 0 10px;
  }
  .pdf-export-range label {
    gap: 4px;
    font-size: 11px;
  }
  .pdf-export-range input {
    height: 32px;
    padding: 0 8px;
    font-size: 12px;
  }
  .pdf-export-option {
    max-width: calc(100% - 20px);
    margin: -1px 10px 0;
    font-size: 11px;
  }
  .pdf-export-note {
    min-height: 16px;
    padding: 0 10px;
    font-size: 11px;
  }
  .pdf-export-panel footer {
    gap: 6px;
  }
  .pdf-export-panel footer button {
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
  }
  .app {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    top: var(--wu-viewport-top, 0px);
    height: var(--wu-app-height, 100dvh);
    max-height: var(--wu-app-height, 100dvh);
  }
  .sidebar, .conversation {
    width: 100vw;
    height: 100%;
    max-height: 100%;
  }
  .sidebar {
    grid-template-rows: 48px 42px minmax(0, 1fr);
  }
  .conversation {
    display: none;
    grid-template-rows: 48px minmax(0, 1fr) auto;
  }
  .conversation.system-log-conversation {
    grid-template-rows: 48px minmax(0, 1fr);
  }
  .app.chat-open .sidebar { display: none; }
  .app.chat-open .conversation { display: grid; }
  .sidebar-head {
    height: 48px;
    padding: 6px 12px;
  }
  .instance-brand { gap: 8px; }
  .sidebar-head h1 { font-size: 17px; }
  .current-user-alias-badge {
    max-width: 82px;
    height: 16px;
    padding-inline: 6px;
    font-size: 9px;
  }
  .instance-select {
    width: min(150px, 46vw);
    height: 20px;
    font-size: 10px;
  }
  .instance-avatar {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    font-size: 12px;
  }
  .instance-avatar img {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border-radius: 50%;
  }
  .search-box { height: 42px; padding: 5px 10px; }
  .search-box input {
    height: 32px;
    padding-left: 38px;
    font-size: 15px;
  }
  .search-box .search-icon {
    margin-left: 13px;
    transform: scale(.9);
  }
  .chat-row {
    height: 76px;
    min-height: 76px;
    grid-template-columns: 50px minmax(0, 1fr) auto;
    gap: 10px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .chat-row .avatar { width: 46px; height: 46px; font-size: 16px; }
  .chat-meta strong {
    font-size: 15px;
    font-weight: 700;
    line-height: 20px;
  }
  .chat-meta span { font-size: 13px; }
  .chat-meta .chat-phone { font-size: 12px; }
  .chat-head { padding: 0 6px; gap: 4px; }
  .chat-head .chat-identity {
    gap: 0;
    padding: 2px 3px;
    margin-left: 0;
  }
  .chat-head .avatar { display: none; }
  .chat-title strong { font-size: 13px; }
  .chat-title span { font-size: 10px; margin-top: 2px; }
  .head-actions { gap: 2px; }
  .ai-balance-badge {
    max-width: 60px;
    min-width: 40px;
    height: 18px;
    padding: 0 4px;
    font-size: 7px;
    line-height: 16px;
  }
  .chat-head .icon-btn {
    width: 26px;
    height: 28px;
    font-size: 14px;
  }
  .chat-head .back-arrow-icon {
    width: 15px;
    height: 15px;
  }
  .chat-head .back-arrow-icon::before {
    left: 4px;
    top: 7px;
    width: 9px;
    height: 2px;
  }
  .chat-head .back-arrow-icon::after {
    left: 3px;
    top: 4px;
    width: 6px;
    height: 6px;
    border-left-width: 2px;
    border-bottom-width: 2px;
  }
  .chat-head .pdf-icon {
    width: 13px;
    height: 16px;
    border-width: 1.5px;
  }
  .chat-head .pdf-icon::before {
    width: 5px;
    height: 5px;
    border-left-width: 1.5px;
    border-bottom-width: 1.5px;
  }
  .chat-head .pdf-icon::after {
    bottom: 2px;
    font-size: 4px;
  }
  .chat-head .search-icon {
    width: 13px;
    height: 13px;
    border-width: 1.8px;
  }
  .chat-head .search-icon::after {
    width: 6px;
    height: 1.8px;
    right: -5px;
    bottom: -4px;
  }
  .chat-head .vertical-dots-icon {
    width: 4px;
    height: 4px;
    box-shadow: 0 -7px 0 currentColor, 0 7px 0 currentColor;
  }
  .icon-btn { width: 34px; height: 34px; font-size: 18px; }
  .mobile-menu { width: 30px; height: 30px; }
  .back-btn, .mobile-menu { display: grid; }
  .messages { padding: 22px 12px; }
  .bubble {
    max-width: 88%;
    padding: 8px 10px 7px;
    font-size: 15px;
  }
  .note-bubble {
    max-width: 94%;
    padding: 0;
  }
  .note-paper {
    min-width: min(300px, 86vw);
  }
  .bubble-line {
    display: block;
    gap: 0;
  }
  .bubble-line::after {
    content: "";
    display: block;
    clear: both;
  }
  .bubble small {
    float: right;
    margin: 4px 0 0 8px;
  }
  .bubble.single-emoji .bubble-line {
    display: flex;
    gap: 8px;
  }
  .bubble.single-emoji small {
    float: none;
    margin: 0 0 3px;
  }
  .sticker-media {
    width: min(196px, 62vw);
    height: min(196px, 62vw);
  }
  .composer {
    grid-template-columns: 24px minmax(0, 1fr) 24px;
    padding: 5px;
    gap: 5px;
  }
  .composer.ask-ai-composer {
    grid-template-columns: 24px minmax(0, 1fr) 24px;
  }
  .mobile-tools-btn {
    display: grid;
    place-items: center;
  }
  .composer:not(.ask-ai-composer) #fileBtn,
  .composer:not(.ask-ai-composer) #emojiBtn,
  .composer:not(.ask-ai-composer) #aiBtn,
  .composer:not(.ask-ai-composer) #noteBtn,
  .composer:not(.ask-ai-composer) #micBtn {
    display: none;
  }
  .composer .icon-btn {
    width: 24px;
    height: 32px;
    font-size: 15px;
  }
  .composer .attach-icon,
  .composer .mic-icon {
    width: 16px;
    height: 16px;
  }
  .composer .ai-compose-icon {
    width: 16px;
    height: 16px;
    font-size: 7px;
    border-width: 1.2px;
  }
  .composer .note-compose-icon {
    width: 16px;
    height: 16px;
  }
  .composer .mobile-tools-icon {
    width: 16px;
    height: 16px;
    border-width: 1.6px;
  }
  .composer .mobile-tools-icon::before {
    width: 8px;
    height: 1.6px;
  }
  .composer .mobile-tools-icon::after {
    width: 1.6px;
    height: 8px;
  }
  .composer .ask-ai-new-icon {
    width: 18px;
    height: 18px;
    border-width: 1.6px;
  }
  .composer .ask-ai-new-icon::before,
  .composer .ask-ai-new-icon::after {
    width: 8px;
    height: 1.6px;
  }
  .composer .ask-ai-new-icon::after {
    width: 1.6px;
    height: 8px;
  }
  .messages.ask-ai-thread {
    max-width: none;
    padding: 22px 16px;
  }
  .ask-ai-content {
    max-width: none;
    font-size: 15px;
    line-height: 1.58;
  }
  .composer textarea {
    min-width: 0;
    min-height: 36px;
    height: 36px;
    max-height: 128px;
    font-size: 14px;
    line-height: 20px;
    padding: 8px 10px;
  }
  .send-btn {
    width: 24px;
    height: 32px;
    align-self: start;
    border-radius: 0;
    background: radial-gradient(circle at center, #233f7f 0 12px, transparent 12.5px);
    box-shadow: none;
  }
  .send-btn::before {
    width: 15px;
    height: 15px;
  }
  .reply-compose {
    left: 6px;
    right: 6px;
    bottom: calc(100% + 3px);
    grid-template-columns: 1fr 28px;
    padding: 5px;
  }
  .reply-compose-main {
    padding: 6px 8px;
  }
  .emoji-pop {
    left: 4px;
    right: 4px;
    bottom: 48px;
    width: auto;
    height: min(410px, calc(100dvh - 116px));
    border-radius: 8px 8px 0 0;
  }
  .ai-pop {
    left: 42px;
    bottom: 48px;
    width: min(230px, calc(100vw - 12px));
  }
  .emoji-grid {
    grid-template-columns: repeat(8, 1fr);
    justify-items: center;
    padding: 12px 8px;
  }
  .emoji-quick-row {
    padding: 8px;
  }
  .perm-grid { grid-template-columns: 1fr; }
  .user-panel {
    width: calc(100vw - 6px);
    max-height: calc(100dvh - 6px);
    padding: 8px;
    grid-template-rows: auto minmax(0, 1fr);
    border-radius: 7px;
  }
  .user-panel header {
    align-items: center;
    padding-bottom: 4px;
    gap: 8px;
  }
  .user-panel header h2 {
    margin: 0;
    font-size: 15px;
  }
  .admin-user-tools {
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 6px;
    min-height: 0;
    overflow: hidden;
  }
  .user-table-wrap {
    min-height: 0;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    border: 0;
    border-radius: 0;
  }
  .user-table {
    min-width: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 5px;
  }
  .user-table thead {
    display: none;
  }
  .user-table,
  .user-table tbody,
  .user-table tr,
  .user-table td {
    display: block;
  }
  .user-table tr {
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #111b21;
  }
  .user-table td {
    min-width: 0;
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 6px;
    align-items: start;
    padding: 2px 0;
    border-bottom: 0;
    font-size: 11px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
  .user-table td::before {
    content: attr(data-label);
    color: #91a0a7;
    font-weight: 800;
  }
  .user-table td[data-label="Actions"] {
    grid-template-columns: 1fr;
    padding-top: 5px;
  }
  .user-table td[data-label="Actions"]::before {
    display: none;
  }
  .user-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
  .user-actions button {
    flex: 0 0 auto;
    width: auto;
    min-height: 27px;
    padding: 0 7px;
    font-size: 11px;
  }
  .status-badge {
    width: max-content;
    min-height: 17px;
    padding: 0 5px;
    font-size: 9px;
  }
  .user-editor {
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 7px;
    max-height: 38dvh;
    overflow-y: auto;
  }
  .user-editor h3 {
    font-size: 12px;
  }
  .user-editor input,
  .user-editor select {
    height: 30px;
    margin-bottom: 0;
    font-size: 12px;
    padding: 0 8px;
  }
  .password-generate-row {
    grid-template-columns: minmax(0, 1fr) 80px;
    gap: 5px;
    margin-top: 2px;
  }
  .password-generate-row button {
    height: 30px;
    padding: 0 6px;
    font-size: 11px;
  }
  .user-editor h3,
  .user-editor .perm-grid,
  .instance-access-field,
  .user-editor footer {
    grid-column: 1;
    grid-row: auto;
  }
  .user-editor .perm-grid {
    grid-template-columns: 1fr;
    gap: 3px;
    margin: 2px 0;
  }
  .user-editor .perm-grid label {
    min-height: 22px;
    font-size: 12px;
  }
  .user-editor .perm-grid input {
    width: 15px;
    height: 15px;
  }
  .user-editor footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .user-editor footer button {
    width: 100%;
    min-height: 31px;
    font-size: 12px;
  }
}

@media (max-width: 420px) {
  .user-table td {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 5px;
  }
  .user-actions button {
    min-height: 25px;
    padding: 0 6px;
    font-size: 10px;
  }
}
