/*
 * XCHAT_BOARD_NATIVE_DOM_V1D
 *
 * Lightweight old-school Board window.
 */

html.xcbm-open,
html.xcbm-open body {
  overflow: hidden !important;
}


.xcbm-overlay {
  position: fixed;
  inset: 0;

  z-index: 100000;

  display: none;

  background:
    rgba(
      1,
      5,
      18,
      0.58
    );
}


.xcbm-overlay.is-open {
  display: block;
}


.xcbm-dialog {
  position: absolute;

  width: 500px;
  height: 430px;

  min-width: 360px;
  min-height: 280px;

  max-width:
    calc(
      100vw - 16px
    );

  max-height:
    calc(
      100dvh - 16px
    );

  box-sizing: border-box;

  /*
   * Browser does resize itself.
   * No JS resize event loop.
   */
  resize: both;

  overflow: hidden;

  contain:
    layout paint;

  background:
    #073a44;

  transform:
    translate3d(
      0,
      0,
      0
    );

  box-shadow:
    0 3px 10px
    rgba(
      0,
      0,
      0,
      0.38
    );
}


.xcbm-dialog.is-dragging {
  will-change: transform;
}


.xcbm-dialog.is-dragging,
.xcbm-dialog.is-dragging * {
  user-select: none !important;
  -webkit-user-select: none !important;
}


/*
 * Barely visible vertical rails.
 */
.xcbm-dialog::before,
.xcbm-dialog::after {
  content: "";

  position: absolute;

  top: 0;
  bottom: 0;

  z-index: 20;

  width: 1px;

  pointer-events: none;

  background:
    rgba(
      145,
      201,
      219,
      0.28
    );
}


.xcbm-dialog::before {
  left: 0;
}


.xcbm-dialog::after {
  right: 0;
}


/* ============================================================
   BOARD
   ============================================================ */

#xchatBoardModal
.xboard-wrap {
  width: 100%;
  height: 100%;

  min-width: 0;
  min-height: 0;

  margin: 0;

  display: flex;
  flex-direction: column;

  box-sizing: border-box;

  overflow: hidden;

  background: #073a44;

  color: #cfcfcf;

  font:
    12px Verdana,
    Arial,
    sans-serif;
}


#xchatBoardModal
.xboard-head {
  flex:
    0 0 25px;

  width: 100%;
  height: 25px;

  overflow: hidden;

  box-sizing: border-box;

  background: #000;

  border-bottom:
    1px solid
    #6f8fff;

  cursor: move;
}


#xchatBoardModal
.xboard-head img {
  display: block;

  width: 100%;
  height: 25px;

  max-width: none;

  object-fit: fill;

  pointer-events: none;
}


#xchatBoardModal
.xboard-body {
  flex:
    1 1 auto;

  width: 100%;

  min-width: 0;
  min-height: 0;

  box-sizing: border-box;

  padding:
    7px 8px 4px;

  overflow-x: hidden;
  overflow-y: auto;

  background: #073a44;

  scrollbar-width: thin;

  cursor: move;
}


#xchatBoardModal
#boardText {
  display: block;

  width: 100%;

  height: 58px;
  min-height: 58px;
  max-height: 240px;

  box-sizing: border-box;

  margin:
    0 auto 6px;

  resize: vertical;

  overflow: auto;

  border:
    1px solid
    #6f8fff;

  border-radius: 0;

  outline: none;

  background: #000;

  color: #cfcfcf;

  font:
    12px Verdana,
    Arial,
    sans-serif;

  cursor: text;
}


#xchatBoardModal
.xboard-buttons {
  margin:
    4px 0 7px;

  text-align: center;
}


#xchatBoardModal
.xboard-button {
  margin:
    0 2px;

  padding:
    1px 7px;

  border:
    1px solid
    #6f8fff;

  border-radius: 0;

  background: #000;

  color: #dcdcdc;

  cursor: pointer;

  font:
    11px Verdana,
    Arial,
    sans-serif;
}


#xchatBoardModal
#boardCancelEdit[hidden],
#xchatBoardModal
#boardClose[hidden] {
  display: none !important;
}


#xchatBoardModal
#boardStatus {
  min-height: 14px;

  margin:
    2px 0;

  color: #ffff00;

  text-align: center;

  font-weight: bold;
}


#xchatBoardModal
.board-empty {
  padding:
    15px 0;

  text-align: center;

  color: #cfcfcf;

  font-weight: bold;
}


#xchatBoardModal
.board-item {
  width: 100%;

  margin:
    0 auto 14px;

  padding: 0;

  box-sizing: border-box;

  color: #cfcfcf;

  cursor: move;
}


#xchatBoardModal
.board-meta {
  display: flex;

  align-items: center;

  gap: 5px;

  min-width: 0;

  margin-bottom: 2px;

  color: #00ff80;

  font-size: 11px;
}


#xchatBoardModal
.board-meta b {
  color: #00ff80;

  font-size: 12px;

  font-weight: bold;
}


#xchatBoardModal
.board-date {
  color: #baffba;
}


#xchatBoardModal
.board-text {
  color: #cfcfcf;

  white-space: pre-wrap;

  word-break: break-word;

  overflow-wrap: anywhere;

  line-height: 1.35;
}


#xchatBoardModal
.board-actions {
  margin-left: auto;

  display: inline-flex;

  align-items: center;

  gap: 4px;

  white-space: nowrap;
}


#xchatBoardModal
.board-edit,
#xchatBoardModal
.board-trash {
  padding: 0;

  border: 0;

  background: transparent;

  cursor: pointer;
}


#xchatBoardModal
.board-edit {
  width: 18px;
  height: 18px;

  color: #9ee8ff;

  font:
    bold 15px/18px
    Arial,
    sans-serif;

  text-align: center;
}


#xchatBoardModal
.board-edit:hover {
  color: #fff;
}


#xchatBoardModal
.board-trash img {
  width: 16px;
  height: 16px;

  vertical-align: middle;
}


#xchatBoardModal
.xboard-info-btn {
  width: 14px;
  height: 13px;

  flex:
    0 0 auto;

  display: inline-flex;

  align-items: center;
  justify-content: center;

  margin:
    0 1px 0 2px;

  padding: 0;

  border: 0;
  outline: 0;

  background: transparent;

  cursor: pointer;
}


#xchatBoardModal
.xboard-info-btn img {
  display: block;

  width: 12px;
  height: 11px;

  pointer-events: none;
}


#xchatBoardModal
.board-pager {
  width: 100%;

  box-sizing: border-box;

  margin:
    4px auto 14px;

  padding:
    9px 4px 11px;

  border-top:
    1px dotted
    #37738a;

  color: #9fd7c6;

  text-align: center;

  font-size: 11px;
}


#xchatBoardModal
.board-pager.is-end {
  color: #739d91;

  border-top-color:
    #28505d;
}


#xchatBoardModal
.xboard-bottom {
  flex:
    0 0 18px;

  width: 100%;
  height: 18px;

  margin: 0;

  overflow: hidden;

  box-sizing: border-box;

  background: #000;

  border-top:
    1px solid
    #6f8fff;

  cursor: move;
}


#xchatBoardModal
.xboard-bottom img {
  display: block;

  width: 100%;
  height: 18px;

  max-width: none;

  object-fit: fill;

  pointer-events: none;
}


@media (max-width:600px) {

  .xcbm-dialog {
    left: 0 !important;
    top: 0 !important;

    width: 100vw !important;
    height: 100dvh !important;

    min-width: 0;
    min-height: 0;

    max-width: none;
    max-height: none;

    resize: none;

    transform:
      none !important;

    box-shadow: none;
  }


  .xcbm-dialog::before,
  .xcbm-dialog::after {
    display: none;
  }


  #xchatBoardModal
  .xboard-head,
  #xchatBoardModal
  .xboard-body,
  #xchatBoardModal
  .xboard-bottom,
  #xchatBoardModal
  .board-item {
    cursor: default;
  }
}
