body,
.chat-page {
  margin: 0;
  height: 100vh;
  min-height: 100vh;
  font-family: Arial, sans-serif;
  background: #f4f6f5;
  color: #17211d;
}
.chat-body-app {
  overflow: hidden;
}
.chat-app-header {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: #fff;
  border-bottom: 1px solid #d8dfdc;
}
.chat-header-left,
.chat-header-right,
.chat-main-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-brand {
  border: 0;
  background: #17211d;
  color: #fff;
  border-radius: 8px;
  padding: 9px 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.chat-main-nav a {
  color: #17211d;
  text-decoration: none;
  padding: 8px 9px;
  border-radius: 8px;
}
.chat-main-nav a.active,
.chat-main-nav a:hover {
  background: #edf2ef;
}
.chat-user-menu {
  position: relative;
}
.chat-user-menu summary {
  cursor: pointer;
  list-style: none;
}
.chat-user-menu span {
  color: #66736e;
  font-size: 12px;
}
.chat-user-menu div {
  position: absolute;
  right: 0;
  top: 28px;
  z-index: 20;
  min-width: 160px;
  border: 1px solid #d8dfdc;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  box-shadow: 0 12px 26px rgba(0,0,0,.13);
}
.chat-user-menu a,
.chat-user-menu button {
  display: block;
  box-sizing: border-box;
  width: 100%;
  border: 0;
  background: transparent;
  color: #17211d;
  text-align: left;
  text-decoration: none;
  padding: 8px;
  cursor: pointer;
  font: inherit;
}
.chat-user-menu a:hover,
.chat-user-menu button:hover {
  background: #edf2ef;
  border-radius: 6px;
}
.chat-app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  height: calc(100vh - 92px);
  min-height: 0;
}
.chat-sidebar {
  border-right: 1px solid #d8dfdc;
  background: #fff;
  padding: 12px;
}
.chat-sidebar nav {
  display: grid;
  gap: 7px;
}
.chat-sidebar a {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 9px;
  border-radius: 8px;
  color: #17211d;
  text-decoration: none;
}
.chat-sidebar a.active,
.chat-sidebar a:hover {
  background: #edf2ef;
}
.chat-sidebar span {
  width: 24px;
  text-align: center;
  font-weight: 700;
}
.chat-app-shell.sidebar-collapsed {
  grid-template-columns: 60px minmax(0, 1fr);
}
.chat-app-shell.sidebar-collapsed .chat-sidebar b {
  display: none;
}
.chat-main,
.chat-public-main {
  padding: 24px 18px;
  min-height: 0;
  overflow: auto;
}
.chat-main-conversation {
  overflow: hidden;
}
.chat-footer {
  border-top: 1px solid #d8dfdc;
  color: #66736e;
  font-size: 12px;
  padding: 8px 18px;
  background: #fff;
}
.chat-shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 18px;
}
.chat-btn {
  display: inline-block;
  padding: 10px 14px;
  border: 1px solid #17211d;
  border-radius: 8px;
  background: #17211d;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}
.chat-btn.secondary {
  background: #fff;
  color: #17211d;
}
.chat-panel {
  background: #fff;
  border: 1px solid #d8dfdc;
  border-radius: 8px;
  padding: 18px;
}
.chat-panel-full {
  box-sizing: border-box;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.chat-panel.narrow {
  max-width: 420px;
}
.chat-page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.chat-page-head h1 {
  margin: 0;
}
.chat-hero {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 28px;
  align-items: start;
}
.chat-form {
  display: grid;
  gap: 10px;
}
.chat-form label {
  display: grid;
  gap: 4px;
  font-size: 13px;
}
.chat-form input,
.chat-form select {
  border: 1px solid #cfd8d4;
  border-radius: 8px;
  padding: 9px;
  font: inherit;
}
.chat-inline-form {
  grid-template-columns: repeat(6, minmax(130px, 1fr)) auto;
  align-items: end;
  margin-bottom: 16px;
}
.chat-alert {
  border-radius: 8px;
  padding: 9px 10px;
  margin: 8px 0;
}
.chat-alert.ok {
  background: #e9f7ef;
  color: #176b36;
}
.chat-alert.error {
  background: #fdecec;
  color: #8f1d1d;
}
.muted {
  color: #66736e;
}
.bot-field {
  display: none !important;
}
.chat-table-wrap {
  overflow: auto;
}
.chat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.chat-table th,
.chat-table td {
  border-bottom: 1px solid #e1e7e4;
  padding: 8px;
  text-align: left;
}
.chat-table th {
  background: #f7f9f8;
}
.chat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.chat-card {
  border: 1px solid #d8dfdc;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}
.chat-card span {
  display: block;
  color: #66736e;
  font-size: 12px;
  margin-bottom: 8px;
}
.chat-card strong {
  font-size: 24px;
}
.chat-conversation-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
}
.chat-message-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}
.chat-admin-message {
  border: 1px solid #d8dfdc;
  border-radius: 8px;
  background: #f7f9f8;
  padding: 10px;
}
.chat-admin-message header {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}
.chat-admin-message header span {
  color: #66736e;
  font-size: 12px;
}
.chat-side-box {
  border: 1px solid #d8dfdc;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  align-self: start;
}
.chat-side-box h2 {
  margin-top: 0;
  font-size: 16px;
}
.chat-form textarea {
  border: 1px solid #cfd8d4;
  border-radius: 8px;
  padding: 9px;
  font: inherit;
  resize: vertical;
}
.chat-workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 56px 320px minmax(0, 1fr);
  border: 1px solid #d8dfdc;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.chat-rail {
  display: grid;
  align-content: stretch;
  gap: 8px;
  padding: 10px 8px;
  background: #17211d;
}
.chat-rail-top,
.chat-rail-bottom {
  display: grid;
  gap: 8px;
}
.chat-rail-bottom {
  align-self: end;
}
.chat-rail a,
.chat-rail button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #dce7e2;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}
.chat-rail a.active,
.chat-rail a:hover,
.chat-rail button.active,
.chat-rail button:hover {
  background: #2f443b;
  color: #fff;
}
.chat-room-list {
  min-width: 0;
  min-height: 0;
  border-right: 1px solid #d8dfdc;
  background: #f7f9f8;
  display: flex;
  flex-direction: column;
}
.chat-room-list-head {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid #d8dfdc;
  background: #fff;
}
.chat-room-list-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.chat-room-list-head span {
  color: #66736e;
  font-size: 12px;
}
.chat-room-current-status {
  min-height: 30px;
  box-sizing: border-box;
  padding: 7px 12px;
  border-bottom: 1px solid #d8dfdc;
  background: #fff;
  color: #66736e;
  font-size: 12px;
}
.chat-room-current-status strong {
  color: #17211d;
  font-weight: 700;
}
.chat-room-add {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: #17211d;
  color: #fff;
  text-decoration: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.chat-room-search {
  padding: 10px;
  border-bottom: 1px solid #d8dfdc;
}
.chat-room-search input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cfd8d4;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}
.chat-room-sections {
  display: grid;
  gap: 5px;
  padding: 8px;
  border-bottom: 1px solid #d8dfdc;
  background: #fff;
}
.chat-room-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 30px;
  border: 1px solid #cfd8d4;
  border-radius: 7px;
  background: #f7f9f8;
  color: #17211d;
  text-align: left;
  padding: 6px 9px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}
.chat-room-section-toggle::before {
  content: "v";
  color: #66736e;
  font-weight: 400;
}
.chat-room-section-toggle[aria-expanded="false"]::before {
  content: ">";
}
.chat-room-section-toggle[aria-expanded="false"] {
  background: #edf2ef;
  color: #66736e;
}
.chat-room-section-toggle span {
  margin-left: auto;
  color: #66736e;
  font-size: 12px;
  font-weight: 400;
}
.chat-room-section-toggle.disabled {
  color: #98a39f;
  background: #f1f4f2;
  cursor: not-allowed;
}
.chat-room-items {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 8px;
}
.chat-room-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 9px;
  border-radius: 8px;
  color: #17211d;
  text-decoration: none;
}
.chat-room-item[hidden] {
  display: none !important;
}
.chat-room-item.active,
.chat-room-item:hover {
  background: #fff;
  box-shadow: inset 0 0 0 1px #d8dfdc;
}
.chat-room-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #dce7e2;
  font-weight: 700;
}
.chat-room-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.chat-room-title,
.chat-room-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-room-title {
  font-weight: 700;
}
.chat-room-meta {
  color: #66736e;
  font-size: 12px;
}
.chat-room-count {
  min-width: 24px;
  border-radius: 999px;
  background: #edf2ef;
  color: #66736e;
  padding: 3px 6px;
  font-size: 12px;
  text-align: center;
}
.chat-room-count b {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  margin-right: 3px;
  border-radius: 999px;
  background: #d71920;
  color: #fff;
  font-size: 11px;
  line-height: 1;
}
.chat-room-view {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
}
.chat-main-panel {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.chat-main-panel[hidden] {
  display: none !important;
}
.chat-panel-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid #d8dfdc;
}
.chat-panel-head h2 {
  margin: 0;
  font-size: 17px;
}
.chat-panel-head p {
  margin: 3px 0 0;
  color: #66736e;
  font-size: 12px;
}
.chat-panel-search {
  padding: 10px 14px;
  border-bottom: 1px solid #d8dfdc;
}
.chat-panel-search input,
.chat-inner-form input,
.chat-inner-form select {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #cfd8d4;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}
.chat-inner-form {
  display: grid;
  gap: 10px;
  padding: 14px;
  overflow: auto;
}
.chat-inner-form label {
  display: grid;
  gap: 5px;
  font-size: 13px;
}
.chat-radio-row {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
}
.chat-radio-row input {
  width: auto;
}
.chat-data-list {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 10px 14px;
}
.chat-data-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid #edf2ef;
  padding: 9px 0;
}
.chat-data-row[hidden] {
  display: none !important;
}
.chat-data-row strong,
.chat-data-row span {
  display: block;
}
.chat-data-row small {
  display: block;
  margin-top: 3px;
  color: #66736e;
  font-size: 12px;
}
.chat-btn.compact {
  min-width: 74px;
  padding: 7px 9px;
  text-align: center;
  font-size: 12px;
}
.chat-btn.secondary {
  background: #fff;
  color: #17211d;
}
.chat-btn.danger {
  border-color: #8f1d1d;
  background: #8f1d1d;
}
.chat-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: wrap;
}
.chat-row-actions form {
  margin: 0;
}
.chat-btn[disabled],
.chat-data-row button[disabled] {
  opacity: .45;
  cursor: not-allowed;
}
.chat-room-view-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid #d8dfdc;
}
.chat-room-view-head h2 {
  margin: 0;
  font-size: 17px;
}
.chat-room-view-head p {
  margin: 3px 0 0;
  color: #66736e;
  font-size: 12px;
}
.chat-room-tools {
  display: flex;
  gap: 6px;
}
.chat-room-tools form {
  margin: 0;
}
.chat-room-tools button,
.chat-composer-plus {
  width: 34px;
  height: 34px;
  border: 1px solid #cfd8d4;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.chat-room-tools button.discussion,
.chat-message-actions button.discussion,
.chat-discussion-draft button.discussion {
  border-color: #2E8B57;
  background: #2E8B57;
  color: #fff;
}
.chat-room-tools button.thread,
.chat-message-actions button.thread {
  border-color: #007FFF;
  background: #007FFF;
  color: #fff;
}
.chat-btn-del,
.chat-message-actions button.chat-btn-del {
  border-color: #98a29d;
  background: #98a29d;
  color: #fff;
}
.chat-tool-panels {
  flex: 0 0 auto;
  background: #fff;
  border-bottom: 1px solid #d8dfdc;
}
.chat-tool-panel {
  padding: 8px 14px;
}
.chat-tool-panel[hidden] {
  display: none;
}
.chat-tool-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
}
.chat-tool-panel header a {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 6px;
  background: #17211d;
  color: #fff;
  text-decoration: none;
  font-size: 11px;
}
.chat-tool-panel header form {
  margin: 0;
}
.chat-thread-escape,
.chat-tool-inline-form button {
  min-height: 22px;
  border: 0;
  border-radius: 6px;
  background: #98a29d;
  color: #fff;
  cursor: pointer;
  font-size: 11px;
}
.chat-tool-inline-form {
  margin: -4px 0 6px 8px;
}
.chat-tool-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px 34px;
  gap: 6px;
}
.chat-tool-search input {
  min-width: 0;
  min-height: 32px;
  border: 1px solid #cfd8d4;
  border-radius: 8px;
  padding: 7px 9px;
  font: inherit;
}
.chat-tool-search button,
.chat-message-actions button {
  border: 1px solid #17211d;
  border-radius: 6px;
  background: #17211d;
  color: #fff;
  cursor: pointer;
}
.chat-tool-search button.chat-btn-del {
  border-color: #98a29d;
  background: #98a29d;
}
.chat-tool-row {
  display: grid;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 7px;
  color: #17211d;
  text-decoration: none;
}
.chat-tool-row:hover,
.chat-tool-row.active {
  background: #edf2ef;
}
.chat-tool-row small,
.chat-active-thread {
  margin: 0;
  color: #66736e;
  font-size: 12px;
}
.chat-room-body {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
}
.chat-thread {
  min-height: 0;
  overflow: auto;
  padding: 14px;
  background: #f7f9f8;
}
.chat-day-separator {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #66736e;
  font-size: 12px;
  margin: 10px 0;
}
.chat-day-separator::before,
.chat-day-separator::after {
  content: "";
  height: 1px;
  flex: 1;
  background: #d8dfdc;
}
.chat-thread-message {
  max-width: 82%;
  padding: 8px 10px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e1e7e4;
}
.chat-thread-message.mine {
  margin-left: 38px;
  margin-right: auto;
  background: #fff;
  border-color: #e1e7e4;
}
.chat-thread-message.received {
  margin-right: auto;
}
.chat-thread-message.system {
  max-width: 82%;
  margin-left: 38px;
  margin-right: auto;
  padding: 3px 6px;
  background: #fff7e8;
  border-color: #ead7b8;
  color: #6b5a36;
  font-size: 11px;
  line-height: 1.15;
}
.chat-thread-message header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 12px;
}
.chat-message-author {
  display: inline-flex;
  min-width: 0;
  align-items: baseline;
  gap: 8px;
}
.chat-message-actions {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
}
.chat-message-actions form {
  margin: 0;
}
.chat-message-actions button {
  width: 24px;
  height: 22px;
  padding: 0;
  font-size: 11px;
  line-height: 1;
}
.chat-discussion-draft form {
  display: grid;
  gap: 8px;
}
.chat-discussion-draft label {
  display: grid;
  gap: 4px;
  color: #66736e;
  font-size: 12px;
}
.chat-discussion-draft input {
  min-width: 0;
  min-height: 30px;
  border: 1px solid #cfd8d4;
  border-radius: 7px;
  padding: 6px 8px;
  color: #17211d;
  font: inherit;
}
.chat-discussion-draft button {
  min-height: 24px;
  border: 0;
  border-radius: 6px;
  padding: 3px 8px;
  cursor: pointer;
  font-size: 12px;
}
.chat-message-actions button.discussion,
.chat-discussion-draft button.discussion {
  border-color: #2E8B57;
  background: #2E8B57;
  color: #fff;
}
.chat-message-actions button.thread {
  border-color: #007FFF;
  background: #007FFF;
  color: #fff;
}
.chat-message-actions button.chat-btn-del,
.chat-discussion-draft button.chat-btn-del {
  border-color: #98a29d;
  background: #98a29d;
  color: #fff;
}
.chat-thread-message header span {
  color: #66736e;
  font-size: 12px;
}
.chat-thread-message header strong {
  font-size: 12px;
}
.chat-thread-content {
  line-height: 1.42;
}
.chat-system-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  flex-wrap: nowrap;
}
.chat-system-meta {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}
.chat-file-download {
  display: inline-flex;
  flex: 0 0 auto;
  width: 58px;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 3px 7px;
  border-radius: 6px;
  background: #17211d;
  color: #fff;
  text-decoration: none;
  font-size: 11px;
  line-height: 1;
}
.chat-room-info {
  min-height: 0;
  border-left: 1px solid #d8dfdc;
  padding: 12px;
  overflow: auto;
}
.chat-room-info h3 {
  margin: 0 0 10px;
  font-size: 14px;
}
.chat-room-info-section {
  margin-bottom: 18px;
}
.chat-info-person,
.chat-info-relation,
.chat-room-info p {
  display: grid;
  gap: 3px;
  margin: 0 0 12px;
}
.chat-info-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chat-info-actions a,
.chat-info-relation a {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #cfd8d4;
  background: #fff;
  color: #17211d;
  text-decoration: none;
  font-size: 12px;
}
.chat-info-actions a:hover,
.chat-info-relation a:hover {
  background: #edf2ef;
}
.chat-info-file-link {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: stretch;
}
.chat-info-file-link span,
.chat-info-file-link a {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  border: 1px solid #17211d;
  background: #17211d;
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  line-height: 1;
}
.chat-info-file-link span {
  padding: 3px 6px;
  border-radius: 6px 0 0 6px;
  font-weight: 700;
}
.chat-info-file-link a {
  min-width: 58px;
  max-width: 72px;
  overflow: hidden;
  padding: 3px 8px;
  border-left: 1px solid rgba(255,255,255,.25);
  border-radius: 0 6px 6px 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-info-file-link a:hover {
  background: #25332e;
}
.chat-info-relation {
  border-top: 1px solid #edf2ef;
  padding-top: 8px;
}
.chat-info-relation span {
  color: #66736e;
  font-size: 11px;
  text-transform: uppercase;
}
.chat-info-relation .chat-info-file-link span {
  color: #fff;
  font-size: 12px;
  text-transform: none;
}
.chat-room-info span,
.chat-room-info small,
.chat-info-relation small {
  color: #66736e;
  font-size: 12px;
}
.chat-room-info .chat-info-file-link span,
.chat-room-info .chat-info-file-link a {
  color: #fff;
}
.chat-composer {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border-top: 1px solid #d8dfdc;
  background: #fff;
}
.chat-composer-tools {
  position: relative;
  display: grid;
  gap: 5px;
  align-self: stretch;
  align-content: end;
}
.chat-composer-tools select {
  width: 74px;
  min-height: 28px;
  border: 1px solid #cfd8d4;
  border-radius: 7px;
  background: #fff;
  color: #17211d;
  font: inherit;
  font-size: 12px;
}
.chat-composer-actions {
  display: grid;
  grid-template-columns: 34px 34px;
  gap: 6px;
}
.chat-composer-menu-list {
  position: absolute;
  left: 0;
  bottom: 39px;
  z-index: 10;
  min-width: 150px;
  border: 1px solid #cfd8d4;
  border-radius: 8px;
  background: #fff;
  padding: 6px;
  box-shadow: 0 12px 28px rgba(0,0,0,.15);
}
.chat-composer-menu-list button {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #17211d;
  text-align: left;
  padding: 8px;
  cursor: pointer;
  font: inherit;
}
.chat-composer-menu-list button:hover {
  background: #edf2ef;
}
.chat-storage-picker {
  position: absolute;
  left: 0;
  bottom: 39px;
  z-index: 12;
  width: min(420px, 72vw);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  border: 1px solid #cfd8d4;
  border-radius: 8px;
  background: #fff;
  padding: 7px;
  box-shadow: 0 12px 28px rgba(0,0,0,.15);
}
.chat-storage-picker[hidden] {
  display: none;
}
.chat-storage-picker select {
  min-width: 0;
  border: 1px solid #cfd8d4;
  border-radius: 7px;
  padding: 7px;
  font: inherit;
  font-size: 12px;
}
.chat-storage-picker button {
  border: 1px solid #17211d;
  border-radius: 7px;
  background: #17211d;
  color: #fff;
  cursor: pointer;
  padding: 7px 10px;
}
.chat-storage-picker p {
  grid-column: 1 / -1;
  margin: 0;
  color: #66736e;
  font-size: 12px;
}
.chat-emoji-palette {
  position: absolute;
  left: 0;
  bottom: 39px;
  z-index: 11;
  width: 190px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  border: 1px solid #cfd8d4;
  border-radius: 8px;
  background: #fff;
  padding: 6px;
  box-shadow: 0 12px 28px rgba(0,0,0,.15);
}
.chat-emoji-palette[hidden] {
  display: none;
}
.chat-emoji-palette button {
  min-height: 30px;
  border: 1px solid #e1e7e4;
  border-radius: 6px;
  background: #f7f9f8;
  cursor: pointer;
}
.chat-emoji-palette button:hover {
  background: #edf2ef;
}
.chat-composer-emoji {
  width: 34px;
  height: 34px;
  border: 1px solid #cfd8d4;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 11px;
}
.chat-composer-input {
  min-width: 0;
}
.chat-composer textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 38px;
  max-height: 120px;
  resize: vertical;
  border: 1px solid #cfd8d4;
  border-radius: 8px;
  padding: 9px;
  font: inherit;
}
.chat-composer .html-editor-holder {
  min-width: 0;
}
.chat-composer .html-editor-holder .ql-toolbar.ql-snow {
  border: 1px solid #cfd8d4;
  border-radius: 8px 8px 0 0;
  padding: 4px;
}
.chat-composer .html-editor-surface {
  min-height: 62px;
  max-height: 150px;
  overflow: auto;
  background: #fff;
  border: 1px solid #cfd8d4;
  border-top: 0;
  border-radius: 0 0 8px 8px;
}
.chat-composer .ql-editor {
  min-height: 60px;
  padding: 8px 9px;
}
.chat-room-placeholder {
  margin: auto;
  text-align: center;
  max-width: 420px;
  color: #66736e;
}
.chat-empty {
  padding: 12px;
}

.wmag-chat-button {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 99980;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 28px;
  background: #17211d;
  color: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
  cursor: pointer;
  font-size: 20px;
}
.wmag-chat-button.is-blinking {
  animation: wmagChatBlink .9s infinite alternate;
}
.wmag-chat-button.is-loading {
  background: #66736e;
}
.wmag-chat-button.is-error {
  background: #8f1d1d;
}
@keyframes wmagChatBlink {
  from { background: #17211d; }
  to { background: #f04f8b; }
}
.wmag-chat-holder {
  position: fixed;
  right: 18px;
  bottom: 86px;
  z-index: 99981;
  width: min(360px, calc(100vw - 36px));
  height: min(520px, calc(100vh - 120px));
  display: none;
  border: 1px solid #cfd8d4;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(0, 0, 0, .24);
  overflow: hidden;
}
.wmag-chat-holder-frame {
  width: min(1180px, calc(100vw - 36px));
  height: min(760px, calc(100vh - 112px));
}
.wmag-chat-holder.is-open {
  display: flex;
  flex-direction: column;
}
.wmag-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #17211d;
  color: #fff;
}
.wmag-chat-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border-bottom: 1px solid #e1e7e4;
  background: #f7f9f8;
}
.wmag-chat-actions[hidden] {
  display: none;
}
.wmag-chat-action {
  border: 1px solid #cfd8d4;
  background: #fff;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  color: #17211d;
  cursor: pointer;
}
.wmag-chat-action:hover {
  border-color: #66736e;
}
.wmag-chat-close {
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 20px;
}
.wmag-chat-frame {
  flex: 1;
  min-height: 0;
  width: 100%;
  border: 0;
  background: #fff;
}
.chat-body-widget {
  margin: 0;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  background: #fff;
}
.chat-body-widget .chat-panel {
  border: 0;
  border-radius: 0;
  padding: 0;
}
.chat-body-widget .chat-workspace {
  border: 0;
  border-radius: 0;
  height: 100vh;
}
.wmag-chat-messages {
  flex: 1;
  overflow: auto;
  padding: 12px;
  background: #f7f9f8;
}
.wmag-chat-msg {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e1e7e4;
}
.wmag-chat-msg strong {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
}
.wmag-chat-form {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #e1e7e4;
}
.wmag-chat-toolbar {
  display: flex;
  gap: 6px;
  align-items: center;
}
.wmag-chat-tool {
  border: 1px solid #cfd8d4;
  background: #fff;
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
}
.wmag-chat-tool.active {
  background: #17211d;
  color: #fff;
}
.wmag-chat-compose {
  display: flex;
  gap: 8px;
}
.wmag-chat-input {
  flex: 1;
  min-height: 42px;
  resize: none;
  border: 1px solid #cfd8d4;
  border-radius: 8px;
  padding: 8px;
  font: inherit;
}
.wmag-chat-editor {
  flex: 1;
  min-height: 42px;
  max-height: 120px;
  overflow: auto;
  border: 1px solid #cfd8d4;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}
.wmag-chat-send {
  border: 0;
  border-radius: 8px;
  background: #17211d;
  color: #fff;
  padding: 0 14px;
  cursor: pointer;
}
@media (max-width: 760px) {
  .chat-hero,
  .chat-app-shell,
  .chat-app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }
  .chat-inline-form {
    grid-template-columns: 1fr;
  }
  .chat-sidebar {
    border-right: 0;
    border-bottom: 1px solid #d8dfdc;
  }
  .chat-conversation-grid {
    grid-template-columns: 1fr;
  }
  .chat-workspace {
    height: auto;
    min-height: 0;
    grid-template-columns: 44px minmax(0, 1fr);
  }
  .chat-room-list {
    min-height: 360px;
  }
  .chat-room-view {
    grid-column: 1 / -1;
    min-height: 520px;
    border-top: 1px solid #d8dfdc;
  }
  .chat-room-body {
    grid-template-columns: 1fr;
  }
  .chat-room-info {
    display: none;
  }
}
