/* App-owned UI polish layered after the generated Tailwind bundle. */

.ce-icon-action,
a.ce-icon-action:hover {
  text-decoration: none;
}

.ce-control > label {
  order: -1;
}

.login-card {
  width: min(380px, calc(100vw - 2rem));
}

.global-search-clear {
  align-self: end;
  justify-self: start;
}

.ce-dialog-chat-settings {
  width: min(760px, calc(100vw - 2rem));
}

.chat-settings-tabs {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  padding: .5rem 1rem;
}

.chat-settings-tab {
  align-items: center;
  border: 1px solid transparent;
  border-radius: .375rem;
  color: #475569;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: .875rem;
  font-weight: 600;
  gap: .375rem;
  min-height: 2.25rem;
  padding: .45rem .75rem;
}

.chat-settings-tab:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.chat-settings-tab.active {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #0369a1;
}

.chat-settings-tab:focus-visible {
  outline: 2px solid #0ea5e9;
  outline-offset: 2px;
}

.chat-settings-tab-count {
  background: #e2e8f0;
  border-radius: 999px;
  color: #475569;
  font-size: .6875rem;
  line-height: 1;
  min-width: 1.25rem;
  padding: .25rem .375rem;
  text-align: center;
}

.chat-settings-tab.active .chat-settings-tab-count {
  background: #bae6fd;
  color: #075985;
}

.chat-settings-body {
  background: #f8fafc;
}

.chat-settings-summary {
  align-items: center;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .5rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: auto minmax(0, 1fr);
  margin-bottom: 1rem;
  padding: .875rem;
}

.chat-settings-summary-avatar {
  font-size: 1.5rem;
  height: 4rem;
  width: 4rem;
}

.chat-settings-summary-main {
  min-width: 0;
}

.chat-settings-title-line {
  align-items: center;
  color: #0f172a;
  display: flex;
  gap: .5rem;
  min-width: 0;
}

.chat-settings-title-line strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-settings-summary-sub {
  color: #64748b;
  font-size: .8125rem;
  margin-top: .15rem;
}

.chat-settings-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: .375rem;
  margin-top: .625rem;
}

.chat-settings-chip {
  background: #f1f5f9;
  border-radius: 999px;
  color: #475569;
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .025em;
  padding: .25rem .5rem;
  text-transform: uppercase;
}

.chat-settings-chip.info {
  background: #e0f2fe;
  color: #0369a1;
}

.chat-settings-chip.warn {
  background: #fef3c7;
  color: #92400e;
}

.chat-settings-chip.danger {
  background: #ffe4e6;
  color: #be123c;
}

.chat-settings-panel {
  margin-bottom: 0;
}

.chat-settings-panel h3 {
  margin-bottom: .75rem;
}

.chat-batch-list-actions {
  align-items: stretch;
}

.chat-batch-list-picker,
.ctx-list-picker {
  display: flex;
  gap: .375rem;
  max-width: 100%;
  overflow-x: auto;
  padding-block: .125rem;
}

.chat-batch-list-picker {
  flex: 1 1 12rem;
}

.chat-batch-list-option,
.ctx-list-option {
  align-items: flex-start;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: .375rem;
  color: #334155;
  display: inline-flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: .125rem;
  max-width: 12rem;
  min-width: 8rem;
  padding: .45rem .625rem;
  text-align: left;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.chat-batch-list-option:hover,
.ctx-list-option:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.chat-batch-list-option.active,
.ctx-list-option.active {
  background: #f0f9ff;
  border-color: #7dd3fc;
  color: #0369a1;
}

.chat-batch-list-option:focus-visible,
.ctx-list-option:focus-visible {
  outline: 2px solid #0ea5e9;
  outline-offset: 2px;
}

.chat-batch-list-name,
.ctx-list-name {
  font-size: .8125rem;
  font-weight: 600;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-batch-list-count,
.ctx-list-count,
.chat-batch-list-empty {
  color: #64748b;
  font-size: .6875rem;
  line-height: 1.2;
}

.chat-batch-list-empty {
  align-self: center;
  padding-inline: .25rem;
}

.chat-list-picker-tools {
  display: grid;
  gap: .5rem;
  grid-template-columns: minmax(0, 1fr) auto auto;
  margin-bottom: .75rem;
}

.chat-list-picker-tools input {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: .375rem;
  color: #0f172a;
  font-size: .875rem;
  min-width: 0;
  padding: .5rem .75rem;
}

.chat-list-picker-tools input:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 2px #e0f2fe;
  outline: none;
}

.user-chat-option input:checked + .user-chat-main .user-chat-title {
  color: #0369a1;
}

.ctx-list-picker {
  flex-direction: column;
  max-height: 12rem;
  overflow-x: hidden;
  overflow-y: auto;
  padding: .25rem;
}

.ctx-list-option {
  width: 100%;
}

.ctx-empty.compact {
  padding-block: .75rem;
}

@media (max-width: 760px) {
  .chat-list-picker-tools {
    grid-template-columns: minmax(0, 1fr);
  }
}

.ctx-menu {
  max-height: calc(100dvh - 1rem);
  overflow: auto;
}

.chat-hide-all-row {
  margin-top: .75rem;
}

.chat-settings-list-grid {
  max-height: 14rem;
  overflow: auto;
  padding-right: .125rem;
}

.chat-settings-list-option {
  align-items: center;
}

.participants .pt-row {
  align-items: center;
  display: grid;
  gap: .75rem;
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.participants .pt-row.is-me {
  background: #f0f9ff;
  border-color: #7dd3fc;
}

.pt-name,
.pt-name-input {
  min-width: 0;
}

.pt-name {
  color: #334155;
  font-weight: 600;
}

.pt-name-input {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: .375rem;
  color: #0f172a;
  padding: .45rem .625rem;
}

.pt-name-input:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 2px #e0f2fe;
  outline: none;
}

.pt-count {
  color: #64748b;
  font-size: .75rem;
  white-space: nowrap;
}

.pt-me {
  align-items: center;
  color: #334155;
  display: inline-flex;
  font-size: .8125rem;
  font-weight: 600;
  gap: .375rem;
  white-space: nowrap;
}

.sources .src {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .5rem;
  padding: .875rem;
}

.sources .src.disabled {
  background: #f8fafc;
  opacity: .68;
}

.src-top {
  align-items: center;
  display: flex;
  gap: .75rem;
  justify-content: space-between;
}

.src-name {
  color: #0f172a;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.src-stats {
  color: #64748b;
  font-size: .8125rem;
  margin-top: .375rem;
}

.src-ctl {
  align-items: center;
  display: flex;
  gap: .75rem;
  justify-content: space-between;
  margin-top: .75rem;
}

.src-ctl > label {
  color: #64748b;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .025em;
  text-transform: uppercase;
}

.prio {
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: .375rem;
  display: inline-flex;
  overflow: hidden;
}

.prio button,
.prio span {
  align-items: center;
  background: #fff;
  display: inline-flex;
  height: 2rem;
  justify-content: center;
  min-width: 2.25rem;
}

.prio button {
  color: #475569;
}

.prio button:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.prio button:disabled {
  color: #cbd5e1;
  cursor: not-allowed;
}

.prio button svg {
  height: 1rem;
  width: 1rem;
}

.prio span {
  border-left: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  color: #0f172a;
  font-size: .875rem;
  font-weight: 700;
}

.switch {
  cursor: pointer;
  display: inline-flex;
}

.switch input {
  opacity: 0;
  pointer-events: none;
  position: absolute;
}

.switch .track {
  background: #cbd5e1;
  border-radius: 999px;
  height: 1.35rem;
  position: relative;
  transition: background-color .15s ease;
  width: 2.45rem;
}

.switch .track::after {
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgb(15 23 42 / .18);
  content: "";
  height: 1.05rem;
  left: .15rem;
  position: absolute;
  top: .15rem;
  transition: transform .15s ease;
  width: 1.05rem;
}

.switch input:checked + .track {
  background: #0ea5e9;
}

.switch input:focus-visible + .track {
  outline: 2px solid #0ea5e9;
  outline-offset: 2px;
}

.switch input:checked + .track::after {
  transform: translateX(1.1rem);
}

.chat-cog {
  opacity: .85;
}

.chat-item:hover .chat-cog,
.chat-cog:focus-visible {
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  .chat-cog {
    opacity: 0;
  }

  .chat-item:hover .chat-cog,
  .chat-cog:focus-visible {
    opacity: 1;
  }
}

@media (max-width: 760px) {
  .ce-dialog-chat-settings {
    width: 100vw;
  }

  .chat-settings-tabs {
    padding-inline: .75rem;
  }

  .chat-settings-summary {
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
  }

  .profile-edit {
    flex-direction: column;
  }

  .profile-btns {
    justify-content: flex-start;
  }

  .participants .pt-row {
    grid-template-columns: minmax(0, 1fr);
  }
}
