.hq-day {
  align-self: center;
  margin: 6px 0 2px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
}

.hq-conv-top span {
  white-space: nowrap;
  flex-shrink: 0;
}

.hq-inbox-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.hq-inbox-head .hq-inbox-title h2 {
  margin: 0;
}

.hq-inbox-title button {
  border: 0;
  background: #25d366;
  color: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.hq-compose-row #toggle-templates {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #e2e8f0;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  cursor: pointer;
}

.hq-compose-row #toggle-templates svg {
  width: 18px;
  height: 18px;
  display: block;
}

.hq-compose-row #toggle-templates[aria-pressed="true"] {
  background: #0f172a;
  color: #fff;
}

.hq-new-contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin: 0 0 10px;
  position: relative;
  z-index: 2;
}

.hq-new-contact input,
.hq-template-params input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  color: #0f172a;
  background: #fff;
}

.hq-new-contact button,
.hq-template-params button {
  border: 0;
  background: #0f172a;
  color: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.hq-template-params {
  display: grid;
  gap: 6px;
  padding: 10px;
}

.hq-session-note {
  margin: 0 0 8px;
  font-size: 12px;
  color: #92400e;
  background: #fffbeb;
  border-radius: 8px;
  padding: 8px 10px;
}

button.hq-conv {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.hq-search {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  background: #fff;
  color: #0f172a;
}

.hq-search:focus {
  outline: 2px solid #bbf7d0;
  border-color: #25d366;
}

.hq-conv-main small {
  display: block;
  margin-top: 2px;
}

.hq-chat > header select,
.hq-chat > header select option {
  background: #fff;
  color: #0f172a;
}

.hq-chat > header select {
  max-width: 180px;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

body:has(.hq-inbox) {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

body:has(.hq-inbox) .main,
body:has(.hq-inbox) .content.split-on {
  min-height: 0;
  overflow: hidden;
}

body:has(.hq-inbox) .content.split-on {
  flex: 1;
}

body:has(.hq-inbox) .hq-inbox {
  height: auto;
  flex: 1;
  min-height: 0;
}

.hq-chat,
.hq-inbox-list,
.hq-info {
  min-height: 0;
}

.hq-chat > header {
  flex-wrap: nowrap;
  overflow-x: auto;
  flex-shrink: 0;
}

.hq-composer {
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.slash-wrap,
.hq-compose-row {
  min-width: 0;
}

.slash-wrap {
  flex: 1 1 auto;
}

.hq-emoji-wrap { position: relative; flex: 0 0 auto; }
.hq-emoji-wrap #toggle-emoji {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #e2e8f0;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.hq-emoji-wrap #toggle-emoji svg { width: 20px; height: 20px; display: block; }
.hq-emoji-wrap #toggle-emoji[aria-pressed="true"] { background: #0f172a; color: #fff; }
.hq-emoji {
  position: absolute;
  bottom: 46px;
  left: 0;
  z-index: 6;
  width: 320px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}
.hq-emoji input {
  width: 100%;
  box-sizing: border-box;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  outline: none;
}
.hq-emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  max-height: 220px;
  overflow: auto;
  padding: 8px;
}
.hq-emoji-grid button {
  width: 100%;
  aspect-ratio: 1;
  border: 0;
  background: transparent;
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.hq-emoji-grid button:hover { background: #f1f5f9; }
.hq-emoji-tabs {
  display: flex;
  border-top: 1px solid #f1f5f9;
}
.hq-emoji-tabs button {
  flex: 1;
  border: 0;
  background: #fff;
  padding: 8px 0;
  font-size: 16px;
  cursor: pointer;
}
.hq-emoji-tabs button.on { background: #f8fafc; }
.hq-attach-wrap { position: relative; flex: 0 0 auto; }
.hq-attach-wrap #toggle-attach {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #e2e8f0;
  color: #0f172a;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.hq-attach {
  position: absolute;
  bottom: 42px;
  left: 0;
  z-index: 5;
  min-width: 140px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
  overflow: hidden;
}
.hq-attach button {
  display: block;
  width: 100%;
  border: 0;
  background: #fff;
  text-align: left;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.hq-attach button:hover { background: #f8fafc; }
.hq-pending-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 13px;
}
.hq-pending-file button {
  border: 0;
  background: transparent;
  color: #b91c1c;
  font: inherit;
  cursor: pointer;
}
.hq-photo {
  display: block;
  max-width: min(260px, 100%);
  max-height: 280px;
  border-radius: 8px;
  margin-bottom: 6px;
}
.hq-doc, .hq-loc {
  display: block;
  margin-bottom: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  text-decoration: none;
}
.hq-loc span, .hq-loc em { display: block; font-size: 12px; }
.hq-translate {
  border: 0;
  background: transparent;
  color: #0369a1;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.hq-en {
  margin: 6px 0 0;
  padding-top: 6px;
  border-top: 1px solid rgba(15, 23, 42, 0.12);
  font-size: 13px;
}
.hq-en span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  opacity: 0.7;
}
.hq-loc strong { display: block; }

.hq-compose-row textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  padding: 10px 14px;
  line-height: 22px;
  font-family: inherit;
  overflow: hidden;
}

@media (max-width: 1280px) {
  .hq-inbox-list { width: 220px; }
  .hq-info { width: 220px; min-width: 0; }
}

@media (max-width: 1100px) {
  .hq-inbox { position: relative; }
  .hq-inbox-list { width: 200px; }
  .hq-info { display: none; }
  .hq-inbox.hq-info-open .hq-info {
    display: flex;
    position: absolute;
    z-index: 6;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(300px, 100%);
    box-shadow: -8px 0 24px rgba(15, 23, 42, 0.16);
  }
}

@media (max-width: 900px) {
  body:has(.hq-inbox) .sidebar {
    width: 100%;
    height: 52px;
    min-height: 52px;
    max-height: 52px;
    flex-direction: row;
    overflow: hidden;
  }
  body:has(.hq-inbox) .rq-brand,
  body:has(.hq-inbox) .sidebar-foot {
    display: none;
  }
  body:has(.hq-inbox) #nav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    padding: 6px 8px;
  }
  body:has(.hq-inbox) #nav .nav-label {
    display: none;
  }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rq-session {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
  padding-left: 10px;
  border-left: 1px solid #e2e8f0;
}

.rq-session[hidden] {
  display: none !important;
}

.rq-session span {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}

.rq-session button {
  background: #fff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
