.work-mode {
  height: 100dvh;
  min-height: 0;
}
.work-mode .workspace {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.work-mode main {
  padding: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.work-mode #page-title {
  display: none;
}
.work-mode #page-error:empty {
  display: none;
}
.work-mode #page-content {
  flex: 1;
  min-height: 0;
  display: flex;
}
.work-chat {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(225px, 290px) minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}
.chat-clients {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: white;
}
.chat-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px;
  padding: 16px 12px;
  border-bottom: 1px solid var(--line);
}
.chat-search select {
  grid-column: 1 / -1;
}
.chat-search input,
.chat-search select,
.chat-filters select {
  min-height: 36px;
  font-size: 13px;
  padding: 7px 9px;
}
.chat-client-list {
  flex: 1;
  overflow-y: auto;
}
.chat-client {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  border: 0;
  border-radius: 0;
  padding: 15px 16px;
  text-align: left;
  border-bottom: 1px solid #edf0ee;
}
.chat-client.selected {
  background: #e8f2ee;
  box-shadow: inset 3px 0 #126449;
}
.client-name {
  font-size: 14px;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.client-meta {
  display: flex;
  gap: 5px;
  align-items: center;
}
.client-meta time {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
}
.client-managers {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.more-clients {
  flex: none;
  border-radius: 0;
  border: 0;
  border-top: 1px solid var(--line);
}
.chat-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: relative;
  background: #f2f5f4;
}
.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  background: white;
  border-bottom: 1px solid var(--line);
}
.chat-heading {
  flex: 1;
  min-width: 0;
}
.chat-heading h2 {
  margin: 0 0 2px;
  font-size: 17px;
  overflow-wrap: anywhere;
}
.chat-header .icon-button,
.chat-search .icon-button {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  height: 36px;
  padding: 7px;
}
.chat-back {
  display: none;
}
.chat-filters {
  display: flex;
  gap: 8px;
  padding: 8px 22px;
  background: #fafcfb;
  border-bottom: 1px solid var(--line);
}
.chat-filters select {
  width: auto;
  min-width: 0;
  max-width: 50%;
  flex: 1;
}
.chat-status {
  background: #fff4d5;
  color: #654c14;
  padding: 9px 16px;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.chat-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 24px;
  scroll-behavior: auto;
  overflow-anchor: none;
}
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 1040px;
  margin: auto;
}
.chat-day {
  align-self: center;
  font-size: 12px;
  color: #66756d;
  margin: 10px 0;
}
.chat-row {
  display: flex;
  max-width: 100%;
}
.chat-row.outgoing {
  justify-content: flex-end;
}
.chat-bubble {
  max-width: min(82%, 700px);
  padding: 10px 13px 5px;
  background: white;
  border: 1px solid #e1e8e4;
  border-radius: 8px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.outgoing .chat-bubble {
  background: #e5f2eb;
  border-color: #d7e8de;
}
.unattributed .chat-bubble {
  border-left: 3px solid #bb9951;
}
.call-row {
  justify-content: center;
  margin: 8px 0;
}
.call-row .chat-bubble {
  background: #edf1f4;
  border-color: #dce3e8;
  max-width: min(90%, 650px);
}
.message-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: #5d6c63;
  margin-bottom: 5px;
}
.message-speaker {
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}
.message-meta .message-note {
  margin-left: auto;
  flex-shrink: 0;
}
.channel-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  opacity: 0.85;
}
.channel-mark svg {
  width: 14px;
  height: 14px;
}
.channel-telegram {
  color: #377fa2;
}
.channel-whatsapp {
  color: #30845b;
}
.channel-whatsapp .wa-phone {
  position: absolute;
  width: 7px;
  height: 7px;
  top: 4px;
  left: 4px;
}
.channel-max {
  color: #6256a6;
  border: 1px solid currentColor;
  border-radius: 50%;
}
.max-letter {
  font-size: 9px;
  font-weight: 750;
  line-height: 1;
}
.channel-phone {
  color: #66746e;
}
.channel-email {
  color: #936237;
}
.message-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.55;
}
.message-text a {
  text-decoration: underline;
}
.message-time {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  color: #6d7b72;
  font-size: 10px;
  min-height: 22px;
  margin-top: 3px;
}
.message-copy {
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  border: none;
  padding: 4px;
  background: transparent;
  opacity: 0.65;
}
.message-copy svg {
  width: 12px;
  height: 12px;
}
.message-note {
  display: inline-block;
  font-size: 11px;
  color: var(--muted);
}
.chat-file {
  margin-top: 8px;
  max-width: 420px;
  min-width: 0;
}
.chat-bubble:has(.chat-file img, .chat-file video) {
  width: 420px;
}
.file-title {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}
.file-title svg {
  width: 14px;
  height: 14px;
}
.chat-file img,
.chat-file video {
  display: block;
  width: 100%;
  max-width: 400px;
  max-height: 300px;
  object-fit: contain;
  background: #e0e5e2;
  border-radius: 4px;
  aspect-ratio: 4/3;
}
.chat-file audio {
  display: block;
  width: 330px;
  max-width: 100%;
  height: 42px;
}
.chat-download {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 5px 0;
}
.chat-download svg {
  width: 14px;
  height: 14px;
}
.voice-transcript {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #cfded4;
}
.chat-empty {
  padding: 36px 18px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  overflow-wrap: anywhere;
}
.load-older {
  display: flex;
  margin: 0 auto 16px;
  font-size: 12px;
  padding: 6px 12px;
  min-height: 32px;
}
.chat-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px;
  border-top: 1px solid var(--line);
  color: #768179;
  font-size: 11px;
  background: #fafcfb;
}
.chat-footer svg {
  width: 12px;
  height: 12px;
}
.chat-to-bottom {
  position: absolute;
  right: 20px;
  bottom: 52px;
  width: 40px;
  height: 40px;
  padding: 9px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 7px #1d382920;
}
@media (max-width: 900px) {
  .work-mode {
    display: flex;
    flex-direction: column;
  }
  .work-mode .sidebar {
    padding: 5px 10px;
    gap: 0;
    border-right: 0;
  }
  .work-mode .sidebar .brand,
  .work-mode .sidebar .version {
    display: none;
  }
  .work-mode .sidebar nav {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 3px;
  }
  .work-mode .nav-button {
    width: auto;
    flex-shrink: 0;
    padding: 7px 10px;
    min-height: 38px;
    font-size: 12px;
  }
  .work-mode .topbar {
    min-height: 43px;
    padding: 5px 12px;
  }
  .work-mode .workspace {
    flex: 1;
  }
  .work-mode .dev-toolbar {
    padding: 6px 12px;
    gap: 6px;
    font-size: 11px;
  }
  .work-mode .dev-toolbar select {
    min-height: 30px;
    padding: 5px;
  }
}
@media (max-width: 700px) {
  .work-chat {
    display: flex;
  }
  .chat-clients {
    flex: 1;
    border-right: 0;
  }
  .chat-pane {
    display: none;
    flex: 1;
  }
  .chat-open .chat-clients {
    display: none;
  }
  .chat-open .chat-pane {
    display: flex;
  }
  .chat-back {
    display: inline-flex;
  }
  .chat-header {
    padding: 10px;
    gap: 8px;
  }
  .chat-heading h2 {
    font-size: 15px;
  }
  .chat-scroll {
    padding: 12px 10px;
  }
  .chat-bubble {
    max-width: 93%;
    padding: 8px 10px 4px;
  }
  .call-row .chat-bubble {
    max-width: 96%;
  }
  .chat-filters {
    padding: 7px 10px;
  }
  .message-text {
    font-size: 14px;
  }
  .chat-file audio {
    width: 265px;
  }
  .chat-file img,
  .chat-file video {
    max-height: 230px;
  }
}
