/* Today inbox feed — ALSTAR-compatible, mobile-first cards */
.bchat-today-inbox,
.bchat-today-inbox .box,
.bchat-today-inbox .box-body,
.bchat-today-shell,
.bchat-today-main,
.bchat-today-layout,
.bchat-today-toolbar,
.bchat-today-composer,
.bchat-today-feed,
.bchat-today-card {
  max-width: 100%;
  box-sizing: border-box;
}

.bchat-today-inbox {
  overflow-x: hidden;
}

.bchat-today-inbox .bchat-today-mock-banner {
  margin-bottom: 12px;
  word-break: break-word;
}

.bchat-today-shell > .box-header.bchat-today-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bchat-today-shell > .box-header .box-title {
  margin: 0;
  max-width: 100%;
}

.bchat-today-date-form {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

.bchat-today-date-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f4f6f9;
  border: 1px solid #d2d6de;
  border-radius: 16px;
  padding: 4px 10px;
  font-size: 12px;
  color: #444;
  white-space: nowrap;
  flex: 0 0 auto;
}

.bchat-today-day-select {
  min-width: 0;
  max-width: 100%;
}

.bchat-today-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  width: 100%;
}

.bchat-today-day-rail {
  flex: 0 0 112px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 12px;
}

.bchat-today-day-tab {
  display: block;
  text-align: center;
  padding: 10px 8px;
  border-radius: 10px;
  border: 1px solid #d2d6de;
  background: #fff;
  color: #444;
  text-decoration: none !important;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.bchat-today-day-tab:hover {
  border-color: #3c8dbc;
  color: #3c8dbc;
}

.bchat-today-day-tab.is-active {
  background: #3c8dbc;
  border-color: #367fa9;
  color: #fff;
}

.bchat-today-day-tab__label {
  display: block;
  font-weight: 700;
  font-size: 13px;
}

.bchat-today-day-tab__date {
  display: block;
  font-size: 11px;
  opacity: .85;
  margin-top: 2px;
  direction: ltr;
}

.bchat-today-main {
  flex: 1;
  min-width: 0;
  width: 100%;
}

.bchat-today-composer {
  background: #fff;
  border: 1px solid #d8dee6;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(16, 24, 40, 0.04);
  width: 100%;
}

.bchat-today-composer__row {
  margin-bottom: 8px;
}

.bchat-today-dest-open {
  text-align: right !important;
  border-radius: 10px !important;
  padding: 10px 12px !important;
  font-weight: 600;
  width: 100%;
  white-space: normal;
  word-break: break-word;
}

.bchat-today-composer__panel textarea {
  border-radius: 10px;
  resize: vertical;
  min-height: 76px;
  margin-bottom: 8px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.bchat-today-composer__toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bchat-today-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #555;
  cursor: pointer;
  margin: 0;
  font-weight: normal;
  max-width: 100%;
}

.bchat-today-tool input.hidden {
  display: none !important;
}

.bchat-today-mic {
  border: 0;
  background: transparent;
  padding: 4px 6px;
  border-radius: 8px;
}

.bchat-today-mic.is-recording {
  color: #c0392b;
  background: rgba(192, 57, 43, 0.08);
  animation: bchatTodayPulse 1s infinite;
}

.bchat-today-mic-status {
  font-size: 11px;
  color: #666;
  max-width: 100%;
  word-break: break-word;
}

@keyframes bchatTodayPulse {
  50% { opacity: .55; }
}

.bchat-today-file-name {
  font-size: 11px;
  color: #666;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bchat-today-composer__send {
  margin-right: auto;
  border-radius: 8px !important;
  font-weight: 600;
}

.bchat-today-composer__hint {
  margin: 8px 0 0;
  font-size: 12px;
  word-break: break-word;
}

.bchat-today-composer__status,
.bchat-today-inline-status {
  margin-top: 6px;
  font-size: 12px;
  word-break: break-word;
}

.bchat-today-composer__status.is-ok,
.bchat-today-inline-status.is-ok {
  color: #1e8449;
}

.bchat-today-composer__status.is-err,
.bchat-today-inline-status.is-err {
  color: #c0392b;
}

.bchat-today-toolbar {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  width: 100%;
}

.bchat-today-search {
  position: relative;
  width: 100%;
  max-width: 100%;
}

.bchat-today-search > i {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
  pointer-events: none;
  z-index: 1;
}

.bchat-today-search .form-control {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding-right: 34px;
  padding-left: 12px;
  border-radius: 10px;
  display: block;
}

.bchat-today-filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  width: 100%;
  max-width: 100%;
}

.bchat-today-filter {
  border: 1px solid #d2d6de;
  background: #fff;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  color: #444;
  flex: 0 0 auto;
  white-space: nowrap;
}

.bchat-today-filter.is-active {
  background: #3c8dbc;
  border-color: #367fa9;
  color: #fff;
}

.bchat-today-count {
  font-size: 12px;
  color: #777;
}

.bchat-today-date-sep {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 16px;
  color: #666;
  font-size: 13px;
  font-weight: 600;
  max-width: 100%;
}

.bchat-today-date-sep > span {
  flex: 0 1 auto;
  min-width: 0;
  text-align: center;
  word-break: break-word;
}

.bchat-today-date-sep::before,
.bchat-today-date-sep::after {
  content: "";
  flex: 1 1 12px;
  min-width: 8px;
  height: 1px;
  background: #e5e8ec;
}

.bchat-today-feed {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.bchat-today-card {
  background: #fff;
  border: 1px solid #e6e9ee;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(16, 24, 40, 0.06);
  padding: 14px 14px 12px;
  width: 100%;
}

.bchat-today-card__meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  width: 100%;
}

.bchat-today-card__identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.bchat-today-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5dade2, #3c8dbc);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 36px;
}

.bchat-today-card__badge {
  border-radius: 999px !important;
  padding: 4px 10px !important;
  font-weight: 600;
  font-size: 11px !important;
  flex: 0 0 auto;
  white-space: nowrap;
}

.bchat-today-card__who {
  text-align: right;
  min-width: 0;
  flex: 1 1 auto;
}

.bchat-today-card__sender {
  display: block;
  font-size: 13px;
  color: #222;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bchat-today-card__time {
  display: block;
  font-size: 11px;
  color: #888;
  direction: ltr;
}

.bchat-today-card__dest,
.bchat-today-card__body {
  width: 100%;
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.bchat-today-card__dest {
  margin: 0 0 8px;
  font-size: 12px;
  color: #555;
}

.bchat-today-card__body {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.7;
  color: #333;
  white-space: pre-wrap;
}

.bchat-today-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.bchat-today-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 8px !important;
  border: 1px solid transparent;
  padding: 6px 12px !important;
  font-size: 12px !important;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none !important;
  cursor: pointer;
  background: #fff;
  max-width: 100%;
}

.bchat-today-action--ghost {
  border-color: #d8dee6;
  color: #445;
  background: #fff;
}

.bchat-today-action--ghost:hover {
  border-color: #3c8dbc;
  color: #3c8dbc;
}

.bchat-today-action--primary {
  background: #2f9e6b;
  border-color: #2f9e6b;
  color: #fff !important;
}

.bchat-today-action--primary:hover {
  background: #27885b;
  border-color: #27885b;
}

.bchat-today-card__go {
  margin-right: auto;
}

.bchat-today-inline-reply {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e5e8ec;
  width: 100%;
}

.bchat-today-inline-reply__row {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.bchat-today-inline-reply__row textarea {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  resize: vertical;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.bchat-today-pager {
  margin-top: 16px;
}

.bchat-today-empty,
.bchat-today-filter-empty {
  margin-top: 8px;
}

/* Destination modal */
body.bchat-today-modal-open {
  overflow: hidden;
}

.bchat-today-modal[hidden] {
  display: none !important;
}

.bchat-today-modal {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.bchat-today-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.bchat-today-modal__panel {
  position: relative;
  width: min(520px, 100%);
  max-height: min(80vh, 640px);
  overflow: auto;
  background: #2f80ed;
  color: #fff;
  border-radius: 16px;
  padding: 16px 16px 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
}

.bchat-today-modal__header h4 {
  margin: 0 28px 4px 0;
  font-weight: 700;
  word-break: break-word;
}

.bchat-today-modal__header .help-block {
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 10px;
}

.bchat-today-modal__close {
  position: absolute;
  left: 12px;
  top: 10px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 26px;
  line-height: 1;
}

.bchat-today-modal__search {
  position: relative;
  margin-bottom: 12px;
  width: 100%;
}

.bchat-today-modal__search > i {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
  pointer-events: none;
}

.bchat-today-modal__search .form-control {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding-right: 34px;
  border-radius: 10px;
}

.bchat-today-modal__list {
  display: grid;
  gap: 6px;
}

.bchat-today-dest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: right;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  color: #222;
  padding: 10px 12px;
  box-sizing: border-box;
  white-space: normal;
  word-break: break-word;
}

.bchat-today-dest-item.is-selected {
  outline: 2px solid #f1c40f;
}

@media (max-width: 991px) {
  .bchat-today-inbox .content,
  .bchat-today-inbox.section.content,
  section.bchat-today-inbox {
    padding-left: 6px !important;
    padding-right: 6px !important;
  }

  .bchat-today-inbox .row,
  .bchat-today-inbox [class*="col-"] {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
    float: none !important;
  }

  .bchat-today-shell > .box-body {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
}

@media (max-width: 767px) {
  .bchat-today-shell > .box-header.bchat-today-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .bchat-today-header .box-tools {
    float: none !important;
    width: 100%;
    position: static !important;
    margin: 0 !important;
  }

  .bchat-today-date-form {
    width: 100%;
    flex-wrap: nowrap;
  }

  .bchat-today-date-pill {
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
  }

  /* Day rail already switches days on mobile — hide cramped duplicate select */
  .bchat-today-day-select {
    display: none !important;
  }

  .bchat-today-layout {
    flex-direction: column;
    gap: 10px;
  }

  .bchat-today-day-rail {
    flex: none;
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    position: static;
    gap: 8px;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .bchat-today-day-tab {
    flex: 1 1 0;
    min-width: 96px;
  }

  .bchat-today-composer {
    padding: 10px;
    border-radius: 12px;
  }

  .bchat-today-composer__toolbar {
    gap: 8px;
  }

  .bchat-today-composer__send {
    margin-right: 0;
    width: 100%;
  }

  .bchat-today-file-name {
    max-width: 100px;
  }

  .bchat-today-search .form-control {
    font-size: 14px;
  }

  .bchat-today-card {
    padding: 12px;
    border-radius: 12px;
  }

  .bchat-today-card__meta {
    flex-wrap: wrap;
    gap: 8px;
  }

  .bchat-today-card__identity {
    flex: 1 1 100%;
    order: 2;
  }

  .bchat-today-card__badge {
    order: 1;
  }

  .bchat-today-card__who,
  .bchat-today-card__sender,
  .bchat-today-card__dest,
  .bchat-today-card__body {
    max-width: 100%;
    white-space: normal;
  }

  .bchat-today-card__sender {
    white-space: normal;
  }

  .bchat-today-card__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .bchat-today-card__go,
  .bchat-today-action {
    margin: 0;
    width: 100%;
  }

  .bchat-today-inline-reply__row {
    flex-direction: column;
    align-items: stretch;
  }

  .bchat-today-inline-reply__row .bchat-today-action {
    width: 100%;
  }

  .bchat-today-modal {
    padding: 10px;
    align-items: flex-end;
  }

  .bchat-today-modal__panel {
    width: 100%;
    max-height: 85vh;
    border-radius: 16px 16px 8px 8px;
  }
}

@media (max-width: 420px) {
  .bchat-today-inbox .content,
  .bchat-today-inbox.section.content,
  section.bchat-today-inbox {
    padding-left: 4px !important;
    padding-right: 4px !important;
  }

  .bchat-today-shell > .box-body {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  .bchat-today-avatar {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    font-size: 11px;
  }

  .bchat-today-card__badge {
    font-size: 10px !important;
    padding: 3px 8px !important;
  }

  .bchat-today-filter {
    padding: 4px 10px;
    font-size: 11px;
  }

  .bchat-today-day-tab {
    min-width: 84px;
    padding: 8px 6px;
  }
}
