.hrm-tiptap-editor {
    --hrm-tiptap-border: #d9d9d9;
    --hrm-tiptap-border-focus: var(--ant-primary-color, #1677ff);
    --hrm-tiptap-bg: #ffffff;
    --hrm-tiptap-toolbar-bg: #fafafa;
    --hrm-tiptap-mention-bg: var(--sf-primary-bg, #e8f4ff);
    --hrm-tiptap-mention-fg: var(--ant-primary-color, #1677ff);
    --hrm-tiptap-height: auto;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--hrm-tiptap-border);
    border-radius: 6px;
    background: var(--hrm-tiptap-bg);
    overflow: hidden;
    transition: border-color 0.15s ease;
}

.hrm-tiptap-editor:focus-within {
    border-color: var(--hrm-tiptap-border-focus);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--ant-primary-color, #1677ff) 10%, transparent);
}

.hrm-tiptap-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    padding: 4px 8px;
    background: var(--hrm-tiptap-toolbar-bg);
    border-bottom: 1px solid var(--hrm-tiptap-border);
}

.hrm-tiptap-toolbar-slot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    row-gap: 4px;
    width: 100%;
}

.hrm-tiptap-toolbar-break {
    flex: 0 0 100%;
    width: 100%;
    height: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.hrm-tiptap-toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #262626;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: background 0.15s ease;
}

.hrm-tiptap-toolbar-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

.hrm-tiptap-toolbar-btn.is-active {
    background: color-mix(in srgb, var(--ant-primary-color, #1677ff) 12%, transparent);
    color: var(--hrm-tiptap-border-focus);
}

.hrm-tiptap-toolbar-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.hrm-tiptap-toolbar-sep {
    width: 1px;
    height: 20px;
    margin: 0 4px;
    background: var(--hrm-tiptap-border);
}

.hrm-tiptap-content {
    flex: 1 1 auto;
    min-height: 120px;
    max-height: var(--hrm-tiptap-height, none);
    padding: 10px 14px;
    overflow-y: auto;
    outline: none;
    font-size: 14px;
    line-height: 1.6;
    color: #262626;
}

.hrm-tiptap-content .ProseMirror {
    outline: none;
    min-height: 100px;
}

.hrm-tiptap-content .ProseMirror p {
    margin: 0 0 6px;
}

.hrm-tiptap-content .ProseMirror p:last-child {
    margin-bottom: 0;
}

.hrm-tiptap-content .ProseMirror p.is-editor-empty:first-child::before {
    content: attr(data-placeholder);
    color: #bfbfbf;
    float: left;
    height: 0;
    pointer-events: none;
}

.hrm-tiptap-content ul,
.hrm-tiptap-content ol {
    padding-left: 22px;
    margin: 6px 0;
}

.hrm-tiptap-content h1,
.hrm-tiptap-content h2,
.hrm-tiptap-content h3 {
    margin: 10px 0 6px;
    font-weight: 600;
    line-height: 1.3;
}

.hrm-tiptap-content h1 { font-size: 22px; }
.hrm-tiptap-content h2 { font-size: 18px; }
.hrm-tiptap-content h3 { font-size: 16px; }

.hrm-tiptap-content blockquote {
    margin: 8px 0;
    padding: 4px 12px;
    border-left: 3px solid var(--hrm-tiptap-border);
    color: #595959;
    background: #fafafa;
    border-radius: 0 4px 4px 0;
}

.hrm-tiptap-content a {
    color: var(--hrm-tiptap-border-focus);
    text-decoration: none;
}

.hrm-tiptap-content a:hover {
    text-decoration: underline;
}

.hrm-tiptap-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 4px 0;
}

/* Sprint 33 V8.9 — Inline image resize + align */
.hrm-tiptap-content img.hrm-img-selected {
    outline: 2px solid var(--ant-primary-color, #1677ff);
    outline-offset: 2px;
}

.hrm-tiptap-content img.hrm-img-align-left {
    float: left;
    margin: 0 12px 8px 0;
}

.hrm-tiptap-content img.hrm-img-align-right {
    float: right;
    margin: 0 0 8px 12px;
}

.hrm-tiptap-content img.hrm-img-align-center {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.hrm-tiptap-content::after {
    content: "";
    display: block;
    clear: both;
}

.hrm-img-bubble-menu {
    position: absolute;
    z-index: 1100;
    background: #ffffff;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    padding: 4px;
    display: inline-flex;
    gap: 2px;
    align-items: center;
    font-size: 12px;
    user-select: none;
}

.hrm-img-bubble-menu.hrm-img-bubble-hidden {
    display: none !important;
}

.hrm-img-bubble-menu button {
    background: transparent;
    border: 0;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 12px;
    color: #262626;
    line-height: 1;
    transition: background 0.15s ease;
}

.hrm-img-bubble-menu button:hover {
    background: rgba(0, 0, 0, 0.06);
}

.hrm-img-bubble-menu button.active {
    background: color-mix(in srgb, var(--ant-primary-color, #1677ff) 12%, transparent);
    color: var(--ant-primary-color, #1677ff);
}

.hrm-img-bubble-divider {
    width: 1px;
    height: 16px;
    background: #e0e0e0;
    margin: 0 4px;
}

.hrm-img-resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--ant-primary-color, #1677ff);
    border: 2px solid #ffffff;
    border-radius: 50%;
    z-index: 1099;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* Cursor 4 góc — TL/BR cùng đường chéo nwse, TR/BL cùng đường chéo nesw */
.hrm-img-resize-tl { cursor: nwse-resize; }
.hrm-img-resize-tr { cursor: nesw-resize; }
.hrm-img-resize-bl { cursor: nesw-resize; }
.hrm-img-resize-br { cursor: nwse-resize; }

/* V8.2 Round 2 — Issue 3: chỉ giữ màu chữ, bỏ background + padding + border-radius */
.hrm-mention {
    color: var(--ant-primary-color, #1677ff);
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.hrm-mention:hover {
    text-decoration: underline;
}

.hrm-hashtag {
    color: var(--ant-primary-color, #1677ff);
    text-decoration: none;
    font-weight: 500;
}

.hrm-hashtag:hover {
    text-decoration: underline;
}

.hrm-tiptap-suggest {
    background: #ffffff;
    border: 1px solid var(--hrm-tiptap-border);
    border-radius: 6px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    max-height: 280px;
    overflow-y: auto;
    min-width: 240px;
    padding: 4px 0;
    z-index: 9999;
}

.hrm-tiptap-suggest-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.hrm-tiptap-suggest-item:hover,
.hrm-tiptap-suggest-item.is-selected {
    background: color-mix(in srgb, var(--ant-primary-color, #1677ff) 8%, transparent);
}

.hrm-tiptap-suggest-avatar {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f0f0f0;
    object-fit: cover;
}

.hrm-tiptap-suggest-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.hrm-tiptap-suggest-name {
    font-weight: 500;
    color: #262626;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hrm-tiptap-suggest-sub {
    font-size: 12px;
    color: #8c8c8c;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hrm-tiptap-suggest-empty {
    padding: 8px 12px;
    color: #8c8c8c;
    font-size: 13px;
    text-align: center;
}

.hrm-tiptap-color-popup {
    display: grid;
    grid-template-columns: repeat(5, 22px);
    gap: 4px;
    padding: 8px;
    background: #ffffff;
    border: 1px solid var(--hrm-tiptap-border);
    border-radius: 6px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    z-index: 9999;
}

.hrm-tiptap-color-swatch {
    width: 22px;
    height: 22px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
    transition: transform 0.1s ease;
}

.hrm-tiptap-color-swatch:hover {
    transform: scale(1.15);
}

.hrm-tiptap-color-clear {
    grid-column: 1 / -1;
    margin-top: 4px;
    padding: 4px 8px;
    border: 1px solid var(--hrm-tiptap-border);
    background: #fafafa;
    color: #262626;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.hrm-tiptap-color-clear:hover {
    background: #f0f0f0;
}

.hrm-tiptap-content table.hrm-tiptap-table,
.hrm-tiptap-content table {
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
    margin: 8px 0;
    overflow: hidden;
}

.hrm-tiptap-content table td,
.hrm-tiptap-content table th {
    border: 1px solid var(--hrm-tiptap-border);
    padding: 6px 8px;
    vertical-align: top;
    position: relative;
    min-width: 40px;
}

.hrm-tiptap-content table th {
    background: #fafafa;
    font-weight: 600;
    text-align: left;
}

.hrm-tiptap-content table .selectedCell {
    background: color-mix(in srgb, var(--ant-primary-color, #1677ff) 8%, transparent);
}

.hrm-tiptap-content table .column-resize-handle {
    position: absolute;
    right: -2px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--hrm-tiptap-border-focus);
    opacity: 0;
    cursor: col-resize;
}

.hrm-tiptap-content table:hover .column-resize-handle {
    opacity: 0.4;
}
