.mod-chat-container,
.mod-chat-container * { box-sizing: border-box; }

.mod-chat-container {
  background: linear-gradient(180deg, rgba(7,14,28,.96), rgba(3,8,18,.98));
  border: 1px solid rgba(111,126,160,.14);
  color: #d7dceb;
  padding: 12px;
  font-family: Tektur, system-ui, sans-serif;
}

.mod-chat-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}

.mod-chat-title {
  display:inline-flex;
  align-items:center;
  min-height:28px;
  padding: 0 12px;
  border:1px solid rgba(199,73,109,.55);
  background: linear-gradient(180deg, rgba(51,14,28,.65), rgba(22,8,14,.5));
  color:#ff6a83;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.mod-chat-actions { display:flex; align-items:center; gap:6px; }
.mod-chat-btn {
  appearance:none; border:1px solid rgba(111,126,160,.16); cursor:pointer;
  background: rgba(17,24,40,.9); color:#aeb7ca; padding:6px 10px; font:600 12px/1 Tektur,system-ui,sans-serif;
}
.mod-chat-btn:hover, .mod-chat-btn:focus-visible { color:#fff; border-color: rgba(199,73,109,.45); }
.mod-chat-icon { padding-inline: 8px; }
.mod-chat-banned-alert { color:#ff6a83; font-size:12px; }

.mod-chat-list {
  height: 330px;
  overflow-y: auto;
  padding: 4px;
  background: linear-gradient(180deg, rgba(5,10,20,.65), rgba(2,6,14,.88));
  border: 1px solid rgba(111,126,160,.14);
}

.mod-chat-list::-webkit-scrollbar { width: 8px; }
.mod-chat-list::-webkit-scrollbar-track { background: transparent; }
.mod-chat-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #ff5f78, #c63d59);
  border-radius: 999px;
}

.mod-chat-loading,
.mod-chat-empty {
  color:#7f8aa2;
  padding:14px;
  text-align:center;
}

.mod-chat-message {
  background: linear-gradient(180deg, rgba(18,25,42,.94), rgba(8,13,24,.96));
  border:1px solid rgba(111,126,160,.12);
  padding: 10px 12px;
  margin-bottom: 10px;
}
.mod-chat-message:last-child { margin-bottom: 0; }
.mod-chat-message-top {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:8px;
}
.mod-chat-author-wrap { display:flex; align-items:center; gap:8px; min-width:0; }
.mod-chat-avatar-img {
  width: 24px; height:24px; border-radius:999px; flex:0 0 24px;
  border:1px solid rgba(255,255,255,.12); background:#b8c0d5; object-fit:cover; display:block; overflow:hidden;
}
.mod-chat-author {
  color:#eef2ff; text-decoration:none; font-weight:700; font-size:14px;
}
.mod-chat-author:hover { color:#fff; }
.mod-chat-date {
  flex: 0 0 auto; color:#98a3bb; font-size:12px; white-space:nowrap;
}
.mod-chat-text {
  color:#d4dae9; font-size:14px; line-height:1.45; word-break:break-word;
}
.mod-chat-text p { margin:0 0 6px; }
.mod-chat-text p:last-child { margin-bottom:0; }
.mod-chat-text img { max-width:100%; height:auto; }
.mod-chat-text blockquote,
.mod-chat-text .quote,
.mod-chat-text .title_quote,
.mod-chat-quote {
  margin:8px 0 0;
  padding:10px 12px;
  border-left:2px solid #ff5f78;
  background: linear-gradient(180deg, rgba(46,53,69,.58), rgba(24,30,43,.72));
  color:#b8c0d5;
}
.mod-chat-actions-inline {
  display:flex; gap:8px; margin-top:8px; opacity:.9; flex-wrap:wrap;
}
.mod-chat-act-btn {
  appearance:none; border:none; background:none; padding:0; cursor:pointer;
  color:#ff7a92; font:600 12px/1 Tektur,system-ui,sans-serif;
}
.mod-chat-act-btn:hover { color:#fff; }

.mod-chat-form { margin-top:10px; }
.mod-chat-editor {
  border: 1px solid rgba(111,126,160,.14);
  background: linear-gradient(180deg, rgba(5,10,20,.65), rgba(2,6,14,.88));
  overflow: hidden;
}
.mod-chat-form textarea {
  width:100%; min-height:84px; resize:vertical; border:none; outline:none;
  background:transparent; color:#eef2ff; padding:12px 14px;
  font: 14px/1.45 Tektur,system-ui,sans-serif;
}
.mod-chat-form textarea::placeholder { color:#7f8aa2; }
.mod-chat-send-row { display:flex; justify-content:flex-end; margin-top:10px; }
.mod-chat-btn-primary {
  appearance:none; cursor:pointer; border:1px solid rgba(199,73,109,.62);
  background: linear-gradient(180deg, #ff5f78, #e64561);
  color:#fff; min-height:38px; padding:0 16px; font:700 13px/1 Tektur,system-ui,sans-serif;
}
.mod-chat-btn-primary:hover { filter:brightness(1.05); }

.mod-chat-guest {
  margin-top:10px; padding:12px 14px; color:#b8c0d5;
  border:1px solid rgba(111,126,160,.14);
  background: linear-gradient(180deg, rgba(5,10,20,.65), rgba(2,6,14,.88));
}
.mod-chat-guest a { color:#ff7a92; text-decoration:none; }
.mod-chat-guest a:hover { color:#fff; }
.mod-chat-error { color:#ffd0d7; }

.mod-chat-archive-list { display:flex; flex-direction:column; gap:10px; }

#dle-popup-archive { padding:0 !important; overflow:hidden !important; }
#dle-popup-archive .mod-chat-archive-container {
  background: linear-gradient(180deg, rgba(7,14,28,.96), rgba(3,8,18,.98));
  color:#d7dceb;
  padding:14px;
}
#dle-popup-archive .mod-chat-pagination { display:flex; justify-content:center; gap:8px; margin-top:14px; }
#dle-popup-archive button {
  appearance:none; border:1px solid rgba(111,126,160,.16); cursor:pointer;
  background: rgba(17,24,40,.9); color:#aeb7ca; padding:6px 10px; font:600 12px/1 Tektur,system-ui,sans-serif;
}

.tox-tinymce { border:none !important; }
.tox .tox-edit-area__iframe { background:#08101d !important; }

@media (max-width: 640px) {
  .mod-chat-list { height: 280px; }
  .mod-chat-message-top { gap:8px; }
  .mod-chat-date { font-size:11px; }
}


/* FPZone toolbar tuning */
.mod-chat-editor {
  padding: 0;
}
.mod-chat-editor > .bb-editor,
.mod-chat-editor > .wseditor,
.mod-chat-editor > .editor-panel,
.mod-chat-editor > .editor,
.mod-chat-editor > .editorcomm,
.mod-chat-editor > .quick-edit,
.mod-chat-editor > .bbcode-toolbar {
  background: linear-gradient(180deg, rgba(11,18,33,.96), rgba(7,12,24,.98));
  border-bottom: 1px solid rgba(111,126,160,.12);
}
.mod-chat-editor button:not(.mod-chat-btn-primary),
.mod-chat-editor input[type=button],
.mod-chat-editor input[type=submit],
.mod-chat-editor .bbcodes,
.mod-chat-editor .editor_button,
.mod-chat-editor .fbutton,
.mod-chat-editor select {
  appearance: none;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(111,126,160,.16) !important;
  background: linear-gradient(180deg, rgba(26,33,51,.96), rgba(12,18,32,.98)) !important;
  color: #c9d3e7 !important;
  border-radius: 4px !important;
  box-shadow: none !important;
  text-shadow: none !important;
}
.mod-chat-editor button:not(.mod-chat-btn-primary):hover,
.mod-chat-editor input[type=button]:hover,
.mod-chat-editor input[type=submit]:hover,
.mod-chat-editor .bbcodes:hover,
.mod-chat-editor .editor_button:hover,
.mod-chat-editor .fbutton:hover,
.mod-chat-editor select:hover {
  color:#fff !important;
  border-color: rgba(199,73,109,.45) !important;
  background: linear-gradient(180deg, rgba(38,20,31,.88), rgba(18,10,16,.92)) !important;
}
.mod-chat-editor .bb-pane,
.mod-chat-editor .editor-row,
.mod-chat-editor .editor-tools,
.mod-chat-editor .tool-line {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  padding:10px 10px 8px;
  background: linear-gradient(180deg, rgba(11,18,33,.96), rgba(7,12,24,.98));
}
.mod-chat-editor textarea,
.mod-chat-editor .area,
.mod-chat-editor .wseditor-textarea,
.mod-chat-editor .editor_textarea {
  background: linear-gradient(180deg, rgba(5,10,20,.78), rgba(2,6,14,.92)) !important;
  color:#eef2ff !important;
}
.mod-chat-container .mod-chat-form .bbcodes,
.mod-chat-container .mod-chat-form .editor_button,
.mod-chat-container .mod-chat-form .fbutton {
  font: 600 12px/1 Tektur,system-ui,sans-serif !important;
}

.mod-chat-message-top .mod-chat-avatar-img{max-width:24px !important;max-height:24px !important;}
/* ===================== */
.message{
  padding:7px 8px 6px;
  margin:0 0 6px;
  background:linear-gradient(180deg,rgba(8,14,30,.98),rgba(4,8,20,.99));
  border:1px solid rgba(83,104,156,.16);
  clip-path:polygon(0 0,calc(100% - 10px) 0,100% 10px,100% 100%,10px 100%,0 calc(100% - 10px));
}

.message-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:4px;
}

.message-user{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
  flex:1 1 auto;
}

.message .avatar{
  width:26px;
  height:26px;
  min-width:26px;
  overflow:hidden;
  border-radius:6px;
  border:1px solid rgba(255,255,255,.08);
  background:#121b2d;
}

.message .avatar img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
}

.message .info{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
  flex:1 1 auto;
}

.message .info b{
  font-size:12px;
  line-height:1;
  color:#e8edf9;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:92px;
}

.message .info span{
  margin-left:auto;
  font-size:11px;
  line-height:1;
  color:#8f9bb9;
  white-space:nowrap;
}

.message-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.message-actions .action-btn{
  border:0;
  background:none;
  padding:0;
  color:#ff5d78;
  font-size:10px;
  font-weight:800;
  cursor:pointer;
  text-transform:lowercase;
}

.message-actions .action-btn:hover{
  color:#fff;
}

.message .text{
  font-size:12px;
  line-height:1.24;
  color:#e6ebf6;
  word-break:break-word;
}

.message .text blockquote{
  margin:4px 0 5px;
  padding:7px 9px;
  background:linear-gradient(90deg,rgba(63,17,31,.20),rgba(25,32,56,.38));
  border-left:2px solid #ff5d78;
  color:#dbe4ff;
  font-size:12px;
  line-height:1.25;
}
/* ===== compact override for current live markup ===== */
.mod-chat-message{
  padding:7px 8px 6px !important;
  margin:0 0 6px !important;
  background:linear-gradient(180deg,rgba(8,14,30,.98),rgba(4,8,20,.99)) !important;
  border:1px solid rgba(83,104,156,.16) !important;
  clip-path:polygon(0 0,calc(100% - 10px) 0,100% 10px,100% 100%,10px 100%,0 calc(100% - 10px)) !important;
}

.mod-chat-message-top{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:8px !important;
  margin-bottom:4px !important;
}

.mod-chat-author-wrap{
  display:flex !important;
  align-items:center !important;
  gap:8px !important;
  min-width:0 !important;
  flex:1 1 auto !important;
}

.mod-chat-avatar-img{
  width:26px !important;
  height:26px !important;
  min-width:26px !important;
  max-width:26px !important;
  min-height:26px !important;
  max-height:26px !important;
  border-radius:6px !important;
  object-fit:cover !important;
  display:block !important;
  flex:0 0 26px !important;
}

.mod-chat-author{
  font-size:12px !important;
  line-height:1 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  max-width:92px !important;
  color:white !important;
}

.mod-chat-date{
  margin-left:auto !important;
  font-size:11px !important;
  line-height:1 !important;
  color:#8f9bb9 !important;
  white-space:nowrap !important;
}

.mod-chat-text{
  font-size:12px !important;
  line-height:1.24 !important;
  color:#e6ebf6 !important;
}

.mod-chat-actions-inline{
  gap:8px !important;
  margin-top:5px !important;
}

.mod-chat-act-btn{
  font-size:10px !important;
  font-weight:800 !important;
  color:#ff5d78 !important;
}

.mod-chat-act-btn:hover{
  color:#fff !important;
}

.mod-chat-quote,
.mod-chat-text blockquote,
.mod-chat-text .quote,
.mod-chat-text .title_quote{
  margin:4px 0 5px !important;
  padding:7px 9px !important;
  background:linear-gradient(90deg,rgba(63,17,31,.20),rgba(25,32,56,.38)) !important;
  border-left:2px solid #ff5d78 !important;
  color:#dbe4ff !important;
  font-size:12px !important;
  line-height:1.25 !important;
}
/* ===== /compact override ===== */