/* app-specific layout on top of win95.css */

#desktop-icon-messenger {
  top: 16px;
  left: 16px;
}

#desktop-icon-recycle {
  top: 112px;
  left: 16px;
}

#desktop-icon-download {
  top: 208px;
  left: 16px;
}

#download-window {
  width: 380px;
  top: 110px;
  left: calc(50% - 190px);
}

.download-body {
  gap: 10px;
}

.download-facts {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#download-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: #000;
}

#login-window {
  width: 340px;
  top: 120px;
  left: calc(50% - 170px);
}

.login-body {
  gap: 10px;
}

.login-intro {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.login-intro .icon-glyph {
  width: 32px;
  height: 32px;
  flex: none;
}

.login-intro p {
  margin: 0;
  font-size: 12px;
}

.login-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 4px;
}

/* ---------------- Messenger window ---------------- */

#messenger-window {
  width: 760px;
  height: 520px;
  top: 40px;
  left: calc(50% - 380px);
}

#messenger-window .window-body {
  padding: 0;
  flex-direction: row;
}

.msgr-sidebar {
  width: 190px;
  flex: none;
  display: flex;
  flex-direction: column;
  border-right: 2px solid var(--w95-face-dark);
  background: var(--w95-face);
}

.msgr-user-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-bottom: 2px solid var(--w95-face-dark);
}

.msgr-avatar {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 2px;
  background: var(--w95-titlebar-active-2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  overflow: hidden;
}

.msgr-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.msgr-user-info {
  min-width: 0;
}

.msgr-user-info .name {
  font-weight: bold;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msgr-user-info .status {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00a000;
  flex: none;
  box-shadow: inset -1px -1px 1px rgba(0, 0, 0, 0.4);
}

.status-dot.offline {
  background: #a0a0a0;
}

.admin-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: bold;
  color: #fff;
  background: #800000;
  border-radius: 2px;
  padding: 1px 4px;
  vertical-align: middle;
  letter-spacing: 0.5px;
}

.msgr-channels-scroll {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
}

.msgr-channel-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px 2px 8px;
}

.msgr-channel-label {
  font-size: 11px;
  font-weight: bold;
  color: #444;
}

.channel-add-btn {
  width: 16px;
  height: 16px;
  min-width: 0;
  padding: 0;
  line-height: 1;
  font-size: 12px;
  font-weight: bold;
  margin-right: 4px;
  cursor: pointer;
}

#text-channel-list,
#voice-channel-list {
  padding: 2px 4px;
}

.channel-item {
  position: relative;
  padding-right: 20px;
}

.channel-item .hash {
  opacity: 0.6;
  font-weight: bold;
}

.channel-delete-btn {
  display: none;
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  line-height: 14px;
  text-align: center;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  color: #800000;
}

.channel-item:hover .channel-delete-btn {
  display: block;
}

.channel-extra-actions {
  display: none;
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  gap: 2px;
}

.channel-item:hover .channel-extra-actions {
  display: flex;
}

.channel-extra-actions span {
  width: 14px;
  height: 14px;
  line-height: 13px;
  text-align: center;
  font-size: 10px;
  cursor: pointer;
  color: #333;
}

.ban-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: bold;
  color: #fff;
  background: #555;
  border-radius: 2px;
  padding: 1px 4px;
  margin-left: 4px;
  vertical-align: middle;
}

.voice-participants {
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 2px;
}

.voice-participant {
  font-size: 11px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-participant.muted {
  color: #888;
  font-style: italic;
}

#voice-status-bar {
  border-top: 2px solid var(--w95-face-dark);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--w95-face);
}

.voice-status-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-status-controls {
  display: flex;
  gap: 4px;
}

.voice-status-controls button {
  flex: 1;
  min-width: 0;
  padding: 3px 4px;
  font-size: 11px;
}

.voice-status-controls button.active {
  box-shadow: inset -1px -1px 0 0 var(--w95-face-lighter),
    inset 1px 1px 0 0 var(--w95-face-darker),
    inset -2px -2px 0 0 var(--w95-face-light),
    inset 2px 2px 0 0 var(--w95-face-dark);
}

.msgr-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.msgr-channel-header {
  padding: 6px 10px;
  border-bottom: 2px solid var(--w95-face-dark);
  background: var(--w95-face);
  display: flex;
  flex-direction: column;
}

.msgr-channel-header .title {
  font-weight: bold;
  font-size: 14px;
}

.msgr-channel-header .topic {
  font-size: 11px;
  color: #444;
}

.msgr-channel-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.msgr-channel-header-titles {
  flex: 1;
  min-width: 0;
}

#mobile-menu-btn {
  display: none;
  flex: none;
  min-width: 0;
  padding: 4px 8px;
}

#sidebar-overlay {
  display: none;
}

#pinned-toggle-btn {
  flex: none;
  min-width: 0;
  padding: 3px 6px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
}

#pinned-panel {
  margin-top: 6px;
  max-height: 120px;
  overflow-y: auto;
  border-top: 1px solid var(--w95-face-dark);
  padding-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pinned-message-row {
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.pinned-message-row .pinned-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.pinned-unpin-btn {
  cursor: pointer;
  color: #800000;
  font-size: 10px;
  flex: none;
}

#typing-indicator {
  font-size: 11px;
  font-style: italic;
  color: #555;
  padding: 0 12px;
  height: 16px;
}

#attach-button {
  flex: none;
  min-width: 0;
  padding: 4px 8px;
}

#attach-preview {
  margin: 0 8px 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 3px 6px;
  background: #fff;
  box-shadow: inset -1px -1px 0 0 var(--w95-face-lighter),
    inset 1px 1px 0 0 var(--w95-face-darker),
    inset -2px -2px 0 0 var(--w95-face-light),
    inset 2px 2px 0 0 var(--w95-face-dark);
}

#attach-preview .remove-attach {
  cursor: pointer;
  color: #800000;
  font-weight: bold;
}

#dm-list {
  padding: 2px 4px;
}

.dm-item {
  position: relative;
  padding-right: 20px;
}

#message-list {
  flex: 1;
  margin: 8px 8px 4px;
  padding: 8px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message-row {
  display: flex;
  gap: 8px;
  position: relative;
  padding-right: 20px;
}

.message-actions {
  display: none;
  position: absolute;
  right: 0;
  top: -2px;
  gap: 3px;
  background: var(--w95-face);
  box-shadow: inset -1px -1px 0 0 var(--w95-face-darker),
    inset 1px 1px 0 0 var(--w95-face-lighter),
    inset -2px -2px 0 0 var(--w95-face-dark),
    inset 2px 2px 0 0 var(--w95-face-light);
  padding: 1px 2px;
}

.message-row:hover .message-actions {
  display: flex;
}

.message-actions span {
  width: 16px;
  height: 16px;
  line-height: 15px;
  text-align: center;
  font-size: 11px;
  cursor: pointer;
  color: #333;
}

.message-actions .message-delete-btn {
  color: #800000;
  font-weight: bold;
}

.message-row.mention-self {
  background: #fff6c8;
  outline: 1px dashed #d0b400;
}

.mention {
  color: #fff;
  background: var(--w95-titlebar-active-1);
  border-radius: 2px;
  padding: 0 3px;
  font-weight: bold;
}

.message-edited-tag {
  font-size: 10px;
  color: #888;
  font-style: italic;
}

.message-attachment {
  margin-top: 4px;
}

.message-attachment img {
  max-width: 260px;
  max-height: 200px;
  border: 1px solid var(--w95-face-dark);
  display: block;
}

.message-attachment .file-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 3px 6px;
  background: #fff;
  box-shadow: inset -1px -1px 0 0 var(--w95-face-lighter),
    inset 1px 1px 0 0 var(--w95-face-darker),
    inset -2px -2px 0 0 var(--w95-face-light),
    inset 2px 2px 0 0 var(--w95-face-dark);
  text-decoration: none;
  color: #000;
}

.message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.reaction-pill {
  font-size: 11px;
  padding: 1px 6px;
  cursor: pointer;
  background: var(--w95-face);
  box-shadow: inset -1px -1px 0 0 var(--w95-face-lighter),
    inset 1px 1px 0 0 var(--w95-face-darker),
    inset -2px -2px 0 0 var(--w95-face-light),
    inset 2px 2px 0 0 var(--w95-face-dark);
}

.reaction-pill.mine {
  box-shadow: inset -1px -1px 0 0 var(--w95-face-lighter),
    inset 1px 1px 0 0 var(--w95-face-darker),
    inset -2px -2px 0 0 var(--w95-face-dark),
    inset 2px 2px 0 0 var(--w95-face-light);
  background: #dbeaff;
}

.reaction-picker {
  position: absolute;
  right: 0;
  top: 16px;
  z-index: 50;
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--w95-face);
  box-shadow: inset -1px -1px 0 0 var(--w95-face-darker),
    inset 1px 1px 0 0 var(--w95-face-lighter),
    inset -2px -2px 0 0 var(--w95-face-dark),
    inset 2px 2px 0 0 var(--w95-face-light);
}

.reaction-picker span {
  font-size: 15px;
  cursor: pointer;
  padding: 1px 3px;
}

.message-edit-input {
  width: 100%;
}

.message-row .msgr-avatar {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

.message-content {
  min-width: 0;
}

.message-meta {
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.message-username {
  font-weight: bold;
  font-size: 12px;
  color: var(--w95-titlebar-active-1);
}

.message-time {
  font-size: 10px;
  color: #666;
}

.message-text {
  font-size: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.system-message {
  font-size: 11px;
  color: #555;
  font-style: italic;
  text-align: center;
}

.msgr-input-row {
  display: flex;
  gap: 6px;
  padding: 0 8px 8px;
}

#message-input {
  flex: 1;
}

.msgr-status-bar {
  border-top: none;
}

/* ---------------- Boot / Shutdown screens ---------------- */

#shutdown-screen {
  position: fixed;
  inset: 0;
  background: #1084d0;
  color: #fff;
  z-index: 20000;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: var(--w95-font);
  text-align: center;
}

#shutdown-screen.visible {
  display: flex;
}

#shutdown-screen .shutdown-box {
  max-width: 420px;
}

#shutdown-screen h1 {
  font-size: 22px;
  margin-bottom: 16px;
}

#shutdown-screen button {
  margin-top: 20px;
}

@media (max-width: 820px) {
  #messenger-window {
    width: calc(100vw - 16px);
    height: calc(100vh - 60px);
    left: 8px;
    top: 8px;
  }
  .msgr-sidebar {
    width: 140px;
  }
}

/* ---------------- Admin panel ---------------- */

#admin-window {
  width: 480px;
  height: 420px;
  top: 80px;
  left: calc(50% - 240px);
}

.admin-body {
  gap: 0;
}

.admin-panel-content {
  flex: 1;
  margin-top: -1px;
  padding: 8px;
  overflow-y: auto;
}

.admin-user-list,
.admin-log-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  background: var(--w95-face);
  box-shadow: inset -1px -1px 0 0 var(--w95-face-lighter),
    inset 1px 1px 0 0 var(--w95-face-darker),
    inset -2px -2px 0 0 var(--w95-face-light),
    inset 2px 2px 0 0 var(--w95-face-dark);
}

.admin-user-name {
  font-weight: bold;
  font-size: 12px;
  flex: 1;
}

.admin-user-date {
  font-size: 10px;
  color: #555;
  flex: none;
}

.admin-user-actions {
  display: flex;
  gap: 4px;
  flex: none;
}

.admin-user-actions button {
  font-size: 11px;
  padding: 3px 6px;
  min-width: 0;
}

.admin-user-self-note {
  font-size: 11px;
  color: #888;
  font-style: italic;
}

.admin-log-row {
  display: flex;
  gap: 8px;
  font-size: 11px;
  padding: 4px 0;
  border-bottom: 1px solid var(--w95-face-dark);
}

.admin-log-time {
  flex: none;
  color: #555;
  white-space: nowrap;
}

/* ================================================================
   Mobile layout -- below this width the Win95 "floating windows on
   a desktop" metaphor stops making sense, so windows go fullscreen
   and the sidebar becomes a slide-out drawer instead.
   ================================================================ */

@media (max-width: 700px) {
  .desktop-icon {
    display: none;
  }

  #taskbar {
    height: 44px;
    padding: 4px;
  }

  #start-button {
    height: 32px;
    padding: 0 12px;
  }

  #taskbar-windows {
    display: none;
  }

  #taskbar-clock {
    height: 32px;
    font-size: 13px;
  }

  #start-menu {
    left: 0;
    bottom: 47px;
    width: 100%;
  }

  .start-menu-item {
    padding: 12px 10px;
  }

  /* windows go fullscreen, edge-to-edge above the taskbar */
  .window {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: calc(100% - 44px) !important;
    margin: 0;
    padding: 0;
    max-width: none;
  }

  .window .title-bar {
    height: 32px;
    cursor: default;
  }

  .window .title-bar-controls button {
    width: 26px;
    height: 24px;
    font-size: 13px;
  }

  #messenger-window .window-body {
    position: relative;
    overflow: hidden;
  }

  /* sidebar becomes a slide-out drawer */
  .msgr-sidebar {
    position: absolute;
    inset: 0;
    z-index: 60;
    width: 82vw;
    max-width: 300px;
    transform: translateX(-100%);
    transition: transform 0.18s ease-out;
    box-shadow: 3px 0 10px rgba(0, 0, 0, 0.45);
  }

  .msgr-sidebar.open {
    transform: translateX(0);
  }

  #sidebar-overlay {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 55;
    background: rgba(0, 0, 0, 0.4);
  }

  #sidebar-overlay.visible {
    display: block;
  }

  .msgr-main {
    width: 100%;
  }

  #mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  /* touch has no hover -- so hover-gated controls must stay visible */
  .channel-delete-btn,
  .channel-extra-actions,
  .message-actions {
    display: flex !important;
  }

  .channel-extra-actions span,
  .channel-delete-btn {
    width: 20px;
    height: 20px;
    line-height: 19px;
    font-size: 13px;
  }

  .message-actions span {
    width: 22px;
    height: 22px;
    line-height: 21px;
    font-size: 14px;
  }

  .channel-add-btn {
    width: 24px;
    height: 24px;
    font-size: 15px;
  }

  /* prevent iOS Safari from auto-zooming on input focus */
  input.w95-input,
  .message-edit-input {
    font-size: 16px;
  }

  .msgr-input-row {
    padding: 6px 8px;
  }

  #attach-button,
  #send-button {
    min-width: 44px;
    padding: 6px 10px;
  }

  #admin-window {
    top: 0;
    left: 0;
  }

  .admin-user-row {
    flex-wrap: wrap;
  }

  .reaction-picker span {
    font-size: 20px;
    padding: 4px 6px;
  }

  #login-window {
    top: 0;
    left: 0;
  }

  .login-body {
    justify-content: center;
    height: 100%;
  }
}

/* ---------------- Toast ---------------- */

#toast {
  position: fixed;
  left: 50%;
  bottom: 46px;
  transform: translateX(-50%);
  z-index: 30000;
  background: var(--w95-face);
  box-shadow: inset -1px -1px 0 0 var(--w95-face-darker),
    inset 1px 1px 0 0 var(--w95-face-lighter),
    inset -2px -2px 0 0 var(--w95-face-dark),
    inset 2px 2px 0 0 var(--w95-face-light);
  padding: 8px 16px;
  font-size: 13px;
  white-space: nowrap;
}

/* ---------------- Account window ---------------- */

#account-window {
  width: 360px;
  top: 90px;
  left: calc(50% - 180px);
}

.account-body {
  gap: 14px;
}

.account-avatar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-avatar-preview {
  width: 48px;
  height: 48px;
  font-size: 18px;
  overflow: hidden;
}

.account-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-hint {
  font-size: 11px;
  color: #444;
  margin-top: 4px;
}

.account-fieldset {
  border: none;
  box-shadow: inset -1px -1px 0 0 var(--w95-face-lighter),
    inset 1px 1px 0 0 var(--w95-face-darker),
    inset -2px -2px 0 0 var(--w95-face-light),
    inset 2px 2px 0 0 var(--w95-face-dark);
  padding: 10px 12px 12px;
  margin: 0;
}

.account-fieldset legend {
  font-size: 11px;
  font-weight: bold;
  padding: 0 4px;
}

.account-danger .login-actions button {
  color: #800000;
}

/* ---------------- Search window ---------------- */

#search-window {
  width: 460px;
  height: 420px;
  top: 90px;
  left: calc(50% - 230px);
}

.search-body {
  gap: 0;
}

.search-results {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-result-row {
  padding: 6px 8px;
  cursor: pointer;
  border-bottom: 1px solid var(--w95-face-dark);
}

.search-result-row:hover {
  background: var(--w95-selection);
  color: #fff;
}

.search-result-meta {
  font-size: 11px;
  color: inherit;
  opacity: 0.7;
  display: flex;
  gap: 6px;
}

.search-result-text {
  font-size: 12px;
  margin-top: 2px;
}

/* ---------------- Unread badges ---------------- */

.channel-item.has-unread .channel-item-label {
  font-weight: bold;
}

.unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c00000;
  display: inline-block;
  margin-left: 4px;
  flex: none;
}

/* ---------------- Channel categories ---------------- */

.channel-category-label {
  font-size: 10px;
  font-weight: bold;
  color: #555;
  padding: 4px 8px 1px 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ---------------- Minesweeper ---------------- */

#minesweeper-window {
  width: auto;
  top: 120px;
  left: calc(50% - 140px);
}

.minesweeper-body {
  gap: 8px;
  align-items: flex-start;
}

.minesweeper-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  width: 100%;
  background: #c0c0c0;
}

.minesweeper-counter {
  background: #000;
  color: #f00;
  font-family: "Courier New", monospace;
  font-weight: bold;
  font-size: 18px;
  padding: 2px 6px;
  letter-spacing: 2px;
  min-width: 44px;
  text-align: center;
}

.minesweeper-face {
  width: 28px;
  height: 28px;
  font-size: 16px;
  padding: 0;
  min-width: 0;
  cursor: pointer;
}

.minesweeper-grid {
  display: grid;
  background: #808080;
  padding: 4px;
}

.ms-cell {
  width: 20px;
  height: 20px;
  font-size: 12px;
  font-weight: bold;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  background: var(--w95-face);
  box-shadow: inset -1px -1px 0 0 var(--w95-face-darker),
    inset 1px 1px 0 0 var(--w95-face-lighter),
    inset -2px -2px 0 0 var(--w95-face-dark),
    inset 2px 2px 0 0 var(--w95-face-light);
}

.ms-cell.revealed {
  box-shadow: inset 1px 1px 0 0 var(--w95-face-dark);
  cursor: default;
}

.ms-cell.mine.revealed {
  background: #c00000;
}

.ms-cell.n1 { color: #0000ff; }
.ms-cell.n2 { color: #008000; }
.ms-cell.n3 { color: #ff0000; }
.ms-cell.n4 { color: #000080; }
.ms-cell.n5 { color: #800000; }
.ms-cell.n6 { color: #008080; }
.ms-cell.n7 { color: #000000; }
.ms-cell.n8 { color: #808080; }

/* ---------------- Screensaver ---------------- */

#screensaver {
  position: fixed;
  inset: 0;
  z-index: 40000;
  background: #000;
  cursor: none;
}

/* ---------------- Markdown ---------------- */

.md-bold { font-weight: bold; }
.md-italic { font-style: italic; }
.md-strike { text-decoration: line-through; }

.md-code {
  font-family: "Courier New", monospace;
  background: #e8e8e8;
  border: 1px solid #a0a0a0;
  padding: 0 3px;
  border-radius: 2px;
}

.md-codeblock {
  display: block;
  font-family: "Courier New", monospace;
  background: #101010;
  color: #d0d0d0;
  padding: 6px 8px;
  margin: 4px 0;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 0 #000;
}

.md-spoiler {
  background: #202020;
  color: transparent;
  border-radius: 2px;
  cursor: pointer;
  transition: color 0.05s;
}

.md-spoiler.revealed {
  background: #d8d8d8;
  color: inherit;
}

.mention-everyone {
  background: #ffd66b;
  color: #4a3200;
  font-weight: bold;
  padding: 0 3px;
  border-radius: 2px;
}

/* ---------------- Reply banner + reply preview ---------------- */

#reply-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #ffffe1;
  border: 1px solid #808080;
  padding: 3px 8px;
  font-size: 11px;
  margin-bottom: 3px;
}

#reply-banner-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

#reply-banner-cancel {
  cursor: pointer;
  font-weight: bold;
  padding: 0 4px;
}

#reply-banner-cancel:hover {
  color: #c00;
}

.message-reply-preview {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #555;
  margin-bottom: 2px;
  padding-left: 4px;
  border-left: 2px solid #a0a0a0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  cursor: pointer;
}

.message-reply-preview .reply-username {
  font-weight: bold;
  color: #333;
  flex-shrink: 0;
}

.message-reply-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  opacity: 0.6;
}

.message-reply-btn:hover {
  opacity: 1;
}

/* ---------------- Emoji picker ---------------- */

.msgr-main {
  position: relative;
}

#emoji-picker-panel {
  position: absolute;
  bottom: 46px;
  right: 8px;
  width: 220px;
  max-height: 180px;
  overflow-y: auto;
  background: var(--w95-face);
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  z-index: 500;
}

#emoji-picker-panel .emoji-picker-btn {
  background: none;
  border: none;
  font-size: 16px;
  line-height: 1;
  padding: 3px;
  cursor: pointer;
  text-align: center;
}

#emoji-picker-panel .emoji-picker-btn:hover {
  background: #cbd7f0;
}

/* ---------------- Profile popup ---------------- */

#profile-popup {
  position: fixed;
  width: 220px;
  background: var(--w95-face);
  padding: 10px;
  z-index: 6000;
}

.profile-popup-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.profile-popup-avatar {
  width: 40px;
  height: 40px;
  font-size: 16px;
  flex-shrink: 0;
}

.profile-popup-name {
  font-weight: bold;
  font-size: 13px;
}

.profile-popup-status {
  font-size: 11px;
  color: #444;
  font-style: italic;
}

.profile-popup-meta {
  font-size: 11px;
  color: #333;
  border-top: 1px solid #808080;
  padding-top: 6px;
}

.profile-popup-meta div {
  margin-bottom: 3px;
}

/* ---------------- Voice: deafen + speaking indicator ---------------- */

#voice-deafen-btn.active {
  background: #c0c0c0;
  box-shadow: inset -1px -1px 0 0 var(--w95-face-lighter),
    inset 1px 1px 0 0 var(--w95-face-darker),
    inset -2px -2px 0 0 var(--w95-face-light),
    inset 2px 2px 0 0 var(--w95-face-dark);
}

.profile-trigger {
  cursor: pointer;
}

.message-row.reply-jump-highlight {
  background: #ffe89a;
  transition: background 0.3s;
}

.voice-participant.speaking {
  color: #1a7a1a;
  font-weight: bold;
  box-shadow: 0 0 0 1px #2ecc40 inset;
}
