/* =========================================================
   Community Knowledge Base — Sunshine Theme
   ========================================================= */

/* ── Layout ─────────────────────────────────────────────── */
.kb-layout {
    display: flex;
    gap: 20px;
    min-height: 60vh;
}
@media (max-width: 768px) {
    .kb-layout { flex-direction: column; }
}
.kb-main { flex: 1; min-width: 0; }

/* ── Sidebar ─────────────────────────────────────────────── */
.kb-sidebar {
    width: 240px;
    min-width: 220px;
    flex-shrink: 0;
}
.kb-sidebar-inner {
    display: block;
    border-radius: 12px;
    padding: 16px;
    height: auto;
}
.kb-sidebar-community-link {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    color: #888;
    /* font-size: 12px; */
    text-decoration: none;
}
.kb-sidebar-community-logo {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    object-fit: cover;
}
.kb-sidebar-home-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    font-weight: 600;
    /* font-size: 13px; */
    margin-bottom: 8px;
    text-decoration: none;
}
.kb-sidebar-home-link.active {
    background: var(--main-color);
    color: #fff;
}
.kb-sidebar-home-link:not(.active) {
    color: var(--main-text);
}
.kb-sidebar-add-collection {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}
.kb-sidebar-add-collection button {
    background: none;
    border: none;
    color: var(--main-color);
    /* font-size: 12px; */
    cursor: pointer;
    padding: 0;
}
.kb-sidebar-stats {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 18px;
}
.kb-sidebar-stat { text-align: center; }
.kb-sidebar-stat-value {
    font-size: 16px;
    font-weight: 700;
}
.kb-sidebar-stat-label {
    /* font-size: 11px; */
    color: #aaa;
}
.kb-tree-list { margin: 0; padding: 0; }
.kb-tree-node { list-style: none; }
.kb-tree-col, .kb-tree-item {
    display: block;
    padding: 5px 8px;
    border-radius: 7px;
    /* font-size: 13px; */
    text-decoration: none;
    color: var(--main-text);
    transition: background .12s;
}
.kb-tree-col:hover, .kb-tree-item:hover { background: #f5f5f5; }
.kb-tree-col.active, .kb-tree-item.active { background: var(--main-color); color: #fff; }
.kb-tree-item { /* font-size: 12px; */ color: #666; }
.kb-tree-children { margin: 0; padding-left: 16px; }

/* ── Header bar ─────────────────────────────────────────── */
.kb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}
.kb-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.kb-header-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}
.kb-header-breadcrumb-sep { color: #aaa; }
.kb-header-desc { color: #888; /* font-size: 13px; */ }
.kb-header-back { color: var(--main-color); /* font-size: 13px; */ text-decoration: none; }
.kb-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.kb-search-input {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 6px 12px;
    /* font-size: 13px; */
    width: 200px;
}

/* ── Collections grid ───────────────────────────────────── */
.kb-collections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

/* ── Collection card ────────────────────────────────────── */
.kb-col-card {
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    position: relative;
    transition: box-shadow .15s;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.kb-col-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.kb-col-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.kb-col-icon {
    font-size: 26px;
    line-height: 1;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.kb-col-actions {
    display: flex;
    gap: 6px;
}
.kb-col-action-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #888;
    padding: 0;
}
.kb-col-action-btn.danger { color: #e55; }
.kb-col-action-btn.danger svg{ width: 20px; height: 20px; }
.kb-col-title {
    font-size: 16px;
    font-weight: 600;
    color: #111;
}
.kb-col-desc { /* font-size: 12px; */ color: #666; margin-top: 2px; }
.kb-col-children-count { /* font-size: 11px; */ color: #aaa; }
.kb-new-collection-card {
    border: 2px dashed #d0d0d0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90px;
    cursor: pointer;
    transition: border-color .15s;
}
.kb-new-collection-card:hover { border-color: var(--main-color); }
.kb-new-collection-card span { color: #aaa; /* font-size: 13px; */ }

/* ── Empty states ───────────────────────────────────────── */
.kb-empty {
    border: 2px dashed #d0d0d0;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    margin-bottom: 24px;
}
.kb-empty p { color: #888; margin-bottom: 12px; }

/* ── Section labels ─────────────────────────────────────── */
.kb-section-label {
    /* font-size: 12px; */
    text-transform: uppercase;
    color: #aaa;
    font-weight: 600;
    letter-spacing: .5px;
    margin-bottom: 10px;
}

/* ── Items list ─────────────────────────────────────────── */
.kb-items-list {
    border-radius: 12px;
    overflow: hidden;
}
.kb-items-list-header {
    padding: 12px 18px;
    border-bottom: 1px solid #f0f0f0;
}
.kb-item-row {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #f5f5f5;
    transition: background .15s;
}
.kb-item-row:last-child { border-bottom: none; }
.kb-item-row:hover { background: #fafafa; }
.kb-item-info { flex: 1; min-width: 0; }
.kb-item-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--main-text);
    text-decoration: none;
}
.kb-item-meta { font-size: 14px; color: #aaa; margin-top: 2px; }
.kb-item-row-actions {
    display: flex;
    gap: 8px;
    margin-left: 12px;
}
.kb-item-row-action {
    background: none;
    border: none;
    /* font-size: 12px; */
    cursor: pointer;
}

/* ── Collection modal ───────────────────────────────────── */
.kb-col-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.kb-col-modal-overlay.open { display: flex; }
.kb-col-modal {
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    width: 420px;
    max-width: 95vw;
}
.kb-col-modal-title { margin: 0 0 20px; font-size: 16px; }
.kb-col-modal-row { margin-bottom: 14px; }
.kb-col-modal-row label {
    /* font-size: 13px; */
    font-weight: 500;
    display: block;
    margin-bottom: 4px;
}
.kb-col-modal-icon-input {
    width: 60px;
    font-size: 20px;
    text-align: center;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 6px;
    margin-left: 10px;
}
.kb-col-modal-color-input {
    margin-left: 10px;
    width: 36px;
    height: 36px;
    border: none;
    cursor: pointer;
    border-radius: 6px;
}
.kb-col-modal-text-input {
    width: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 12px;
    box-sizing: border-box;
}
.kb-col-modal-error {
    color: #e55;
    /* font-size: 13px; */
    margin-bottom: 10px;
    display: none;
}
.kb-col-modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ── Article view ───────────────────────────────────────── */
.kb-article-card {
    display: block;
    border-radius: 14px;
    padding: 20px 28px;
    margin-bottom: 20px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,.1);
}
.kb-article-title { font-size: 24px; font-weight: 700; margin: 0 0 8px; }
.kb-article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.kb-article-author {
    display: flex;
    align-items: center;
    gap: 8px;
    /* font-size: 12px; */
    color: #888;
}
.kb-article-author-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
}
.kb-article-meta-item { /* font-size: 12px; */ color: #bbb; }
.kb-article-content {
    font-size: 15px;
    line-height: 1.7;
    color: var(--main-text);
}
.kb-article-content > *:first-child { margin-top: 0; }
.kb-article-content img { max-width: 100%; border-radius: 8px; }
.kb-article-content h1,
.kb-article-content h2,
.kb-article-content h3 { margin-top: 1.4em; }
.kb-article-content pre {
    background: #f5f5f5;
    padding: 14px;
    border-radius: 8px;
    overflow: auto;
}
.kb-article-content code {
    background: #f0f0f0;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: .9em;
}
.kb-article-content blockquote {
    border-left: 3px solid var(--main-color);
    margin: 0;
    padding-left: 14px;
    color: #666;
}
.kb-article-actions { display: flex; gap: 10px; }

/* ── Breadcrumb ─────────────────────────────────────────── */
.kb-breadcrumb { color: #aaa; }
.kb-breadcrumb a { color: var(--main-color); text-decoration: none; }
.kb-breadcrumb-sep { margin: 0 6px; }
.kb-breadcrumb-current { color: #555; }

/* ── Comments ───────────────────────────────────────────── */
.kb-comments-card {
    border-radius: 14px;
    padding: 24px 28px;
}
.kb-comments-title { font-size: 15px; font-weight: 600; margin: 0 0 18px; }
.kb-comments-count { /* font-size: 12px; */ color: #aaa; font-weight: 400; }
.kb-comment-form { display: flex; gap: 12px; margin-bottom: 24px; align-items: flex-end; }
.kb-comment-avatar,
.kb-comment-reply-avatar {
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.kb-comment-avatar { width: 34px; height: 34px; }
.kb-comment-reply-avatar { width: 28px; height: 28px; }
.kb-comment-input-wrap { flex: 1; }
.kb-comment-textarea {
    width: 100%;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 10px 14px;
    /* font-size: 13px; */
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
}
.kb-comment-submit { margin-top: 8px; text-align: right; }
.kb-comment { display: flex; gap: 12px; margin-bottom: 18px; }
.kb-comment-body { flex: 1; }
.kb-comment-bubble {
    background: #f7f7f7;
    border-radius: 10px;
    padding: 10px 14px;
}
.kb-comment-author-name {
    /* font-size: 13px; */
    font-weight: 600;
    color: var(--main-text);
    text-decoration: none;
}
.kb-comment-time { /* font-size: 11px; */ color: #bbb; margin-left: 8px; }
.kb-comment-text { margin: 6px 0 0; /* font-size: 13px; */ }
.kb-comment-actions { display: flex; gap: 12px; margin-top: 5px; padding-left: 8px; }
.kb-comment-action-btn {
    background: none;
    border: none;
    /* font-size: 11px; */
    color: #888;
    cursor: pointer;
}
.kb-comment-action-btn.danger { color: #e55; }
.kb-reply { margin-left: 24px; }
.kb-reply-bubble {
    background: #f0f0f0;
    border-radius: 8px;
    padding: 8px 12px;
}
.kb-reply-author-name {
    /* font-size: 12px; */
    font-weight: 600;
    color: var(--main-text);
    text-decoration: none;
}
.kb-reply-text { margin: 4px 0 0; /* font-size: 12px; */ }
.kb-no-comments { color: #bbb; /* font-size: 13px; */ text-align: center; padding: 0; }

/* ── Editor form ─────────────────────────────────────────── */
.kb-editor-card { border-radius: 14px; padding: 28px 32px; background: #fff; }
.kb-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}
.kb-editor-title { margin: 0; font-size: 18px; font-weight: 600; }
.kb-editor-cancel { /* font-size: 13px; */ color: #888; text-decoration: none; }
.kb-editor-field { margin-bottom: 16px; }
.kb-editor-label {
    /* font-size: 13px; */
    font-weight: 500;
    display: block;
    margin-bottom: 6px;
}
/* ── Article editor form field rows (explicit block, immune to inherited flex) */
.kb-article-field {
    display: block !important;
    width: 100% !important;
    margin-bottom: 16px;
    box-sizing: border-box;
}
.kb-article-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--main-text, #393d4a);
}
/* Full-width collection picker button inside article editor */
.kb-col-picker-btn-full {
    display: flex !important;
    width: 100% !important;
    max-width: none !important;
    height: 50px;
    background: #F5F5F5;
    border: 0 !important;
    border-radius: 10px;
    font-size: 16px;
    padding: 8px 15px;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    cursor: pointer;
    color: var(--main-text, #393d4a);
    box-sizing: border-box;
}
.kb-col-picker-btn-full:hover { background: #ebebeb; }
/* Article editor card form-header (title like "Create new event") */
.kb-article-form-header {
    padding: 18px 20px 16px;
    border-bottom: 1px solid var(--border-color, #eee);
}
.kb-article-form-title {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 700;
    color: var(--main-text, #393d4a);
}
.kb-editor-title-input {
    width: 100%;
    background-color: #F5F5F5;
    border: 0;
    border-radius: 10px;
    color: #393d4a;
    font-size: 16px;
    line-height: 28px;
    padding: 8px 15px;
    height: 50px;
    box-sizing: border-box;
    outline: 0;
    font-family: var(--main-font);
}
.kb-editor-collection-select {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 8px 12px;
    /* font-size: 13px; */
    width: 280px;
}
.kb-editor-error { color: #e55; /* font-size: 13px; */ margin-bottom: 10px; display: none; }
.kb-editor-actions { display: flex; gap: 12px; }

/* ── Sub-collections section ────────────────────────────── */
.kb-subcol-section { margin-bottom: 18px; }
.kb-subcol-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

/* ── Search bar with icon ───────────────────────────────── */
.kb-search-wrap {
    position: relative;
    /* display: inline-flex; */
    align-items: center;
}
.kb-search-icon {
    position: absolute;
    left: 10px;
    color: #aaa;
    pointer-events: none;
    flex-shrink: 0;
}
.kb-search-wrap .kb-search-input {
    padding-left: 32px;
    width: 220px;
}

/* ── Accordion list ─────────────────────────────────────── */
.kb-accordion-list {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    overflow: hidden;
}
.kb-acc-item {
    border-bottom: 1px solid #f2f2f2;
}
.kb-acc-item:last-child { border-bottom: none; }

.kb-acc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    cursor: pointer;
    user-select: none;
    transition: background .12s;
}
.kb-acc-header:hover { background: #fafafa; }

.kb-acc-col-icon {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
    width: 26px;
    text-align: center;
}
.kb-acc-title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kb-acc-count {
    background: #f0f0f0;
    color: #777;
    /* /* font-size: 11px; */ */
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
    flex-shrink: 0;
}
.kb-acc-admin-btns {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.kb-acc-admin-btn {
    /* font-size: 13px; */
    color: #bbb;
    text-decoration: none;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color .12s;
}
.kb-acc-admin-btn:hover { color: #555; }
.kb-acc-chevron {
    flex-shrink: 0;
    color: #ccc;
    transition: transform .2s;
}
.kb-acc-item.open .kb-acc-header > .kb-acc-chevron,
.kb-acc-subcol.open .kb-acc-subcol-header > .kb-acc-chevron {
    transform: rotate(90deg);
}

.kb-acc-body {
    display: none;
    background: #fafafa;
    border-top: 1px solid #f2f2f2;
}

/* ── Article rows inside accordion ──────────────────────── */
.kb-acc-article-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px 10px 52px;
    text-decoration: none;
    border-bottom: 1px solid #f5f5f5;
    transition: background .12s;
}
.kb-acc-article-row:last-child { border-bottom: none; }
.kb-acc-article-row:hover { background: #f3f3f3; }
.kb-acc-article-title {
    flex: 1;
    /* font-size: 13px; */
    color: #333;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}
.kb-acc-article-title:hover { color: var(--main-color, #6366f1); }
.kb-acc-article-meta {
    /* font-size: 11px; */
    color: #bbb;
    flex-shrink: 0;
    white-space: nowrap;
}
.kb-acc-article-edit {
    /* font-size: 12px; */
    color: #888;
    text-decoration: none;
    flex-shrink: 0;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color .12s;
}
.kb-acc-article-edit:hover { color: #333; }

.kb-acc-empty {
    padding: 14px 18px 14px 52px;
    /* font-size: 13px; */
    color: #bbb;
    font-style: italic;
}

/* ── Sub-collections inside accordion ───────────────────── */
.kb-acc-subcol {
    border-bottom: 1px solid #f0f0f0;
}
.kb-acc-subcol:last-of-type { border-bottom: none; }
.kb-acc-subcol-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px 10px 36px;
    cursor: pointer;
    user-select: none;
    /* font-size: 13px; */
    transition: background .12s;
}
.kb-acc-subcol-header:hover { background: #f0f0f0; }
.kb-acc-subcol-title {
    flex: 1;
    /* font-size: 13px; */
    font-weight: 500;
    color: #444;
}
.kb-acc-subcol-body {
    display: none;
    background: #f5f5f5;
}
.kb-acc-subcol-body .kb-acc-article-row {
    padding-left: 68px;
    background: transparent;
}
.kb-acc-subcol-body .kb-acc-article-row:hover { background: #ebebeb; }

/* ── Editor.js text visibility fix ─────────────────────── */
#kb-editorjs,
#kbce-desc-editorjs {
    color: #333;
}
#kb-editorjs .ce-paragraph,
#kb-editorjs .ce-header,
#kb-editorjs .cdx-input,
#kb-editorjs [contenteditable],
#kbce-desc-editorjs .ce-paragraph,
#kbce-desc-editorjs .ce-header,
#kbce-desc-editorjs .cdx-input,
#kbce-desc-editorjs [contenteditable] {
    color: #333 !important;
    -webkit-text-fill-color: #333 !important;
}
#kb-editorjs .ce-block__content *,
#kbce-desc-editorjs .ce-block__content * {
    color: #333;
    -webkit-text-fill-color: #333;
}
.codex-editor{
    display: flex !important;
    /* flex-direction: column !important; */
    gap: 10px !important;
}
.ce-toolbar{
    position:  relative !important;
    order:-1 !important;
}
.ce-toolbar__actions{
    position: initial !important;
}
.kb-manage-table{
    font-size: 14px !important;
}
a.btn.btn-default.btn-mat{
    font-size: 16px !important;
}
.kb-manage-col-desc{
    font-size: 14px !important;
}
.kb-manage-table th{
    font-size: 16px !important;
}
a.btn.btn-main.btn-mat {
    font-size: 16px !important;
}
a.kb-col-action-btn svg {
    font-size: 16px !important;
    width: 18px !important;
    height: 18px !important;
}
.kbce-user-time{
    font-size: 13px !important;
}
.kbce-user-name{
    font-size: 16px !important;
}
button#kbce-unpublish-btn {
    font-size: 14px !important;
}
button#kbce-save-btn {
    font-size: 14px !important;
}
.kbce-item-meta{
    font-size: 14px !important;
}
.kbce-item-actions{
    font-size: 14px !important;
}
.kbce-item-action-btn{
    font-size: 14px !important;
}
.kbce-item-action-btn.danger{
    font-size: 14px !important;
}

/* =========================================================
   Moved from kb-edit-item.phtml inline <style>
   ========================================================= */

/* ── Collection picker ───────────────────────────────────── */
.kb-col-picker           { position:relative; }
.kb-col-picker-btn       { display:inline-flex; align-items:center; gap:6px; padding:5px 10px; border:1px solid var(--border-color,#ddd); border-radius:8px; background:#f5f5f5; font-size:13px; color:var(--text-color,#444); cursor:pointer; white-space:nowrap; max-width:280px; }
.kb-col-picker-btn:hover { background:var(--bg-light,#f8f9fa); border-color:var(--main-color,#6366f1); }
.kb-col-picker-drop      { position:absolute; top:calc(100% + 4px); left:0; z-index:500; background:#fff; border:1px solid var(--border-color,#e0e0e0); border-radius:10px; box-shadow:0 6px 24px rgba(0,0,0,.12); min-width:220px; max-width:320px; max-height:260px; overflow-y:auto; padding:4px 0; }
.kb-col-picker-opt       { display:flex; align-items:center; gap:7px; padding:8px 10px; font-size:13px; color:var(--text-color,#333); cursor:pointer; border-radius:6px; margin:1px 4px; }
.kb-col-picker-opt:hover { background:var(--bg-light,#f5f5f5); }
.kb-col-picker-opt.active{ background:var(--main-color,#6366f1); color:#fff; }

/* ── Publish/Draft badges ────────────────────────────────── */
.kb-pub-badge             { display:inline-flex; align-items:center; font-size:11px; font-weight:600; letter-spacing:.04em; border-radius:4px; padding:2px 7px; }
.kb-pub-badge-published   { background:#dcfce7; color:#15803d; }
.kb-pub-badge-draft       { background:#f3f4f6; color:#6b7280; }
.kb-pub-toggle-btn        { display:inline-flex; align-items:center; font-size:11px; font-weight:600; letter-spacing:.04em; border-radius:4px; padding:2px 10px; border:none; cursor:pointer; transition:opacity .15s; }
.kb-pub-toggle-btn:hover  { opacity:.8; }
.kb-pub-toggle-btn.published { background:#dcfce7; color:#15803d; }
.kb-pub-toggle-btn.draft     { background:#f3f4f6; color:#6b7280; }

/* ── Article / Collection editor footer bar ──────────────── */
.kb-editor-footer     { display:flex; align-items:center; gap:10px; padding:16px 20px; border-top:1px solid var(--border-color,#eee); flex-wrap:wrap; justify-content:flex-end; background:#fff; padding-left: 0 !important; padding-right: 0 !important; }
.kb-footer-btn        { font-size:14px !important; padding:9px 22px !important; border-radius:30px !important; min-width:90px; }
.kb-footer-btn-danger { background:#fff5f5 !important; color:#c00 !important; border:1px solid #fcc !important; }

/* ── Editor.js mount overrides ───────────────────────────── */
#kb-editorjs .ce-block__content,
#kb-editorjs .ce-toolbar__content { max-width:100% !important; }
#kb-editorjs .ce-block--stretched .ce-block__content { max-width:none !important; }
#kb-editorjs .codex-editor__redactor { padding-bottom:80px !important; }
/* Table: tc-wrap/tc-table have height:100% in bundle; tc-add-column grows N×34px per row
   causing align-self:stretch to inflate row height. Fix with auto height + start alignment. */
/* #kb-editorjs .tc-wrap  { height:auto !important; --color-border:#aaa; border-left:1px solid #aaa !important; }
#kb-editorjs .tc-table { height:auto !important; align-self:start !important; align-content:start !important; }

#kb-editorjs .ce-block--stretched .tc-table { overflow-x:auto !important; }
#kb-editorjs .ce-block--stretched .tc-row   { display:flex !important; flex-wrap:nowrap !important; }
#kb-editorjs .ce-block--stretched .tc-cell  { flex:1 0 80px !important; } */

/* =========================================================
   Moved from kb-manage.phtml inline <style>
   ========================================================= */

/* ── Manage: shared list & table ─────────────────────────── */
.kb-manage-col-list { display:flex; flex-direction:column; gap:6px; }
.kb-manage-col-row  { display:flex; align-items:center; gap:6px; padding:8px 10px; border-radius:8px; background:var(--bg-light,#f8f9fa); }
.kb-manage-col-title{ font-weight:500; font-size:14px; flex:1; color:var(--text-color,#333); text-decoration:none; }
.kb-manage-col-title:hover{ color:var(--main-color); }
.kb-manage-col-desc { font-size:12px; color:var(--text-muted,#888); }
.kb-manage-col-actions { margin-left:auto; display:flex; gap:6px; }
.kb-manage-table    { width:100%; border-collapse:collapse; font-size:13px; }
.kb-manage-table th { text-align:left; padding:8px 10px; font-weight:500; border-bottom:1px solid var(--border-color,#eee); color:var(--text-muted,#888); font-size:12px; }
.kb-manage-table td { padding:9px 10px; border-bottom:1px solid var(--border-color,#eee); vertical-align:middle; min-width:128px; }
.kb-manage-table tr:last-child td { border-bottom:none; }
.kb-manage-item-title { font-weight:500; color:var(--text-color,#333); text-decoration:none; }
.kb-manage-item-title:hover { color:var(--main-color); }
.kb-col-action-buttons { display:flex; align-items:center; gap:10px; justify-content:center; }
.kb-col-action-buttons .kb-col-action-btn { padding:0; }

/* ── Editor.js holder (collection editor) ────────────────── */
.kb-editorjs-holder { padding:20px 54px; min-height:180px; }
.kb-editorjs-holder .ce-block__content,
.kb-editorjs-holder .ce-toolbar__content { max-width:100% !important; }
.kb-editorjs-holder .ce-block--stretched .ce-block__content { max-width:none !important; }
.kb-editorjs-holder .codex-editor__redactor { padding-bottom:80px !important; }
/* Table: same height fix as #kb-editorjs above */
.kb-editorjs-holder .tc-wrap  { height:auto !important; --color-border:#aaa; border-left:1px solid #aaa !important; }
/* .kb-editorjs-holder .tc-table { height:auto !important; align-self:start !important; align-content:start !important; }

.kb-editorjs-holder .ce-block--stretched .tc-table { overflow-x:auto !important; }
.kb-editorjs-holder .ce-block--stretched .tc-row   { display:flex !important; flex-wrap:nowrap !important; }
.kb-editorjs-holder .ce-block--stretched .tc-cell  { flex:1 0 80px !important; } */


#kb-editorjs .tc-wrap {
    height: auto !important;
    --color-border: #aaa;
    border-left: none !important;
  }
  
  #kb-editorjs .tc-table {
    height: auto !important;
    align-self: start !important;
    align-content: start !important;
    border-left: 1px solid #aaa;
  }
  
  #kb-editorjs .tc-add-column {
    border-top: none !important;
  }
  
  #kb-editorjs .tc-add-row {
    border: none;
  }
  
  #kb-editorjs .tc-row::after {
    border-bottom: none;
  }
  #kb-editorjs .codex-editor {
     align-items: flex-start; 
    }
  #kb-editorjs .tc-table::after,
  #kb-editorjs .tc-table::before { 
    pointer-events: none; 
}



/* ── KB article read view: rendered table ────────────────── */
.kb-table-wrap { overflow-x:auto; margin:8px 0; }
.kb-table { width:100%; border-collapse:collapse; font-size:14px; line-height:1.5; }
.kb-table td,
.kb-table th { padding:8px 12px; border:1px solid var(--border-color,#e8e8eb); min-width:80px; vertical-align:top; word-break:break-word; }
.kb-table th { background:var(--bg-light,#f9f9fb); font-weight:600; text-align:left; }
.kb-table tbody tr:hover { background:var(--bg-light,#f9f9fb); }
/* stretched table in read view: allow horizontal scroll for wide tables */
.kb-table-wrap.kb-table-stretched { overflow-x:auto; }
.kb-table-wrap.kb-table-stretched .kb-table { width:max-content; min-width:100%; }

/* ── Collection full-page editor (kbce) ─────────────────── */
.kbce-topbar        { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 16px !important; margin-bottom:12px; position:sticky; top:70px; z-index:500; }
@media (max-width: 768px) {
    .kbce-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .kbce-add-article-btn{
        margin-top: 10px;
    }
    .kbce-items-header{
        display: block;
    }
}

/* @media (max-width: 768px) {
    .kbce-body {
        padding: 16px 12px !important;
    }

    .kbce-items-header {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .kbce-items-header .kbce-add-article-btn {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .kbce-add-article-btn{
        padding: 5px 9px !important;
    }
    .kbce-items-list {
        overflow-x: hidden;
        max-width: 100%;
    }

    .kbce-item-row {
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px 6px;
    }

    .kbce-item-left {
        flex: 1 1 auto;
        min-width: 0;
        max-width: calc(100% - 130px);
    }

    .kbce-item-link {
        font-size: 13px;
    }

    .kbce-item-right {
        flex: 0 0 auto;
        margin-left: auto;
        gap: 6px;
        min-width: 0;
    }

    .kbce-item-meta {
        min-width: 0;
        font-size: 10px;
    }

    .kbce-item-actions .kb-pub-toggle-btn {
        min-width: 0;
        font-size: 10px;
        padding: 2px 6px;
    }
} */
@media (max-width: 768px) {
    .kbce-body {
        /* padding: 16px 12px !important; */
        overflow-x: hidden;
    }

    .kbce-items-section {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .kbce-items-header {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        min-width: max-content;
        padding-bottom: 4px;
    }

    .kbce-items-header .kbce-add-article-btn {
        margin-left: 0 !important;
        margin-right: 0 !important;
        flex-shrink: 0;
        white-space: nowrap;
    }

    .kbce-items-list {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    .kbce-item-row {
        flex-wrap: nowrap;
        min-width: 520px;
        gap: 10px;
        padding: 8px 10px;
    }

    .kbce-item-left {
        flex: 1 1 auto;
        min-width: 140px;
        max-width: none;
    }

    .kbce-item-link {
        font-size: 13px;
    }

    .kbce-item-right {
        flex-shrink: 0;
        margin-left: auto;
        gap: 8px;
    }

    .kbce-item-meta {
        min-width: 88px;
        font-size: 11px;
    }

    .kbce-item-actions .kb-pub-toggle-btn {
        min-width: 76px;
        font-size: 11px;
    }
}
@media (max-width: 768px) {
    table.kb-manage-table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table.kb-manage-table thead,
    table.kb-manage-table tbody {
        display: table;
        width: max-content;
        min-width: 680px;
    }

    table.kb-manage-table tr {
        display: table-row;
    }

    table.kb-manage-table th,
    table.kb-manage-table td {
        display: table-cell;
        padding: 8px;
        font-size: 12px;
        vertical-align: top;
    }

    table.kb-manage-table th:first-child,
    table.kb-manage-table td:first-child {
        min-width: 140px;
        max-width: 200px;
    }

    .kb-manage-item-title {
        white-space: normal;
        word-break: break-word;
        line-height: 1.35;
    }

    .kb-manage-col-name {
        white-space: nowrap;
        font-size: 12px;
    }

    table.kb-manage-table .kb-pub-toggle-btn {
        font-size: 10px;
        padding: 2px 6px;
    }

    .kb-col-action-buttons .kb-col-action-btn svg {
        width: 16px !important;
        height: 16px !important;
    }
    table.kb-manage-table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: #1565c0 #dbeafe;
    }

    table.kb-manage-table::-webkit-scrollbar {
        height: 5px;
    }

    table.kb-manage-table::-webkit-scrollbar-track {
        background: #dbeafe;
        border-radius: 5px;
    }

    table.kb-manage-table::-webkit-scrollbar-thumb {
        background: #1565c0;
        border-radius: 5px;
    }

    table.kb-manage-table::-webkit-scrollbar-thumb:hover {
        background: #0d47a1;
    }
}
.kbce-topbar-left   { display:flex; align-items:center; gap:6px; min-width:0; }
.kbce-topbar-right  { display:flex; align-items:center; gap:8px; flex-shrink:0; position:relative; }
.kbce-icon-btn      { display:flex; align-items:center; gap:5px; background:none; border:1px solid var(--border-color,#ddd); border-radius:7px; padding:5px 10px; font-size:12px; color:var(--text-muted,#555); cursor:pointer; }
.kbce-icon-btn:hover{ background:var(--bg-light,#f5f5f5); }
.kbce-layout        { display:flex; gap:0; align-items:flex-start; }
.kbce-body          { flex:1; min-width:0; padding:22px 24px ; }
.kbce-activity-panel{ width:300px; flex-shrink:0; background:#fff; border-left:1px solid var(--border-color,#eee); border-radius:0 12px 12px 0; position:sticky; top:70px; max-height:calc(100vh - 90px); display:flex; flex-direction:column; overflow:hidden; box-shadow:-2px 0 12px rgba(0,0,0,.05); }
.kbce-meta-row      { display:flex; align-items:center; gap:10px; margin-bottom:20px; flex-wrap:wrap; }
.kbce-icon-wrap     { position:relative; }
.kbce-icon-picker-btn{ font-size:26px; background:none; border:2px solid transparent; border-radius:10px; padding:4px 8px; cursor:pointer; line-height:1; transition:border-color .15s; }
.kbce-icon-picker-btn:hover{ border-color:var(--border-color,#ddd); background:var(--bg-light,#f8f9fa); }
.kbce-emoji-picker  { position:absolute; top:calc(100% + 6px); left:0; z-index:200; background:#fff; border:1px solid var(--border-color,#ddd); border-radius:10px; box-shadow:0 4px 16px rgba(0,0,0,.12); width:220px; }
.kbce-emoji-grid    { display:flex; flex-wrap:wrap; padding:8px; gap:2px; }
.kbce-emoji-opt     { font-size:20px; background:none; border:none; border-radius:6px; padding:4px; cursor:pointer; line-height:1; }
.kbce-emoji-opt:hover{ background:var(--bg-light,#f5f5f5); }
.kbce-emoji-custom-input{ width:100%; border:none; outline:none; font-size:13px; padding:2px 0; color:var(--text-color,#333); background:transparent; }
.kbce-color-wrap    { display:flex; align-items:center; gap:0; cursor:pointer; }
.kbce-color-input   { width:0; height:0; padding:0; border:none; opacity:0; position:absolute; }
.kbce-color-swatch  { width:22px; height:22px; border-radius:50%; border:2px solid rgba(0,0,0,.12); cursor:pointer; transition:transform .15s; }
.kbce-color-swatch:hover{ transform:scale(1.15); }
.kbce-visibility-toggle{ display:flex; align-items:center; gap:6px; font-size:11px; font-weight:600; letter-spacing:.05em; color:var(--text-muted,#888); cursor:pointer; margin-left:6px; background:none; border:1px solid transparent; border-radius:6px; padding:3px 8px; transition:background .15s,border-color .15s; }
.kbce-visibility-toggle:hover{ background:var(--bg-light,#f5f5f5); border-color:var(--border-color,#ddd); }
.kbce-pub-dot       { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.kbce-title-field   { font-size:18px; font-weight:600; line-height:1.4; color:#393d4a; outline:none; margin-bottom:0; padding:10px 15px; min-height:50px; background-color:#F5F5F5; border-radius:10px; border:0; transition:box-shadow .15s; box-sizing:border-box; }
.kbce-title-field:focus{ box-shadow:0 0 0 2px var(--main-color,#6366f1)44; }
.kbce-title-field.kbce-placeholder:before{ content:attr(data-placeholder); color:var(--text-muted,#bbb); font-weight:400; pointer-events:none; }
.kbce-desc-field    { font-size:14px; color:var(--text-muted,#888); outline:none; margin-bottom:0; min-height:24px; padding:2px 0; border-bottom:1px solid transparent; transition:border-color .15s; }
.kbce-desc-field:focus{ border-bottom-color:var(--border-color,#ddd); }
.kbce-desc-field.kbce-placeholder:before{ content:attr(data-placeholder); color:var(--text-muted,#ccc); pointer-events:none; }
.kbce-items-section { border-top:1px solid var(--border-color,#eee); padding-top:20px; }
.kbce-items-header  { display:flex; align-items:center; gap:8px; font-size:12px; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted,#888); margin-bottom:10px; }
.kbce-items-count   { background:var(--bg-light,#f0f0f0); border-radius:10px; padding:1px 7px; font-size:11px; }
/* .kbce-items-list    { display:flex; flex-direction:column; gap:2px; margin-bottom:10px; }
.kbce-item-row      { display:flex; align-items:center; gap:8px; padding:7px 10px; border-radius:7px; }
.kbce-item-row:hover{ background:var(--bg-light,#f8f9fa); }
.kbce-item-link     { flex:1; font-size:14px; color:var(--text-color,#333); text-decoration:none; font-weight:500; }
.kbce-item-link:hover{ color:var(--main-color); }
.kbce-item-meta     { font-size:11px; color:var(--text-muted,#aaa); white-space:nowrap; }
.kbce-item-actions  { display:flex; gap:2px; opacity:1; transition:opacity .15s; }
.kbce-item-action-btn{ background:none; border:none; border-radius:5px; padding:3px 6px; cursor:pointer; font-size:12px; color:var(--text-muted,#888); }
.kbce-item-action-btn:hover{ background:var(--bg-light,#eee); color:var(--text-color,#333); }
.kbce-item-action-btn.danger:hover{ background:#ffe5e5; color:#c00; } */
.kbce-item-row      { display:flex; align-items:center; gap:12px; padding:7px 10px; border-radius:7px; }
.kbce-item-row:hover{ background:var(--bg-light,#f8f9fa); }
.kbce-item-left     { display:flex; align-items:center; gap:8px; flex:1; min-width:0; }
.kbce-item-icon     { flex-shrink:0; opacity:.5; }
.kbce-item-link     { flex:1; min-width:0; font-size:14px; color:var(--text-color,#333); text-decoration:none; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.kbce-item-link:hover{ color:var(--main-color); }
.kbce-item-right    { display:flex; align-items:center; gap:10px; flex-shrink:0; margin-left:auto; }
.kbce-item-meta     { font-size:11px; color:var(--text-muted,#aaa); white-space:nowrap; text-align:right; min-width:88px; }
.kbce-item-actions  { display:flex; align-items:center; gap:4px; flex-shrink:0; }
.kbce-item-actions .kb-pub-toggle-btn { min-width:76px; justify-content:center; font-size:11px; padding:2px 8px; }
.kbce-item-action-btn {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0 4px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    color: var(--text-muted, #888);
}
.kbce-item-action-btn:hover {
    background: none;
    color: var(--text-color, #333);
}
.kbce-item-action-btn.danger {
    color: #e55;
}
.kbce-item-action-btn.danger:hover {
    background: none;
    color: #c00;
}
@media (max-width: 768px) {
    .kbce-body{
        padding: 15px !important;
    }
}
/* ── Comments ───────────────────────────────────────────── */
.kb-comments-card {
    background: #fff;
    border-radius: 14px;
    padding: 24px 28px;
    margin-top: 24px;
    border-top: 1px solid var(--border-color, #eee);
}

.kb-comments-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--text-color, #1a1a1a);
}

.kb-comments-count {
    color: #aaa;
    font-weight: 400;
    font-size: 14px;
}

.kb-no-comments {
    color: #b0b0b0;
    font-size: 14px;
    text-align: center;
    padding: 0;
    margin: 0;
}

/* Form */
.kb-comment-form {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    align-items: flex-end;
}

.kb-comment-avatar,
.kb-comment-reply-avatar {
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.kb-comment-avatar { width: 40px; height: 40px; }
.kb-comment-reply-avatar { width: 32px; height: 32px; }

.kb-comment-input-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.kb-comment-textarea {
    flex: 1;
    width: 100%;
    min-width: 0;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    resize: vertical;
    min-height: 44px;
    box-sizing: border-box;
    font-family: inherit;
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.kb-comment-textarea:focus {
    border-color: var(--main-color, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}

.kb-comment-post-btn {
    flex-shrink: 0;
    border: none;
    border-radius: 999px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #5b8def 0%, #6366f1 100%);
    transition: opacity .15s, transform .1s;
    white-space: nowrap;
}

.kb-comment-post-btn:hover {
    opacity: .92;
}

/* Comment list */
.kb-comment {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.kb-comment-body {
    flex: 1;
    min-width: 0;
}

.kb-comment-bubble {
    background: #f5f6f8;
    border-radius: 12px;
    padding: 12px 14px;
}

.kb-comment-author-name,
.kb-reply-author-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color, #1a1a1a);
    text-decoration: none;
}

.kb-comment-author-name:hover,
.kb-reply-author-name:hover {
    color: var(--main-color);
}

.kb-comment-time {
    font-size: 12px;
    color: #bbb;
    margin-left: 8px;
}

.kb-comment-text,
.kb-reply-text {
    margin: 6px 0 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-color, #333);
    word-break: break-word;
}

.kb-comment-actions {
    display: flex;
    gap: 12px;
    margin-top: 6px;
    padding-left: 4px;
}

.kb-comment-action-btn {
    background: none;
    border: none;
    font-size: 12px;
    color: #888;
    cursor: pointer;
    padding: 0;
}

.kb-comment-action-btn:hover { color: var(--main-color); }
.kb-comment-action-btn.danger { color: #e55; }
.kb-comment-action-btn.danger:hover { color: #c00; }

.kb-reply { margin-left: 20px; }

.kb-reply-bubble {
    background: #eef0f3;
    border-radius: 10px;
    padding: 10px 12px;
}

/* Mobile */
@media (max-width: 768px) {
    .kb-comments-card {
        padding: 16px;
        margin-top: 16px;
        border-radius: 12px;
    }

    .kb-comments-title {
        font-size: 15px;
        margin-bottom: 12px;
    }

    .kb-no-comments {
        padding: 0;
        font-size: 13px;
    }

    .kb-comment-form {
        gap: 10px;
    }

    .kb-comment-avatar {
        width: 36px;
        height: 36px;
    }

    .kb-comment-input-wrap {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .kb-comment-post-btn {
        align-self: flex-end;
        padding: 8px 18px;
    }

    .kb-comment-time {
        display: block;
        margin: 2px 0 0;
    }

    .kb-comment-bubble,
    .kb-reply-bubble {
        padding: 10px 12px;
    }

    .kb-reply {
        margin-left: 0;
        padding-left: 12px;
        border-left: 2px solid #eee;
    }

    .kb-comment-textarea {
        font-size: 13px;
        min-height: 40px;
    }
}
.kbce-items-empty   { font-size:13px; color:var(--text-muted,#aaa); margin:0 0 12px; }
.kbce-add-article-btn{ display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:600; color:#fff; background:var(--main-color,#6366f1); text-decoration:none; padding:5px 14px; border-radius:6px; }
.kbce-add-article-btn:hover{ opacity:.88; color:#fff; }
.kbce-more-menu-fixed  { position:fixed; z-index:9999; background:#fff; border:1px solid var(--border-color,#e0e0e0); border-radius:10px; box-shadow:0 6px 24px rgba(0,0,0,.14); min-width:240px; padding:6px 0; }
.kbce-more-menu        { position:absolute; right:0; top:calc(100% + 6px); z-index:9999; background:#fff; border:1px solid var(--border-color,#e0e0e0); border-radius:10px; box-shadow:0 6px 24px rgba(0,0,0,.12); min-width:290px; padding:6px 0; }
.kbce-more-users       { padding:10px 14px; display:flex; gap:14px; }
.kbce-more-user-block  { flex:1; }
.kbce-more-user-label  { display:block; font-size:10px; font-weight:700; letter-spacing:.06em; color:var(--text-muted,#aaa); margin-bottom:6px; }
.kbce-more-user-info   { display:flex; align-items:center; gap:7px; }
.kbce-avatar           { width:30px; height:30px; border-radius:50%; object-fit:cover; flex-shrink:0; }
.kbce-avatar-initials  { display:inline-flex; align-items:center; justify-content:center; width:30px; height:30px; border-radius:50%; background:var(--main-color,#6366f1); color:#fff; font-size:12px; font-weight:600; flex-shrink:0; }
.kbce-user-name        { font-size:12px; font-weight:500; color:var(--text-color,#333); line-height:1.2; }
.kbce-user-time        { font-size:11px; color:var(--text-muted,#aaa); margin-top:1px; }
.kbce-more-meta-simple { padding:6px 14px; font-size:12px; color:var(--text-muted,#888); display:flex; flex-direction:column; gap:3px; }
.kbce-more-meta-label  { color:var(--text-muted,#999); }
.kbce-more-meta-val    { color:var(--text-color,#555); font-weight:500; }
.kbce-more-divider     { height:1px; background:var(--border-color,#eee); margin:4px 0; }
.kbce-more-item        { display:flex; align-items:center; gap:8px; width:100%; padding:8px 14px; border:none; background:none; font-size:13px; color:var(--text-color,#333); cursor:pointer; text-align:left; }
.kbce-more-item:hover  { background:var(--bg-light,#f5f5f5); }
.kbce-more-item.danger { color:#d00; }
.kbce-more-item.danger:hover{ background:#fff5f5; }
.kbce-activity-header{ display:flex; align-items:center; justify-content:space-between; padding:12px 16px; border-bottom:1px solid var(--border-color,#eee); flex-shrink:0; }
.kbce-activity-title { font-size:11px; font-weight:700; letter-spacing:.08em; color:var(--text-muted,#888); }
.kbce-activity-close { background:none; border:none; font-size:16px; cursor:pointer; color:var(--text-muted,#aaa); padding:2px 6px; border-radius:4px; line-height:1; }
.kbce-activity-close:hover{ color:var(--text-color,#333); background:var(--bg-light,#eee); }
.kbce-activity-body  { flex:1; overflow-y:auto; padding:12px 16px; }
.kbce-activity-footer{ padding:10px 16px; border-top:1px solid var(--border-color,#eee); flex-shrink:0; }
.kbce-activity-feed  { display:flex; flex-direction:column; gap:10px; }
.kbce-activity-item  { display:flex; gap:10px; align-items:flex-start; }
.kbce-activity-dot   { width:8px; height:8px; border-radius:50%; background:var(--main-color,#6366f1); margin-top:4px; flex-shrink:0; }
.kbce-activity-text  { font-size:13px; color:var(--text-color,#444); line-height:1.4; }
.kbce-activity-time  { display:block; font-size:11px; color:var(--text-muted,#aaa); margin-top:2px; }
.kbce-activity-link  { color:var(--main-color); text-decoration:none; }
.kbce-activity-link:hover{ text-decoration:underline; }
.kbce-activity-empty { font-size:13px; color:var(--text-muted,#aaa); margin:0; text-align:center; padding:20px 0; }

/* ── Collection description Editor.js ───────────────────── */
.kbce-desc-editorjs                              { margin-bottom:0; min-height:80px; background-color:#F5F5F5; border-radius:10px; padding:6px 8px; }
.kbce-desc-editorjs .ce-block__content,
.kbce-desc-editorjs .ce-toolbar__content        { max-width:100% !important; }
.kbce-desc-editorjs .codex-editor__redactor     { padding-bottom:20px !important; }
.kbce-desc-editorjs .ce-paragraph               { font-size:14px; color:#393d4a; -webkit-text-fill-color:#393d4a; }

/* ── Share buttons ───────────────────────────────────────── */
.kb-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    transition: background 0.15s;
    line-height: 1;
}
.kb-share-btn:hover { background: #f5f5f5; }

.kb-acc-share-btn, .kb-acc-article-share {
    background: none;
    border: none;
    padding: 3px 5px;
    color: #888;
    cursor: pointer;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    opacity: 1;
    transition: opacity 0.15s, background 0.15s;
    line-height: 1;
    flex-shrink: 0;
}
.kb-acc-share-btn:hover, .kb-acc-article-share:hover { opacity: 1; background: #f0f0f0; }

/* ── Live search dropdown ─────────────────────────────────────────────── */
.kb-search-wrap { position: relative; }
.kb-search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0; right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,.13);
    z-index: 9999;
    max-height: 420px;
    overflow-y: auto;
}
.kb-sd-section {
    padding: 10px 16px 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #9ca3af;
}
.kb-sd-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 16px;
    text-decoration: none;
    color: #1f2937;
    transition: background .1s;
}
.kb-sd-item:hover { background: #f9fafb; text-decoration: none; color: #1f2937; }
.kb-sd-icon { flex-shrink: 0; margin-top: 2px; color: #6366f1; line-height: 0; }
.kb-sd-text { flex: 1; min-width: 0; }
.kb-sd-title {
    font-size: 14px;
    font-weight: 600;
    display: block;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kb-sd-tag {
    display: inline-block;
    margin-top: 3px;
    font-size: 11px;
    background: #f3f4f6;
    border-radius: 4px;
    padding: 1px 7px;
    color: #6b7280;
}
.kb-sd-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-top: 1px solid #f3f4f6;
    font-size: 13px;
    color: #6b7280;
    text-decoration: none;
    transition: background .1s;
}
.kb-sd-footer:hover { background: #f9fafb; color: #374151; text-decoration: none; }

.kbce-desc-editorjs .codex-editor--empty .ce-block:first-child .ce-paragraph:before { color:var(--text-muted,#bbb); }

/* =========================================================
   Moved from kb-home.phtml inline <style>
   ========================================================= */

/* ── Hero ────────────────────────────────────────────────── */
.kb-hero {
    background: #fff;
    padding: 40px 32px 44px;
    text-align: center;
    margin: 0 0 24px;
    border-radius: 12px;
    border: 1px solid #eee;
}
.kb-hero-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--main-color);
    margin-bottom: 16px;
}
.kb-hero-search-row {
    display: flex;
    align-items: center;
    /* max-width: 720px; */
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    overflow: hidden;
    border: 1.5px solid #e0e0e0;
}
.kb-hero-search-row svg {
    flex-shrink: 0;
    /* margin-left: 14px; */
    color: #bbb;
}
.kb-hero-search-row input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    padding: 11px 10px 11px 8px;
    background: transparent;
    color: var(--main-text);
}
.kb-hero-search-row input::placeholder { color: #aaa; }
.kb-hero-search-btn {
    background: var(--main-color);
    color: #fff;
    border: none;
    padding: 0 20px;
    height: 44px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity .15s;
    flex-shrink: 0;
}
.kb-hero-search-btn:hover { opacity: .88; }
.kb-compact-header {
    background: #fff;
    padding: 20px !important;
    border-radius: 10px;
    margin-bottom: 20px;
}


/* ── Collection card grid ────────────────────────────────── */
.kb-col-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
    padding: 0 2px 24px;
}
.kb-col-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: #fff;
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    padding: 20px 18px 16px;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s, box-shadow .15s, transform .1s;
    position: relative;
}
.kb-col-card:hover {
    border-color: var(--main-color);
    box-shadow: 0 4px 14px rgba(0,0,0,.07);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}
.kb-col-card-icon {
    font-size: 28px;
    margin-bottom: 10px;
    line-height: 1;
}
.kb-col-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--main-text);
    margin-bottom: 5px;
    line-height: 1.35;
}
.kb-col-card-desc {
    font-size: 12px;
    color: #888;
    line-height: 1.45;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.kb-col-card-count {
    margin-top: 12px;
    font-size: 11px;
    color: #aaa;
    font-weight: 500;
}
.kb-col-card-admin {
    position: absolute;
    top: 8px;
    right: 28px;
    display: flex;
    gap: 4px;
}
.kb-col-card-admin a {
    font-size: 13px;
    text-decoration: none;
    background: rgba(255,255,255,.9);
    border-radius: 6px;
    padding: 2px 5px;
}
.kb-col-card.active {
    border-color: var(--main-color);
    box-shadow: 0 4px 14px rgba(0,0,0,.1);
}
.kb-col-card-share {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #ccc;
    border-radius: 6px;
    transition: color .15s;
    line-height: 0;
}
.kb-col-card-share:hover { color: var(--main-color); }

/* ── Collection detail rows ──────────────────────────────── */
.kb-col-detail-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 0;
    border-bottom: 1px solid #f5f5f5;
}
.kb-col-detail-row:last-child { border-bottom: none; }
.kb-col-detail-row-icon { flex-shrink: 0; color: var(--main-color); line-height: 0; }
.kb-col-detail-row-title {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--main-text);
    text-decoration: none;
}
.kb-col-detail-row-title:hover { color: var(--main-color); text-decoration: none; }
.kb-col-detail-row-edit { font-size: 13px; text-decoration: none; flex-shrink: 0; }
.kb-col-detail-empty { padding: 20px 0; color: #aaa; font-size: 14px; text-align: center; }

/* ── Collection sections ─────────────────────────────────── */
.kb-col-sections { margin-top: 8px; }
.kb-col-section {
    display: none;
    background: #fff;
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    margin-bottom: 14px;
    padding: 20px 24px 8px;
    scroll-margin-top: 80px;
    transition: border-color .2s, box-shadow .2s;
}
.kb-col-section.kb-active {
    display: block;
    border-color: var(--main-color);
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.kb-col-section-hdr {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--main-text);
    margin-bottom: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}
.kb-col-section-hdr-icon { font-size: 20px; line-height: 1; }

/* ── Sub-collection link rows ────────────────────────────── */
.kb-col-sub-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: color .15s;
    text-decoration: none;
    color: var(--main-text);
}
.kb-col-sub-link:last-child { border-bottom: none; }
.kb-col-sub-link:hover { color: var(--main-color); }
.kb-col-sub-link:hover .kb-col-sub-link-chevron { color: var(--main-color); }
.kb-col-sub-link-icon { flex-shrink: 0; color: #888; line-height: 0; }
.kb-col-sub-link-title { flex: 1; font-size: 14px; font-weight: 500; }
.kb-col-sub-link-count { font-size: 11px; color: #aaa; white-space: nowrap; }
.kb-col-sub-link-chevron { flex-shrink: 0; color: #ccc; line-height: 0; }

/* ── Compact header ──────────────────────────────────────── */
.kb-compact-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0 18px;
    flex-wrap: wrap;
}
.kb-compact-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.kb-compact-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--main-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kb-compact-search-wrap {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border: 1.5px solid #e8e8e8;
    border-radius: 7px;
    padding: 0 10px;
    gap: 6px;
    height: 36px;
}
.kb-compact-search-wrap input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    width: 180px;
    color: var(--main-text);
}
.kb-compact-search-wrap input::placeholder { color: #aaa; }
.kb-manage-btn {
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 7px;
    background: var(--main-color);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    transition: opacity .15s;
}
.kb-manage-btn:hover { opacity: .88; color: #fff; text-decoration: none; }

/* ── Empty state ─────────────────────────────────────────── */
.kb-col-empty-card {
    grid-column: 1/-1;
    text-align: center;
    padding: 40px 20px;
    color: #aaa;
    font-size: 14px;
}
/* Wider embed URL field */
#kb-editorjs,
.kb-editorjs-holder {
    padding-left: 24px !important;
    padding-right: 24px !important;
}

#kb-editorjs .ce-block__content,
.kb-editorjs-holder .ce-block__content,
#kbce-desc-editorjs .ce-block__content {
    max-width: 100% !important;
    width: 100% !important;
}

#kb-editorjs input[type="url"],
.kb-editorjs-holder input[type="url"],
#kbce-desc-editorjs input[type="url"] {
    width: 100% !important;
    min-width: 520px;
    max-width: 100%;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    #kb-editorjs input[type="url"],
    .kb-editorjs-holder input[type="url"],
    #kbce-desc-editorjs input[type="url"] {
        min-width: 0;
    }
}
#kb-editorjs .ce-paragraph,
#kb-editorjs [contenteditable] {
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}

#kb-editorjs a {
    word-break: break-all;
}
.community-register{
    margin: 0 auto !important;
}
/* ── Hero ────────────────────────────────────────────────── */
.kb-hero {
    background: #ffffff;
    padding: 40px 32px 44px;
    text-align: center;
    margin: 0 0 24px;
    border-radius: 12px;
    border: 1px solid #eee;
}

.kb-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.kb-hero-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--main-color);
    margin: 0;
    text-align: left;
}

.kb-hero-top .kb-manage-btn {
    flex-shrink: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}
.kb-search-wrap .kb-hero-search-row {
    width: 100% !important;
}
@media (min-width: 768px) {
    .kb-editor-footer{
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}