/* Shared admin rich text editor and preview styles. */

.admin-md-wrap .rt-toolbar {
  position: sticky;
  top: 10px;
  z-index: 12;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(15, 23, 36, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(15, 23, 36, 0.08);
  backdrop-filter: blur(12px);
}

.rt-toolbar button {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(15, 23, 36, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text, #162031);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.rt-toolbar button:hover,
.rt-toolbar button.active {
  border-color: rgba(37, 99, 235, 0.32);
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent, #2563eb);
}

.admin-rich-editor .ProseMirror table,
.rt-preview table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 16px 0 22px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 14px;
  background: rgba(248, 251, 255, 0.88);
}

.admin-rich-editor .ProseMirror th,
.admin-rich-editor .ProseMirror td,
.rt-preview th,
.rt-preview td {
  min-width: 88px;
  padding: 10px 12px;
  border-right: 1px solid rgba(148, 163, 184, 0.24);
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
  vertical-align: top;
}

.admin-rich-editor .ProseMirror th:last-child,
.admin-rich-editor .ProseMirror td:last-child,
.rt-preview th:last-child,
.rt-preview td:last-child {
  border-right: 0;
}

.admin-rich-editor .ProseMirror tr:last-child td,
.rt-preview tr:last-child td {
  border-bottom: 0;
}

.admin-rich-editor .ProseMirror th,
.rt-preview th {
  background: rgba(37, 99, 235, 0.08);
  color: var(--text, #162031);
  font-weight: 800;
}

.admin-rich-editor .ProseMirror pre,
.rt-preview pre {
  margin: 16px 0 22px;
  padding: 18px 22px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 18px;
  background: #f8fbff;
  color: #334155;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  line-height: 1.55;
  overflow-x: auto;
}

.admin-rich-editor .ProseMirror blockquote,
.rt-preview blockquote {
  margin: 16px 0 22px;
  padding: 14px 18px;
  border-left: 4px solid rgba(37, 99, 235, 0.42);
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.06);
  color: var(--text, #162031);
}

.admin-rich-editor .ProseMirror img,
.rt-preview img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 16px 0 22px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.rt-preview [data-align="left"],
.task-description-rich [data-align="left"],
.description [data-align="left"] {
  text-align: left;
}

.rt-preview [data-align="center"],
.task-description-rich [data-align="center"],
.description [data-align="center"] {
  text-align: center;
}

.rt-preview [data-align="right"],
.task-description-rich [data-align="right"],
.description [data-align="right"] {
  text-align: right;
}

.rt-preview [data-align="justify"],
.task-description-rich [data-align="justify"],
.description [data-align="justify"] {
  text-align: justify;
}

body[data-theme="matrix"] .admin-md-wrap .rt-toolbar,
body[data-theme="matrix"][data-matrix-variant="blue"] .admin-md-wrap .rt-toolbar {
  background: rgba(6, 19, 13, 0.92);
}
