.editbored-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px 8px 0 0;
    position: sticky;
    top: 12px;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.editbored-toolbar-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: #555;
    transition: all 0.15s ease;
}
.editbored-toolbar-btn:hover {
    background: #f0f0f0;
    color: #333;
}
.editbored-toolbar-btn:active {
    background: #e0e0e0;
    transform: scale(0.95);
}
.editbored-toolbar-btn.active {
    background: #007AFF20;
    color: #007AFF;
}
.editbored-toolbar-btn svg {
    width: 18px;
    height: 18px;
}
.editbored-toolbar-divider {
    width: 1px;
    height: 24px;
    background: #e0e0e0;
    margin: 6px 8px;
}
.editbored-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
}
.editbored-editor {
    width: 100%;
    min-height: 300px;
    font-size: 17px;
    line-height: 1.8;
    padding: 12px 16px;
    outline: none;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    background: #fff;
    box-sizing: border-box;
}
.editbored-editor:empty::before {
    content: 'Start writing...';
    color: #aaa;
    font-style: italic;
    pointer-events: none;
}
.editbored-editor h1 {
    font-size: 2em;
    font-weight: 700;
    margin: 1.2em 0 0.4em;
    color: #1a1a1a;
}
.editbored-editor h2 {
    font-size: 1.6em;
    font-weight: 600;
    margin: 1.1em 0 0.4em;
    color: #222;
}
.editbored-editor h3 {
    font-size: 1.3em;
    font-weight: 600;
    margin: 1em 0 0.4em;
    color: #2a2a2a;
}
.editbored-editor p {
    margin: 0.6em 0;
}
.editbored-editor strong, .editbored-editor b {
    font-weight: 700;
}
.editbored-editor em, .editbored-editor i {
    font-style: italic;
}
.editbored-editor del, .editbored-editor s {
    text-decoration: line-through;
    color: #888;
}
.editbored-editor a {
    color: #007AFF;
    text-decoration: none;
    border-bottom: 1px solid #007AFF40;
}
.editbored-editor a:hover {
    border-bottom-color: #007AFF;
}
.editbored-editor ul, .editbored-editor ol {
    margin: 0.6em 0;
    padding-left: 1.5em;
}
.editbored-editor li {
    margin: 0.3em 0;
}
.editbored-editor blockquote {
    border-left: 3px solid #007AFF;
    margin: 0.8em 0;
    padding: 0.5em 1em;
    color: #555;
    background: #f8f9fa;
    border-radius: 0 4px 4px 0;
}
.editbored-editor code {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.9em;
    background: #f0f0f0;
    padding: 0.15em 0.4em;
    border-radius: 4px;
    color: #d63384;
}
.editbored-editor pre {
    background: #282c34;
    border-radius: 8px;
    margin: 0.8em 0;
    padding: 16px;
    overflow-x: auto;
}
.editbored-editor pre code {
    background: transparent;
    color: #abb2bf;
    padding: 0;
    font-size: 14px;
    line-height: 1.6;
}
.editbored-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 0.6em 0;
}
.editbored-editor hr {
    border: none;
    border-top: 2px solid #e0e0e0;
    margin: 1.5em 0;
}
.editbored-editor table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.8em 0;
}
.editbored-editor th, .editbored-editor td {
    border: 1px solid #e0e0e0;
    padding: 10px 12px;
    text-align: left;
}
.editbored-editor th {
    background: #f5f5f5;
    font-weight: 600;
}
.editbored-mentions-dropdown {
    position: absolute;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    z-index: 1000;
    display: none;
}
.editbored-mention-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
}
.editbored-mention-item:hover, .editbored-mention-item.active {
    background: #e3f2fd;
    color: #1976d2;
}
.editbored-progress {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    margin: 6px 0;
    overflow: hidden;
    display: none;
}
.editbored-progress-bar {
    height: 100%;
    background: #550296;
    width: 0%;
    transition: width 0.2s;
}

/* Link preview styles */
.editbored-editor .link-preview-wrap {
    position: relative;
    margin: 0.8em 0;
}
.editbored-editor .link-preview-wrap:hover .preview-remove-btn {
    opacity: 1;
}
.editbored-editor .link-preview {
    border-radius: 12px;
    overflow: hidden;
}
.editbored-editor .link-preview--youtube {
    position: relative;
    padding-top: 56.25%;
    background: #000;
}
.editbored-editor .link-preview--youtube iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}
.editbored-editor .link-preview--twitter {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}
.editbored-editor .link-preview--instagram {
    background: #fff;
    border: 1px solid #dbdbdb;
}
.editbored-editor .link-preview--facebook {
    background: #f0f2f5;
}
.editbored-editor .link-preview--generic {
    border: 1px solid #e0e0e0;
    background: #fff;
}
.editbored-editor .link-preview--image img {
    max-width: 100%;
    display: block;
    border-radius: 12px;
}
.editbored-editor .link-preview a {
    color: #007AFF;
    text-decoration: none;
}
.editbored-editor .link-preview a:hover {
    text-decoration: underline;
}

/* Mention styles for rendered output */
.markdown-content .mention, .thread-content .mention, .post-content .mention {
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 4px;
    padding: 0.1em 0.3em;
    font-weight: 500;
    white-space: nowrap;
}

/* Back to rich text button */
.editbored-back-to-rich {
    display: none;
    margin: 8px 0;
    padding: 6px 14px;
    background: #007AFF;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    align-self: flex-start;
    transition: background 0.15s ease;
}
.editbored-back-to-rich:hover {
    background: #0066d6;
}

/* Frontend markdown rendering styles */
.markdown-content h1, .thread-content h1, .post-content h1,
.markdown-content h2, .thread-content h2, .post-content h2,
.markdown-content h3, .thread-content h3, .post-content h3 {
    font-weight: 700;
    margin: 1.2em 0 0.4em;
    color: #1a1a1a;
}
.markdown-content h1, .thread-content h1, .post-content h1 { font-size: 2em; }
.markdown-content h2, .thread-content h2, .post-content h2 { font-size: 1.6em; }
.markdown-content h3, .thread-content h3, .post-content h3 { font-size: 1.3em; }
.markdown-content p, .thread-content p, .post-content p {
    margin: 0.6em 0;
}
.markdown-content strong, .thread-content strong, .post-content strong,
.markdown-content b, .thread-content b, .post-content b {
    font-weight: 700;
}
.markdown-content em, .thread-content em, .post-content em,
.markdown-content i, .thread-content i, .post-content i {
    font-style: italic;
}
.markdown-content del, .thread-content del, .post-content del,
.markdown-content s, .thread-content s, .post-content s {
    text-decoration: line-through;
    color: #888;
}
.markdown-content a, .thread-content a, .post-content a {
    color: #007AFF;
    text-decoration: none;
    border-bottom: 1px solid #007AFF40;
}
.markdown-content a:hover, .thread-content a:hover, .post-content a:hover {
    border-bottom-color: #007AFF;
}
.markdown-content ul, .thread-content ul, .post-content ul,
.markdown-content ol, .thread-content ol, .post-content ol {
    margin: 0.6em 0;
    padding-left: 1.5em;
}
.markdown-content li, .thread-content li, .post-content li {
    margin: 0.3em 0;
}
.markdown-content blockquote, .thread-content blockquote, .post-content blockquote {
    border-left: 3px solid #007AFF;
    margin: 0.8em 0;
    padding: 0.5em 1em;
    color: #555;
    background: #f8f9fa;
    border-radius: 0 4px 4px 0;
}
.markdown-content code, .thread-content code, .post-content code {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.9em;
    background: #f0f0f0;
    padding: 0.15em 0.4em;
    border-radius: 4px;
    color: #d63384;
}
.markdown-content pre, .thread-content pre, .post-content pre {
    background: #282c34;
    border-radius: 8px;
    margin: 0.8em 0;
    padding: 16px;
    overflow-x: auto;
}
.markdown-content pre code, .thread-content pre code, .post-content pre code {
    background: transparent;
    color: #abb2bf;
    padding: 0;
    font-size: 14px;
    line-height: 1.6;
}
.markdown-content img, .thread-content img, .post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 0.6em 0;
}
.markdown-content hr, .thread-content hr, .post-content hr {
    border: none;
    border-top: 2px solid #e0e0e0;
    margin: 1.5em 0;
}
.markdown-content table, .thread-content table, .post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.8em 0;
}
.markdown-content th, .thread-content th, .post-content th,
.markdown-content td, .thread-content td, .post-content td {
    border: 1px solid #e0e0e0;
    padding: 10px 12px;
    text-align: left;
}
.markdown-content th, .thread-content th, .post-content th {
    background: #f5f5f5;
    font-weight: 600;
}
