/* Approved ZaloDesk canvas: production layout, actual data and existing actions. */
:root {
  --sidebar-size: 196px;
  --text-secondary: #596579;
  --brand: #0769d5;
  --control-focus: #1b84ff;
  --radius: 10px;
}
:root[data-theme="dark"] {
  --text-secondary: #a1a5b7;
  --brand: #8bbaff;
  --border: #30333d;
}
body .primary,
body .send-button {
  background: #0769d5 !important;
  color: #fff !important;
}
body .shell > aside {
  padding: 0 14px 16px;
}
.sidebar-brand {
  padding: 0 8px !important;
}
.sidebar-brand > span:last-child {
  font-size: 23px !important;
  letter-spacing: -0.8px;
}
.sidebar-brand small {
  font-size: 9px !important;
  letter-spacing: 0;
}
.sidebar-workspace {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  padding: 8px !important;
  gap: 7px !important;
  margin: 12px 2px 16px;
  border-radius: 8px;
  background: var(--surface-soft);
}
.sidebar-workspace > div {
  min-width: 0;
}
.sidebar-workspace .workspace-emblem {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
}
.sidebar-workspace .workspace-emblem i {
  font-size: 17px;
}
.sidebar-workspace strong {
  font-size: 11px;
  line-height: 17px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#sidebar-account-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  line-height: 15px;
  margin-top: 1px;
  white-space: nowrap;
  color: var(--text-secondary);
}
#sidebar-account-label::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-secondary);
}
.sidebar-workspace[data-connection="connected"] #sidebar-account-label::before {
  background: var(--success);
}
.sidebar-workspace[data-connection="partial"] #sidebar-account-label::before,
.sidebar-workspace[data-connection="connecting"]
  #sidebar-account-label::before {
  background: var(--warning);
}
.sidebar-label {
  font-size: 9px;
}
.shell nav button {
  min-height: 44px;
  gap: 10px;
  padding: 10px 12px;
  font-size: 12px;
}
.shell nav button i {
  font-size: 20px;
}
.shell nav .nav-divider {
  margin-top: 18px;
}
.workspace-header {
  min-height: 58px;
}
body .header-icon,
body .notification-toggle {
  width: 44px;
  height: 44px;
  min-height: 44px;
}
.toolbar-menu button {
  min-height: 44px !important;
}
.list-heading h1:after {
  display: none !important;
}
.list-heading h1 {
  font-size: 16px !important;
}
.thread-top strong {
  font-size: 13px;
}
.thread-preview {
  font-size: 12px;
}
.thread-top time {
  font-size: 10px;
}
.thread .avatar {
  border-radius: 50%;
}
.thread .crm-badge {
  font-size: 10px;
}
.thread {
  min-height: 88px;
}
.chat-identity h2 {
  font-size: 14px;
}
.chat-header-actions {
  gap: 4px;
}
.chat-identity p {
  font-size: 11px;
}
body .icon-button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 10px;
}
body .icon-button i {
  font-size: 20px;
}
.bubble {
  font-size: 14px;
  line-height: 1.65;
}
.bubble.out {
  color: var(--text);
}
.messages {
  scrollbar-gutter: stable;
}
.bubble small {
  font-size: 10px;
  line-height: 1.6;
}
.bubble.media-bubble:not(.sticker-bubble) {
  max-width: 85%;
}
.media-bubble img {
  max-height: 360px;
  object-fit: contain;
}
body .send-button {
  width: 44px !important;
  height: 44px !important;
  min-height: 44px;
}
#send-form textarea {
  font-size: 14px !important;
}
.composer-toolbar .composer-hint {
  font-size: 10px;
}
.customer-table-wrap {
  border-radius: 10px;
}
.customer-table th {
  font-size: 10px;
  letter-spacing: 0.5px;
}
.customer-table td {
  border-left: 0 !important;
  border-right: 0 !important;
}
.customer-table .crm-identity strong {
  font-size: 13px;
}
.task-card {
  box-shadow: none;
  border-color: var(--border);
  border-radius: 8px;
}
.task-column {
  background: var(--surface-soft);
  border: 0;
}
.task-card h3 {
  font-size: 13px;
}
body button.compact-action {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
}
.crm-toolbar {
  align-items: center;
}
/* Profile works as a third region on desktop and an independent sheet on phones. */
#conversation-details {
  width: auto;
  min-width: 0;
  text-align: left;
  padding: 16px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  scrollbar-width: thin;
  scrollbar-gutter: stable;
  box-shadow: none;
}
#conversation-details[hidden] {
  display: none !important;
}
#conversation-details h3 {
  font-size: 14px;
  font-weight: 650;
  margin: 4px 0 16px;
  padding-right: 32px;
}
#conversation-details > .avatar {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  margin: 0 0 12px;
  font-size: 14px;
}
#detail-name {
  font-size: 14px;
  overflow-wrap: anywhere;
}
#detail-account {
  font-size: 11px;
  margin: 8px 0 0;
}
#detail-crm-badges {
  justify-content: flex-start;
  margin-top: 8px;
}
.detail-close {
  position: absolute;
  right: 10px;
  top: 10px;
}
#conversation-details {
  position: relative;
}
#customer-crm-form {
  padding-top: 16px;
  margin-top: 16px;
}
#conversation-details .mt-field {
  margin-bottom: 16px;
}
#conversation-details .mt-field .kt-form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}
#conversation-details input.kt-input,
#conversation-details select.kt-select {
  height: 44px;
  min-height: 44px;
  font-size: 12px;
  padding: 11px 32px 11px 12px;
}
#conversation-details textarea.kt-textarea {
  font-size: 12px;
  min-height: 96px;
  padding: 12px;
}
#customer-crm-form > button.primary {
  width: 100%;
  min-height: 44px;
}
#conversation-details h4 {
  font-size: 13px;
  margin: 0 0 16px;
}
.detail-task-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.detail-task-heading h4 {
  margin: 0 !important;
}
.detail-task-heading #task-from-chat {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 10px;
}
.profile-task-card {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0;
}
.profile-task-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: space-between;
}
.profile-task-heading strong {
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.profile-task-heading button {
  flex-shrink: 0;
}
.profile-task-card p {
  font-size: 11px;
  margin: 0;
  line-height: 1.7;
}
.profile-task-card select.kt-select {
  width: 100%;
}
.detail-tasks .empty {
  padding: 14px 0;
  font-size: 12px;
  text-align: left;
  line-height: 1.7;
}
.conversation-options {
  border-color: var(--border);
}
.conversation-options > summary {
  cursor: pointer;
  min-height: 44px;
  display: list-item;
  align-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 0;
}
.detail-options-body > .detail-section:first-child {
  border-top: 0;
  margin-top: 0;
}
.detail-section .check {
  min-height: 44px;
}
.detail-options-body .detail-section button {
  min-height: 44px;
}
#simulate-form {
  margin-top: 20px;
}
#customer-crm-form .small {
  font-size: 11px;
}
.detail-section {
  border-color: var(--border);
}
@media (min-width: 901px) {
  #workspace.inbox-mode main {
    display: flex;
    flex-direction: column;
    padding: 12px !important;
    overflow: hidden;
  }
  #workspace.inbox-mode [data-page="inbox"] {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }
  #workspace.inbox-mode [data-page="inbox"][hidden] {
    display: none;
  }
  .inbox {
    flex: 1;
    min-height: 0;
    grid-template-columns: 292px minmax(0, 1fr) !important;
    gap: 12px !important;
    height: auto !important;
  }
  .thread-list {
    height: 100%;
    border-radius: 10px;
  }
  .chat-workspace {
    background: transparent;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
    min-height: 0;
  }
  #chat-empty {
    border: 1px solid var(--border);
    border-radius: 10px;
    height: 100%;
  }
  #chat-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 64px minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    column-gap: 16px;
  }
  #chat-panel[hidden] {
    display: none !important;
  }
  .chat-body {
    display: contents;
  }
  .chat-header {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    height: auto;
    padding: 10px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
  }
  .chat-content {
    grid-column: 1;
    grid-row: 2;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 1px solid var(--border);
    border-radius: 0 0 10px 10px;
    overflow: hidden;
    position: relative;
  }
  .messages {
    padding: 24px;
  }
  .composer {
    margin: 0 20px 20px;
    border-radius: 8px;
    flex-shrink: 0;
  }
  .composer-toolbar {
    padding: 8px 8px 0;
  }
  #send-form {
    padding: 0 12px 10px;
  }
  #conversation-details {
    position: absolute;
    inset: 0 0 0 auto;
    width: 300px;
    z-index: 7;
    max-height: 100%;
    box-shadow: 0 12px 40px #0002;
  }
  .chat-header #back-threads {
    display: none;
  }
  .chat-workspace {
    position: relative;
  }
  .chat-body.details-open .chat-content {
    visibility: visible;
  }
}
@media (min-width: 1200px) {
  #chat-panel:has(#conversation-details:not([hidden])) {
    grid-template-columns: minmax(0, 1fr) 268px;
  }
  #conversation-details {
    position: relative;
    inset: auto;
    grid-column: 2;
    grid-row: 1/3;
    width: auto;
    height: 100%;
    max-height: 100%;
    box-shadow: none;
  }
  .detail-close {
    right: 8px;
    top: 8px;
  }
  #chat-panel:has(#conversation-details:not([hidden])) .composer-hint {
    display: none;
  }
}
@media (min-width: 901px) and (max-width: 1199px) {
  .inbox {
    grid-template-columns: 272px minmax(0, 1fr) !important;
  }
}
@media (max-width: 900px) {
  :root {
    --sidebar-size: 0px;
  }
  body .shell > aside {
    padding: 0;
  }
  .shell nav button {
    font-size: 9px;
    padding: 4px;
    min-height: 50px;
  }
  .workspace-header {
    min-height: 48px;
  }
  body .workspace-header .actions {
    gap: 2px;
  }
  body .header-icon,
  body .notification-toggle {
    width: 44px;
    height: 44px;
    min-height: 44px;
  }
  .header-user-avatar {
    display: none;
  }
  #workspace.inbox-mode main {
    padding: 0 !important;
    overflow: hidden;
  }
  .chat-header {
    padding: 8px 10px;
    gap: 4px;
    min-height: 66px;
  }
  .chat-header-actions {
    gap: 0;
  }
  #chat-avatar {
    width: 36px;
    height: 36px;
  }
  .chat-identity {
    padding-left: 4px;
  }
  .chat-identity h2 {
    font-size: 14px;
  }
  .chat-identity p {
    font-size: 10px;
  }
  .messages {
    padding: 20px 16px;
  }
  .bubble {
    max-width: 87%;
    font-size: 14px;
  }
  .composer {
    margin: 0;
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 0;
  }
  .composer-toolbar {
    padding: 3px 8px;
  }
  .composer-toolbar .bot-status {
    font-size: 10px;
  }
  #send-form {
    padding: 4px 12px 12px;
    gap: 8px;
  }
  #send-form textarea {
    font-size: 16px !important;
    min-height: 54px !important;
  }
  #conversation-details {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px 12px 0 0;
    z-index: 8;
    box-shadow: none;
    padding: 20px;
    text-align: left;
  }
  #conversation-details > .avatar {
    width: 44px;
    height: 44px;
  }
  #conversation-details select.kt-select,
  #conversation-details input.kt-input,
  #conversation-details textarea.kt-textarea {
    font-size: 16px;
  }
  .chat-body.details-open .chat-content {
    visibility: hidden;
  }
  .profile-task-card {
    padding: 16px;
  }
  #conversation-details h3 {
    font-size: 17px;
  }
  #conversation-details .mt-field .kt-form-label {
    font-size: 13px;
  }
  .customer-table .text-button.compact-action {
    min-height: 44px;
  }
  .thread {
    min-height: 88px;
  }
  .thread-list .list-heading h1 {
    font-size: 20px !important;
  }
  #new-message-indicator {
    z-index: 3;
    bottom: 145px;
  }
  .notice-heading button {
    width: 44px;
    height: 44px;
  }
  .notice-tabs button {
    min-height: 44px;
  }
}
/* Keep search as one control, not a bordered input inside another border. */
body .search-wrap input#thread-search {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0;
  min-width: 0;
  height: 36px;
  min-height: 36px;
}
body .shell nav button.active {
  background: var(--brand-soft) !important;
  color: var(--brand) !important;
}
body #conversation-details .detail-close {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  font-size: 22px;
  color: var(--text-secondary);
  border: 0;
  background: transparent;
}
.read-sync-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 20px;
  color: var(--text-secondary);
  font-size: 10px;
  flex-shrink: 0;
}
.read-sync-bar button {
  width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--brand);
  border: 0;
  font-size: 20px;
}
.unread-count {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #0769d5;
  color: #fff;
  font-size: 10px;
  position: static;
}
.thread {
  position: relative;
}
.thread.has-unread .thread-top strong {
  font-weight: 750;
}
.thread.has-unread .thread-preview {
  color: var(--text);
  padding-right: 20px;
}
.list-filters {
  flex-wrap: wrap;
}
.filter-tabs {
  gap: 8px;
  flex-wrap: wrap;
}
.filter-tabs button {
  min-height: 44px;
}
.customer-advanced {
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.customer-advanced summary {
  cursor: pointer;
  min-height: 44px;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.engagement-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 16px;
  border-top: 1px solid var(--border);
}
.engagement-filters label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}
.engagement-filters select {
  min-width: 0;
}
.engagement-filters > button {
  min-height: 44px;
  justify-self: start;
}
.customer-group-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  margin: 10px 0;
}
.customer-group-item button {
  white-space: normal;
  text-align: left;
  justify-content: flex-start;
  width: auto !important;
  font-size: 12px;
}
.customer-group-item > span {
  font-size: 10px;
}
#customer-group-list .empty {
  padding: 10px 0;
  font-size: 12px;
  line-height: 1.6;
  text-align: left;
}
#customer-group-note {
  font-size: 11px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
@media (max-width: 900px) {
  .engagement-filters {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
  .engagement-filters select {
    font-size: 16px;
    min-height: 44px;
  }
  .read-sync-bar {
    padding: 0 12px;
    font-size: 10px;
  }
  .read-sync-bar button {
    flex-shrink: 0;
  }
  .filter-tabs {
    gap: 12px;
  }
  .customer-group-item button {
    min-height: 44px;
  }
}
.engagement-filters label {
  margin: 0;
  gap: 6px;
}
.engagement-filters select.kt-select {
  height: 44px;
  min-height: 44px;
}
#reply-preview {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--brand-soft);
  border-radius: 8px 8px 0 0;
  color: var(--text);
}
#reply-preview[hidden] {
  display: none;
}
#reply-preview > div {
  min-width: 0;
}
#reply-author {
  font-size: 12px;
  color: var(--brand);
}
#reply-text {
  font-size: 12px;
  margin: 5px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 65vw;
}
.quoted-message {
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 10px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.quoted-message strong {
  font-size: 11px;
  color: var(--brand);
}
.quoted-message p {
  font-size: 12px;
  line-height: 1.6;
  margin: 4px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bubble.recalled {
  font-style: italic;
  color: var(--text-secondary);
  background: var(--surface-soft);
}
.bubble.recalled small {
  font-style: normal;
}
.message-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 6px;
  opacity: 0.6;
}
.bubble:hover .message-actions,
.bubble:focus-within .message-actions {
  opacity: 1;
}
.message-actions button {
  min-height: 32px;
  padding: 4px 8px;
  font-size: 10px;
  background: transparent;
  border: 0;
  color: var(--brand);
  border-radius: 5px;
}
.message-actions button:hover {
  background: var(--surface);
}
.message-actions button:disabled {
  color: var(--text-secondary);
  opacity: 0.6;
  cursor: not-allowed;
}
.recall-confirm {
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  margin-top: 10px;
  font-size: 12px;
}
.recall-confirm p {
  margin: 0 0 8px;
}
.recall-confirm button {
  min-height: 44px;
  padding: 8px 10px;
  margin: 4px;
  font-size: 12px;
}
.recall-confirm button:first-of-type {
  background: #ab3434;
  color: white;
  border: 0;
}
.sticker-bubble .message-actions {
  background: var(--surface);
  border-radius: 6px;
}
.bubble.media-bubble .quoted-message {
  font-style: normal;
}
@media (max-width: 900px) {
  .message-actions {
    opacity: 1;
  }
  .message-actions button {
    min-height: 44px;
    padding: 8px;
    font-size: 11px;
  }
  #reply-text {
    max-width: 65vw;
  }
  .quoted-message {
    font-size: 13px;
  }
  .recall-confirm button {
    min-height: 44px;
  }
}
.message-actions .message-reaction-trigger {
  display: inline-grid;
  place-items: center;
  width: 32px;
  min-width: 32px;
  font-size: 20px;
  line-height: 1;
  padding: 0;
  color: var(--brand);
}
.reaction-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.reaction-summary button.reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text-secondary);
  padding: 3px 9px;
  min-height: 28px;
  font-size: 12px;
  line-height: 1.4;
}
.reaction-summary button.reaction-chip.mine {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: var(--brand);
}
.reaction-summary button:hover {
  border-color: var(--brand);
}
.reaction-picker {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  width: 248px;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  margin-top: 10px;
  box-shadow: 0 4px 12px #0001;
}
.reaction-picker-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  grid-column: 1/-1;
  padding: 0 2px 5px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.reaction-picker-heading strong {
  font-size: 11px;
  color: var(--text-secondary);
}
.reaction-picker button {
  display: inline-grid;
  place-items: center;
  min-height: 44px;
  min-width: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: 23px;
  padding: 4px;
  color: var(--text);
}
.reaction-picker button:hover,
.reaction-picker button[aria-pressed="true"] {
  background: var(--brand-soft);
  outline: 1px solid var(--brand);
}
.reaction-picker button:disabled {
  opacity: 0.4;
  cursor: wait;
}
.reaction-picker .reaction-picker-heading button {
  font-size: 22px;
  width: 36px;
  min-height: 36px;
}
.reaction-picker button.remove-reaction {
  grid-column: 1/-1;
  font-size: 11px;
  color: var(--brand);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--border);
  border-radius: 0;
}
.sticker-bubble .reaction-summary {
  background: var(--surface);
  padding: 5px;
  border-radius: 8px;
  width: fit-content;
}
.sticker-bubble .reaction-picker {
  background: var(--surface);
}
@media (max-width: 900px) {
  .message-actions .message-reaction-trigger {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
  }
  .reaction-summary button.reaction-chip {
    min-height: 44px;
    padding: 6px 12px;
  }
  .reaction-picker {
    width: 248px;
  }
  .reaction-picker .reaction-picker-heading button {
    width: 44px;
    min-height: 44px;
  }
}

/* Compact header chrome keeps separators aligned with content. */
.customer-table th {
  background: var(--surface-soft) !important;
  border-bottom: 1px solid var(--border);
  padding-block: 10px;
}
#toast {
  left: auto;
  right: 16px;
  bottom: 20px;
  transform: none;
  max-width: min(360px, calc(100vw - 32px));
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.6;
  border-radius: 8px;
  box-shadow: 0 4px 16px #07143722;
  overflow-wrap: anywhere;
}
@media (min-width: 901px) {
  .list-heading {
    padding: 12px 16px 8px;
  }
  .chat-header #chat-avatar {
    width: 36px;
    height: 36px;
  }
  .chat-header .chat-header-actions {
    gap: 2px;
  }
  .chat-header .chat-identity h2 {
    font-size: 14px;
  }
  .chat-header .chat-identity p {
    font-size: 10px;
  }
}
@media (max-width: 900px) {
  #toast {
    right: 12px;
    left: 12px;
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: none;
    font-size: 12px;
    padding: 10px 12px;
  }
  .chat-header {
    min-height: 60px;
    padding: 6px 10px;
  }
  .notice-heading h2 {
    font-size: 15px;
  }
}

/* Inbox chrome stays compact; optional filters float over the list. */
.thread-list {
  position: relative;
}
.thread-list .list-heading {
  padding: 4px 12px;
  min-height: 44px;
  flex-shrink: 0;
}
.thread-list .list-heading > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.thread-list .list-heading h1 {
  font-size: 15px !important;
  margin: 0;
}
.thread-list #conversation-count {
  font-size: 10px;
  white-space: nowrap;
}
.thread-list #sync-directory {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 7px;
}
.thread-search-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px 6px;
  flex-shrink: 0;
}
.thread-search-row .search-wrap {
  margin: 0;
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
}
.thread-filters {
  flex-shrink: 0;
}
.thread-filters > summary {
  list-style: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  position: relative;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
}
.thread-filters > summary::-webkit-details-marker {
  display: none;
}
.thread-filters > summary svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.thread-filters > summary:hover,
.thread-filters[open] > summary,
.thread-filters > summary.active {
  background: var(--brand-soft);
  color: var(--brand);
}
.thread-filters > summary:focus-visible {
  outline: 2px solid var(--control-focus);
  outline-offset: 2px;
}
#thread-filter-count {
  position: absolute;
  right: -2px;
  top: -3px;
  background: var(--brand);
  color: var(--surface);
  font-size: 9px;
  line-height: 16px;
  min-width: 16px;
  text-align: center;
  border-radius: 8px;
}
.thread-filter-panel {
  position: absolute;
  top: 86px;
  left: 8px;
  right: 8px;
  z-index: 9;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 6px 20px #07143722;
  max-height: min(400px, calc(100dvh - 240px));
  overflow-y: auto;
  overscroll-behavior: contain;
}
.thread-filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}
.thread-filter-panel label {
  font-size: 11px;
  color: var(--text-secondary);
  margin: 0;
}
.thread-filter-panel select.kt-select {
  width: 100%;
  height: 36px;
  min-height: 36px;
  font-size: 12px;
  flex-shrink: 0;
}
.thread-filter-panel .text-button {
  font-size: 12px;
  min-height: 36px;
  align-self: flex-start;
}
.thread-list .list-account {
  margin: 0;
  padding: 0 12px 4px;
  flex-shrink: 0;
}
.thread-list .list-account select.kt-select {
  width: 100%;
  height: 30px;
  min-height: 30px;
  padding: 4px 28px 4px 9px;
  font-size: 11px;
}
.thread-list .list-filters {
  padding: 0 12px;
  flex-shrink: 0;
}
.thread-list .filter-tabs {
  width: 100%;
  gap: 14px;
  flex-wrap: nowrap;
}
.thread-list .filter-tabs button {
  font-size: 11px;
  min-height: 34px;
  padding: 7px 0;
}
.thread-list .list-footer {
  padding: 6px 12px;
  font-size: 10px;
  flex-shrink: 0;
}
.thread-list .thread {
  min-height: 72px;
  padding: 8px 10px;
  margin: 2px 6px;
  width: calc(100% - 12px);
}
.thread-list .thread .avatar {
  width: 38px;
  height: 38px;
}
.thread-list .thread-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0;
  overflow: hidden;
}
.thread-list .thread-top {
  line-height: 18px;
}
.thread-list .thread-preview {
  min-width: 0;
  padding-right: 0 !important;
  margin-top: 0;
  line-height: 17px;
}
.thread-list .thread-labels {
  display: flex;
  gap: 4px;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  height: 16px;
}
.thread-list .thread-labels > span {
  max-width: 88px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 4px;
  font-size: 10px;
  line-height: 14px;
  height: 16px;
  border-radius: 3px;
  display: block;
  flex: 0 1 auto;
}
.thread-list .thread-tag {
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 12%, transparent);
}
.thread-list .thread-labels .thread-tag-more {
  flex-shrink: 0;
  color: var(--text-secondary);
  background: var(--surface-soft);
}
.thread-list .thread-meta {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  align-self: stretch;
  justify-content: space-between;
  gap: 6px;
  min-width: 30px;
  padding: 2px 0;
}
.thread-list .thread-meta time {
  font-size: 10px;
  font-weight: 400;
  line-height: 14px;
  white-space: nowrap;
  color: var(--text-secondary);
}
.thread-list .thread-meta .unread-count {
  position: static;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: 10px;
  line-height: 18px;
  font-weight: 500;
  flex-shrink: 0;
}
.thread-list .thread-meta .thread-status {
  position: static;
  flex-shrink: 0;
  margin: 0 4px 4px 0;
}
@media (max-width: 900px) {
  .thread-list #sync-directory {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
  .thread-search-row .search-wrap,
  .thread-filters > summary {
    height: 44px;
  }
  .thread-filters > summary {
    width: 44px;
  }
  .thread-filter-panel {
    top: 100px;
  }
  .thread-filter-panel select.kt-select {
    height: 44px;
    min-height: 44px;
    font-size: 16px;
  }
  .thread-filter-panel .text-button {
    min-height: 44px;
  }
  .thread-list .list-account select.kt-select {
    height: 40px;
    min-height: 40px;
    font-size: 16px;
  }
  .thread-list .filter-tabs {
    gap: 18px;
  }
  .thread-list .filter-tabs button {
    font-size: 12px;
    min-height: 44px;
  }
  .thread-list .thread {
    min-height: 76px;
  }
}
/* Only one page of conversation rows is mounted at a time. */
.thread-pagination { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:12px; border-top:1px solid var(--border); color:var(--text-secondary); font-size:11px; }
.thread-pagination button { min-height:34px; margin:0; padding:6px 10px; font-size:11px; }
