/* Focused interaction fixes layered over the main stylesheet. */

#system-feed {
  display: none !important;
}

.selected-user-hint {
  margin-left: auto;
  min-width: 0;
  color: #8d8d8d;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-row {
  align-items: stretch;
}

.composer-field {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  background: #141414;
  box-shadow: 0 0 0 1px rgba(223, 0, 255, 0.08);
}

.composer-field:focus-within {
  box-shadow: 0 0 0 2px rgba(223, 0, 255, 0.18);
}

.composer-field #input {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.composer-field #input:focus {
  outline: none;
}

#target-nickname.selected-target,
.reply-reference {
  flex: 0 1 auto;
  width: auto;
  max-width: 42%;
  min-width: 0;
  height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(223, 0, 255, 0.48);
  border-radius: 999px;
  background: rgba(223, 0, 255, 0.1);
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  outline: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-reference {
  border-color: rgba(255, 209, 102, 0.7);
  background: rgba(255, 209, 102, 0.1);
  color: #ffd166;
}

#send-private:disabled,
.mod-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
  filter: none;
}

#mod-tools {
  margin: 0 8px 8px;
}

.mod-permission-hint {
  color: #929292;
  font-size: 11px;
}

.mod-panel.no-target {
  border-color: #333;
}

.msg-item {
  position: relative;
  gap: 11px;
  padding: 7px 13px;
  border-bottom-color: #171717;
  font-size: 14px;
  line-height: 1.55;
}

.msg-time {
  min-width: 105px;
  color: #9b9b9b;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1.65;
  white-space: nowrap;
}

.msg-time--reply {
  border-radius: 4px;
  cursor: pointer;
  outline: none;
  transition: color 120ms ease, background 120ms ease;
}

.msg-time--reply:hover,
.msg-time--reply:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.msg-body,
.msg-text {
  color: #f1f1f1;
}

.msg-item[data-user] {
  --message-user-color-visible: var(--message-user-color, #f1f1f1);
}

.msg-item[data-user] .nick-link,
.msg-item[data-user] .msg-text {
  color: var(--message-user-color-visible, #f1f1f1);
}

.reply-time-reference {
  display: inline-block;
  margin: 0 2px;
  padding: 0 4px;
  border: 1px solid rgba(148, 180, 205, 0.24);
  border-radius: 4px;
  background: rgba(148, 180, 205, 0.09);
  color: #9aafc0;
  font-size: 0.92em;
  font-style: normal;
  white-space: nowrap;
}

button.reply-time-reference {
  font: inherit;
  font-size: 0.92em;
  cursor: pointer;
}

button.reply-time-reference:hover,
button.reply-time-reference:focus-visible {
  border-color: #ffd166;
  color: #ffd166;
}

#list-gen .msg-item.reply-jump-highlight,
#list-priv .msg-item.reply-jump-highlight {
  outline: 2px solid #ffd166;
  outline-offset: -2px;
  background: rgba(255, 209, 102, 0.16) !important;
}

:root[data-theme="light"] .reply-time-reference {
  border-color: rgba(48, 91, 120, 0.25);
  background: rgba(48, 91, 120, 0.08);
  color: #3d647e;
}

:root[data-theme="light"] #list-gen .msg-item.reply-jump-highlight,
:root[data-theme="light"] #list-priv .msg-item.reply-jump-highlight {
  background: rgba(177, 114, 0, 0.16) !important;
}

.addressed-nickname {
  color: var(--addressed-user-color, currentColor);
}

:root[data-theme="light"] .addressed-nickname {
  color: var(--addressed-user-color-light, currentColor);
}

.nick-link {
  font-size: 14px;
}

.msg-system-inline {
  border-left: 2px solid #6d6d6d;
  background: rgba(255, 255, 255, 0.025);
  color: #b9b9b9;
  font-style: italic;
}

.msg-system-inline__body {
  color: #b9b9b9;
}

.msg-time--system {
  color: #7e7e7e;
}

.msg-item.is-for-me {
  margin: 3px 7px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 209, 102, 0.62);
  border-left: 3px solid #ffd166;
  border-radius: 7px;
  background: rgba(255, 209, 102, 0.075);
  box-shadow: inset 0 0 0 1px rgba(255, 209, 102, 0.05);
}

.msg-item.is-for-me .msg-time {
  color: #ffd166;
}

.chat-color-picker {
  position: relative;
  margin-left: auto;
}

.chat-color-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 25px;
  padding: 0 9px;
  border: 1px solid #3b3b3b;
  border-radius: 7px;
  background: #171717;
  color: #d9d9d9;
  cursor: pointer;
  font-size: 11px;
}

.chat-color-button:disabled {
  cursor: default;
  opacity: 0.88;
}

.chat-color-swatch,
.chat-color-option__swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  box-shadow: 0 0 7px rgba(255, 255, 255, 0.16);
}

.chat-color-menu {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 4000;
  display: grid;
  width: 190px;
  max-height: calc(100dvh - 16px);
  padding: 7px;
  gap: 4px;
  overflow-y: auto;
  border: 1px solid #383838;
  border-radius: 9px;
  background: #111;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.72);
}

.chat-color-palette {
  display: grid;
  grid-template-columns: repeat(6, 25px);
  justify-content: center;
  gap: 5px;
  padding-bottom: 7px;
}

.chat-color-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  min-height: 25px;
  padding: 3px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

.chat-color-option:hover,
.chat-color-option.is-selected {
  border-color: rgba(255, 255, 255, 0.78);
  background: #242424;
}

.chat-color-option:hover {
  transform: scale(1.08);
}

.chat-color-option.is-selected {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.22);
}

.chat-color-option__swatch {
  width: 17px;
  height: 17px;
  flex-basis: 17px;
}

.chat-color-locked {
  padding: 8px;
  color: #bdbdbd;
  font-size: 11px;
  line-height: 1.4;
}

@media (max-width: 768px) {
  .tools-row {
    flex-wrap: nowrap;
  }

  .selected-user-hint {
    display: none;
  }

  .composer-row {
    gap: 5px;
    padding: 7px;
  }

  .composer-field {
    padding: 0 6px;
  }

  #target-nickname.selected-target,
  .reply-reference {
    max-width: 34%;
    padding: 0 7px;
  }

  .composer-row .btn {
    padding: 0 10px;
  }

  .layout-toolbar {
    flex-wrap: wrap;
  }

  .chat-color-picker {
    margin-left: 0;
  }

  .chat-color-menu {
    right: auto;
    left: 0;
  }

  .msg-item {
    gap: 8px;
    padding: 7px 9px;
    font-size: 14px;
  }

  .msg-time {
    min-width: 96px;
    font-size: 11px;
  }

  .msg-item.is-for-me {
    margin: 3px 4px;
  }
}
