
/* access */
.access-lock{display:inline-flex;vertical-align:-2px;margin-inline-end:4px;color:var(--text-subtle)}.access-lock .icon{width:14px;height:14px}.access-when{display:none}.access-row .form-help{margin-top:4px}.access-pw{display:flex;gap:8px;justify-content:center;margin-top:12px}.access-pw input{max-width:220px}.access-hidden{margin:12px 0 0;padding:12px 14px;border:1px dashed var(--line);border-radius:var(--radius);background:var(--panel-2);color:var(--text-muted);font-size:var(--font-size-sm)}.access-hidden b{color:var(--text)}.access-shown{margin-top:12px;padding:12px 14px;border:1px solid var(--success);border-radius:var(--radius);background:var(--success-soft)}.access-shown > .access-shown-head{display:flex;align-items:center;gap:6px;margin-bottom:6px;color:var(--success);font-size:var(--font-size-sm);font-weight:600}.access-shown .icon{width:15px;height:15px}.access-private{color:var(--text-muted);font-style:italic}

/* aiclassify */
.aiclassify-strip{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:-4px 0 12px;padding:9px 12px;border-radius:10px;background:var(--panel-2);font-size:var(--font-size-sm);color:var(--text-muted)}.aiclassify-strip[hidden]{display:none}.aiclassify-lead{color:var(--text-muted)}.aiclassify-chip{padding:2px 9px;border:1px solid var(--line);border-radius:999px;background:var(--panel);color:var(--text)}.aiclassify-chip.aiclassify-cat{border-color:transparent;background:var(--brand-soft);color:var(--brand);font-weight:600}.aiclassify-space{flex:1}.aiclassify-btn{margin-top:6px;padding:3px 10px;border:0;border-radius:999px;background:var(--brand-soft);color:var(--brand);font:inherit;font-size:var(--font-size-xs);cursor:pointer}.aiclassify-btn:disabled{opacity:.6;cursor:default}

/* announce */
.announce-bar{display:flex;align-items:center;gap:8px;padding:9px 14px;margin-bottom:12px;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);font-size:var(--font-size-md)}.announce-icon{display:inline-flex;color:var(--brand);flex:none}.announce-icon svg{width:18px;height:18px}.announce-label{color:var(--brand);flex:none}.announce-list{position:relative;flex:1;min-width:0;height:1.6em;overflow:hidden}.announce-item{position:absolute;inset:0;display:flex;align-items:center;gap:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;opacity:0;transform:translateY(110%);transition:opacity .35s,transform .35s}.announce-item.on{opacity:1;transform:none}.announce-item.off{opacity:0;transform:translateY(-110%)}.announce-item a{color:var(--text);font-weight:550}.announce-item a:hover{color:var(--brand)}.announce-item time{color:var(--text-subtle);font-size:var(--font-size-xs);flex:none}.announce-nav{display:inline-flex;gap:2px;flex:none;margin-inline-start:auto}.announce-nav button{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border:0;border-radius:var(--radius-sm);background:none;color:var(--text-subtle);cursor:pointer;padding:0}.announce-nav button:hover{background:var(--panel-2);color:var(--text)}.announce-nav svg{width:16px;height:16px}[dir="rtl"] .announce-nav svg{transform:scaleX(-1)}.col-right .announce-bar{flex-wrap:wrap}.col-right .announce-list{flex-basis:100%}.col-right .announce-nav{order:-1;margin-inline-start:auto}@media(max-width:640px){.announce-bar{margin:0 calc(-1 * var(--page-x,12px)) 10px;border-radius:0;border-left:0;border-right:0;padding:8px var(--page-x,12px);font-size:var(--font-size-sm)}.announce-item time{display:none}}

/* back_to_top */

    #back-to-top {
      position: fixed;
      bottom: 24px;
      inset-inline-end: 24px;
      z-index: 100;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 40px;
      height: 40px;
      border: 1px solid var(--line);
      border-radius: var(--radius-sm);
      background: var(--panel);
      color: var(--text-muted);
      box-shadow: var(--shadow-md);
      cursor: pointer;
      opacity: 0;
      visibility: hidden;
      transform: translateY(10px);
      transition: opacity .2s ease, visibility .2s ease, transform .2s ease, background .12s, color .12s, border-color .12s;
    }
    #back-to-top.show {
      opacity: 1;
      visibility: visible;
      transform: translateY(0);
    }
    #back-to-top:hover {
      background: var(--panel-2);
      color: var(--brand);
      border-color: var(--brand);
    }
    #back-to-top .icon {
      width: 18px;
      height: 18px;
    }

/* badge */
.badge-strip{display:inline-flex;align-items:center;gap:3px;vertical-align:middle}.badge-pic{display:inline-block;object-fit:contain;vertical-align:middle}.badge-pic-empty{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;background:var(--panel-2);border:1px solid var(--line);color:var(--text-muted);font-size:11px;font-weight:700}.badge-more{font-size:var(--font-size-xs);color:var(--text-subtle)}.badge-profile{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 0 14px}.badge-profile-label{font-size:var(--font-size-sm);color:var(--text-muted)}.badge-profile .badge-pic{width:34px;height:34px}.badge-profile a{margin-inline-start:auto;font-size:var(--font-size-sm)}.profile-card .badge-profile{margin:0;gap:8px}.profile-card .badge-profile .badge-strip{order:3;flex-basis:100%;flex-wrap:wrap}.profile-card .badge-profile .badge-pic{width:30px;height:30px}.badge-wall{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:14px}.badge-card{display:flex;gap:12px;align-items:flex-start;padding:14px;border:1px solid var(--line);border-radius:var(--radius);background:var(--panel)}.badge-card.locked{opacity:.55}.badge-card .badge-pic{width:48px;height:48px;flex:none}.badge-card b{display:block}.badge-card p{margin:2px 0 6px;font-size:var(--font-size-sm);color:var(--text-muted)}.badge-how{font-size:var(--font-size-xs);color:var(--text-subtle)}.badge-have{display:block;margin-top:3px;font-size:var(--font-size-xs);color:var(--brand);font-weight:600}.badge-admin-pic{width:32px;height:32px;object-fit:contain;vertical-align:middle}

/* code_highlight */
.post-content pre code.hljs{background:transparent;padding:0}.post-content pre,.editor-preview pre{position:relative;padding:34px 14px 14px;border-radius:6px;line-height:1.7;tab-size:4}.post-content pre.code-dark,.editor-preview pre.code-dark{background:#22272e;border-color:#2f3742;color:#d6dae1}.post-content pre.has-lines,.editor-preview pre.has-lines{padding-inline-start:56px}.code-lines{position:absolute;top:34px;inset-inline-start:0;width:42px;padding-inline-end:10px;text-align:end;color:var(--text-disabled);white-space:pre;user-select:none;-webkit-user-select:none;pointer-events:none;line-height:inherit;font-size:inherit}.code-dark .code-lines{color:#5b6675;border-inline-end:1px solid #2f3742}.code-copy{position:absolute;top:6px;inset-inline-end:8px;display:inline-flex;align-items:center;gap:5px;padding:3px 9px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--panel);color:var(--text-muted);font:inherit;font-size:var(--font-size-xs);line-height:1.6;cursor:pointer;opacity:.75;transition:opacity .15s,color .15s,border-color .15s}.code-copy svg{width:13px;height:13px}.code-copy:hover,.code-copy:focus-visible{opacity:1;color:var(--text)}.code-dark .code-copy{border-color:#39424f;background:#2b323b;color:#9aa6b5}.code-dark .code-copy:hover{color:#fff}.code-copy.done{opacity:1;color:var(--success);border-color:var(--success)}.code-dark .code-copy.done{color:#5dd39e;border-color:#3d7f63}@media(max-width:640px){.code-copy span{display:none}.code-copy{padding:4px 6px}}

/* comments */

/* =========================================================
 * COMMENTS MAIN CONTENT
 * ========================================================= */

.comments-content-wrap {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
}


/* =========================================================
 * SPACE BEFORE ADD COMMENT
 * ========================================================= */

.comments-content-wrap .comments-form,
.comments-content-wrap .comments-login-notice {
    margin-top: 16px;
}

.comments-block {
    margin-top: 32px;
}


/* =========================================================
 * HEADER
 * ========================================================= */

.comments-header {
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 18px;
    padding: 12px 16px;

    box-sizing: border-box;

    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);

    background: #fff;
}

.comments-title-wrap {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.comments-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;

    width: 30px;
    height: 30px;

    border-radius: 8px;

    background: var(--panel-2);
    color: var(--text-muted);
}

.comments-title-icon svg,
.comments-title-icon i {
    width: 16px;
    height: 16px;
}

.comments-title {
    margin: 0;

    font-size: 1.25rem;
    line-height: 1.3;
}

.comments-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 26px;
    height: 24px;
    padding: 0 7px;

    box-sizing: border-box;

    border: 1px solid var(--line);
    border-radius: 999px;

    background: var(--panel-2);
    color: var(--text-muted);

    font-size: var(--font-size-xs);
    font-weight: 600;
    line-height: 1;
}


/* =========================================================
 * ADD COMMENT
 * ========================================================= */

.comments-form {
    margin-top: 16px;
    margin-bottom: 0;
    padding: 16px;
    box-sizing: border-box;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-2);
}

.comments-form-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comments-textarea {
    width: 100%;
    min-height: 105px;
    padding: 11px 12px;
    box-sizing: border-box;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: var(--text);
    font: inherit;
    line-height: 1.5;
    resize: vertical;
}

.comments-textarea:focus {
    outline: none;
    border-color: var(--text-muted);
}

.comments-form-actions {
    display: flex;
    justify-content: flex-end;
}

.comments-login-notice {
    margin-bottom: 24px;
    padding: 13px 15px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    background: var(--panel-2);
    color: var(--text-muted);
}


/* =========================================================
 * EMPTY
 * ========================================================= */

.comments-empty {
    padding: 28px 16px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    background: var(--panel-2);
    color: var(--text-muted);
    text-align: center;
}


/* =========================================================
 * COMMENTS LIST
 * ========================================================= */

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.comments-item {
    position: relative;
    padding: 17px 18px;
    box-sizing: border-box;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
}


/* =========================================================
 * COMMENT HEADER
 * ========================================================= */

.comments-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.comments-author {
    min-width: 0;
}

.comments-author-profile {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.comments-author-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
}

.comments-author-avatar img {
    display: block;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
}

.comments-author-name {
    min-width: 0;
    font-weight: 600;
    line-height: 1.4;
}

.comments-date {
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    white-space: nowrap;
}

.comments-author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.comments-author-role {
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    line-height: 1.3;
}

/* =========================================================
 * COMMENT CONTENT
 * ========================================================= */

.comments-content {
    color: var(--text);
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.comments-content > :first-child {
    margin-top: 0;
}

.comments-content > :last-child {
    margin-bottom: 0;
}

.comments-content p {
    margin-top: 0;
    margin-bottom: 10px;
}

.comments-content p:last-child {
    margin-bottom: 0;
}


/* =========================================================
 * ACTIONS
 * ========================================================= */

.comments-item-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--line-soft);
}

.comments-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 11px;
    box-sizing: border-box;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel-2);
    color: var(--text);
    text-decoration: none;
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition:
        opacity .15s ease,
        background-color .15s ease;
}

.comments-action-button:hover {
    text-decoration: none;
    opacity: .88;
    background: var(--panel);
}

.comments-delete-form {
    display: inline-flex;
    margin: 0;
    padding: 0;
}

.comments-delete-form .comments-action-button {
    font-family: inherit;
}


/* =========================================================
 * PAGINATION
 * ========================================================= */

.comments-pagination {
    margin-top: 22px;
}


/* =========================================================
 * EDIT PAGE
 * ========================================================= */

.comments-edit-page {
    width: 100%;
    max-width: 760px;
    margin: 28px auto;
}

.comments-edit-form {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 20px;
    box-sizing: border-box;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
}

.comments-edit-heading {
    margin: 0 0 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line-soft);
}

.comments-edit-heading h2 {
    display: block;
    margin: 0;
    color: var(--text);
    font-size: 1.25rem;
    line-height: 1.3;
    font-weight: 600;
}

.comments-edit-heading p {
    display: block;
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    line-height: 1.5;
}

.comments-edit-label {
    display: block;
    margin-bottom: 10px;
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 600;
}

.comments-edit-textarea {
    width: 100%;
    min-height: 190px;
    padding: 12px 13px;
    box-sizing: border-box;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel-2);
    color: var(--text);
    font: inherit;
    line-height: 1.6;
    resize: vertical;
}

.comments-edit-textarea:focus {
    outline: none;
    border-color: var(--text-muted);
}

.comments-edit-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line-soft);
}

.comments-edit-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.comments-edit-cancel:hover {
    text-decoration: none;
}


/* =========================================================
 * MOBILE
 * ========================================================= */

@media (max-width: 600px) {

    .comments-block {
        margin-top: 26px;
    }

    .comments-header {
        margin-bottom: 14px;
    }

    .comments-title {
        font-size: 1.15rem;
    }

    .comments-form {
        padding: 13px;
    }

    .comments-item {
        padding: 14px;
    }

    .comments-item-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .comments-date {
        white-space: normal;
    }


    /* COMMENT ACTIONS */

    .comments-item-actions {
        justify-content: flex-end;
        align-items: center;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .comments-action-button {
        min-height: 36px;
        width: auto;
    }

    .comments-delete-form {
        display: inline-flex;
        width: auto;
    }


    /* COMMENT FORM */

    .comments-form-actions {
        justify-content: flex-end;
    }

    .comments-form-actions .btn {
        width: auto;
    }


    /* EDIT PAGE */

    .comments-edit-page {
        margin: 20px auto;
    }

    .comments-edit-form {
        padding: 14px;
    }

    .comments-edit-heading {
        margin-bottom: 15px;
        padding-bottom: 12px;
    }

    .comments-edit-heading h2 {
        font-size: 1.15rem;
    }

    .comments-edit-actions {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 8px;
    }

    .comments-edit-actions .btn,
    .comments-edit-cancel {
        width: auto;
        box-sizing: border-box;
    }

    .comments-author-profile {
        gap: 9px;
    }

    .comments-author-avatar,
    .comments-author-avatar img {
        width: 40px;
        height: 40px;
    }



}


/* docs */
body.page-docs.no-left.no-right .page-grid{max-width:1360px}.docs-shell{display:grid;grid-template-columns:250px minmax(0,1fr) 210px;gap:28px;align-items:start}.docs-side{position:sticky;top:calc(var(--topbar-h,56px) + 16px);max-height:calc(100vh - var(--topbar-h,56px) - 32px);overflow-y:auto;scrollbar-width:thin;padding-inline-end:6px}.docs-side-head{margin-bottom:10px}.docs-brand{display:inline-flex;align-items:center;gap:8px;font-weight:700;font-size:var(--font-size-lg);color:var(--text)}.docs-brand svg{width:20px;height:20px;color:var(--brand)}.docs-search{display:flex;align-items:center;gap:6px;padding:0 10px;height:34px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--panel);color:var(--text-subtle);margin-bottom:12px}.docs-search svg{width:15px;height:15px;flex:none}.docs-search input{border:0;background:none;padding:0;height:100%;min-width:0;flex:1}.docs-search input:focus{outline:0}.docs-spaces{display:flex;flex-direction:column;gap:2px;margin-bottom:14px;padding-bottom:12px;border-bottom:1px solid var(--line-soft)}.docs-space{display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:var(--radius-sm);color:var(--text-muted);font-weight:500}.docs-space svg{width:16px;height:16px}.docs-space:hover{background:var(--panel-2);text-decoration:none}.docs-space.active{background:var(--brand-soft);color:var(--brand)}.docs-tree{list-style:none;margin:0;padding:0}.docs-tree li{position:relative}.docs-tree a{display:block;padding:5px 30px 5px 8px;border-radius:var(--radius-sm);color:var(--text-muted);font-size:var(--font-size-sm);line-height:1.4}.docs-tree a:hover{background:var(--panel-2);color:var(--text);text-decoration:none}.docs-tree li.active>a{background:var(--brand-soft);color:var(--brand);font-weight:600}.docs-tree .flag{font-size:10px;padding:0 5px;margin-inline-start:4px}.docs-tree-sub{margin-inline-start:12px;padding-inline-start:8px;border-inline-start:1px solid var(--line)}.docs-tree li.has-kids:not(.open)>.docs-tree-sub{display:none}.docs-fold{position:absolute;top:3px;inset-inline-end:2px;width:24px;height:24px;border:0;background:none;color:var(--text-subtle);cursor:pointer;border-radius:4px;display:inline-flex;align-items:center;justify-content:center}.docs-fold svg{width:14px;height:14px;transition:transform .15s;transform:rotate(-90deg)}.docs-tree li.open>.docs-fold svg{transform:none}.docs-fold:hover{background:var(--panel-2);color:var(--text)}.docs-main{min-width:0}.docs-article{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:28px 34px 24px}.docs-crumbs{display:flex;flex-wrap:wrap;gap:6px;font-size:var(--font-size-sm);color:var(--text-subtle);margin-bottom:10px}.docs-crumbs a{color:var(--text-muted)}.docs-article h1{margin:0 0 6px;font-size:1.75rem;line-height:1.25}.docs-lede{margin:0 0 6px;color:var(--text-muted);font-size:var(--font-size-md)}.docs-meta{font-size:var(--font-size-xs);color:var(--text-subtle);margin-bottom:22px;padding-bottom:14px;border-bottom:1px solid var(--line-soft)}.docs-body{font-size:15.5px}.docs-body h2{font-size:1.35rem;margin:1.6em 0 .6em;padding-top:.2em}.docs-body h3{font-size:1.12rem;margin:1.3em 0 .5em}.docs-body h4{font-size:1rem;margin:1.1em 0 .4em}.docs-body h2,.docs-body h3,.docs-body h4{scroll-margin-top:calc(var(--topbar-h,56px) + 18px);position:relative}.docs-anchor{margin-inline-start:6px;color:var(--text-disabled);font-weight:400;text-decoration:none;opacity:0}.docs-body h2:hover .docs-anchor,.docs-body h3:hover .docs-anchor,.docs-body h4:hover .docs-anchor{opacity:1}.docs-body pre{position:relative}.docs-copy-code{position:absolute;top:6px;inset-inline-end:6px;padding:2px 8px;font-size:11px;border:1px solid var(--line);border-radius:4px;background:var(--panel);color:var(--text-muted);cursor:pointer;opacity:0}.docs-body pre:hover .docs-copy-code{opacity:1}.docs-foot{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:32px}.docs-pager{display:flex;flex-direction:column;gap:2px;padding:12px 14px;border:1px solid var(--line);border-radius:var(--radius-sm);color:inherit}.docs-pager:hover{border-color:var(--brand);text-decoration:none}.docs-pager small{color:var(--text-subtle)}.docs-pager.next{grid-column:2;text-align:end}.docs-pager.prev{grid-column:1}.docs-links{display:flex;flex-wrap:wrap;gap:16px;margin-top:18px;font-size:var(--font-size-sm)}.docs-links a{display:inline-flex;align-items:center;gap:5px;color:var(--text-muted)}.docs-links svg{width:14px;height:14px}.docs-toc{position:sticky;top:calc(var(--topbar-h,56px) + 16px);max-height:calc(100vh - var(--topbar-h,56px) - 32px);overflow-y:auto;font-size:var(--font-size-sm)}.docs-toc-head{font-weight:600;font-size:var(--font-size-xs);text-transform:uppercase;letter-spacing:.04em;color:var(--text-subtle);margin-bottom:8px}.docs-toc-list{list-style:none;margin:0;padding:0;border-inline-start:2px solid var(--line-soft)}.docs-toc-list li a{display:block;padding:4px 10px;color:var(--text-muted);border-inline-start:2px solid transparent;margin-inline-start:-2px;line-height:1.35}.docs-toc-list li.l3 a{padding-inline-start:22px;font-size:var(--font-size-xs)}.docs-toc-list li a:hover{color:var(--text);text-decoration:none}.docs-toc-list li.active>a{color:var(--brand);border-color:var(--brand);font-weight:600}.docs-ai{display:flex;flex-direction:column;gap:6px;margin-top:16px}.docs-ai .btn{justify-content:flex-start}.docs-callout{margin:1em 0;padding:12px 14px;border-radius:var(--radius-sm);border:1px solid var(--line);border-inline-start:4px solid var(--c);background:color-mix(in srgb,var(--c) 7%,var(--panel))}.docs-callout-title{display:flex;align-items:center;gap:6px;font-weight:600;color:var(--c);margin-bottom:4px}.docs-callout-title svg{width:16px;height:16px}.docs-callout-body>:last-child{margin-bottom:0}.docs-callout-tip{--c:#16a34a}.docs-callout-note{--c:#2563eb}.docs-callout-warning{--c:#d97706}.docs-callout-danger{--c:#dc2626}.docs-callout-success{--c:#0d9488}.docs-tabs{margin:1em 0;border:1px solid var(--line);border-radius:var(--radius-sm);overflow:hidden}.docs-tab-list{display:flex;gap:2px;padding:4px;background:var(--panel-2);border-bottom:1px solid var(--line);overflow-x:auto}.docs-tab{border:0;background:none;padding:6px 12px;border-radius:4px;color:var(--text-muted);font:inherit;font-size:var(--font-size-sm);cursor:pointer;white-space:nowrap}.docs-tab.active{background:var(--panel);color:var(--brand);font-weight:600;box-shadow:var(--shadow)}.docs-tab-panel{padding:12px 14px}.docs-tab-panel>:last-child{margin-bottom:0}.docs-steps{counter-reset:s;margin:1em 0;padding:0}.docs-step{position:relative;padding:0 0 18px 42px;border-inline-start:2px solid var(--line-soft);margin-inline-start:14px}.docs-step:last-child{border-color:transparent;padding-bottom:0}.docs-step::before{counter-increment:s;content:counter(s);position:absolute;inset-inline-start:-15px;top:-2px;width:28px;height:28px;border-radius:50%;background:var(--brand);color:#fff;font-weight:700;font-size:13px;display:flex;align-items:center;justify-content:center}.docs-step-title{font-weight:600;margin-bottom:4px;line-height:1.7}.docs-step-body>:last-child{margin-bottom:0}.docs-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px;margin:1em 0}.docs-card{display:flex;gap:12px;padding:14px;border:1px solid var(--line);border-radius:var(--radius);background:var(--panel);color:inherit}.docs-card-link:hover{border-color:var(--brand);text-decoration:none;box-shadow:var(--shadow-md)}.docs-card-icon{display:inline-flex;width:34px;height:34px;border-radius:8px;background:var(--brand-soft);color:var(--brand);align-items:center;justify-content:center;flex:none}.docs-card-icon svg{width:18px;height:18px}.docs-card-text{min-width:0}.docs-card-text b{display:block;margin-bottom:2px}.docs-card-text p{margin:0;color:var(--text-muted);font-size:var(--font-size-sm)}.docs-card-text small{color:var(--text-subtle)}.docs-details{margin:1em 0;border:1px solid var(--line);border-radius:var(--radius-sm);padding:0 14px}.docs-details summary{padding:10px 0;font-weight:600;cursor:pointer}.docs-details-body{padding:0 0 12px}.docs-details-body>:last-child{margin-bottom:0}.docs-block{margin:1em 0;padding:12px 14px;border:1px dashed var(--line);border-radius:var(--radius-sm)}.docs-block-title{font-weight:600;margin-bottom:6px}.docs-hero{padding:34px 36px;border-radius:18px;color:#fff;background:linear-gradient(135deg,var(--brand) 0%,color-mix(in srgb,var(--brand) 55%,#2563eb) 100%);margin-bottom:20px}.docs-hero h1{display:flex;align-items:center;gap:10px;margin:0 0 6px;color:#fff;font-size:1.7rem}.docs-hero h1 svg{width:30px;height:30px}.docs-hero p{margin:0 0 16px;opacity:.9;max-width:560px}.docs-hero-search{display:flex;align-items:center;gap:8px;max-width:560px;background:#fff;border-radius:999px;padding:4px 4px 4px 14px;color:var(--text-subtle)}.docs-hero-search svg{width:18px;height:18px;flex:none}.docs-hero-search input{flex:1;border:0;background:none;padding:8px 0;min-width:0;color:#1f2328}.docs-hero-search input:focus{outline:0}.docs-hero-search .btn{border-radius:999px}.docs-search-big{background:var(--panel-2);margin:12px 0 20px;max-width:none}.docs-search-big input{color:var(--text)}.docs-space-cards{grid-template-columns:repeat(auto-fill,minmax(260px,1fr));margin:0 0 20px}.docs-space-card{padding:18px}.docs-recent{list-style:none;margin:0;padding:0}.docs-recent li{display:flex;justify-content:space-between;gap:12px;padding:8px 0;border-bottom:1px solid var(--line-soft)}.docs-recent li:last-child{border:0}.docs-recent .muted{font-size:var(--font-size-sm);white-space:nowrap}.docs-results{list-style:none;margin:0;padding:0}.docs-results li{padding:12px 0;border-bottom:1px solid var(--line-soft)}.docs-results li a{display:flex;justify-content:space-between;gap:12px}.docs-results li p{margin:4px 0 0;color:var(--text-muted);font-size:var(--font-size-sm)}.docs-results mark{background:var(--brand-soft);color:var(--brand);padding:0 2px;border-radius:2px}.docs-menu-btn{display:none}.docs-scrim{position:fixed;inset:0;background:var(--backdrop);z-index:110}@media(max-width:1100px){.docs-shell{grid-template-columns:230px minmax(0,1fr)}.docs-toc{display:none}}@media(max-width:820px){.docs-shell{grid-template-columns:minmax(0,1fr)}.docs-menu-btn{display:inline-flex;margin-bottom:10px}.docs-side{position:fixed;top:0;bottom:0;inset-inline-start:0;width:290px;max-width:85vw;max-height:none;background:var(--panel);padding:16px;z-index:120;transform:translateX(-100%);transition:transform .2s;box-shadow:var(--shadow-md)}[dir=rtl] .docs-side{transform:translateX(100%)}.docs-side.open{transform:none}.docs-article{padding:18px 16px}.docs-foot{grid-template-columns:1fr}.docs-pager.next{grid-column:1}.docs-hero{padding:22px 18px}.docs-hero h1{font-size:1.3rem}}

/* drafts */
.drafts-status{margin-inline-start:8px;align-self:center}.drafts-save{white-space:nowrap}.drafts-ask{position:fixed;inset:0;z-index:220;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.45);padding:16px}.drafts-ask-box{background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-md);padding:20px 22px;max-width:440px;width:100%}.drafts-ask-box h3{margin:0 0 6px;font-size:1.05em}.drafts-ask-box p{margin:0 0 16px;color:var(--text-muted)}.drafts-ask-row{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.drafts-list{display:grid;gap:8px}.drafts-item{display:flex;align-items:center;gap:12px;padding:12px 14px;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius)}.drafts-item{min-width:0}.drafts-main{flex:1;min-width:0;overflow:hidden}.drafts-main .small{overflow-wrap:anywhere;word-break:break-word;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.drafts-title{font-weight:600;color:var(--text)}.drafts-title:hover{color:var(--brand)}.drafts-item .row-actions{display:flex;gap:6px;flex:none}@media(max-width:640px){.drafts-item{flex-wrap:wrap}}

/* featured */
.featured-label{display:inline-block;margin-inline-end:6px;padding:0 6px;border-radius:5px;background:color-mix(in srgb,var(--warning) 16%,transparent);color:color-mix(in srgb,var(--warning) 72%,var(--text));font-size:var(--font-size-xs);font-weight:600;line-height:1.7;vertical-align:.12em;white-space:nowrap}.topic-title .featured-label{font-size:var(--font-size-sm);vertical-align:.28em}.featured-bold{font-weight:700}.featured-red,.featured-red a{color:#d93025}.featured-orange,.featured-orange a{color:#e7672e}.featured-green,.featured-green a{color:#188038}.featured-blue,.featured-blue a{color:#1a73e8}.featured-purple,.featured-purple a{color:#7b3fe4}.featured-menu{position:relative;display:inline-block}.featured-menu summary{list-style:none;cursor:pointer}.featured-menu summary::-webkit-details-marker{display:none}.featured-form{position:absolute;left:0;top:calc(100% + 6px);z-index:30;min-width:230px;padding:12px;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:0 8px 24px rgba(0,0,0,.12)}.featured-form .form-row{margin-bottom:8px}.featured-form select{width:100%}.topic-bar .featured-form{left:auto;right:0}

/* follow */
.follow-you{display:inline-block;margin-left:6px;padding:1px 7px;border-radius:6px;background:var(--panel-2);color:var(--text-muted);font-size:var(--font-size-xs);font-weight:400;vertical-align:middle}.follow-list .follow-row{display:flex;align-items:center;gap:12px;padding:12px 16px;border-top:1px solid var(--line-soft)}.follow-list .follow-row:first-child{border-top:0}.follow-row-main{flex:1;min-width:0}.follow-row-name{font-weight:600}.follow-bio{color:var(--text-muted);font-size:var(--font-size-sm);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.follow-row .member-action-form{margin:0;flex:none}[data-action=follow]:not(.is-done):not(.btn-primary){color:var(--brand);border-color:var(--brand)}[data-action=follow].is-done:hover{color:var(--danger);border-color:var(--danger);background:var(--danger-soft)}.follow-suggest{border-bottom:1px solid var(--line-soft)}.follow-suggest-head{padding:12px 16px 0;color:var(--text-muted);font-size:var(--font-size-sm)}

/* growth */
/* Growth: the pages (head and tabs, hero, overview boxes, calendar, leaderboards, levels) and the sidebar card. */
.growth-page{display:grid;grid-template-columns:minmax(0,1fr);gap:14px}
.growth-page>*{min-width:0}
.growth-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px}
.growth-head h1{margin:0;font-size:var(--font-size-2xl)}
.growth-tabs{margin:0}
.growth-pill{display:inline-block;padding:0 6px;border:1px solid var(--line);border-radius:var(--radius-pill);background:var(--panel-2);color:var(--text-muted);font-size:var(--font-size-xs);font-weight:600;line-height:1.6;white-space:nowrap;vertical-align:middle}
/* buttons */
.growth-go{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:0 18px;height:40px;border:0;border-radius:999px;background:var(--brand);color:var(--brand-text,#fff);font:inherit;font-weight:650;cursor:pointer;box-shadow:0 4px 12px color-mix(in srgb,var(--brand) 25%,transparent);transition:transform .12s}
.growth-go:hover{transform:translateY(-1px);color:var(--brand-text,#fff);text-decoration:none}
.growth-go:disabled{opacity:.7;cursor:default;transform:none}
.growth-go svg,.growth-done svg{width:17px;height:17px}
.growth-go b{padding:1px 8px;border-radius:999px;background:color-mix(in srgb,#fff 24%,transparent);font-size:var(--font-size-sm)}
.growth-done{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:40px;padding:0 16px;border-radius:999px;background:var(--success-soft);color:var(--success);font-weight:650}
.growth-done:hover{color:var(--success);text-decoration:none}
/* layout: two columns on wide screens, one below 900px */
.growth-top2{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:14px}
.growth-split{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:14px;align-items:start}
.growth-split-cal{grid-template-columns:minmax(0,1.15fr) minmax(0,1fr)}
.growth-col{display:flex;flex-direction:column;gap:14px;min-width:0}
/* the warm cards (the streak, the level): the one tinted surface of a page */
.growth-warm{padding:16px 18px;border-radius:var(--radius);background:var(--brand-soft);color:color-mix(in srgb,var(--brand) 55%,var(--text))}
.growth-warm-line{display:flex;align-items:center;gap:6px;margin:0;font-size:var(--font-size-sm)}
.growth-warm-line svg{width:16px;height:16px;flex:none}
.growth-warm .growth-go{box-shadow:none}
.growth-streak-num{display:flex;align-items:baseline;gap:8px;margin-top:12px;color:color-mix(in srgb,var(--brand) 35%,var(--text))}
.growth-streak-num svg{width:22px;height:22px;align-self:center;color:var(--brand)}
.growth-streak-num b{font-size:2rem;font-weight:600;line-height:1}
.growth-streak-num span{font-size:var(--font-size-sm)}
.growth-steps{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;margin-top:14px}
.growth-seg{text-align:center;font-size:var(--font-size-xs);line-height:1.3}
.growth-seg i{display:block;height:6px;margin-bottom:5px;border-radius:3px;background:color-mix(in srgb,var(--brand) 22%,transparent)}
.growth-seg.on i{background:var(--brand)}
.growth-seg span{display:inline-flex;align-items:center;gap:2px}
.growth-seg svg{width:12px;height:12px}
.growth-level-top{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}
.growth-level-top b{font-size:1.75rem;font-weight:600;line-height:1;color:color-mix(in srgb,var(--brand) 35%,var(--text))}
.growth-level-top small{margin-inline-start:auto;font-size:var(--font-size-xs)}
.growth-warm-bar{height:8px;margin:14px 0 6px;border-radius:4px;background:color-mix(in srgb,var(--brand) 22%,transparent);overflow:hidden}
.growth-warm-bar i{display:block;height:100%;border-radius:inherit;background:var(--brand)}
.growth-level p{margin:0;font-size:var(--font-size-xs)}
/* my card and the three numbers (overview) */
.growth-me .card-body{display:flex;align-items:center;gap:14px;height:100%}
.growth-me-main{flex:1;min-width:0}
.growth-me-name{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.growth-me-name .user-link{font-size:var(--font-size-md);font-weight:600}
.growth-lvtag{padding:1px 8px;border:1px solid color-mix(in srgb,var(--brand) 40%,var(--line));border-radius:999px;color:var(--brand);font-size:var(--font-size-xs);font-weight:600;white-space:nowrap}
.growth-me-main small{color:var(--text-muted);font-size:var(--font-size-xs)}
.growth-thin{display:block;height:6px;margin:10px 0 6px;border-radius:3px;background:var(--line);overflow:hidden}
.growth-thin i{display:block;height:100%;border-radius:inherit;background:var(--brand)}
.growth-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.growth-stats a{display:flex;flex-direction:column;gap:2px;padding:12px 16px;border:1px solid var(--line);border-radius:var(--radius);background:var(--panel);color:var(--text)}
.growth-stats a:hover{border-color:color-mix(in srgb,var(--brand) 40%,var(--line));text-decoration:none}
.growth-stats small{color:var(--text-muted);font-size:var(--font-size-xs)}
.growth-stats b{font-size:var(--font-size-xl);font-weight:600;line-height:1.2}
/* today's tasks: one row each */
.growth-tasks{list-style:none;margin:0;padding:0}
.growth-task{display:flex;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--line-soft)}
.growth-task:last-child{border:0}
.growth-ic{flex:none;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;background:var(--brand-soft);color:var(--brand)}
.growth-ic svg{width:16px;height:16px}
.growth-task-main{flex:1;min-width:0}
.growth-task-name{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px}
.growth-task-name a,.growth-task-name span{color:var(--text);font-weight:500}
.growth-task-name small{color:var(--text-muted);font-size:var(--font-size-xs)}
.growth-task .growth-thin{margin:6px 0 0}
.growth-task-num{flex:none;display:inline-flex;align-items:center;justify-content:flex-end;gap:3px;min-width:44px;color:var(--text-muted);font-size:var(--font-size-xs);font-variant-numeric:tabular-nums;white-space:nowrap}
.growth-task.is-done .growth-task-num{color:var(--brand);font-weight:600}
.growth-task-num svg{width:13px;height:13px}
.growth-tasks+.growth-chips{margin:0 0 6px 44px}
.growth-note{display:flex;align-items:center;gap:6px;margin:8px 0 0;color:var(--text-muted);font-size:var(--font-size-xs)}
.growth-note svg{width:13px;height:13px;color:var(--brand)}
/* lists: top members, today's check-ins */
.growth-toplist .growth-n{width:18px}
.growth-n.top{color:var(--brand)}
.growth-page .growth-toplist li>b{color:var(--text-muted);font-weight:500}
.growth-toplist li.me .user-link{font-weight:600}
.growth-pts{padding:1px 8px;border-radius:999px;background:var(--brand-soft)}
/* overview lists */
.growth-box .card-head a{font-size:var(--font-size-sm)}
.growth-toplist,.growth-rows{list-style:none;margin:0;padding:0}
.growth-toplist li,.growth-rows li{display:flex;align-items:center;gap:9px;padding:6px 0;border-bottom:1px solid var(--line-soft)}
.growth-toplist li:last-child,.growth-rows li:last-child{border:0}
.growth-toplist li>b,.growth-rows li>b{margin-inline-start:auto;color:var(--brand);font-size:var(--font-size-sm);white-space:nowrap}
.growth-toplist .user-link{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.growth-who{display:flex;flex-direction:column;min-width:0}
.growth-who small{color:var(--text-muted);font-size:var(--font-size-xs)}
.growth-earn-group{margin:14px 0 2px;color:var(--text-muted);font-size:var(--font-size-xs);font-weight:600;text-transform:uppercase;letter-spacing:.04em}
.growth-earn-group:first-of-type{margin-top:4px}
.growth-earn-intro{margin:0 0 6px}
.growth-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:-6px}
.growth-chip{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border:1px solid var(--line);border-radius:999px;color:var(--text);font-size:var(--font-size-xs)}
.growth-chip b{color:var(--brand)}
.growth-chip.ok{border-color:transparent;background:var(--success-soft);color:var(--success)}
.growth-chip svg{width:12px;height:12px}
a.growth-chip:hover{border-color:var(--brand);text-decoration:none}
.growth-more-list{list-style:none;margin:0;padding:0}
.growth-more-list li{display:flex;align-items:center;gap:8px;padding:6px 0;border-bottom:1px solid var(--line-soft);font-size:var(--font-size-sm)}
.growth-more-list li:last-child{border:0}
.growth-more-list li b{margin-inline-start:auto;color:var(--brand)}
.growth-box .growth-earn-intro{margin:14px 0 0}
/* calendar: checked days tinted circles, today ringed (solid once checked in) */
.growth-cal-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}
.growth-cal-head h3{margin:0;font-size:var(--font-size-md)}
.growth-cal{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px 4px;justify-items:center}
.growth-cal .wd{padding-bottom:2px;color:var(--text-subtle);font-size:var(--font-size-xs)}
.growth-cal .d{display:flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:50%;color:var(--text);font-size:var(--font-size-sm)}
.growth-cal .d.pad{visibility:hidden}
.growth-cal .d.on{background:var(--brand-soft);color:color-mix(in srgb,var(--brand) 55%,var(--text));font-weight:600}
.growth-cal .d.today{box-shadow:inset 0 0 0 1.5px var(--brand)}
.growth-cal .d.on.today{background:var(--brand);color:#fff;box-shadow:none}
.growth-cal .d.ahead{color:var(--text-subtle)}
.growth-cal-foot{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px;padding-top:12px;border-top:1px solid var(--line-soft)}
.growth-cal-foot span{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border-radius:999px;background:var(--panel-2);color:var(--text-muted);font-size:var(--font-size-xs)}
.growth-cal-foot svg{width:13px;height:13px}
/* leaderboards */
.growth-board-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px}
.growth-board-head .tabs{margin:0}
.growth-board-sub{margin:-6px 0 0}
.growth-mine{display:inline-flex;align-items:center;gap:6px;padding:5px 12px;border-radius:999px;background:var(--brand-soft);color:var(--brand);font-size:var(--font-size-sm);font-weight:600}
.growth-mine svg{width:14px;height:14px}
.growth-podium{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.12fr) minmax(0,1fr);gap:14px;align-items:end;margin-top:26px}
.growth-top.r1,.growth-top.r2,.growth-top.r3{--tint:rgba(122,167,255,.16);--ring:#7aa7ff;--num:#4c7fe8;display:block;min-width:0;padding:44px 10px 18px;border:1px solid var(--line-soft);border-radius:16px;background:linear-gradient(180deg,var(--tint) 0%,var(--panel) 100%);text-align:center}
.growth-top.r1{--tint:rgba(255,178,36,.2);--ring:#f5a623;--num:#e8641c;padding-top:50px;transform:translateY(-14px)}
.growth-top.r3{--tint:rgba(240,138,155,.16);--ring:#f08a9b;--num:#e2576f}
.growth-top.empty{min-height:110px;border-style:dashed;background:none}
.growth-top.me{box-shadow:0 0 0 2px var(--brand)}
.growth-pic{position:relative;display:inline-block;line-height:0}
.growth-crown{position:absolute;z-index:1;top:-28px;left:50%;width:40px;height:40px;transform:translateX(-50%);color:var(--ring);line-height:normal}
.growth-crown svg{width:40px;height:40px;fill:currentColor}
.growth-crown i{position:absolute;top:14px;left:0;right:0;color:#fff;font-size:12px;font-style:normal;font-weight:700;text-align:center}
.growth-top .avatar{width:72px;height:72px;font-size:28px;border:3px solid var(--ring)}
.growth-name{margin-top:10px;overflow:hidden;font-weight:600;white-space:nowrap;text-overflow:ellipsis}
.growth-val{margin-top:8px;color:var(--num);font-weight:700;font-size:1.15rem}
.growth-sub{margin-top:2px;overflow:hidden;color:var(--text-muted);font-size:var(--font-size-xs);white-space:nowrap;text-overflow:ellipsis}
.growth-table ol{list-style:none;margin:0;padding:4px 16px}
.growth-table li{padding:10px 0;border-bottom:1px solid var(--line-soft)}
.growth-table li:last-child{border:0}
.growth-table .growth-row{display:flex;align-items:center;gap:10px}
.growth-n{flex:none;width:28px;color:var(--text-subtle);font-weight:600;text-align:center}
.growth-table li.me{margin:0 -16px;padding-inline:16px;background:var(--brand-soft)}
.growth-table .growth-row>b{margin-inline-start:auto;white-space:nowrap}
/* levels: reached ones ticked, the current one tinted, the ones ahead as open circles */
.growth-ladder{list-style:none;margin:0 0 8px;padding:0}
.growth-ladder li{display:flex;align-items:center;gap:10px;padding:9px 10px;border-radius:var(--radius-sm)}
.growth-ladder li>svg{flex:none;width:16px;height:16px;color:var(--text-subtle)}
.growth-ladder li.past>svg,.growth-ladder li.now>svg{color:var(--brand)}
.growth-ladder li b{font-weight:500}
.growth-ladder li .muted{margin-inline-start:auto;font-variant-numeric:tabular-nums}
.growth-ladder li.now{background:var(--brand-soft)}
.growth-ladder li.now b{font-weight:600}
.growth-ladder li.past .growth-pill{border-color:color-mix(in srgb,var(--brand) 40%,var(--line));color:var(--brand)}
.growth-ladder li.now .growth-pill{border-color:var(--brand);background:var(--brand);color:#fff}
/* sidebar card */
.growth-sidecard .card-head{gap:8px}
.growth-more{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;color:var(--text-muted)}
.growth-more:hover{background:var(--panel-2);color:var(--text)}
.growth-more svg{width:15px;height:15px}
.growth-card{display:flex;flex-direction:column;gap:10px}
.growth-week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px}
.growth-wd{display:flex;flex-direction:column;align-items:center;gap:5px}
.growth-wd i{color:var(--text-subtle);font-size:11px;font-style:normal;font-weight:500;line-height:1}
.growth-wd.today i{color:var(--brand);font-weight:700}
.growth-wd b{display:flex;align-items:center;justify-content:center;width:100%;max-width:26px;aspect-ratio:1;border:1px solid var(--line);border-radius:50%;background:var(--panel-2);color:#fff}
.growth-wd b.on{border-color:var(--brand);background:var(--brand)}
.growth-wd.today b:not(.on){border:2px dashed var(--brand);background:var(--brand-soft)}
.growth-wd b.ahead{opacity:.45}
.growth-wd b svg{width:12px;height:12px;stroke-width:3}
.growth-inline{margin:0}
.growth-card .growth-go,.growth-card .growth-done{width:100%}
/* in the sidebar the check-in is the second action: soft, so New Topic in the member card above stays the one solid button */
.growth-card .growth-go{background:var(--brand-soft);color:var(--brand);box-shadow:none}
.growth-card .growth-go:hover{background:color-mix(in srgb,var(--brand) 18%,var(--panel));color:var(--brand)}
.growth-card .growth-go b{background:color-mix(in srgb,var(--brand) 16%,transparent)}
.growth-hint{margin:0;color:var(--text-muted);font-size:var(--font-size-xs);text-align:center}
.growth-lv{display:block;padding-top:10px;border-top:1px solid var(--line-soft);color:var(--text)}
.growth-lv:hover{text-decoration:none}
.growth-card.just-done .growth-done{animation:growth-pop .4s ease}
@keyframes growth-pop{0%{transform:scale(.9)}60%{transform:scale(1.04)}100%{transform:scale(1)}}
@media (prefers-reduced-motion:reduce){.growth-card.just-done *{animation:none}}
@media (max-width:900px){.growth-top2,.growth-split,.growth-split-cal{grid-template-columns:minmax(0,1fr)}.growth-split-cal>.growth-col{order:-1}}
@media (max-width:640px){
.growth-head h1{font-size:var(--font-size-xl)}
.growth-head{flex-wrap:nowrap;flex-direction:column;align-items:stretch}
.growth-tabs{width:100%;overflow-x:auto;flex-wrap:nowrap;scrollbar-width:none}
.growth-tabs .tab{flex:none}
.growth-stats{gap:8px}
.growth-stats a{padding:10px 12px}
.growth-stats b{font-size:var(--font-size-lg)}
.growth-cal .d{width:100%;max-width:38px;height:auto;aspect-ratio:1}
.growth-tasks+.growth-chips{margin-inline-start:0}
.growth-podium{gap:8px;margin-top:22px}
.growth-top.r1,.growth-top.r2,.growth-top.r3{padding:30px 6px 12px;border-radius:12px}
.growth-top.r1{padding-top:34px;transform:translateY(-10px)}
.growth-top .avatar{width:52px;height:52px;font-size:20px;border-width:2px}
.growth-crown{top:-20px;width:28px;height:28px}.growth-crown svg{width:28px;height:28px}.growth-crown i{top:9px;font-size:10px}
.growth-name{font-size:var(--font-size-sm)}
.growth-val{font-size:var(--font-size-md)}
}
/* the Leaderboard card of the right column (board.php): a segmented switch, then the top members of the board */
.growth-topcard .card-body{padding-top:4px}
.growth-top-tabs{display:flex;gap:2px;margin:0 0 6px;padding:3px;border-radius:9px;background:var(--panel-2)}
.growth-top-tab{flex:1;min-width:0;padding:5px 2px;border:0;border-radius:7px;background:none;color:var(--text-muted);font:inherit;font-size:var(--font-size-xs);cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.growth-top-tab:hover{color:var(--text)}
.growth-top-tab.active{background:var(--panel);color:var(--text);font-weight:600;box-shadow:0 1px 2px rgba(0,0,0,.08)}
.growth-top-list{list-style:none;margin:0;padding:0}
.growth-top-list[hidden]{display:none}
.growth-top-list li{display:flex;align-items:center;gap:9px;padding:6px 2px;font-size:var(--font-size-sm)}
.growth-top-list .avatar{width:26px;height:26px;flex:none}
.growth-top-rank{display:inline-grid;place-items:center;width:20px;height:20px;flex:none;border-radius:50%;color:var(--text-subtle);font-size:11px;font-weight:700}
.growth-top-rank.r1{background:#fac775;color:#633806}.growth-top-rank.r2{background:#d3d1c7;color:#444441}.growth-top-rank.r3{background:#f0997b;color:#712b13}
.growth-top-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.growth-top-name .user-link{color:var(--text)}
.growth-top-value{display:inline-flex;align-items:center;gap:3px;flex:none;color:var(--text-muted);font-size:var(--font-size-xs);font-variant-numeric:tabular-nums}
.growth-top-value .icon{width:13px;height:13px;color:var(--brand)}
.growth-top-list li.me{margin:0 -6px;padding-inline:8px;border-radius:9px;background:var(--brand-soft)}
.growth-top-list li.growth-top-you{margin-top:4px}
.growth-top-list li.me .growth-top-name,.growth-top-list li.me .growth-top-value{color:var(--brand);font-weight:600}
.growth-top-empty{padding:8px 2px}
.growth-guest{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:22px 24px}
.growth-guest-main{min-width:0}
.growth-guest h2{margin:0 0 6px;overflow-wrap:anywhere;font-size:var(--font-size-xl);color:var(--text)}
.growth-guest p{margin:0 0 16px;font-size:var(--font-size-sm)}
.growth-guest-btns{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.growth-guest-btns .btn{height:40px;border-radius:999px;padding:0 18px}
.growth-guest .growth-streak-num{flex:none;margin:0;flex-direction:column;align-items:center;gap:2px}
.growth-ways{list-style:none;margin:0;padding:0}
.growth-ways li{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 0;border-top:1px solid var(--line-soft)}
.growth-ways li:first-child{border-top:0}
.growth-ways span{display:flex;flex-direction:column;min-width:0}
.growth-ways small{color:var(--text-muted);font-size:var(--font-size-xs)}
.growth-ways b{color:var(--brand);font-weight:650}
@media (max-width:640px){.growth-guest{flex-direction:column;align-items:stretch;padding:18px}.growth-guest .growth-streak-num{flex-direction:row;align-items:baseline}}


/* guard */
.guard-secret{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;margin:.4rem 0 .8rem}.guard-secret code{font-size:1.1em;letter-spacing:.08em;padding:.4rem .6rem;background:var(--bg-soft);border-radius:var(--radius)}.guard-codes{margin-bottom:1rem;padding:.8rem 1rem;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-soft)}.guard-codes pre{margin:.4rem 0 0;font-size:1.05em;letter-spacing:.06em}.guard-status{margin-bottom:1rem}

/* history */
.history-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px 4px}.history-head h1{margin:0;font-size:var(--font-size-xl)}.history-private{display:inline-flex;align-items:center;gap:5px;color:var(--text-muted);font-size:var(--font-size-xs)}.history-private .icon{width:13px;height:13px}.history-day{padding:12px 16px 4px;color:var(--text-muted);font-size:var(--font-size-xs);font-weight:600}.history-row{display:flex;align-items:center;gap:10px;padding:10px 16px;border-top:1px solid var(--line-soft);transition:opacity .2s}.history-row:hover{background:var(--panel-2)}.history-row.is-gone{opacity:0}.history-main{flex:1;min-width:0}.history-title{display:block;color:var(--text);font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.history-title:hover{color:var(--brand);text-decoration:none}.history-meta{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;margin-top:2px;color:var(--text-muted);font-size:var(--font-size-xs)}.history-cat{padding:0 6px;border-radius:6px;background:var(--panel-2);color:var(--text-muted)}.history-continue{flex:none;color:var(--brand);font-size:var(--font-size-sm);white-space:nowrap}.history-x{flex:none;display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--text-muted);cursor:pointer}.history-x:hover{background:var(--danger-soft);color:var(--danger)}.history-x .icon{width:15px;height:15px}@media (max-width:640px){.history-continue{display:none}.history-row{padding:10px 12px}}

/* image_gallery */
/* ============================================================
   Image Gallery — assets/gallery.css
   Two parts:
     1. The grid (.imgallery) — wraps consecutive <img> tags inside
        a post into a responsive grid.
     2. The lightbox (.imgallery-lightbox) — a full-screen overlay
        with prev/next navigation, opened by clicking a gallery image.

   All colours come from the forum's CSS variables, so the gallery
   follows light/dark themes and any brand-colour override.
   ============================================================ */

/* ---------- 1. Grid ---------- */
[data-imgallery] {
  display: grid;
  grid-template-columns: repeat(var(--imgallery-cols, 2), 1fr);
  gap: 6px;
  margin: 12px 0;
  /* Cap each image's height so a row of three portraits doesn't push
     the rest of the topic down by 3000 pixels. */
  --imgallery-cell-h: 220px;
}

/* Column-count modifiers — set by the PHP hook based on image count.
   .imgallery-2 → two columns, .imgallery-3 → three, and so on up to 5. */
.imgallery-2 { --imgallery-cols: 2; }
.imgallery-3 { --imgallery-cols: 3; }
.imgallery-4 { --imgallery-cols: 4; --imgallery-cell-h: 180px; }
.imgallery-5 { --imgallery-cols: 5; --imgallery-cell-h: 160px; }

/* On small screens, cap the column count at 2 so thumbnails stay big enough to tap. */
@media (max-width: 540px) {
  [data-imgallery] { --imgallery-cols: 2 !important; --imgallery-cell-h: 140px; }
  .imgallery-2     { --imgallery-cols: 2 !important; }
}

[data-imgallery] img[data-imgallery-item] {
  width: 100%;
  height: var(--imgallery-cell-h);
  object-fit: cover;
  border-radius: var(--radius-sm, 8px);
  cursor: zoom-in;
  background: var(--panel-2, #f8f9fb);
  border: 1px solid var(--line-soft, #eff1f4);
  transition: transform .2s cubic-bezier(.22, .61, .2, 1), box-shadow .2s, filter .2s;
  display: block;
}

[data-imgallery] img[data-imgallery-item]:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
  filter: brightness(1.05);
  z-index: 1;
}

[data-imgallery] img[data-imgallery-item]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* When images live inside the grid, the .post-image-max setting of the
   forum shouldn't make them tiny — override it for gallery items only. */
.post-content [data-imgallery] img[data-imgallery-item] {
  max-width: none;
}

/* ---------- 2. Lightbox ---------- */
[data-imgallery-lightbox] {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(8, 10, 14, .92);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: imgallery-fade-in .25s cubic-bezier(.22, .61, .2, 1);
}

[data-imgallery-lightbox][hidden] {
  display: none;
}

@keyframes imgallery-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* The big image */
.imgallery-stage {
  margin: 0;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.imgallery-stage img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-sm, 8px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .5);
  animation: imgallery-zoom-in .25s cubic-bezier(.22, .61, .2, 1);
}

@keyframes imgallery-zoom-in {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}

/* Caption (the image's alt text, if any) */
.imgallery-caption {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 80vw;
  padding: 6px 14px;
  border-radius: var(--radius-pill, 999px);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: var(--font-size-sm, 12px);
  text-align: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.imgallery-caption:empty { display: none; }

/* Counter ("3 / 7") */
.imgallery-counter {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: var(--radius-pill, 999px);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: var(--font-size-xs, 11px);
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.imgallery-counter:empty { display: none; }

/* Close button (top-right) */
.imgallery-close {
  position: absolute;
  top: 16px;
  inset-inline-end: 16px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background .15s, transform .15s;
}
.imgallery-close:hover {
  background: rgba(255, 255, 255, .18);
  transform: scale(1.05);
}
.imgallery-close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; }

/* Prev / next buttons (vertically centred on each side) */
.imgallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background .15s, transform .15s;
}
.imgallery-nav:hover {
  background: rgba(255, 255, 255, .18);
}
.imgallery-prev:hover { transform: translateY(-50%) scale(1.05) translateX(-2px); }
.imgallery-next:hover { transform: translateY(-50%) scale(1.05) translateX(2px); }
.imgallery-nav svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; fill: none; }

.imgallery-prev { inset-inline-start: 16px; }
.imgallery-next { inset-inline-end: 16px; }

/* On small screens, move the prev/next buttons to the bottom and make
   them bigger so they're easy to tap. */
@media (max-width: 540px) {
  [data-imgallery-lightbox] { padding: 12px; }
  .imgallery-stage,
  .imgallery-stage img { max-width: 95vw; max-height: 70vh; }
  .imgallery-nav {
    top: auto;
    bottom: 24px;
    transform: none;
    width: 56px;
    height: 56px;
  }
  .imgallery-prev:hover,
  .imgallery-next:hover { transform: scale(1.05); }
  .imgallery-prev { inset-inline-start: 16px; }
  .imgallery-next { inset-inline-end: 16px; }
  .imgallery-caption { bottom: 90px; }
  .imgallery-close { width: 36px; height: 36px; }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  [data-imgallery-lightbox],
  .imgallery-stage img,
  [data-imgallery] img[data-imgallery-item] {
    animation: none !important;
    transition: none !important;
  }
}

/* Print: hide the lightbox; galleries print as simple image grids. */
@media print {
  [data-imgallery-lightbox] { display: none !important; }
  [data-imgallery] img[data-imgallery-item] { height: auto; cursor: default; }
}


/* image_gallery_pro */
/* ============================================================
   Image Gallery Pro — assets/gallery.css
   Four parts:
     1. The grid ([data-igp]) — wraps consecutive <img> tags inside
        a post into a responsive grid, with column-count and
        aspect-ratio modifiers set by the :::gallery directive.
     2. Single images (img[data-igp-item]) — natural size, zoom-in
        cursor, optional aspect-ratio crop from the directive.
     3. The lightbox (.igp-lightbox) — a full-screen overlay with
        prev/next navigation, opened by clicking any marked image
        (gallery item or single image).
     4. The editor panel (.igp-panel) — the Gallery toolbar button's
        popup: columns picker, aspect-ratio picker, apply button and
        the paste-your-links hint.

   All colours come from the forum's CSS variables, so the gallery
   follows light/dark themes and any brand-colour override.
   ============================================================ */

/* ---------- 1. Grid ---------- */
[data-igp] {
  display: grid;
  grid-template-columns: repeat(var(--igp-cols, 2), 1fr);
  gap: 6px;
  margin: 12px 0;
  /* Auto-ratio cells: cap each image's height so a row of three
     portraits doesn't push the rest of the topic down. */
  --igp-cell-h: 220px;
}

/* Column-count modifiers — set by the engine from the directive
   (cols=auto picks min(image count, 5)). */
.igp-cols-2 { --igp-cols: 2; }
.igp-cols-3 { --igp-cols: 3; }
.igp-cols-4 { --igp-cols: 4; --igp-cell-h: 180px; }
.igp-cols-5 { --igp-cols: 5; --igp-cell-h: 160px; }

/* On small screens, cap the column count at 2 so thumbnails stay
   big enough to tap. */
@media (max-width: 540px) {
  [data-igp] { --igp-cols: 2 !important; --igp-cell-h: 140px; }
}

[data-igp] img[data-igp-item] {
  width: 100%;
  height: var(--igp-cell-h);
  object-fit: cover;
  border-radius: var(--radius-sm, 8px);
  cursor: zoom-in;
  background: var(--panel-2, #f8f9fb);
  border: 1px solid var(--line-soft, #eff1f4);
  transition: transform .2s cubic-bezier(.22, .61, .2, 1), box-shadow .2s, filter .2s;
  display: block;
}

[data-igp] img[data-igp-item]:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
  filter: brightness(1.05);
  z-index: 1;
}

[data-igp] img[data-igp-item]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* When images live inside the grid, the .post-image-max setting of the
   forum shouldn't make them tiny — override it for gallery items only. */
.post-content [data-igp] img[data-igp-item] {
  max-width: none;
}

/* ---------- Aspect ratios (from :::gallery ratio=…) ---------- */

/* Ratio'd cells size themselves from the cell width instead of the
   fixed auto height. */
[data-igp].igp-ratio-square    img[data-igp-item],
[data-igp].igp-ratio-landscape img[data-igp-item],
[data-igp].igp-ratio-portrait  img[data-igp-item] { height: auto; }

[data-igp].igp-ratio-square    img[data-igp-item] { aspect-ratio: 1 / 1; }
[data-igp].igp-ratio-landscape img[data-igp-item] { aspect-ratio: 4 / 3; }
[data-igp].igp-ratio-portrait  img[data-igp-item] { aspect-ratio: 3 / 4; }

/* Wide two-column grids: keep portrait/square cells from becoming huge. */
[data-igp].igp-ratio-square    img[data-igp-item] { max-height: 440px; }
[data-igp].igp-ratio-portrait  img[data-igp-item] { max-height: 520px; }

/* ---------- 2. Single images ---------- */

/* A single image keeps FlatBB's natural rendering; only the cursor (and
   keyboard focus ring) say "click me". */
.post-content img[data-igp-item] { cursor: zoom-in; }
.post-content img[data-igp-item]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* With a ratio from the directive, a single image fills the post width
   (respecting the admin's post-image cap) cropped to that ratio —
   the way Twitter/X renders single media. */
.post-content img[data-igp-item].igp-ratio-square,
.post-content img[data-igp-item].igp-ratio-landscape,
.post-content img[data-igp-item].igp-ratio-portrait {
  display: block;
  width: min(100%, var(--post-img-max, 100%));
  height: auto;
  object-fit: cover;
  border-radius: var(--radius-sm, 8px);
  margin-inline: auto;
}

.post-content img[data-igp-item].igp-ratio-square    { aspect-ratio: 1 / 1; max-height: 440px; }
.post-content img[data-igp-item].igp-ratio-landscape { aspect-ratio: 4 / 3; max-height: 400px; }
.post-content img[data-igp-item].igp-ratio-portrait  { aspect-ratio: 3 / 4; max-height: 520px; }

/* ---------- 3. Lightbox ---------- */
[data-igp-lightbox] {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(8, 10, 14, .92);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: igp-fade-in .25s cubic-bezier(.22, .61, .2, 1);
}

[data-igp-lightbox][hidden] {
  display: none;
}

@keyframes igp-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* The big image */
.igp-stage {
  margin: 0;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.igp-stage img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-sm, 8px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .5);
  animation: igp-zoom-in .25s cubic-bezier(.22, .61, .2, 1);
}

@keyframes igp-zoom-in {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}

/* Caption (kept empty by the JS, like Image Gallery 1.0.3+) */
.igp-caption {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 80vw;
  padding: 6px 14px;
  border-radius: var(--radius-pill, 999px);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: var(--font-size-sm, 12px);
  text-align: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.igp-caption:empty { display: none; }

/* Counter ("3 / 7") */
.igp-counter {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: var(--radius-pill, 999px);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: var(--font-size-xs, 11px);
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.igp-counter:empty { display: none; }

/* Close button (top-right) */
.igp-close {
  position: absolute;
  top: 16px;
  inset-inline-end: 16px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background .15s, transform .15s;
}
.igp-close:hover {
  background: rgba(255, 255, 255, .18);
  transform: scale(1.05);
}
.igp-close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; }

/* Prev / next buttons (vertically centred on each side) */
.igp-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background .15s, transform .15s;
}
.igp-nav:hover {
  background: rgba(255, 255, 255, .18);
}
.igp-prev:hover { transform: translateY(-50%) scale(1.05) translateX(-2px); }
.igp-next:hover { transform: translateY(-50%) scale(1.05) translateX(2px); }
.igp-nav svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; fill: none; }

.igp-prev { inset-inline-start: 16px; }
.igp-next { inset-inline-end: 16px; }

/* On small screens, move the prev/next buttons to the bottom and make
   them bigger so they're easy to tap. */
@media (max-width: 540px) {
  [data-igp-lightbox] { padding: 12px; }
  .igp-stage,
  .igp-stage img { max-width: 95vw; max-height: 70vh; }
  .igp-nav {
    top: auto;
    bottom: 24px;
    transform: none;
    width: 56px;
    height: 56px;
  }
  .igp-prev:hover,
  .igp-next:hover { transform: scale(1.05); }
  .igp-prev { inset-inline-start: 16px; }
  .igp-next { inset-inline-end: 16px; }
  .igp-caption { bottom: 90px; }
  .igp-close { width: 36px; height: 36px; }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  [data-igp-lightbox],
  .igp-stage img,
  [data-igp] img[data-igp-item] {
    animation: none !important;
    transition: none !important;
  }
}

/* Print: hide the lightbox; galleries print as simple image grids. */
@media print {
  [data-igp-lightbox] { display: none !important; }
  [data-igp] img[data-igp-item] { height: auto; cursor: default; }
}

/* ---------- 4. Editor panel ---------- */
.igp-panel {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm, 8px);
  background: var(--panel);
  padding: 10px 12px;
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.igp-panel-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-size-sm, 13px);
  font-weight: 600;
  color: var(--text);
}
.igp-panel-title .icon { width: 15px; height: 15px; color: var(--brand); }

.igp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.igp-row-label {
  font-size: var(--font-size-sm, 13px);
  color: var(--text-muted);
  flex: none;
  min-width: 72px;
}

.igp-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.igp-picker button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 8px);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: var(--font-size-sm, 13px);
  line-height: 1.4;
  transition: border-color .15s, background .15s, color .15s;
}
.igp-picker button:hover { border-color: var(--brand); }
.igp-picker button.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}
.igp-picker button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

/* Mini aspect-ratio previews inside the ratio picker */
.igp-box {
  display: inline-block;
  width: 15px;
  flex: none;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  opacity: .85;
}
.igp-box-square    { aspect-ratio: 1 / 1; }
.igp-box-landscape { width: 19px; aspect-ratio: 4 / 3; }
.igp-box-portrait  { width: 12px; aspect-ratio: 3 / 4; }

.igp-panel-actions {
  display: flex;
  justify-content: flex-end;
}

/* The helper hint under the pickers */
.igp-panel-hint {
  margin: 0;
  padding-block-start: 8px;
  border-block-start: 1px dashed var(--line-soft);
  font-size: var(--font-size-xs, 11px);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.igp-panel-hint .icon { width: 13px; height: 13px; flex: none; }


/* infinite_scroll */

    .infscroll-loader {
        width: 24px;
        height: 24px;
        border: 3px solid rgba(0, 0, 0, 0.1);
        border-radius: 50%;
        border-top-color: currentColor;
        animation: infscroll-spin 0.8s linear infinite;
        margin: 0 auto;
    }
    @keyframes infscroll-spin {
        to { transform: rotate(360deg); }
    }

/* invite */
.invite-note{display:flex;align-items:center;gap:6px;color:var(--brand);font-weight:600}.invite-note svg{width:15px;height:15px}.invite-hero{display:flex;flex-wrap:wrap;align-items:center;gap:18px}.invite-hero>div:first-child{flex:1 1 320px}.invite-hero h1{margin:0 0 6px}.invite-hero p{margin:0;color:var(--text-muted)}.invite-link{display:flex;gap:8px;align-items:center;margin-top:14px;flex-wrap:wrap}.invite-link input{flex:1 1 260px;font-family:var(--mono);font-size:var(--font-size-sm)}.invite-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:16px 0}.invite-stats div{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:14px;text-align:center}.invite-stats b{display:block;font-size:1.4rem;color:var(--brand)}.invite-stats span{font-size:var(--font-size-sm);color:var(--text-muted)}.invite-rules{margin:0;padding-inline-start:18px;color:var(--text-muted);font-size:var(--font-size-sm)}.invite-rules b{color:var(--text)}.invite-list{list-style:none;margin:0;padding:0}.invite-list li{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid var(--line-soft)}.invite-list li:last-child{border:0}.invite-list .muted{margin-inline-start:auto;font-size:var(--font-size-sm)}.invite-state{font-size:var(--font-size-xs);padding:1px 8px;border-radius:999px;background:var(--panel-2);color:var(--text-muted)}.invite-state.paid{background:var(--success-soft);color:var(--success)}@media(max-width:640px){.invite-stats{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.invite-stats b{font-size:1.1rem}}

/* lightbox */
.post-content img,.editor-preview img{cursor:zoom-in}.post-content a img,.editor-preview a img{cursor:pointer}html.lightbox-lock{overflow:hidden}.lightbox{position:fixed;inset:0;z-index:210;display:none;align-items:center;justify-content:center;background:rgba(0,0,0,.88);opacity:0;transition:opacity .15s;touch-action:pan-y}.lightbox.open{display:flex;opacity:1}.lightbox-stage{margin:0;display:flex;flex-direction:column;align-items:center;gap:10px;max-width:94vw;max-height:92vh}.lightbox-stage img{max-width:94vw;max-height:84vh;object-fit:contain;border-radius:var(--radius-sm);background:#fff;box-shadow:0 8px 40px rgba(0,0,0,.5);cursor:default}.lightbox-cap{color:rgba(255,255,255,.82);font-size:var(--font-size-sm);max-width:80vw;text-align:center;word-break:break-word}.lightbox-close{position:fixed;top:14px;inset-inline-end:16px;width:40px;height:40px;border:0;border-radius:50%;background:rgba(255,255,255,.12);color:#fff;font-size:20px;line-height:1;cursor:pointer}.lightbox-close:hover{background:rgba(255,255,255,.22)}.lightbox-nav{position:fixed;top:50%;transform:translateY(-50%);width:48px;height:48px;border:0;border-radius:50%;background:rgba(255,255,255,.12);color:#fff;font-size:30px;line-height:1;cursor:pointer;display:none}.lightbox.has-many .lightbox-nav{display:inline-flex;align-items:center;justify-content:center}.lightbox-nav:hover{background:rgba(255,255,255,.22)}.lightbox-prev{inset-inline-start:16px}.lightbox-next{inset-inline-end:16px}[dir="rtl"] .lightbox-nav{transform:translateY(-50%) scaleX(-1)}.lightbox-count{position:fixed;top:18px;inset-inline-start:50%;transform:translateX(-50%);color:rgba(255,255,255,.82);font-size:var(--font-size-sm);font-variant-numeric:tabular-nums}@media(max-width:640px){.lightbox-nav{width:40px;height:40px;font-size:24px}.lightbox-prev{inset-inline-start:6px}.lightbox-next{inset-inline-end:6px}}@media(prefers-reduced-motion:reduce){.lightbox{transition:none}}

/* maintenance */
.maintenance-body{display:flex;align-items:center;justify-content:center;min-height:100vh;margin:0;padding:24px;background:var(--bg)}.maintenance-box{max-width:520px;width:100%;text-align:center;background:var(--card);border:1px solid var(--border);border-radius:var(--radius);padding:40px 32px}.maintenance-icon svg{width:44px;height:44px;color:var(--brand)}.maintenance-site{color:var(--muted);font-size:var(--font-size-sm);margin:8px 0 0}.maintenance-box h1{font-size:1.5rem;margin:6px 0 14px}.maintenance-box .post-content{color:var(--text);text-align:left}.maintenance-box .post-content p{text-align:center}.maintenance-login{margin:22px 0 0;font-size:var(--font-size-sm)}.maintenance-login a{color:var(--muted)}.maintenance-banner{display:flex;align-items:center;gap:8px;padding:10px 14px;border-radius:var(--radius-sm);margin-bottom:16px;background:var(--danger-soft);color:var(--danger);font-weight:500}.maintenance-banner svg{width:18px;height:18px;flex:none}.maintenance-banner a{color:inherit;text-decoration:underline;margin-left:auto}.maintenance-card-b svg{width:26px;height:26px;color:var(--danger)}

/* market */
.market-filter-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:12px}.market-filter-row .tabs{margin:0}.market-search{margin-inline-start:auto;width:200px;height:32px;padding:0 10px}.market-search input{font-size:var(--font-size-sm)}.market-filter-row .icon-btn{width:32px;height:32px}.market-cat-form select{width:auto;max-width:220px;height:32px;padding:0 8px;font-size:var(--font-size-sm)}@media(max-width:640px){.market-search{width:100%;margin-inline-start:0;order:2}.market-filter-row .icon-btn{order:3}}.market-connect{padding:18px 16px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--panel-2);text-align:center}.market-connect p:first-child{max-width:520px;margin:0 auto 12px}.market-connect .btn-lg{margin:4px 0 8px}.market-token-fold{margin-top:14px}.market-token-fold summary{cursor:pointer}.market-token-fold .admin-form{margin-top:10px}@media(max-width:640px){.plugin-item{flex-direction:column;gap:10px}.plugin-ops{justify-content:flex-start}.market-account-card .btn-row{margin-inline-start:0}.admin-toolbar form.inline{margin:0}}.market-other{display:flex;gap:10px;align-items:flex-start;padding:12px 14px;margin:0 0 14px;border-radius:var(--radius-sm);background:var(--warning-soft,var(--info-soft));color:var(--text)}.market-other svg{width:20px;height:20px;flex:none;margin-top:2px;color:var(--warning,var(--info))}.market-other p{margin:0 0 6px}.market-other-stop{background:var(--danger-soft)}.market-other-stop svg{color:var(--danger)}.market-tabs{margin-bottom:12px}.market-free{background:var(--success-soft,#dcfce7);color:var(--success,#15803d)}.market-paid{background:#fff1e6;color:#c2410c}[data-theme=dark] .market-paid{background:rgba(194,65,12,.25);color:#fdba74}.market-account{display:inline-flex;align-items:center;gap:6px;margin-inline-start:auto;color:var(--text-muted);font-size:var(--font-size-sm);white-space:nowrap}.market-account svg{width:16px;height:16px}.market-account b{color:var(--text)}.market-account-card{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:14px 16px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--panel-2)}.market-account-card>svg{width:28px;height:28px;color:var(--brand);flex:none}.market-account-card>div:first-of-type{flex:1;min-width:200px}.market-account-card .btn-row{margin-inline-start:auto}.plugin-ops small{display:block;text-align:right;margin-top:4px}.plugin-ops .btn[disabled]{opacity:.5;cursor:default}.market-foot{margin-top:14px}.market-theme-blank{display:flex;align-items:center;justify-content:center;width:100%;height:100%;color:var(--text-subtle)}.market-theme-blank .icon{width:40px;height:40px}.market-theme-badges{margin:2px 0}.theme-ops small{display:block;width:100%}.market-publish-themes{margin-top:18px;padding:14px 16px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--panel-2)}.market-publish-themes h3{margin:0 0 4px;font-size:var(--font-size-md)}.market-publish-themes p{margin:0}.market-publish-list{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}.market-publish-list .muted{font-weight:400}

/* market */
.market-shots-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(118px,1fr));gap:8px}.market-shot{position:relative;aspect-ratio:3/2;border:1px solid var(--line);border-radius:var(--radius-sm);overflow:hidden;background:var(--panel-2);user-select:none;-webkit-user-select:none}.market-shot img{display:block;width:100%;height:100%;object-fit:cover;pointer-events:none;-webkit-user-drag:none}.market-shots.is-js .market-shot{cursor:grab}.market-shot.is-dragging{opacity:.45;pointer-events:none;outline:2px dashed var(--brand);outline-offset:-2px}.market-shots.is-sorting,.market-shots.is-sorting *{cursor:grabbing}.market-shot:first-child{border:2px solid var(--brand)}.market-shot-cover{display:none;position:absolute;left:5px;bottom:5px;padding:1px 7px;border-radius:4px;background:var(--brand);color:var(--brand-text,#fff);font-size:11px;font-weight:600;line-height:1.5}.market-shot:first-child .market-shot-cover{display:block}.market-shot-x,.market-shot-grip{position:absolute;top:5px;display:flex;align-items:center;justify-content:center;width:22px;height:22px;padding:0;border:0;border-radius:50%;background:rgba(0,0,0,.62);color:#fff;font-size:16px;line-height:1;cursor:pointer}.market-shot-x{right:5px}.market-shot-x:hover{background:var(--danger,#dc2626)}.market-shot-grip{left:5px;cursor:grab;touch-action:none}.market-shot-grip:hover{background:rgba(0,0,0,.8)}.market-shot-x:focus-visible,.market-shot-grip:focus-visible{outline:2px solid var(--brand);outline-offset:1px}.market-shot-keep{position:absolute;left:5px;top:5px;display:flex;gap:4px;align-items:center;margin:0;padding:1px 6px;border-radius:4px;background:var(--panel);font-size:var(--font-size-xs)}.market-shots.is-js .market-shot-keep,.market-shots:not(.is-js) .market-shot-x,.market-shots:not(.is-js) .market-shot-grip{display:none}.market-shot-add{position:relative;aspect-ratio:3/2;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;margin:0;border:1px dashed var(--text-subtle);border-radius:var(--radius-sm);color:var(--text-muted);font-size:var(--font-size-sm);font-weight:500;cursor:pointer}.market-shot-add:hover{border-color:var(--brand);color:var(--brand);background:var(--brand-soft)}.market-shot-add .icon{width:20px;height:20px}.market-shot-add[hidden],.market-shots-error[hidden]{display:none}.market-shots.is-js .market-shot-add input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}.market-shots:not(.is-js) .market-shot-add{grid-column:1/-1;aspect-ratio:auto;align-items:stretch;border:0;cursor:default}.market-shots:not(.is-js) .market-shot-add .icon,.market-shots:not(.is-js) .market-shot-add span{display:none}.market-shots-error{margin:6px 0 0;color:var(--danger,#dc2626);font-size:var(--font-size-sm)}

/* media_embed */
/* ============================================================
   Media Embed — assets/embed.css
   Responsive video / audio / tweet embeds inside .post-content.
   All colours come from the forum's CSS variables so the plugin
   follows light / dark themes.
   ============================================================ */

.media-embed {
  margin: 16px 0;
  border-radius: var(--radius-sm, 8px);
  overflow: hidden;
  background: var(--panel-2, #f8f9fb);
  border: 1px solid var(--line-soft, #eff1f4);
}

/* ---------- Video (YouTube / Vimeo / Aparat) ---------- */
.media-embed-video {
  position: relative;
  width: 100%;
  aspect-ratio: var(--media-embed-ratio, 16 / 9);
}

.media-embed-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ---------- Direct HTML5 video (.mp4 / .webm / .ogg / .mov / .m4v) ---------- */
.media-embed-html5 {
  position: relative;
  width: 100%;
  background: #000;
  /* No forced aspect-ratio — let the video's native dimensions
     drive the height so portrait videos don't get letterboxed
     into a 16:9 slab. The browser sizes <video> to the file's
     intrinsic ratio while still respecting the container width. */
}

.media-embed-html5 video {
  display: block;
  width: 100%;
  max-height: 80vh;            /* keep tall portrait videos sane */
  height: auto;
  background: #000;
  border: 0;
  outline: 0;
}

/* The download fallback link — visible only if the <video> tag
   itself cannot render (browser shows the inline fallback). In
   a supporting browser it stays as a tiny "Download" link under
   the player, which is genuinely useful for direct file links. */
.media-embed-html5 .media-embed-download {
  display: block;
  padding: 8px 12px;
  background: var(--panel-2, #f8f9fb);
  color: var(--brand, #2563eb);
  font-size: 0.85em;
  text-decoration: none;
  border-top: 1px solid var(--line-soft, #eff1f4);
}

.media-embed-html5 .media-embed-download:hover {
  text-decoration: underline;
}

/* The inline <a> fallback inside <video> is shown only when the
   browser cannot play the source — hide it visually otherwise
   so we don't end up with a duplicate of the download link. */
.media-embed-html5 video > a {
  display: inline-block;
  color: #fff;
  padding: 12px;
  background: #111;
}

/* ---------- Audio (SoundCloud / Spotify) ---------- */
.media-embed-audio {
  background: transparent;
  border: 0;
}

.media-embed-audio iframe {
  display: block;
  border: 0;
}

/* ---------- Twitter / X ---------- */
.media-embed-tweet {
  padding: 12px 16px;
  max-width: 550px;
}

.media-embed-tweet blockquote {
  margin: 0;
}

.media-embed-tweet a {
  color: var(--brand);
  text-decoration: none;
}

.media-embed-tweet a:hover {
  text-decoration: underline;
}

/* ---------- Small screens ---------- */
@media (max-width: 540px) {
  .media-embed {
    margin: 12px -4px;
    border-radius: var(--radius-sm, 8px);
  }

  .media-embed-tweet {
    padding: 8px 12px;
  }

  .media-embed-html5 video {
    max-height: 70vh;
  }
}

/* ---------- Print ---------- */
@media print {
  .media-embed-video,
  .media-embed-audio,
  .media-embed-html5 {
    display: none;
  }

  .media-embed-tweet {
    border: 1px solid #ccc;
  }
}


/* media_gallery */

/* =========================================================
 * MEDIA GALLERY
 * Responsive, clean and consistent design
 * ========================================================= */

.mg-hero,
.mg-filters,
.mg-grid,
.mg-card,
.mg-empty,
.mg-pagination,
.mg-add-hero,
.mg-add-card,
.mg-add-form,
.mg-upload-box,
.mg-youtube-input,
.mg-item,
.mg-item-top,
.mg-item-title,
.mg-item-image,
.mg-item-video,
.mg-item-description,
.mg-item-bottom,
.mg-item-stats,
.mg-item-actions {
    box-sizing: border-box;
}

.mg-hero *,
.mg-add-hero *,
.mg-filters *,
.mg-grid *,
.mg-add-card *,
.mg-item * {
    box-sizing: border-box;
}

.mg-hero,
.mg-filters,
.mg-grid,
.mg-card,
.mg-add-card,
.mg-item {
    min-width: 0;
}


/* =========================================================
 * HERO
 * ========================================================= */


.mg-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 1.25rem;

    width: 100%;
    margin-bottom: 1.25rem;
    padding: 1.5rem;

    border: 1px solid var(--line, var(--border));
    border-radius: var(--radius, 14px);

    background:
        linear-gradient(
            135deg,
            var(--card-bg, var(--panel)),
            var(--bg-soft, var(--panel))
        );

    box-shadow:
        0 .2rem .8rem rgba(0, 0, 0, .035);
}

.mg-hero-content {
    flex: 1 1 auto;
    min-width: 0;
}

.mg-kicker {
    margin: 0 0 .35rem;

    color: var(--brand);

    font-size: .72rem;
    font-weight: 800;

    letter-spacing: .08em;
    line-height: 1.3;

    text-transform: uppercase;
}

.mg-hero h1 {
    margin: 0;

    max-width: 100%;

    font-size: clamp(1.65rem, 4vw, 2.35rem);
    line-height: 1.1;

    overflow-wrap: anywhere;
}

.mg-hero p {
    max-width: 46rem;

    margin: .55rem 0 0;

    color: var(--text-muted);

    line-height: 1.5;

    overflow-wrap: anywhere;
}

.mg-hero-button {
    flex: 0 0 auto;
    white-space: nowrap;
}

.mg-edit-card {
    width: 100%;
    box-sizing: border-box;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
}

.mg-edit-form {
    width: 100%;
}

.mg-action-edit {
    text-decoration: none;
}

.mg-action-edit:hover {
    text-decoration: none;
}

.mg-action-delete {
    color: #dc3545;
}

.mg-action-delete:hover {
    color: #fff;
    background: #dc3545;
}
/* =========================================================
 * FILTERS
 * ========================================================= */

.mg-filters {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(9rem, 11rem)
        minmax(9rem, 11rem)
        auto;

    align-items: stretch;

    gap: .65rem;

    width: 100%;
    margin-bottom: 1.25rem;
}

.mg-search {
    position: relative;

    display: flex;
    align-items: center;

    width: 100%;
    min-width: 0;
}

.mg-search > svg,
.mg-search > i,
.mg-search > .icon,
.mg-search > span:first-child {
    position: absolute;

    inset-inline-start: .85rem;
    top: 50%;

    z-index: 3;

    display: grid;

    width: 1rem;
    height: 1rem;

    place-items: center;

    margin: 0;

    transform: translateY(-50%);

    color: var(--text-muted);

    pointer-events: none;

    line-height: 0;
}

.mg-search input {
    display: block;

    width: 100%;
    min-width: 0;
    height: 2.75rem;

    box-sizing: border-box;

    margin: 0 !important;

    padding-top: 0 !important;
    padding-bottom: 0 !important;

    padding-inline-start: 2.5rem !important;
    padding-inline-end: .85rem !important;
}

.mg-filters select {
    display: block;

    width: 100%;
    min-width: 0;
    height: 2.75rem;

    box-sizing: border-box;

    margin: 0 !important;
}

.mg-filters > .btn {
    display: inline-flex;

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

    min-width: 6.5rem;
    height: 2.75rem;

    box-sizing: border-box;

    margin: 0 !important;

    white-space: nowrap;
}


/* =========================================================
 * GALLERY GRID
 * ========================================================= */

.mg-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 1rem;

    width: 100%;
}


/* =========================================================
 * CARD
 * ========================================================= */

.mg-card {
    display: flex;
    flex-direction: column;

    width: 100%;
    min-width: 0;

    overflow: hidden;

    border: 1px solid var(--line, var(--border));
    border-radius: var(--radius, 14px);

    background: var(--card-bg, var(--panel));

    box-shadow:
        0 .2rem .8rem rgba(0, 0, 0, .035);

    transition:
        transform .18s ease,
        box-shadow .18s ease,
        border-color .18s ease;
}

.mg-card:hover {
    transform: translateY(-2px);

    border-color: var(--brand);

    box-shadow:
        0 .65rem 1.5rem rgba(0, 0, 0, .08);
}


/* =========================================================
 * MEDIA PREVIEW
 * ========================================================= */

.mg-media {
    position: relative;

    display: block;

    width: 100%;
    min-width: 0;

    overflow: hidden;

    aspect-ratio: 16 / 10;

    background: var(--bg-soft, var(--panel));

    text-decoration: none;
}

.mg-media img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition:
        transform .3s ease,
        filter .3s ease;
}

.mg-card:hover .mg-media img {
    transform: scale(1.035);
}

.mg-card-youtube:hover .mg-media img {
    filter: brightness(.82);
}

.mg-media-fallback {
    display: grid;

    width: 100%;
    height: 100%;

    place-items: center;

    color: var(--text-muted);
}

.mg-media-fallback svg,
.mg-media-fallback i {
    width: 3rem;
    height: 3rem;
}


/* =========================================================
 * YOUTUBE BADGE
 * ========================================================= */

.mg-youtube-badge {
    position: absolute;

    inset-block-start: .65rem;
    inset-inline-start: .65rem;

    z-index: 2;

    display: inline-flex;

    align-items: center;

    gap: .35rem;

    max-width: calc(100% - 1.3rem);

    padding: .35rem .55rem;

    border-radius: 999px;

    background: rgba(0, 0, 0, .78);

    color: #fff;

    font-size: .72rem;
    font-weight: 700;

    white-space: nowrap;

    overflow: hidden;
    text-overflow: ellipsis;

    backdrop-filter: blur(5px);
}

.mg-youtube-badge svg,
.mg-youtube-badge i {
    flex: 0 0 auto;

    width: .8rem;
    height: .8rem;
}

.mg-play {
    position: absolute;

    left: 50%;
    top: 50%;

    z-index: 2;

    display: grid;

    width: 3.35rem;
    height: 3.35rem;

    place-items: center;

    transform: translate(-50%, -50%);

    border-radius: 50%;

    background: var(--brand);

    color: #fff;

    box-shadow:
        0 .45rem 1.2rem rgba(0, 0, 0, .3);

    transition:
        transform .18s ease,
        background .18s ease;
}

.mg-card:hover .mg-play {
    transform:
        translate(-50%, -50%)
        scale(1.08);
}

.mg-play svg,
.mg-play i {
    width: 1.25rem;
    height: 1.25rem;
}


/* =========================================================
 * PHOTO BADGE
 * ========================================================= */

.mg-photo-badge {
    position: absolute;

    inset-block-end: .65rem;
    inset-inline-start: .65rem;

    z-index: 2;

    display: grid;

    width: 2rem;
    height: 2rem;

    place-items: center;

    border-radius: 50%;

    background: rgba(0, 0, 0, .68);

    color: #fff;

    backdrop-filter: blur(5px);
}

.mg-photo-badge svg,
.mg-photo-badge i {
    width: .95rem;
    height: .95rem;
}


/* =========================================================
 * FEATURED
 * ========================================================= */

.mg-featured {
    position: absolute;

    inset-block-start: .65rem;
    inset-inline-end: .65rem;

    z-index: 2;

    display: inline-flex;

    align-items: center;

    gap: .3rem;

    max-width: calc(100% - 1.3rem);

    padding: .35rem .55rem;

    border-radius: 999px;

    background: var(--brand);

    color: #fff;

    font-size: .7rem;
    font-weight: 800;

    white-space: nowrap;

    overflow: hidden;
    text-overflow: ellipsis;

    box-shadow:
        0 .25rem .6rem rgba(0, 0, 0, .14);
}

.mg-featured svg,
.mg-featured i {
    width: .75rem;
    height: .75rem;

    flex: 0 0 auto;
}


/* =========================================================
 * CARD BODY
 * ========================================================= */

.mg-card-body {
    display: flex;
    flex-direction: column;

    flex: 1 1 auto;

    min-width: 0;

    padding: 1rem;
}

.mg-card-category {
    display: inline-flex;
    align-items: center;

    width: fit-content;
    max-width: 100%;

    margin: 0 0 .45rem;
    padding: .22rem .55rem;

    box-sizing: border-box;

    border-radius: 999px;

    background: rgba(0, 123, 255, .08);

    color: var(--brand);

    font-size: .68rem;
    font-weight: 800;

    letter-spacing: .035em;
    line-height: 1.25;

    text-transform: uppercase;

    white-space: normal;

    overflow-wrap: anywhere;
    word-break: break-word;
}

.mg-card h3 {
    display: block;

    width: 100%;
    min-width: 0;

    margin: 0;

    font-size: 1.05rem;
    font-weight: 750;

    line-height: 1.3;

    overflow-wrap: anywhere;
    word-break: break-word;
}

.mg-card h3 a {
    display: block;

    width: 100%;
    min-width: 0;

    color: inherit;
    text-decoration: none;

    overflow-wrap: anywhere;
    word-break: break-word;
}

.mg-card h3 a:hover {
    color: var(--brand);
}

.mg-card h3 a:hover {
    color: var(--brand);
}

.mg-excerpt {
    display: -webkit-box;

    margin: .5rem 0 0;

    overflow: hidden;

    color: var(--text-muted);

    font-size: .9rem;
    line-height: 1.45;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;

    overflow-wrap: anywhere;
}

.mg-card-foot {
    display: flex;

    align-items: center;

    gap: 1rem;

    min-width: 0;

    margin-top: auto;
    padding-top: .75rem;

    border-top: 1px solid var(--line, var(--border));

    color: var(--text-muted);

    font-size: .78rem;

    flex-wrap: wrap;
}

.mg-card-author {
    display:flex;
    align-items:center;

    gap:9px;

    width:100%;
    max-width:100%;

    margin-top:11px;
    padding:7px 9px 7px 7px;

    border:1px solid var(--line);
    border-radius:var(--radius);

    background:var(--panel);

    box-sizing:border-box;
}

.mg-card-author-avatar {
    flex:0 0 34px;
}

.mg-card-author-avatar img {
    display:block;

    width:34px;
    height:34px;

    border-radius:50%;
    object-fit:cover;
}

.mg-card-author-info {
    display:flex;
    flex-direction:column;
    justify-content:center;

    min-width:0;
    flex:1;

    line-height:1.2;
}

.mg-card-author-name {
    display:block;

    min-width:0;
    max-width:100%;

    font-size:var(--font-size-xs);
    font-weight:600;

    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.mg-card-author-role {
    display:block;

    margin-top:2px;

    min-width:0;
    max-width:100%;

    color:var(--brand);

    font-size:11px;
    font-weight:600;

    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.mg-card-author-date {
    display:block;

    margin-top:2px;

    color:var(--muted);

    font-size:11px;

    line-height:1.2;

    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.mg-card-foot > span {
    display: inline-flex;

    align-items: center;

    gap: .3rem;

    min-width: 0;
}

.mg-card-foot svg,
.mg-card-foot i {
    flex: 0 0 auto;

    width: .85rem;
    height: .85rem;
}


/* =========================================================
 * EMPTY STATE
 * ========================================================= */

.mg-empty {
    display: flex;
    flex-direction: column;

    align-items: center;

    width: 100%;

    padding: 4rem 1.5rem;

    text-align: center;

    border: 1px solid var(--line, var(--border));
    border-radius: var(--radius, 14px);

    background: var(--card-bg, var(--panel));
}

.mg-empty-icon {
    display: grid;

    width: 4rem;
    height: 4rem;

    margin-bottom: 1rem;

    place-items: center;

    border-radius: 50%;

    background: rgba(0, 123, 255, .10);

    color: var(--brand);
}

.mg-empty-icon svg,
.mg-empty-icon i {
    width: 1.75rem;
    height: 1.75rem;
}

.mg-empty h2 {
    margin: 0;
}

.mg-empty p {
    max-width: 30rem;

    margin: .45rem 0 1.25rem;

    color: var(--text-muted);

    line-height: 1.5;

    overflow-wrap: anywhere;
}


/* =========================================================
 * PAGINATION
 * ========================================================= */

.mg-pagination {
    display: flex;

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

    gap: .4rem;

    width: 100%;

    margin-top: 1.5rem;

    flex-wrap: wrap;
}

.mg-pagination a {
    display: inline-flex;

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

    min-width: 2.35rem;
    min-height: 2.35rem;

    padding: .35rem .65rem;

    border: 1px solid var(--line, var(--border));
    border-radius: var(--radius, 10px);

    background: var(--card-bg, var(--panel));

    color: inherit;

    text-decoration: none;

    transition:
        background .15s ease,
        color .15s ease,
        border-color .15s ease;
}

.mg-pagination a:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.mg-pagination a.active {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}


/* =========================================================
 * ADD PAGE
 * ========================================================= */

.mg-add-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 1.25rem;

    width: 100%;
    min-width: 0;
    box-sizing: border-box;

    margin-bottom: 1.25rem;
    padding: 1.5rem;

    border: 1px solid var(--line, var(--border));
    border-radius: var(--radius, 14px);

    background:
        linear-gradient(
            135deg,
            var(--card-bg, var(--panel)),
            var(--bg-soft, var(--panel))
        );

    box-shadow:
        0 .2rem .8rem rgba(0, 0, 0, .035);
}

.mg-add-hero > * {
    min-width: 0;
}


.mg-add-hero h1 {
    margin: 0;

    max-width: 100%;

    font-size: clamp(1.65rem, 4vw, 2.35rem);
    line-height: 1.1;

    overflow-wrap: anywhere;
}

.mg-add-hero p {
    max-width: 46rem;

    margin: .55rem 0 0;

    color: var(--text-muted);

    line-height: 1.5;

    overflow-wrap: anywhere;
}

.mg-add-hero .btn {
    flex: 0 0 auto;

    white-space: nowrap;
}

.mg-add-card {
    width: 100%;
    max-width: 54rem;

    margin: 0 auto;

    padding: 1.25rem;

    border: 1px solid var(--line, var(--border));
    border-radius: var(--radius, 14px);

    background: var(--card-bg, var(--panel));

    box-shadow:
        0 .2rem .8rem rgba(0, 0, 0, .035);
}

.mg-add-form {
    display: grid;

    gap: 1rem;

    min-width: 0;
}


/* =========================================================
 * UPLOAD BOX
 * ========================================================= */

.mg-upload-box {
    display: flex;
    flex-direction: column;

    align-items: center;

    width: 100%;

    padding: 2rem 1.25rem;

    border: 1.5px dashed var(--line, var(--border));
    border-radius: var(--radius, 14px);

    background: var(--bg-soft, var(--panel));

    text-align: center;

    transition:
        border-color .15s ease,
        background .15s ease;
}

.mg-upload-box:hover {
    border-color: var(--brand);

    background:
        color-mix(
            in srgb,
            var(--brand) 4%,
            var(--bg-soft, var(--panel))
        );
}

.mg-upload-icon {
    display: grid;

    width: 3.75rem;
    height: 3.75rem;

    margin-bottom: .8rem;

    place-items: center;

    border-radius: 50%;

    background: rgba(0, 123, 255, .10);

    color: var(--brand);
}

.mg-upload-icon svg,
.mg-upload-icon i {
    width: 1.7rem;
    height: 1.7rem;
}

.mg-upload-title {
    max-width: 100%;

    font-size: 1.05rem;
    font-weight: 750;

    overflow-wrap: anywhere;
}

.mg-upload-text {
    max-width: 32rem;

    margin: .35rem 0 1rem;

    color: var(--text-muted);

    font-size: .88rem;
    line-height: 1.5;

    overflow-wrap: anywhere;
}

.mg-upload-button {
    position: relative;

    display: inline-flex;

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

    gap: .45rem;

    max-width: 100%;

    overflow: hidden;

    cursor: pointer;
}

.mg-upload-button input {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    opacity: 0;

    cursor: pointer;
}

.mg-upload-box small {
    max-width: 100%;

    margin-top: .75rem;

    color: var(--text-muted);

    font-size: .75rem;
    line-height: 1.4;

    overflow-wrap: anywhere;
}


/* =========================================================
 * OR
 * ========================================================= */

.mg-or {
    display: flex;

    align-items: center;

    gap: .75rem;

    width: 100%;

    color: var(--text-muted);

    font-size: .75rem;
    font-weight: 800;

    letter-spacing: .08em;

    white-space: nowrap;
}

.mg-or::before,
.mg-or::after {
    content: "";

    flex: 1 1 auto;

    min-width: 0;

    height: 1px;

    background: var(--line, var(--border));
}


/* =========================================================
 * YOUTUBE INPUT
 * ========================================================= */

.mg-youtube-input {
    display: flex;

    align-items: center;

    width: 100%;
    min-width: 0;

    overflow: hidden;

    border: 1px solid var(--line, var(--border));
    border-radius: var(--radius, 10px);

    background: var(--card-bg, var(--panel));

    transition:
        border-color .15s ease,
        box-shadow .15s ease;
}

.mg-youtube-input:focus-within {
    border-color: var(--brand);

    box-shadow:
        0 0 0 3px rgba(0, 123, 255, .08);
}

.mg-youtube-input-icon {
    display: grid;

    flex: 0 0 3rem;

    width: 3rem;
    height: 3rem;

    place-items: center;

    background: rgba(0, 123, 255, .10);

    color: var(--brand);
}

.mg-youtube-input-icon svg,
.mg-youtube-input-icon i {
    width: 1rem;
    height: 1rem;
}

.mg-youtube-input input {
    display: block;

    flex: 1 1 auto;

    width: 100%;
    min-width: 0;

    box-sizing: border-box;

    border: 0 !important;

    box-shadow: none !important;
}


/* =========================================================
 * FORM ACTIONS
 * ========================================================= */

.mg-form-actions {
    display: flex;

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

    gap: .65rem;

    width: 100%;

    padding-top: .5rem;
}


/* =========================================================
 * ITEM PAGE
 * ========================================================= */

.mg-item {
    width: 100%;
    max-width: 72rem;

    margin: 0 auto;
}


/* =========================================================
 * ITEM TOP
 * ========================================================= */

.mg-item-top {
    display: flex;

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

    gap: .75rem;

    width: 100%;
    min-width: 0;

    margin-bottom: .75rem;

    flex-wrap: wrap;
}


/* =========================================================
 * ITEM TYPE
 * ========================================================= */

.mg-item-type {
    display: inline-flex;

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

    gap: .4rem;

    flex: 0 0 auto;

    max-width: 100%;

    min-height: 2rem;

    padding: .4rem .7rem;

    border-radius: 999px;

    font-size: .72rem;
    font-weight: 800;

    line-height: 1.25;

    white-space: nowrap;

    overflow: hidden;
    text-overflow: ellipsis;
}

.mg-item-type.photo {
    background: rgba(0, 123, 255, .10);
    color: var(--brand);
}

.mg-item-type.youtube {
    background: #111;
    color: #fff;
}

.mg-item-type svg,
.mg-item-type i {
    flex: 0 0 auto;

    width: .8rem;
    height: .8rem;
}


/* =========================================================
 * ITEM TITLE
 * ========================================================= */

.mg-item-title {
    width: 100%;
    min-width: 0;

    margin: 0 0 1rem;
}

.mg-item-title h1 {
    max-width: 100%;

    margin: 0;

    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 750;

    line-height: 1.15;

    overflow-wrap: anywhere;
}


/* =========================================================
 * ITEM IMAGE
 * ========================================================= */

.mg-item-image {
    position: relative;

    display: flex;

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

    width: 100%;
    max-width: 100%;

    min-height: 0;

    overflow: hidden;

    border: 1px solid var(--line, var(--border));
    border-radius: var(--radius, 14px);

    background: var(--bg-soft, var(--panel));
}

.mg-item-image img {
    display: block;

    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 78vh;

    object-fit: contain;
}

.mg-item-image-empty {
    display: grid;

    width: 100%;
    min-height: 20rem;

    place-items: center;

    color: var(--text-muted);
}

.mg-item-image-empty svg,
.mg-item-image-empty i {
    width: 3rem;
    height: 3rem;
}


/* =========================================================
 * ITEM VIDEO
 * ========================================================= */

.mg-item-video {
    position: relative;

    width: 100%;
    max-width: 100%;

    overflow: hidden;

    aspect-ratio: 16 / 9;

    border-radius: var(--radius, 14px);

    background: #000;
}

.mg-item-video iframe {
    position: absolute;

    inset: 0;

    display: block;

    width: 100%;
    height: 100%;

    border: 0;
}


/* =========================================================
 * MEDIA CARD DESCRIPTION
 * ========================================================= */

.mg-card-description {
    width: 100%;
    min-width: 0;

    margin-top: 1rem;
    padding: 1rem 1.1rem;

    box-sizing: border-box;

    border: 1px solid var(--line, var(--border));
    border-radius: var(--radius, 12px);

    background: var(--card-bg, var(--panel));

    box-shadow:
        0 .12rem .4rem rgba(0, 0, 0, .025);

    overflow: hidden;
}


/* =========================================================
 * EXCERPT
 * ========================================================= */

.mg-card-description .mg-excerpt {
    margin: 0;

    color: var(--text, inherit);

    font-size: .8rem;
    font-weight: 500;

    line-height: 1.55;

    overflow-wrap: anywhere;
    word-break: break-word;
}


/* =========================================================
 * MOBILE
 * ========================================================= */

@media (max-width: 42rem) {

    .mg-card-description {
        margin-top: .7rem;
        padding: .75rem .8rem;

        border-radius: var(--radius, 12px);
    }

    .mg-card-description .mg-excerpt {
        font-size: .75rem;
        line-height: 1.5;
    }

}


/* =========================================================
 * ITEM BOTTOM
 * ========================================================= */

.mg-item-bottom {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        auto;

    align-items: stretch;

    gap: .75rem;

    width: 100%;
    min-width: 0;

    margin-top: 1rem;
    padding: .75rem;

    box-sizing: border-box;

    border: 1px solid var(--line, var(--border));
    border-radius: var(--radius, 12px);

    background: var(--card-bg, var(--panel));
}


/* =========================================================
 * STATS
 * ========================================================= */

.mg-item-stats {
    grid-column: 1;
    min-width: 0;
}


/* =========================================================
 * ACTIONS
 * ========================================================= */

.mg-item-actions {
    grid-column: 1 / -1 !important;

    display: flex;

    flex-direction: row;
    flex-wrap: wrap;

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

    gap: .55rem;

    width: 100%;
    max-width: 100%;

    margin: 1rem auto 0;
    padding: .4rem;

    box-sizing: border-box;

    border: none;
    border-radius: 12px;

    background: var(--bg-soft, var(--panel));

    box-shadow:
        0 .15rem .5rem rgba(0, 0, 0, .025);
}



/* =========================================================
 * ITEM STATS
 * ========================================================= */

.mg-item-stats {
    display: flex;

    align-items: center;

    gap: .45rem;

    min-width: 0;

    flex-wrap: wrap;

    color: var(--text-muted);

    font-size: .8rem;
}

.mg-item-stats > span {
    display: inline-flex;

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

    gap: .35rem;

    min-width: 0;
    min-height: 2.35rem;

    padding: .35rem .65rem;

    border: 1px solid var(--line, var(--border));
    border-radius: 8px;

    background: var(--bg-soft, var(--panel));

    white-space: nowrap;
}

.mg-item-stats strong {
    color: inherit;
    font-weight: 750;
}

.mg-item-stats svg,
.mg-item-stats i {
    flex: 0 0 auto;

    width: .9rem;
    height: .9rem;
}


/* =========================================================
 * ITEM ACTIONS CONTAINER
 * Харесай + Добави в любими
 * ========================================================= */

.mg-item-actions {
    display: flex;

    flex-direction: row;
    flex-wrap: wrap;

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

    gap: .55rem;

    width: 100%;
    max-width: 100%;

    margin: 1rem auto 0;
    padding: .4rem;

    box-sizing: border-box;

    border: none;
    border-radius: 12px;

    background: var(--bg-soft, var(--panel));

    box-shadow:
        0 .15rem .5rem rgba(0, 0, 0, .025);
}

/* =========================================================
 * ACTION FORM
 * ========================================================= */

.mg-item-actions form.mg-action-form {

    display: flex;

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

    flex: 0 0 auto;

    width: auto;
    min-width: 0;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;

    background: transparent !important;

    box-shadow: none !important;
}


/* =========================================================
 * ACTION BUTTON
 * ========================================================= */

.mg-item-actions form.mg-action-form button,
.mg-item-actions form.mg-action-form input[type="submit"],
.mg-item-actions > button.mg-action-form,
.mg-item-actions > input.mg-action-form[type="submit"] {

    display: inline-flex !important;

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

    gap: .5rem;

    width: auto;

    min-width: 9.5rem;
    min-height: 2.65rem;

    margin: 0 !important;

    padding: .55rem .9rem !important;

    box-sizing: border-box;

    border: 1px solid var(--line, var(--border)) !important;
    border-radius: 9px !important;

    background: var(--card-bg, var(--panel)) !important;

    color: var(--text, inherit) !important;

    font-family: inherit;

    font-size: .8rem;
    font-weight: 750;

    line-height: 1.2;

    text-align: center;

    white-space: nowrap;

    cursor: pointer;

    box-shadow:
        0 .1rem .3rem rgba(0, 0, 0, .025) !important;

    appearance: none;
    -webkit-appearance: none;

    transition:
        background .18s ease,
        color .18s ease,
        border-color .18s ease,
        box-shadow .18s ease,
        transform .18s ease;
}


/* =========================================================
 * ACTION ICON
 * ========================================================= */

.mg-item-actions form.mg-action-form button svg,
.mg-item-actions form.mg-action-form button i,
.mg-item-actions form.mg-action-form input[type="submit"] svg,
.mg-item-actions form.mg-action-form input[type="submit"] i,
.mg-item-actions > button.mg-action-form svg,
.mg-item-actions > button.mg-action-form i {

    display: block;

    flex: 0 0 auto;

    width: 1rem;
    height: 1rem;

    margin: 0;

    transition:
        transform .18s ease,
        color .18s ease;
}


/* =========================================================
 * ACTION TEXT
 * ========================================================= */

.mg-item-actions form.mg-action-form button span,
.mg-item-actions form.mg-action-form input[type="submit"] span,
.mg-item-actions > button.mg-action-form span {

    display: inline-flex;
    align-items: center;

    min-width: 0;

    margin: 0;

    color: inherit;

    font-size: inherit;
    font-weight: inherit;

    line-height: 1.2;

    white-space: nowrap;
}


/* =========================================================
 * HOVER
 * ========================================================= */

.mg-item-actions form.mg-action-form button:hover,
.mg-item-actions form.mg-action-form input[type="submit"]:hover,
.mg-item-actions > button.mg-action-form:hover,
.mg-item-actions > input.mg-action-form[type="submit"]:hover {

    border-color: var(--brand) !important;

    background:
        rgba(0, 123, 255, .055) !important;

    color: var(--brand) !important;

    box-shadow:
        0 .25rem .7rem rgba(0, 123, 255, .08) !important;

    transform: translateY(-1px);
}


.mg-item-actions form.mg-action-form button:hover svg,
.mg-item-actions form.mg-action-form button:hover i,
.mg-item-actions > button.mg-action-form:hover svg,
.mg-item-actions > button.mg-action-form:hover i {

    transform: scale(1.08);
}


/* =========================================================
 * ACTIVE
 * Харесано / Добавено в любими
 * ========================================================= */

.mg-item-actions form.mg-action-form.is-active button,
.mg-item-actions form.mg-action-form.is-active input[type="submit"],
.mg-item-actions > button.mg-action-form.is-active,
.mg-item-actions > input.mg-action-form.is-active[type="submit"],
.mg-item-actions form.is-active button,
.mg-item-actions form.is-active input[type="submit"] {

    border-color: var(--brand) !important;

    background:
        rgba(0, 123, 255, .11) !important;

    color: var(--brand) !important;

    box-shadow:
        inset 0 0 0 1px rgba(0, 123, 255, .04),
        0 .2rem .6rem rgba(0, 123, 255, .06) !important;
}


/* =========================================================
 * ACTIVE ICON
 * ========================================================= */

.mg-item-actions form.mg-action-form.is-active button svg,
.mg-item-actions form.mg-action-form.is-active button i,
.mg-item-actions form.is-active button svg,
.mg-item-actions form.is-active button i {

    transform: scale(1.08);
}


/* =========================================================
 * ACTIVE HOVER
 * ========================================================= */

.mg-item-actions form.mg-action-form.is-active button:hover,
.mg-item-actions form.mg-action-form.is-active input[type="submit"]:hover,
.mg-item-actions > button.mg-action-form.is-active:hover,
.mg-item-actions > input.mg-action-form.is-active[type="submit"]:hover,
.mg-item-actions form.is-active button:hover,
.mg-item-actions form.is-active input[type="submit"]:hover {

    border-color: var(--brand) !important;

    background: var(--brand) !important;

    color: #fff !important;

    box-shadow:
        0 .3rem .8rem rgba(0, 123, 255, .18) !important;

    transform: translateY(-1px);
}

.mg-author-card {
    display:flex;
    align-items:center;
    gap:12px;

    width:100%;
    max-width:100%;

    margin:16px 0 20px;
    padding:10px 14px 10px 10px;

    border:1px solid var(--line);
    border-radius:var(--radius);

    background:var(--panel);
    box-sizing:border-box;
}

.mg-author-card-avatar {
    flex:0 0 44px;
}

.mg-author-card-avatar img {
    display:block;

    width:44px;
    height:44px;

    border-radius:50%;
    object-fit:cover;
}

.mg-author-card-info {
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    justify-content:center;

    min-width:0;
    flex:1;

    line-height:1.2;
}

.mg-author-card-name {
    display:block;

    max-width:100%;

    font-size:var(--font-size-sm);
    font-weight:600;

    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.mg-author-card-role {
    display:block;

    margin-top:3px;

    color:var(--brand);
    font-size:var(--font-size-xs);
    font-weight:600;

    line-height:1.2;
}

.mg-author-card-date {
    display:block;

    margin-top:3px;

    color:var(--muted);
    font-size:var(--font-size-xs);

    line-height:1.2;
}

/* =========================================================
 * FOCUS
 * ========================================================= */

.mg-item-actions form.mg-action-form button:focus-visible,
.mg-item-actions form.mg-action-form input[type="submit"]:focus-visible,
.mg-item-actions > button.mg-action-form:focus-visible,
.mg-item-actions > input.mg-action-form[type="submit"]:focus-visible {

    outline: 2px solid var(--brand);

    outline-offset: 2px;
}


/* =========================================================
 * DISABLED
 * ========================================================= */

.mg-item-actions form.mg-action-form button:disabled,
.mg-item-actions form.mg-action-form input[type="submit"]:disabled {

    opacity: .55;

    cursor: not-allowed;

    transform: none !important;
}


/* =========================================================
 * MOBILE
 * ========================================================= */



@media (max-width: 42rem) {

    .mg-item-actions {

        display: grid;

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        align-items: stretch;

        width: 100%;

        gap: .45rem;

        padding: .4rem;
    }

    .mg-item-actions form.mg-action-form {

        display: flex;

        width: 100%;
        min-width: 0;
    }

    .mg-item-actions form.mg-action-form button,
    .mg-item-actions form.mg-action-form input[type="submit"] {

        width: 100%;

        min-width: 0;

        min-height: 2.75rem;

        padding: .55rem .45rem !important;

        border-radius: 9px !important;

        font-size: .78rem;
    }

    .mg-item-actions form.mg-action-form button svg,
    .mg-item-actions form.mg-action-form button i {

        width: .95rem;
        height: .95rem;
    }
}


/* =========================================================
 * SMALL PHONES
 * ========================================================= */

@media (max-width: 32rem) {

    .mg-item-actions {

        gap: .4rem;

        padding: .35rem;
    }

    .mg-item-actions form.mg-action-form button,
    .mg-item-actions form.mg-action-form input[type="submit"] {

        min-height: 2.65rem;

        padding-inline: .3rem !important;

        font-size: .75rem;
    }
}


/* =========================================================
 * VERY SMALL PHONES
 * ========================================================= */

@media (max-width: 25rem) {

    .mg-item-actions {

        gap: .35rem;
    }

    .mg-item-actions form.mg-action-form button,
    .mg-item-actions form.mg-action-form input[type="submit"] {

        min-height: 2.6rem;

        padding-inline: .2rem !important;

        font-size: .72rem;
    }

    .mg-item-actions form.mg-action-form button svg,
    .mg-item-actions form.mg-action-form button i {

        width: .85rem;
        height: .85rem;
    }
}

/* =========================================================
 * DISABLED
 * ========================================================= */

.mg-item-actions form.mg-action-form button:disabled,
.mg-item-actions form.mg-action-form input[type="submit"]:disabled {
    opacity: .55;

    cursor: not-allowed;

    transform: none !important;
}


/* =========================================================
 * TABLET
 * ========================================================= */

@media (max-width: 58rem) {

    .mg-filters {
        grid-template-columns:
            minmax(0, 1fr)
            minmax(8.5rem, 10rem)
            minmax(8.5rem, 10rem);
    }

    .mg-search {
        grid-column: 1 / -1;
    }

    .mg-filters > .btn {
        width: 100%;
    }

    .mg-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .mg-item-bottom {
        grid-template-columns:
            minmax(0, 1fr)
            auto;
    }

    .mg-item-actions {
        max-width: 100%;
    }
}


/* =========================================================
 * MOBILE
 * ========================================================= */

@media (max-width: 42rem) {

    .mg-grid {
        grid-template-columns: 1fr !important;
        gap: .8rem;
    }

    .mg-hero {
        align-items: stretch;

        flex-direction: column;

        gap: 1rem;

        padding: 1.25rem;
    }

    .mg-hero-button {
        width: 100%;

        justify-content: center;
    }

    .mg-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: .8rem;
    }

    .mg-item-top {
        align-items: flex-start;

        gap: .6rem;

        margin-bottom: .65rem;
    }

    .mg-item-type {
        min-height: 1.95rem;

        padding: .38rem .6rem;

        font-size: .7rem;
    }

    .mg-item-title {
        margin-bottom: .85rem;
    }

    .mg-item-title h1 {
        font-size: clamp(1.4rem, 6vw, 1.9rem);

        line-height: 1.16;
    }

    .mg-item-image {
        border-radius: 10px;
    }

    .mg-item-image img {
        max-width: 100%;
        max-height: 70vh;
    }

    .mg-item-video {
        border-radius: 10px;
    }

    .mg-item-description {
        margin-top: .8rem;

        padding: .9rem;
    }

    .mg-item-bottom {
        display: flex;
        flex-direction: column;

        gap: .65rem;

        margin-top: .8rem;

        padding: .65rem;
    }

    .mg-item-stats {
        width: 100%;
    }

    .mg-item-actions {
        display: grid;

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        align-items: stretch;

        width: 100%;

        gap: .45rem;

        padding: .35rem;
    }

    .mg-item-actions form.mg-action-form {
        display: flex;

        width: 100%;
        min-width: 0;
    }

    .mg-item-actions form.mg-action-form button,
    .mg-item-actions form.mg-action-form input[type="submit"] {
        width: 100%;
        min-width: 0;
        min-height: 2.65rem;

        padding: .5rem .45rem !important;

        font-size: .78rem;
    }
}


/* =========================================================
 * SMALL TABLETS / LARGE PHONES
 * ========================================================= */

@media (max-width: 38rem) {

    .mg-filters {
        grid-template-columns: 1fr;
    }

    .mg-search,
    .mg-filters select,
    .mg-filters > .btn {
        grid-column: 1;
    }

    .mg-search input,
    .mg-filters select,
    .mg-filters > .btn {
        width: 100%;

        height: 2.7rem;
    }

    .mg-add-hero {
        align-items: flex-start;

        flex-direction: column;

        gap: .75rem;
    }

    .mg-add-hero .btn {
        width: 100%;

        justify-content: center;
    }

    .mg-add-card {
        padding: 1rem;
    }

    .mg-item-top {
        align-items: flex-start;

        flex-direction: row;

        flex-wrap: wrap;
    }

    .mg-item-type {
        flex: 0 0 auto;

        max-width: 100%;
    }

    .mg-item-stats {
        display: grid;

        grid-template-columns:
            repeat(3, minmax(0, 1fr));

        gap: .35rem;

        width: 100%;
    }

    .mg-item-stats > span {
        justify-content: center;

        min-width: 0;
        min-height: 2.35rem;

        padding: .3rem .35rem;

        font-size: .72rem;

        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mg-item-actions {
        width: 100%;
    }
}


/* =========================================================
 * PHONES
 * ========================================================= */

@media (max-width: 32rem) {

    .mg-grid {
        grid-template-columns: 1fr;

        gap: .8rem;
    }

    .mg-card-body {
        padding: .9rem;
    }

    .mg-card-category {
        margin-bottom: .4rem;

        padding: .2rem .5rem;

        font-size: .65rem;
        line-height: 1.25;
    }

    .mg-card h3 {
        font-size: 1rem;
        line-height: 1.3;
    }

    .mg-card-foot {
        gap: .75rem;
    }

    /* останалият ти CSS продължава */

    .mg-upload-box {
        padding: 1.5rem .7rem;
    }

    .mg-upload-title {
        font-size: 1rem;
    }

    .mg-upload-text {
        font-size: .82rem;
    }

    .mg-upload-button {
        width: 100%;

        justify-content: center;
    }

    .mg-form-actions {
        width: 100%;
    }

    .mg-form-actions .btn {
        width: 100%;

        justify-content: center;
    }

    .mg-item-title {
        margin-bottom: .75rem;
    }

    .mg-item-title h1 {
        font-size: clamp(1.35rem, 6.5vw, 1.75rem);

        line-height: 1.17;
    }

    .mg-item-description {
        padding: .85rem;
    }

    .mg-pagination {
        gap: .3rem;
    }

    .mg-pagination a {
        min-width: 2.2rem;
        min-height: 2.2rem;

        padding-inline: .5rem;
    }

    .mg-item-actions {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .mg-item-actions form.mg-action-form button,
    .mg-item-actions form.mg-action-form input[type="submit"] {
        min-width: 0;

        font-size: .76rem;

        padding-inline: .3rem !important;
    }

    .mg-item-actions form.mg-action-form button span,
    .mg-item-actions form.mg-action-form input[type="submit"] span {
        overflow: hidden;

        text-overflow: ellipsis;
    }
}


/* =========================================================
 * VERY SMALL PHONES
 * ========================================================= */

@media (max-width: 25rem) {

    .mg-hero,
    .mg-add-hero,
    .mg-add-card {
        border-radius: 10px;
    }

    .mg-hero,
    .mg-add-hero {
        padding: 1.1rem;
    }

    .mg-hero h1,
    .mg-add-hero h1 {
        font-size: 1.5rem;
    }

    .mg-hero p,
    .mg-add-hero p {
        font-size: .88rem;
    }

    .mg-media {
        aspect-ratio: 4 / 3;
    }

    .mg-item-top {
        gap: .5rem;

        margin-bottom: .55rem;
    }

    .mg-item-type {
        min-height: 1.85rem;

        padding: .35rem .55rem;

        font-size: .67rem;
    }

    .mg-item-title h1 {
        font-size: 1.3rem;

        line-height: 1.18;
    }

    .mg-item-stats {
        grid-template-columns: 1fr 1fr 1fr;

        gap: .3rem;
    }

    .mg-item-stats > span {
        justify-content: center;

        padding-inline: .25rem;

        font-size: .68rem;
    }

    .mg-item-actions {
        grid-template-columns:
            1fr 1fr;
    }

    .mg-item-actions form.mg-action-form {
        width: 100%;
    }

    .mg-item-actions form.mg-action-form button,
    .mg-item-actions form.mg-action-form input[type="submit"] {
        width: 100%;

        min-height: 2.65rem;

        padding-inline: .2rem !important;

        font-size: .72rem;
    }

    .mg-item-actions form.mg-action-form button svg,
    .mg-item-actions form.mg-action-form button i {
        width: .85rem;
        height: .85rem;
    }
}


/* =========================================================
 * EXTRA SMALL PHONES
 * ========================================================= */

@media (max-width: 21rem) {

    .mg-hero {
        padding: 1rem;
    }

    .mg-upload-button {
        width: 100%;
    }

    .mg-youtube-input-icon {
        flex-basis: 2.6rem;

        width: 2.6rem;
    }

    .mg-youtube-input input {
        font-size: .85rem;
    }

    .mg-item-title h1 {
        font-size: 1.22rem;
    }

    .mg-item-stats {
        grid-template-columns: 1fr;
    }

    .mg-item-stats > span {
        justify-content: flex-start;

        padding-inline: .55rem;

        font-size: .72rem;
    }

    .mg-item-actions {
        grid-template-columns:
            1fr 1fr;
    }

    .mg-item-actions form.mg-action-form button,
    .mg-item-actions form.mg-action-form input[type="submit"] {
        min-height: 2.55rem;

        font-size: .69rem;
    }

    .mg-item-actions form.mg-action-form button span,
    .mg-item-actions form.mg-action-form input[type="submit"] span {
        white-space: nowrap;
    }
}
/* =========================================================
 * MOBILE GALLERY — ONE CARD PER ROW
 * ========================================================= */

@media (max-width: 42rem) {

    .mg-grid {
        display: grid !important;

        grid-template-columns: minmax(0, 1fr) !important;

        width: 100% !important;

        gap: .8rem !important;
    }

    .mg-card {
        width: 100% !important;
        min-width: 0 !important;
    }
}

/* =========================================================
 * REDUCED MOTION
 * ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .mg-card,
    .mg-media img,
    .mg-play,
    .mg-item-actions form.mg-action-form button,
    .mg-item-actions form.mg-action-form input[type="submit"],
    .mg-upload-box,
    .mg-youtube-input {
        transition: none !important;
    }

    .mg-card:hover {
        transform: none;
    }

    .mg-card:hover .mg-media img {
        transform: none;
    }

    .mg-card:hover .mg-play {
        transform: translate(-50%, -50%);
    }
}
/* =========================================================
 * ITEM TITLE — CLEAN CENTERED VERSION
 * ========================================================= */

.mg-item-title {
    display: flex !important;

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

    width: 100% !important;

    margin: 0 0 1rem !important;

    text-align: center !important;
}

.mg-item-title h1 {
    display: block !important;

    width: auto;
    max-width: 100%;

    margin: 0 auto !important;

    padding: .55rem 1rem !important;

    border: 1px solid var(--line, var(--border)) !important;
    border-radius: 10px !important;

    background: var(--card-bg, var(--panel)) !important;

    color: inherit;

    font-size: clamp(1.4rem, 4vw, 2.1rem);
    font-weight: 750;

    line-height: 1.2;

    text-align: center !important;

    overflow-wrap: anywhere;

    box-sizing: border-box;
}


/* =========================================================
 * IMAGE — VISUAL SEPARATION FROM TITLE
 * ========================================================= */

.mg-item-image {
    margin-top: .25rem;

    border: 0;
    outline: 0;

    border-radius: 12px;

    overflow: hidden;

    background: var(--bg-soft, var(--panel));

    box-shadow: none;
}

.mg-item-image a,
.mg-item-image a:focus,
.mg-item-image a:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}


/* =========================================================
 * MOBILE
 * ========================================================= */

@media (max-width: 42rem) {

    .mg-item-title {
        margin-bottom: .8rem !important;
    }

    .mg-item-title h1 {
        padding: .5rem .75rem !important;

        font-size: clamp(1.3rem, 6vw, 1.8rem);
    }

    .mg-item-image {
        margin-top: .15rem;

        border-radius: 10px;
    }
}
/* =========================================================
 * ITEM TITLE + CATEGORY — VERTICAL
 * ========================================================= */

.mg-item-title {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: .45rem !important;

    width: 100% !important;
    margin: 0 0 1rem !important;

    text-align: center !important;
}

.mg-item-title .mg-card-category {
    margin: 0 !important;
    flex: 0 0 auto;
    text-align: center !important;
}

.mg-item-title h1 {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;

    margin: 0 !important;
    padding: .55rem 1rem !important;

    border: 1px solid var(--line, var(--border)) !important;
    border-radius: 10px !important;

    background: var(--card-bg, var(--panel)) !important;
    color: inherit;

    font-size: clamp(1.4rem, 4vw, 2.1rem);
    font-weight: 750;
    line-height: 1.2;

    text-align: center !important;
    overflow-wrap: anywhere;
    box-sizing: border-box;
}
/* =========================================================
 * MEDIA TYPE BADGE — ЕДНАКВА ВИСОЧИНА
 * ========================================================= */

.mg-item-media {
    display: flex !important;
    align-items: center !important;
    gap: .65rem !important;
}

.mg-item-media .mg-media-type,
.mg-item-media .mg-type-badge,
.mg-item-media .mg-card-category {
    position: static !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    transform: none !important;
    align-self: center !important;
}
/* =========================================================
 * ITEM TOP
 * Back to gallery + media type
 * ========================================================= */

.mg-item-top {
    display: flex;

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

    gap: .65rem;

    width: 100%;
    min-width: 0;

    margin-bottom: .75rem;

    flex-wrap: wrap;
}


/* =========================================================
 * BACK TO GALLERY
 * ========================================================= */

.mg-item-top .mg-item-back {
    display: inline-flex;

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

    flex: 0 0 auto;

    width: auto;
    max-width: 100%;

    min-width: 0;
    min-height: 2.45rem;
    height: 2.45rem;

    margin: 0;
    padding: .45rem .75rem;

    box-sizing: border-box;

    gap: .4rem;

    white-space: nowrap;

    overflow: hidden;
}


/* Icon */

.mg-item-top .mg-item-back svg,
.mg-item-top .mg-item-back i {
    flex: 0 0 auto;

    width: .85rem;
    height: .85rem;

    margin: 0;
}


/* Text */

.mg-item-top .mg-item-back span {
    display: inline-block;

    min-width: 0;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;
}


/* =========================================================
 * MEDIA TYPE
 * ========================================================= */

.mg-item-top .mg-item-type {
    display: inline-flex;

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

    flex: 0 0 auto;

    width: auto;
    max-width: 100%;

    min-width: 0;
    min-height: 2.45rem;
    height: 2.45rem;

    margin: 0;
    padding: .45rem .7rem;

    box-sizing: border-box;

    gap: .4rem;

    white-space: nowrap;

    overflow: hidden;
}

.mg-item-type-icon {
    display: inline-flex;

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

    flex: 0 0 auto;

    width: .85rem;
    height: .85rem;

    margin: 0;
}

.mg-item-type-icon svg,
.mg-item-type-icon i {
    width: .85rem;
    height: .85rem;

    margin: 0;
}

.mg-item-type-text {
    display: inline-flex;

    align-items: center;

    min-width: 0;
    height: 100%;

    line-height: 1;
}


/* =========================================================
 * MOBILE
 * ========================================================= */

@media (max-width: 42rem) {

    .mg-item-top {
        align-items: center;

        gap: .5rem;

        width: 100%;

        flex-wrap: nowrap;
    }

    .mg-item-top .mg-item-back {
        flex: 0 1 auto;

        width: auto;
        max-width: calc(100% - 5rem);

        height: 2.4rem;
        min-height: 2.4rem;

        padding: .4rem .65rem;
    }

    .mg-item-top .mg-item-type {
        flex: 0 0 auto;

        width: auto;

        height: 2.4rem;
        min-height: 2.4rem;

        padding: .4rem .65rem;
    }
}


/* =========================================================
 * SMALL PHONES
 * ========================================================= */

@media (max-width: 32rem) {

    .mg-item-top {
        gap: .4rem;
    }

    .mg-item-top .mg-item-back {
        max-width: calc(100% - 4.7rem);

        height: 2.35rem;
        min-height: 2.35rem;

        padding: .4rem .55rem;
    }

    .mg-item-top .mg-item-type {
        height: 2.35rem;
        min-height: 2.35rem;

        padding: .4rem .55rem;
    }

    .mg-item-type-icon,
    .mg-item-type-icon svg,
    .mg-item-type-icon i {
        width: .8rem;
        height: .8rem;
    }

    .mg-item-type-text {
        font-size: .72rem;
    }
}


/* =========================================================
 * VERY SMALL PHONES
 * ========================================================= */

@media (max-width: 25rem) {

    .mg-item-top {
        gap: .35rem;
    }

    .mg-item-top .mg-item-back {
        max-width: calc(100% - 4.5rem);

        height: 2.3rem;
        min-height: 2.3rem;

        padding: .35rem .5rem;
    }

    .mg-item-top .mg-item-type {
        height: 2.3rem;
        min-height: 2.3rem;

        padding: .35rem .5rem;
    }
}


/* =========================================================
 * EXTRA SMALL PHONES
 * ========================================================= */

@media (max-width: 21rem) {

    .mg-item-top {
        align-items: stretch;

        flex-wrap: wrap;

        gap: .4rem;
    }

    .mg-item-top .mg-item-back {
        flex: 1 1 auto;

        max-width: none;

        min-width: 0;
    }

    .mg-item-top .mg-item-type {
        flex: 0 0 auto;
    }
}


/* =========================================================
 * VERY SMALL PHONES
 * ========================================================= */

@media (max-width: 25rem) {

    .mg-item-top {
        gap: .4rem;
    }

    .mg-item-top .mg-item-back,
    .mg-item-top .mg-item-type {
        height: 2.3rem;
        min-height: 2.3rem;
    }

    .mg-item-top .mg-item-back {
        padding-left: .5rem;
        padding-right: .5rem;
    }

    .mg-item-top .mg-item-type {
        padding-left: .5rem;
        padding-right: .5rem;
    }
}
@media (max-width:600px) {

    .mg-item-stats .mg-stat-label {
        display: none;
    }

    .mg-author-card {
        gap:9px;

        margin:12px 0 16px;
        padding:8px 11px 8px 8px;
    }

    .mg-author-card-avatar {
        flex-basis:40px;
    }

    .mg-author-card-avatar img {
        width:40px;
        height:40px;
    }

    .mg-author-card-name {
        font-size:var(--font-size-xs);
    }

    .mg-author-card-role {
        font-size:11px;
    }

    .mg-author-card-date {
        font-size:11px;
    }
}


@media (max-width:380px) {

    .mg-author-card {
        gap:8px;

        padding:7px 9px 7px 7px;
    }

    .mg-author-card-avatar {
        flex-basis:36px;
    }

    .mg-author-card-avatar img {
        width:36px;
        height:36px;
    }
}
@media (max-width:600px) {

    .mg-card-author {
        gap:7px;

        margin-top:9px;
        padding:6px 8px 6px 6px;
    }

    .mg-card-author-avatar {
        flex-basis:30px;
    }

    .mg-card-author-avatar img {
        width:30px;
        height:30px;
    }

    .mg-card-author-name {
        font-size:11px;
    }

    .mg-card-author-role {
        font-size:10px;
    }

    .mg-card-author-date {
        font-size:10px;
    }
}


@media (max-width:380px) {

    .mg-card-author {
        gap:6px;

        padding:5px 7px 5px 5px;
    }

    .mg-card-author-avatar {
        flex-basis:28px;
    }

    .mg-card-author-avatar img {
        width:28px;
        height:28px;
    }
}

.mg-item-page,
.mg-item-content,
.mg-item-comments,
.mg-comments,
.mg-comment-form {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* =========================================================
 * ITEM ACTIONS — FULL ROW BELOW STATS
 * ========================================================= */

.mg-item-actions {
    grid-column: 1 / -1 !important;

    display: flex !important;

    flex-direction: row !important;
    flex-wrap: wrap !important;

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

    gap: .55rem !important;

    width: 100% !important;
    max-width: 100% !important;

    margin: 0 !important;
    padding: .4rem !important;

    box-sizing: border-box;
}
/* =========================================================
 * MEDIA CARD FOOT — STATISTICS BLOCK
 * ========================================================= */

.mg-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: .5rem;

    width: 100%;
    min-width: 0;

    margin-top: .7rem;
    padding: .55rem .65rem;

    box-sizing: border-box;

    border: 1px solid var(--line, var(--border));
    border-radius: var(--radius, 12px);

    background: var(--card-bg, var(--panel));

    box-shadow:
        0 .12rem .4rem rgba(0, 0, 0, .025);
}


/* =========================================================
 * INDIVIDUAL STAT
 * ========================================================= */

.mg-card-foot > span {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 1 1 0;

    gap: .35rem;

    min-width: 0;

    padding: .4rem .5rem;

    border-radius: 8px;

    color: var(--muted, #777);

    font-size: .75rem;
    font-weight: 650;
    line-height: 1.2;

    text-align: center;
    white-space: nowrap;

    box-sizing: border-box;
}


/* =========================================================
 * ICON
 * ========================================================= */

.mg-card-foot > span > svg,
.mg-card-foot > span > i {
    width: 1rem;
    height: 1rem;

    flex: 0 0 auto;

    opacity: .8;
}


/* =========================================================
 * NUMBER
 * ========================================================= */

.mg-card-foot > span > span {
    display: inline-flex;
    align-items: center;

    min-width: 0;
}


/* =========================================================
 * HOVER
 * ========================================================= */

.mg-card-foot > span:hover {
    color: var(--text, inherit);

    background: var(--bg-soft, var(--panel));
}


/* =========================================================
 * MOBILE
 * ========================================================= */

@media (max-width: 42rem) {

    .mg-card-foot {
        gap: .3rem;

        margin-top: .55rem;
        padding: .45rem .5rem;

        border-radius: 10px;
    }

    .mg-card-foot > span {
        gap: .25rem;

        padding: .35rem .3rem;

        font-size: .72rem;
    }

    .mg-card-foot > span > svg,
    .mg-card-foot > span > i {
        width: .9rem;
        height: .9rem;
    }

}

/* =========================================================
 * COMPLETE MEDIA CARD
 * ========================================================= */

.mg-card-container {
    display: flex;
    flex-direction: column;

    width: 100%;
    min-width: 0;

    padding: .75rem;

    box-sizing: border-box;

    border: 1px solid var(--line, var(--border));
    border-radius: var(--radius, 12px);

    background: var(--card-bg, var(--panel));

    box-shadow:
        0 .12rem .4rem rgba(0, 0, 0, .025);

    overflow: hidden;
}


/* =========================================================
 * ITEM DESCRIPTION
 * ========================================================= */

.mg-item-description {
    display: block;

    width: 100%;
    min-width: 0;

    margin-top: 1rem;
    padding: 1rem 1.1rem;

    box-sizing: border-box;

    border: 1px solid var(--line, var(--border));
    border-radius: var(--radius, 12px);

    background: var(--card-bg, var(--panel));

    box-shadow:
        0 .12rem .4rem rgba(0, 0, 0, .025);

    white-space: pre-wrap;

    overflow-wrap: anywhere;
    word-break: break-word;
}


/* =========================================================
 * DESCRIPTION LABEL
 * ========================================================= */

.mg-item-description-label {
    margin: 0 0 .45rem;

    color: var(--brand);

    font-size: .7rem;
    font-weight: 800;

    letter-spacing: .05em;
    line-height: 1.3;

    text-transform: uppercase;
}


/* =========================================================
 * DESCRIPTION TEXT
 * ========================================================= */

.mg-item-description > div:not(.mg-item-description-label) {
    color: var(--text, inherit);

    font-size: .8rem;
    font-weight: 500;

    line-height: 1.55;

    overflow-wrap: anywhere;
    word-break: break-word;
}


/* =========================================================
 * MOBILE
 * ========================================================= */

@media (max-width: 42rem) {

    .mg-item-description {
        margin-top: .7rem;
        padding: .75rem .8rem;

        border-radius: var(--radius, 12px);
    }

    .mg-item-description-label {
        margin-bottom: .4rem;

        font-size: .68rem;
    }

    .mg-item-description > div:not(.mg-item-description-label) {
        font-size: .75rem;
        line-height: 1.5;
    }

}

.mg-card-body h3 {
    width: 100%;
    min-width: 0;

    margin: .2rem 0 0;

    color: var(--text, inherit);

    font-size: 1.05rem;
    font-weight: 800;

    line-height: 1.35;
    letter-spacing: -.01em;

    overflow-wrap: anywhere;
    word-break: break-word;
}

.mg-card-body h3 a {
    display: block;

    color: inherit;

    text-decoration: none;
}

.mg-card-body h3 a:hover {
    color: var(--brand);
}
/* =========================================================
 * ITEM BOTTOM — SINGLE COLUMN
 * ========================================================= */

.mg-item-bottom {
    display: flex !important;

    flex-direction: column !important;

    align-items: stretch !important;

    gap: .75rem;

    width: 100%;
    min-width: 0;

    margin-top: 1rem;
    padding: .75rem;

    box-sizing: border-box;

    border: 1px solid var(--line, var(--border));
    border-radius: var(--radius, 12px);

    background: var(--card-bg, var(--panel));
}


/* =========================================================
 * ITEM STATS — FULL WIDTH
 * ========================================================= */

.mg-item-stats {
    width: 100% !important;
    max-width: 100% !important;

    min-width: 0;

    box-sizing: border-box;

    grid-column: auto !important;

    margin-top: 8px;

    justify-content: center;
}


/* =========================================================
 * ITEM ACTIONS — FULL WIDTH
 * ========================================================= */

.mg-item-actions {
    width: 100% !important;
    max-width: 100% !important;

    min-width: 0;

    box-sizing: border-box;

    margin: 0 !important;

    grid-column: auto !important;
}


/* =========================================================
 * COMMENTS — FULL WIDTH
 * ========================================================= */

.mg-item-comments,
.mg-comments,
.mg-comment-form {
    width: 100% !important;
    max-width: 100% !important;

    min-width: 0 !important;

    box-sizing: border-box;

    grid-column: auto !important;
}

/* =========================================================
 * MEDIA GALLERY — ADMIN THUMBNAILS
 * ========================================================= */

.mg-admin-media {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 260px;
}

.mg-admin-thumb {
    display: block;
    width: 90px;
    height: 60px;
    flex: 0 0 90px;
    overflow: hidden;
    border-radius: 8px;
    text-decoration: none;
}

.mg-admin-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mg-admin-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #f1f1f1;
    font-size: 22px;
}

.mg-admin-media-info {
    min-width: 0;
}

.mg-admin-media-info b {
    display: inline-block;
    max-width: 100%;
}

.mg-admin-media-info b a {
    text-decoration: none;
}

.mg-admin-media-info small {
    white-space: nowrap;
}

@media (max-width: 800px) {

    .mg-admin-media {
        min-width: 200px;
    }

    .mg-admin-thumb {
        width: 70px;
        height: 48px;
        flex-basis: 70px;
    }

}
.mg-card {
    position: relative;
}


/* media_gallery_profile */

/* =========================================================
 * MEDIA GALLERY PROFILE
 * ========================================================= */

.page-media-gallery-profile .mg-profile-page {
    width: 100%;
    box-sizing: border-box;
}


/* =========================================================
 * HEADER
 * ========================================================= */

.page-media-gallery-profile .mg-profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
    padding: 18px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-sizing: border-box;
}


.page-media-gallery-profile .mg-profile-header-title {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}


.page-media-gallery-profile .mg-profile-header-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #f3f4f6;
    font-size: 21px;
}


.page-media-gallery-profile .mg-profile-header h2 {
    margin: 0;
    font-size: 21px;
    line-height: 1.25;
    color: #222;
}


.page-media-gallery-profile .mg-profile-header-subtitle {
    margin-top: 4px;
    color: #777;
    font-size: 13px;
    line-height: 1.4;
}


/* =========================================================
 * SWITCH BUTTONS
 * ========================================================= */

.page-media-gallery-profile .mg-profile-switch {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}


.page-media-gallery-profile .mg-profile-switch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid #ddd;
    border-radius: 9px;
    background: #fff;
    color: #444;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    box-sizing: border-box;
    transition:
        background .15s ease,
        border-color .15s ease,
        color .15s ease;
}


.page-media-gallery-profile .mg-profile-switch-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
    text-decoration: none;
}


.page-media-gallery-profile .mg-profile-switch-btn.is-active {
    background: #007BFF;
    border-color: #007BFF;
    color: #fff;
}


.page-media-gallery-profile .mg-profile-switch-btn span {
    opacity: .75;
    font-weight: 700;
}


.page-media-gallery-profile .mg-profile-switch-btn.is-active span {
    opacity: 1;
}


/* =========================================================
 * PROFILE GRID
 *
 * Uses the same card system as the main Media Gallery.
 * ========================================================= */

.page-media-gallery-profile .mg-profile-grid {
    width: 100%;
}


/*
 * If the main Gallery CSS already defines .mg-grid,
 * its grid layout is used directly.
 *
 * This fallback only makes sure the Profile grid still
 * behaves correctly if the main grid CSS is not scoped
 * globally.
 */

.page-media-gallery-profile .mg-profile-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 16px;
}


/* =========================================================
 * MAIN GALLERY CARD COMPATIBILITY
 *
 * These rules use the SAME class names as the main Gallery.
 * They do not recreate the old Profile card design.
 * ========================================================= */

.page-media-gallery-profile .mg-card-wrap,
.page-media-gallery-profile .mg-card-container {
    min-width: 0;
}


/*
 * Author section.
 *
 * Same class names and visual proportions as the main Gallery.
 */

.page-media-gallery-profile .mg-card-author {
    display: flex;
    align-items: center;
    min-width: 0;
}


.page-media-gallery-profile .mg-card-author-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    overflow: hidden;
    border-radius: 50%;
}


.page-media-gallery-profile .mg-card-author-avatar img {
    display: block;
    width: 34px;
    height: 34px;
    object-fit: cover;
}


.page-media-gallery-profile .mg-card-author-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}


.page-media-gallery-profile .mg-card-author-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.page-media-gallery-profile .mg-card-author-role {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.page-media-gallery-profile .mg-card-author-date {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* =========================================================
 * EMPTY STATE
 * ========================================================= */

.page-media-gallery-profile .mg-profile-empty {
    padding: 50px 22px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    text-align: center;
    box-sizing: border-box;
}


.page-media-gallery-profile .mg-profile-empty-icon {
    font-size: 38px;
    line-height: 1;
    margin-bottom: 14px;
}


.page-media-gallery-profile .mg-profile-empty-title {
    color: #222;
    font-size: 17px;
    font-weight: 700;
}


.page-media-gallery-profile .mg-profile-empty-text {
    max-width: 520px;
    margin: 8px auto 18px;
    color: #777;
    font-size: 13px;
    line-height: 1.5;
}


.page-media-gallery-profile .mg-profile-gallery-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 15px;
    border-radius: 8px;
    background: #007BFF;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}


.page-media-gallery-profile .mg-profile-gallery-btn:hover {
    background: #0069d9;
    color: #fff;
    text-decoration: none;
}


/* =========================================================
 * PAGINATION
 * ========================================================= */

.page-media-gallery-profile .mg-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 20px;
}


.page-media-gallery-profile .mg-pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.35rem;
    min-height: 2.35rem;
    padding: 0 .65rem;
    border: 1px solid #ddd;
    border-radius: 7px;
    background: #fff;
    color: #555;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    box-sizing: border-box;
    transition:
        background .15s ease,
        border-color .15s ease,
        color .15s ease;
}


.page-media-gallery-profile .mg-pagination a:hover {
    background: #f5f5f5;
    border-color: #ccc;
    text-decoration: none;
}


.page-media-gallery-profile .mg-pagination a.is-active {
    background: #007BFF;
    border-color: #007BFF;
    color: #fff;
}


/* =========================================================
 * RESPONSIVE
 * ========================================================= */

@media (max-width: 1100px) {

    .page-media-gallery-profile .mg-profile-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

}


@media (max-width: 800px) {

    .page-media-gallery-profile .mg-profile-header {
        align-items: flex-start;
        flex-direction: column;
    }


    .page-media-gallery-profile .mg-profile-switch {
        width: 100%;
    }


    .page-media-gallery-profile .mg-profile-switch-btn {
        flex: 1 1 0;
    }


    .page-media-gallery-profile .mg-profile-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

}


@media (max-width: 480px) {

    .page-media-gallery-profile .mg-profile-header {
        padding: 14px;
        margin-bottom: 15px;
        border-radius: 11px;
    }


    .page-media-gallery-profile .mg-profile-header h2 {
        font-size: 18px;
    }


    .page-media-gallery-profile .mg-profile-header-subtitle {
        font-size: 12px;
    }


    .page-media-gallery-profile .mg-profile-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
        gap: 9px;
    }


    /*
     * Do NOT shrink the author to the old
     * mg-profile-card-author design.
     *
     * Main Gallery uses 34px avatar.
     */
    .page-media-gallery-profile .mg-card-author-avatar {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
    }


    .page-media-gallery-profile .mg-card-author-avatar img {
        width: 34px;
        height: 34px;
    }


    .page-media-gallery-profile .mg-profile-empty {
        padding: 38px 15px;
    }


    .page-media-gallery-profile .mg-pagination {
        gap: 4px;
        margin-top: 16px;
    }


    .page-media-gallery-profile .mg-pagination a {
        min-width: 2.15rem;
        min-height: 2.15rem;
        padding: 0 .5rem;
        font-size: 12px;
    }

}


/* messages */
.page-messages .layout-main{max-width:100%}.chat{display:grid;grid-template-columns:300px 1fr;height:calc(100vh - 140px);min-height:420px;border:1px solid var(--line);border-radius:var(--radius);background:var(--panel);overflow:hidden}.chat-list{border-right:1px solid var(--line);overflow-y:auto}.chat-list-head{padding:12px 16px;border-bottom:1px solid var(--line)}.chat-list-head h3{margin:0}.chat-item{display:flex;gap:10px;padding:10px 14px;border-bottom:1px solid var(--line);color:inherit;text-decoration:none}.chat-item:hover,.chat-item.active{background:var(--panel-2)}.chat-item-main{flex:1;min-width:0}.chat-item-top{display:flex;justify-content:space-between;gap:8px}.chat-item-top time{color:var(--text-muted);font-size:var(--font-size-xs);white-space:nowrap}.chat-item-last{color:var(--text-muted);font-size:var(--font-size-sm);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-item.unread .chat-item-last{color:var(--text);font-weight:600}.chat-item.unread b::after{content:"";display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--brand);margin-left:6px;vertical-align:middle}.chat-pane{display:flex;flex-direction:column;min-width:0;min-height:0}.chat-head{display:flex;align-items:center;gap:10px;padding:10px 14px;border-bottom:1px solid var(--line)}.chat-head-tools{margin-left:auto;display:flex;gap:6px}.chat-back{display:none;color:inherit}.chat-who{display:flex;flex-direction:column;min-width:0;line-height:1.25}.chat-who small{color:var(--text-muted);font-size:var(--font-size-xs)}.chat-more{text-align:center;color:var(--text-muted);font-size:var(--font-size-xs);padding:4px 0}.chat-log{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:14px;display:flex;flex-direction:column;gap:4px}.chat-day{text-align:center;margin:10px 0 4px;color:var(--text-muted);font-size:var(--font-size-xs)}.chat-msg{display:flex;align-items:center;gap:4px}.chat-msg.me{justify-content:flex-end}.bubble{max-width:75%;padding:8px 12px;border-radius:18px;background:var(--panel-2);line-height:1.4}.chat-msg.me .bubble{background:var(--brand);color:#fff}.chat-msg.me .bubble a{color:#fff;text-decoration:underline}.bubble .post-content{display:inline}.bubble .post-content p{display:inline;margin:0}.bubble .post-content p+p::before{content:"\A";white-space:pre}.chat-meta{display:inline-flex;align-items:center;gap:4px;margin-left:8px;vertical-align:bottom;font-size:10px;opacity:.75;white-space:nowrap}.chat-edited{font-style:italic}.chat-tick{display:inline-flex;line-height:0}.chat-tick svg{width:16px;height:11px}.chat-tick .chat-tick-2{display:none}.chat-tick.is-read .chat-tick-2{display:inline}.chat-msg.me .chat-meta:has(.is-read){opacity:1}.chat-item-last .chat-tick{margin-right:3px;vertical-align:-1px;color:var(--text-muted)}.chat-item-last .chat-tick.is-read{color:var(--brand)}.chat-tools{display:none;gap:2px}.chat-msg.me:hover .chat-tools,.chat-msg.show-tools .chat-tools,.chat-tools:focus-within{display:inline-flex}.chat-tool{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--text-muted);cursor:pointer}.chat-tool:hover{background:var(--panel-2);color:var(--text)}.chat-tool svg{width:15px;height:15px}.chat-recalled{justify-content:center}.chat-note{padding:2px 10px;border-radius:999px;background:var(--panel-2);color:var(--text-muted);font-size:var(--font-size-xs)}.chat-editing{display:flex;align-items:center;gap:8px;padding:6px 14px;border-top:1px solid var(--line);background:var(--panel-2);color:var(--text-muted);font-size:var(--font-size-sm)}.chat-editing svg{width:15px;height:15px}.chat-editing span{flex:1}.chat-editing[hidden]{display:none}.chat-editing+.chat-input{border-top:0}.chat-input{display:flex;gap:8px;padding:10px 14px;border-top:1px solid var(--line);align-items:flex-end}.chat-input textarea{flex:1;resize:none;min-height:38px;max-height:140px}.chat-empty{padding:40px 20px;text-align:center}.chat-none .chat-empty{margin:auto}@media (max-width:760px){.chat{grid-template-columns:1fr;height:auto;min-height:0}.chat:not(.chat-open) .chat-list{overflow:visible;border-right:0}.chat-open .chat-list{display:none}.chat:not(.chat-open) .chat-pane{display:none}.chat-open{position:fixed;left:0;right:0;top:0;z-index:85;height:100vh;height:100dvh;height:var(--chat-vh,100dvh);border:0;border-radius:0}body.page-messages-chat{overflow:hidden}.chat-open .chat-head{padding:8px 10px}.chat-open .chat-head .btn{padding-inline:8px}.chat-open .chat-log{padding:10px}.chat-open .chat-input{padding:8px 10px calc(8px + env(safe-area-inset-bottom))}.chat-open .chat-input textarea{font-size:16px}.chat-back{display:inline-flex;padding:4px}.bubble{max-width:88%}.chat-msg.me:hover .chat-tools{display:none}.chat-msg.show-tools .chat-tools{display:inline-flex}}

/* nsfw */
.nsfw-badge{display:inline-block;margin-inline-start:4px;padding:0 6px;border-radius:4px;background:#e0245e;color:#fff;font-size:10px;font-weight:700;letter-spacing:.3px;line-height:1.7;vertical-align:middle}.topic-title .nsfw-badge{font-size:12px;line-height:1.8;padding:0 8px}

/* pages */
.pages-page h1{margin-bottom:4px}.pages-page .post-content{margin-top:16px}.pages-page .post-content h2{margin-top:26px}.pages-page .post-content h3{margin-top:18px}

/* poll */
.poll-box{border:1px solid var(--line);border-radius:var(--radius);background:var(--panel-2);padding:14px;margin:14px 0}.poll-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:10px}.poll-head b{font-size:var(--font-size-md)}.poll-head svg{width:16px;height:16px;color:var(--brand)}.poll-tag{font-size:var(--font-size-xs);color:var(--text-muted);border:1px solid var(--line);border-radius:999px;padding:1px 8px}.poll-tag.poll-over{color:var(--text);border-color:var(--text-muted)}.poll-list{list-style:none;margin:0;padding:0}.poll-row{position:relative;display:flex;align-items:center;gap:10px;padding:8px 10px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--panel);overflow:hidden}.poll-row+.poll-row{margin-top:6px}.poll-fill{position:absolute;inset-inline-start:0;top:0;bottom:0;background:var(--brand);opacity:.14}.poll-pick{position:relative;display:flex;align-items:center;gap:8px;flex:1;cursor:pointer;margin:0}.poll-pick input{margin:0}.poll-label{position:relative;flex:1;display:flex;align-items:center;gap:6px}.poll-label.poll-mine{font-weight:600}.poll-label svg{width:14px;height:14px;color:var(--success)}.poll-num{position:relative;color:var(--text-muted);font-size:var(--font-size-sm);font-variant-numeric:tabular-nums;white-space:nowrap}.poll-voters{position:relative;display:flex;align-items:center;gap:2px}.poll-voters img{width:20px;height:20px;border-radius:50%;border:1px solid var(--panel)}.poll-more{color:var(--text-muted);font-size:var(--font-size-xs);margin-inline-start:2px}.poll-actions{margin-top:10px;display:flex;align-items:center;gap:10px;flex-wrap:wrap}.poll-foot{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:10px;color:var(--text-muted);font-size:var(--font-size-xs)}.poll-links{display:flex;gap:12px;margin-inline-start:auto;flex-wrap:wrap}.poll-links form{display:inline}.poll-links .danger{color:var(--danger,#d64545)}.poll-chip{display:inline-flex;align-items:center;gap:3px;margin-inline-start:6px;font-size:var(--font-size-xs);color:var(--brand);vertical-align:middle}.poll-chip svg{width:12px;height:12px}.poll-chip-over{color:var(--text-muted)}.poll-composer{border:1px solid var(--line);border-radius:var(--radius-sm);padding:10px 12px;margin-bottom:12px;background:var(--panel-2)}.poll-composer summary{cursor:pointer;display:flex;align-items:center;gap:6px;font-weight:600}.poll-composer summary svg{width:15px;height:15px;color:var(--brand)}.poll-composer[open] summary{margin-bottom:10px}.poll-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:0 14px}.poll-locked{border:1px solid var(--line);border-radius:var(--radius-sm);padding:10px 12px;background:var(--panel-2)}

/* profileplus */
/* ------------------------------------------------------------------
 * Profile Plus — modern centered profile header
 * Everything is scoped under .profileplus-* and uses the core theme
 * variables, so light/dark and custom brand colours all follow the site.
 * Direction-neutral (margin-inline / inset-inline) for RTL language packs.
 * ------------------------------------------------------------------ */

/* the region the core wraps around our header */
.region-user-profile-after { margin-bottom: 0; }

.profileplus-head {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
  text-align: center;
}
.profileplus-head .profileplus-cover { order: 1; }
.profileplus-head .profileplus-actions { order: 4; }
.profileplus-head .profileplus-main { order: 2; }
.profileplus-head .profileplus-stats { order: 3; }

/* --- cover ------------------------------------------------------- */

.profileplus-cover {
  height: 88px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  position: relative;
  flex: none;
}
/* the thin brand accent line along the bottom edge */
.profileplus-cover::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--brand) 55%, transparent) 50%, transparent);
}
.profileplus-cover-soft {
  background: linear-gradient(180deg, var(--brand-soft), color-mix(in srgb, var(--panel) 88%, var(--brand-soft)) 55%, var(--panel));
}

/* --- action buttons ---------------------------------------------- */

.profileplus-actions {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  z-index: 2;
}

/* --- avatar ------------------------------------------------------- */

.profileplus-avatar {
  margin-top: calc(var(--profileplus-size, 112px) / -2);
  position: relative;
  z-index: 1;
}
.profileplus-avatar .avatar {
  border: 4px solid var(--panel);
  box-shadow: var(--shadow);
}
/* only image avatars get the panel backing (a letter avatar keeps its gradient) */
.profileplus-avatar img.avatar { background: var(--panel); }
/* the stock green dot is hidden here: online is shown with a brand-coloured ripple */
.profileplus-avatar .online-dot { display: none; }
/* while online the avatar ring itself takes the brand colour (follows the site brand setting) */
.profileplus-avatar .avatar-online .avatar { border-color: var(--brand); }
/* a wave-like circle that expands from the avatar edge and fades, in the brand colour */
.profileplus-avatar .avatar-online::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--brand);
  opacity: 0;
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .profileplus-avatar .avatar-online::before { animation: profileplus-ripple 2.4s ease-out infinite; }
}
@keyframes profileplus-ripple {
  0%   { transform: scale(1);    opacity: .7; }
  70%  { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(1.25); opacity: 0; }
}

/* --- live online pill --------------------------------------------- */

.profileplus-online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 3px 11px;
  border-radius: var(--radius-pill);
  background: var(--success-soft);
  color: var(--success);
  font-size: var(--font-size-xs);
  font-weight: 600;
}
.profileplus-online i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  flex: none;
}
@media (prefers-reduced-motion: no-preference) {
  .profileplus-online i { animation: profileplus-pulse 2.2s ease-out infinite; }
}
@keyframes profileplus-pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 45%, transparent); }
  70%  { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* --- name, share button, flags ------------------------------------ */

.profileplus-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 20px 2px;
  font-size: var(--font-size-2xl);
}
.profileplus-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text-muted);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.profileplus-share .icon { width: 14px; height: 14px; }
.profileplus-share:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }

/* --- bio ----------------------------------------------------------- */

.profileplus-bio {
  max-width: 60ch;
  margin: 6px auto 0;
  color: var(--text-muted);
}

/* --- social + website icon chips ----------------------------------- */

.profileplus-links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-inline: 16px;
}
.profileplus-btn {
  --profileplus-c: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text-muted);
  text-decoration: none;
  transition: color .16s, border-color .16s, background .16s, transform .16s;
}
.profileplus-btn .icon { width: 18px; height: 18px; flex: none; }
.profileplus-btn:hover,
.profileplus-btn:focus-visible {
  color: var(--profileplus-c);
  border-color: color-mix(in srgb, var(--profileplus-c) 42%, transparent);
  background: color-mix(in srgb, var(--profileplus-c) 10%, var(--panel-2));
  transform: translateY(-2px);
}
/* brand colours, as custom properties (dark mode uses lighter marks) */
.profileplus-telegram  { --profileplus-c: #229ed9; }
.profileplus-instagram { --profileplus-c: #d62976; }
.profileplus-x         { --profileplus-c: #0f1419; }
.profileplus-github    { --profileplus-c: #24292f; }
[data-theme="dark"] .profileplus-x,
[data-theme="dark"] .profileplus-github { --profileplus-c: #e7e9ea; }
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] .profileplus-x,
  [data-theme="auto"] .profileplus-github { --profileplus-c: #e7e9ea; }
}
/* the website chip is a wider pill with the domain */
.profileplus-btn.profileplus-site {
  width: auto;
  max-width: 250px;
  padding-inline: 12px;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
  color: var(--text);
}
.profileplus-btn.profileplus-site span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- meta line ------------------------------------------------------ */

.profileplus-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 12px;
  padding-inline: 16px;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}
.profileplus-meta span,
.profileplus-meta .slot { display: inline-flex; align-items: center; gap: 4px; }
.profileplus-meta .icon { width: 14px; height: 14px; color: var(--text-subtle); }
.profileplus-meta a { color: var(--text-muted); }

/* --- statistics cards ------------------------------------------------ */

.profileplus-stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding: 16px 20px 18px;
  border-top: 1px solid var(--line-soft);
}
.profileplus-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 96px;
  padding: 10px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--text);
  text-decoration: none;
  transition: border-color .16s, color .16s, transform .16s;
}
.profileplus-stat b { font-size: var(--font-size-xl); line-height: 1.25; }
.profileplus-stat span { color: var(--text-muted); font-size: var(--font-size-xs); margin-top: 2px; }
.profileplus-stat small { color: var(--text-subtle); font-size: var(--font-size-xs); }
.profileplus-stat:hover { border-color: color-mix(in srgb, var(--brand) 55%, transparent); }

/* --- entrance animation (skipped when the visitor prefers stillness) - */

@media (prefers-reduced-motion: no-preference) {
  .profileplus-main  { animation: profileplus-rise .4s ease-out both; }
  .profileplus-stats { animation: profileplus-rise .4s .09s ease-out both; }
}
@keyframes profileplus-rise {
  from { opacity: 0; transform: translateY(10px); }
}

/* --- settings form group (Settings → Profile) ----------------------- */

.profileplus-form {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.profileplus-form-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-size-md);
  font-weight: 600;
}
.profileplus-form-head .icon { color: var(--brand); width: 16px; height: 16px; }
.profileplus-form-hint { color: var(--text-muted); font-size: var(--font-size-sm); margin: 4px 0 10px; }

/* --- narrow screens --------------------------------------------------- */

@media (max-width: 640px) {
  .profileplus-cover { height: 64px; }
  .profileplus-actions {
    position: static;
    justify-content: center;
    margin: 12px 12px 0;
    padding-bottom: 2px;
  }
  .profileplus-avatar { margin-top: -42px; }
  .profileplus-avatar .avatar { width: 84px; height: 84px; }
  .profileplus-avatar .avatar-letter { font-size: 37px; }
  .profileplus-name { margin-top: 8px; font-size: var(--font-size-xl); }
  .profileplus-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 12px 14px 14px; }
  .profileplus-stat { min-width: 0; padding: 8px 12px; }
  .profileplus-btn.profileplus-site { max-width: 200px; }
}


/* qa */
.qa-c-brand,.slot:has(.qa-c-brand)+.post{--qa-c1:var(--brand);--qa-c2:var(--brand-hover);--qa-ink:var(--brand)}.qa-c-green,.slot:has(.qa-c-green)+.post{--qa-c1:#18a050;--qa-c2:#14b8a6;--qa-ink:#188038}.qa-c-orange,.slot:has(.qa-c-orange)+.post{--qa-c1:#eb8214;--qa-c2:#fac828;--qa-ink:#b8600a}[data-theme="dark"] .qa-c-green,[data-theme="dark"] .slot:has(.qa-c-green)+.post{--qa-ink:#5dd39e}.qa-c-orange,[data-theme="dark"] .slot:has(.qa-c-orange)+.post{--qa-ink:#f5b04c}@media(prefers-color-scheme:dark){[data-theme="auto"] .qa-c-green,[data-theme="auto"] .slot:has(.qa-c-green)+.post{--qa-ink:#5dd39e}.qa-c-orange,[data-theme="auto"] .slot:has(.qa-c-orange)+.post{--qa-ink:#f5b04c}}.qa-tag{display:inline-block;margin-inline-end:6px;padding:0 6px;border-radius:4px;font-size:.6em;font-weight:700;line-height:1.7;vertical-align:middle;letter-spacing:.02em}.row-title .qa-tag{font-size:var(--font-size-xs);vertical-align:1px}.qa-tag-open{background:var(--brand-soft);color:var(--brand)}.qa-tag-solved{background:color-mix(in srgb,var(--qa-c1) 14%,transparent);color:var(--qa-ink)}.qa-medal{width:22px;height:22px;color:#e0a100;flex:none}.qa-seek{display:flex;align-items:center;flex-wrap:wrap;gap:10px 16px;margin:16px 0 4px;padding:12px 16px;border:1px solid var(--line);border-radius:var(--radius);background:var(--panel-2)}.qa-seek b{font-size:var(--font-size-md)}.qa-seek-item{color:var(--text-muted);font-size:var(--font-size-sm)}.qa-answer-btn{margin-inline-start:auto}.qa-best{margin:16px 0 4px;border:1px solid color-mix(in srgb,var(--qa-c1) 35%,var(--line));border-radius:var(--radius);background:linear-gradient(180deg,color-mix(in srgb,var(--qa-c1) 10%,transparent),color-mix(in srgb,var(--qa-c2) 3%,transparent) 70%,transparent),var(--panel)}.qa-best header{display:flex;align-items:center;gap:8px;padding:12px 16px 10px;border-bottom:1px solid color-mix(in srgb,var(--qa-c1) 22%,transparent);color:var(--qa-ink)}.qa-best header b{font-size:var(--font-size-md)}.qa-reward{margin-inline-start:auto;display:inline-flex;align-items:center;gap:4px;color:#e0a100;font-size:var(--font-size-sm);font-weight:600}.qa-reward .icon{width:14px;height:14px}.qa-best-who{display:flex;align-items:center;gap:8px;padding:10px 16px 0}.qa-best .post-content{padding:8px 16px 12px}.qa-best footer{padding:0 16px 12px;text-align:end;font-size:var(--font-size-sm)}.slot:has(.qa-accepted-anchor)+.post{border-color:color-mix(in srgb,var(--qa-c1) 35%,var(--line));background:linear-gradient(180deg,color-mix(in srgb,var(--qa-c1) 10%,transparent),color-mix(in srgb,var(--qa-c2) 3%,transparent) 70%,transparent),var(--panel)}.qa-best-mark{display:inline-flex;align-items:center;gap:3px;color:var(--qa-ink);font-weight:600}.qa-best-mark .icon{width:14px;height:14px}.qa-act.active .icon,.qa-best-mark .icon{fill:none;stroke:var(--qa-ink)}.qa-act.active{color:var(--qa-ink)}.qa-ask .form-help{margin-top:4px}@media(max-width:640px){.qa-seek{padding:10px 12px}.qa-answer-btn{margin-inline-start:0;width:100%;justify-content:center}}

/* report */
.report-act.report-flagged{color:var(--danger)}.report-quote{border-inline-start:3px solid var(--line);padding:8px 12px;margin:0 0 16px;color:var(--text-muted);background:var(--panel-2);border-radius:var(--radius-sm)}.report-quote b{color:var(--text)}.report-group{border:1px solid var(--line);border-radius:var(--radius);background:var(--panel);margin-bottom:14px}.report-group-head{display:flex;flex-wrap:wrap;gap:6px 12px;align-items:center;padding:10px 14px;border-bottom:1px solid var(--line)}.report-group-head .flag{margin-inline-start:auto}.report-excerpt{padding:10px 14px;color:var(--text-muted);font-size:var(--font-size-sm);border-bottom:1px solid var(--line)}.report-list{list-style:none;margin:0;padding:6px 14px}.report-list li{display:flex;flex-wrap:wrap;gap:4px 10px;align-items:baseline;padding:6px 0;border-bottom:1px dashed var(--line)}.report-list li:last-child{border-bottom:0}.report-note{flex-basis:100%;color:var(--text)}.report-ops{display:flex;gap:8px;padding:10px 14px;border-top:1px solid var(--line);flex-wrap:wrap}.report-ops .action-form{display:inline}

/* reward */
.reward-bar{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;margin:12px 0 4px;padding:10px 14px;border:1px solid var(--warning);border-radius:var(--radius);background:var(--warning-soft);font-size:var(--font-size-sm)}.reward-bar .icon{width:18px;height:18px;color:#e0a100;flex:none}.reward-bar form{margin-inline-start:auto}.reward-over{border-color:var(--line);background:var(--panel-2);color:var(--text-muted)}.reward-mark{display:inline-flex;vertical-align:-2px;margin-inline-end:4px;color:#e0a100}.reward-mark .icon{width:14px;height:14px}.reward-got{display:inline-flex;align-items:center;gap:2px;color:#b8860b;font-weight:600}.reward-got .icon{width:13px;height:13px;fill:currentColor;stroke:none}.reward-when{display:none}

/* seo_pro */
.seo-pro-panel{border:1px solid var(--line);border-radius:var(--radius-sm);padding:10px 12px;margin-bottom:12px;background:var(--panel-2)}.seo-pro-panel summary{cursor:pointer;display:flex;align-items:center;gap:6px;font-weight:600}.seo-pro-panel summary svg{width:15px;height:15px;color:var(--brand)}.seo-pro-panel[open] summary{margin-bottom:10px}.seo-pro-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:0 14px}.seo-pro-map{margin:0;padding-inline-start:18px;line-height:1.8}.seo-pro-tags .tag{margin:0 6px 6px 0}.seo-pro-card{max-width:520px;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;background:var(--panel)}.seo-pro-card img{display:block;width:100%;max-height:270px;object-fit:cover}.seo-pro-noimg{height:120px;display:flex;align-items:center;justify-content:center;background:var(--panel-2);color:var(--text-muted)}.seo-pro-card-body{padding:10px 12px}.seo-pro-card-body b{display:block;margin:2px 0}.seo-pro-card-body p{margin:0;color:var(--text-muted);font-size:var(--font-size-sm)}

/* share */
.share-menu .dropdown-menu{min-width:190px;inset-inline-end:auto;inset-inline-start:0}.share-menu .dropdown-menu a{text-decoration:none}.share-menu .dropdown-menu .icon{width:18px;height:18px;flex:none}.post-actions .share-menu{display:inline-block}.post-actions .share-menu .dropdown-toggle{padding:4px 8px}

/* signature */
.signature{margin-top:12px;padding-top:8px;border-top:1px dashed var(--line);color:var(--text-muted);font-size:var(--font-size-sm);line-height:1.45}.signature p{margin:0}.signature a{color:var(--text-muted);text-decoration:underline}.signature-preview{margin-top:0;padding:8px 10px;border:1px solid var(--line);border-radius:var(--radius-sm)}@media(max-width:640px){.signature-mobile-hide{display:none}}

/* social_login */
.social-login{margin-top:18px}.social-login-or{display:flex;align-items:center;gap:10px;margin-bottom:10px;color:var(--text-subtle);font-size:var(--font-size-sm)}.social-login-or::before,.social-login-or::after{content:"";flex:1;border-top:1px solid var(--line)}.social-login-btns{display:grid;gap:8px}.social-login-btn{justify-content:center;gap:9px;font-weight:550}.social-login-btn svg{width:18px;height:18px;flex:none}.social-login-list{display:grid;gap:8px;margin-bottom:6px}.social-login-row{display:flex;align-items:center;gap:10px;padding:8px 12px;border:1px solid var(--line);border-radius:var(--radius)}.social-login-row svg{width:18px;height:18px;flex:none}.social-login-row .btn{margin-left:auto}

/* tabbar */
/* Bottom Bar: phones only. The bar sits over the bottom of the page; the page leaves --tabbar-h free so nothing hides under it
   (other floating buttons can use the same variable: bottom: calc(var(--tabbar-h, 0px) + 16px)). */
.tabbar { display: none; }
@media (max-width: 768px) {
  body:has(.tabbar) { --tabbar-h: calc(58px + env(safe-area-inset-bottom)); }
  .tabbar { position: fixed; z-index: 70; inset-inline: 0; bottom: 0; display: grid; grid-template-columns: repeat(var(--tabbar-cols, 5), minmax(0, 1fr)); align-items: center;
    height: var(--tabbar-h); padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: var(--panel); transition: transform .25s; }
  body:has(.tabbar) .page-grid { padding-bottom: calc(var(--tabbar-h) + 24px); }
  body:has(.tabbar) .footer { padding-bottom: var(--tabbar-h); }
  body:has(.tabbar[data-tabbar-hide-new]) .header-new-topic { display: none; } /* setting: New Topic only in the middle of the bar */
  .tabbar-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; height: 58px; color: var(--text-subtle); font-size: 11px; line-height: 1.2; text-decoration: none; -webkit-tap-highlight-color: transparent; }
  .tabbar-item:hover { color: var(--text); }
  .tabbar-item.active { color: var(--brand); }
  .tabbar-item.active .tabbar-label { font-weight: 600; }
  .tabbar-icon { position: relative; display: inline-grid; place-items: center; width: 26px; height: 26px; }
  .tabbar-icon > .icon { width: 23px; height: 23px; }
  .tabbar-item.active .tabbar-icon > .icon { stroke-width: 2.4; }
  .tabbar-icon .avatar { width: 24px !important; height: 24px !important; font-size: 11px; }
  .tabbar-item.active .tabbar-icon .avatar { box-shadow: 0 0 0 2px var(--brand); }
  .tabbar-label { max-width: 100%; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar-badge { position: absolute; top: -3px; inset-inline-start: 15px; min-width: 16px; height: 16px; padding: 0 4px; border: 2px solid var(--panel); border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; line-height: 12px; text-align: center; box-sizing: content-box; }
  /* New Topic: a round brand button lifted above the bar */
  .tabbar-center { display: grid; place-items: center; }
  .tabbar-new { display: grid; place-items: center; width: 50px; height: 50px; margin-top: -22px; border: 4px solid var(--panel); border-radius: 50%; background: var(--brand); color: #fff;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 38%, transparent); -webkit-tap-highlight-color: transparent; }
  .tabbar-new:hover, .tabbar-new:active { color: #fff; filter: brightness(.95); }
  .tabbar-new .icon { width: 26px; height: 26px; stroke-width: 2.4; }
  /* a solid bar that stays; the setting can slide it away while scrolling down (scrolling up brings it back). The keyboard always wins */
  body.tabbar-away .tabbar[data-tabbar-scroll="hide"] { transform: translateY(calc(100% + 24px)); }
  body.tabbar-typing .tabbar { transform: translateY(calc(100% + 24px)); }
  body.drawer-open .tabbar { visibility: hidden; }
}


/* tip */
.tip-modal[hidden],.tip-custom[hidden]{display:none}.tip-strip{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:12px;padding:8px 12px;border-radius:var(--radius-sm);background:var(--panel-2);font-size:var(--font-size-sm);color:var(--text-muted)}.tip-strip-faces{display:flex;align-items:center}.tip-strip-faces .avatar{margin-inline-end:-6px;border:2px solid var(--panel)}.tip-more{margin-inline-start:12px;font-size:var(--font-size-xs)}.tip-strip-text{display:inline-flex;align-items:center;gap:4px;margin-inline-start:6px}.tip-strip-text svg{width:14px;height:14px;color:var(--brand)}.tip-modal{position:fixed;inset:0;z-index:230;display:flex;align-items:center;justify-content:center;padding:16px}.tip-modal-scrim{position:absolute;inset:0;background:var(--backdrop)}.tip-modal-box{position:relative;width:100%;max-width:460px;max-height:92vh;overflow:auto;background:var(--panel);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow-md);padding:18px 20px 20px}.tip-modal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.tip-modal-head h3{margin:0;font-size:1.15rem}.tip-modal-x{border:0;background:none;color:var(--text-subtle);cursor:pointer;width:32px;height:32px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center}.tip-modal-x:hover{background:var(--panel-2);color:var(--text)}.tip-modal-x svg{width:18px;height:18px}.tip-author{display:flex;align-items:center;gap:12px;padding:10px 0 14px;border-bottom:1px solid var(--line-soft);margin-bottom:14px}.tip-author-avatar .avatar{--s:46px;width:46px;height:46px;font-size:20px}.tip-author b{font-size:var(--font-size-md)}.tip-author p{margin:2px 0 0}.tip-tiles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:12px}.tip-tile{display:flex;flex-direction:column;align-items:center;gap:2px;padding:12px 6px;border:1px solid var(--line);border-radius:12px;background:var(--panel-2);color:var(--text);cursor:pointer;font:inherit}.tip-tile b{font-size:1.25rem;line-height:1.2}.tip-tile span{font-size:var(--font-size-xs);color:var(--text-muted)}.tip-tile.active{border-color:var(--brand);background:var(--brand-soft);color:var(--brand)}.tip-tile.active span{color:var(--brand)}.tip-tile-custom b svg{width:20px;height:20px}.tip-custom{margin-bottom:12px}.tip-note{margin-bottom:12px}.tip-balance{display:flex;align-items:center;gap:6px;font-size:var(--font-size-sm);color:var(--text-muted);margin-bottom:12px}.tip-balance a{margin-inline-start:auto}.tip-send{display:flex;justify-content:center;gap:8px;padding:12px;font-size:var(--font-size-md);border-radius:12px}.tip-send.busy{opacity:.6;pointer-events:none}@media(max-width:480px){.tip-tiles{gap:8px}.tip-tile b{font-size:1.1rem}}

/* translate */
.translate-box{margin-top:10px;padding:10px 12px;border-inline-start:3px solid var(--brand);background:var(--panel-2);border-radius:var(--radius-sm)}.translate-foot{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:8px;font-size:var(--font-size-xs);color:var(--text-subtle)}.translate-foot button{border:0;background:none;color:var(--brand);cursor:pointer;font:inherit;font-size:inherit;padding:0}.translate-btn.busy{opacity:.6;pointer-events:none}.translate-title{display:block;margin-top:4px;color:var(--text-muted);font-weight:400;font-size:.8em}

/* usercard */
.usercard{position:absolute;z-index:60;width:320px;max-width:calc(100vw - 20px);border:1px solid var(--line);border-radius:var(--radius);background:var(--panel);box-shadow:var(--shadow-lg,0 10px 30px rgba(0,0,0,.18));opacity:0;pointer-events:none;transform:translateY(-4px);transition:opacity .12s,transform .12s}.usercard.open{opacity:1;pointer-events:auto;transform:none}.usercard-body{padding:14px}.usercard-head{display:flex;gap:12px;align-items:center}.usercard-head img{width:52px;height:52px;border-radius:50%}.usercard-who{display:flex;flex-direction:column;gap:2px;min-width:0}.usercard-name{font-weight:600;font-size:var(--font-size-md)}.usercard-handle{color:var(--text-muted);font-size:var(--font-size-xs)}.usercard-group{color:var(--brand);font-size:var(--font-size-xs)}.usercard-seen{color:var(--text-muted);font-size:var(--font-size-xs)}.usercard-bio{margin:10px 0 0;color:var(--text);font-size:var(--font-size-sm);line-height:1.5}.usercard-meta{display:flex;flex-wrap:wrap;gap:10px;margin-top:8px;color:var(--text-muted);font-size:var(--font-size-xs)}.usercard-meta span{display:inline-flex;align-items:center;gap:4px}.usercard-meta svg{width:12px;height:12px}.usercard-stats{display:flex;gap:4px;margin-top:12px;text-align:center}.usercard-stats>*{flex:1;min-width:0;color:var(--text);text-decoration:none;border:1px solid var(--line);border-radius:var(--radius-sm);padding:6px 2px}.usercard-stats a:hover{background:var(--brand-soft)}.usercard-stats b{display:block;font-size:var(--font-size-md)}.usercard-stats span{display:block;color:var(--text-muted);font-size:var(--font-size-xs);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.usercard-foot{display:flex;gap:6px;margin-top:12px}.usercard-foot form{display:flex;flex:1;margin:0}.usercard-foot .btn{flex:1;width:100%;justify-content:center}.usercard-loading{height:96px;border-radius:var(--radius-sm);background:linear-gradient(90deg,var(--panel-2) 25%,var(--line) 37%,var(--panel-2) 63%);background-size:400% 100%;animation:usercard-shine 1.2s linear infinite}@keyframes usercard-shine{0%{background-position:100% 0}100%{background-position:0 0}}@media (prefers-reduced-motion:reduce){.usercard{transition:none}.usercard-loading{animation:none}}

/* verified */
.profile-labels .verified-title{margin:0;padding:1px 7px;border-radius:var(--flag-radius,4px);background:color-mix(in srgb,currentColor 12%,transparent);font-size:var(--font-size-xs);vertical-align:middle}.profile-labels .verified-badge{margin:0}.verified-corner{position:absolute;inset-inline-end:-2px;bottom:-2px;width:clamp(13px,calc(var(--s) * .3),18px);height:clamp(13px,calc(var(--s) * .3),18px);border-radius:50%;background:var(--panel);box-shadow:0 0 0 1.5px var(--panel);line-height:0}.verified-corner svg{width:100%;height:100%;display:block}.profile-head .verified-corner{width:24px;height:24px}@media (max-width:768px){.profile-head .verified-corner{width:18px;height:18px}}.verified-badge{display:inline-block;vertical-align:-.15em;width:1.05em;height:1.05em;margin-left:.25em;line-height:0}.verified-badge svg{width:100%;height:100%;display:block}.profile-head h1 .verified-badge{width:.8em;height:.8em;vertical-align:-.05em}.verified-title{display:inline-block;margin-left:.4em;font-size:.55em;font-weight:600;vertical-align:.3em;letter-spacing:.01em}.settings-form:has(input[name=verified_noop]) .form-actions{display:none}.verified-status{display:flex;align-items:center;gap:.6rem;padding:.8rem 1rem;border:1px solid var(--border);border-radius:var(--radius);margin-bottom:1rem;background:var(--bg-soft)}.verified-status .verified-badge{width:1.4em;height:1.4em;margin:0}

/* video */

    .video-container {
        position: relative;
        padding-bottom: 56.25%;
        height: 0;
        overflow: hidden;
        max-width: 100%;
        background: #000;
        border-radius: 8px;
        margin: 1rem 0;
    }
    .video-container iframe,
    .video-container video {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border: 0;
    }
    .audio-container {
        margin: 1rem 0;
        border-radius: 8px;
        overflow: hidden;
    }
    .tweet-container {
        margin: 1rem 0;
        max-width: 550px;
    }
    .tweet-container iframe{
        border-radius: 8px;
    }

/* wysiwyg */
.editor.wysiwyg .editor-input,.editor.wysiwyg [data-cmd=preview]{display:none}.editor:not(.wysiwyg) .wysiwyg-area{display:none}.wysiwyg-area{position:relative;min-width:0;max-width:100%;overflow:hidden;min-height:200px;padding:10px 12px;cursor:text;font-size:15px;line-height:1.7}.wysiwyg-area .milkdown{min-width:0;max-width:100%}.wysiwyg-area .ProseMirror{outline:0;border:0;background:none;border-radius:0;padding:0;margin:0;min-height:180px;min-width:0;max-width:100%;position:relative;white-space:pre-wrap;white-space:break-spaces;word-wrap:break-word;overflow-wrap:anywhere;word-break:break-word;font-variant-ligatures:none}.wysiwyg-area .ProseMirror:focus,.wysiwyg-area .ProseMirror:focus-visible{outline:0;box-shadow:none}.wysiwyg-area.wysiwyg-empty::before{content:attr(data-placeholder);position:absolute;top:10px;inset-inline-start:12px;color:var(--text-subtle);pointer-events:none}.wysiwyg-area .ProseMirror>*:first-child{margin-top:0}.wysiwyg-area .ProseMirror>*:last-child{margin-bottom:0}.wysiwyg-area .ProseMirror li{position:relative}.wysiwyg-area .ProseMirror pre{white-space:pre;overflow:auto;max-width:100%}.wysiwyg-area .ProseMirror code{overflow-wrap:anywhere}.wysiwyg-area .ProseMirror img{max-width:100%;height:auto}.wysiwyg-area .ProseMirror a{pointer-events:none}.wysiwyg-area .ProseMirror hr{margin:14px 0}.wysiwyg-area .tableWrapper{overflow-x:auto;max-width:100%;margin-bottom:1em}.wysiwyg-area .ProseMirror table{display:block;overflow-x:auto;max-width:100%;width:auto;min-width:0;border-collapse:collapse;table-layout:auto;margin:0 0 1em}.wysiwyg-area .ProseMirror td,.wysiwyg-area .ProseMirror th{vertical-align:top;box-sizing:border-box;position:relative;min-width:90px;overflow-wrap:break-word}.wysiwyg-area .ProseMirror .selectedCell:after{z-index:2;position:absolute;content:"";inset:0;background:var(--brand-soft);opacity:.6;pointer-events:none}.wysiwyg-area .ProseMirror .column-resize-handle{position:absolute;right:-2px;top:0;bottom:0;width:4px;z-index:20;background:var(--brand);pointer-events:none}.wysiwyg-area .ProseMirror.resize-cursor{cursor:col-resize}.wysiwyg-area .ProseMirror-selectednode{outline:2px solid var(--brand)}.wysiwyg-area li.ProseMirror-selectednode{outline:none}.wysiwyg-area .ProseMirror-hideselection *::selection{background:transparent}.wysiwyg-area .ProseMirror-hideselection{caret-color:transparent}.wysiwyg-area img.ProseMirror-separator{display:inline!important;border:none!important;margin:0!important}.wysiwyg-area .ProseMirror [draggable][contenteditable=false]{user-select:text}.editor.fullscreen .wysiwyg-area{height:100%;min-height:0;overflow:auto}.tb-btn[data-cmd=wysiwyg].active{color:var(--brand);background:var(--brand-soft)}.editor.wysiwyg .mention-menu button.active{background:var(--panel-2)}@media(max-width:640px){.wysiwyg-area{padding:10px;font-size:15px}.wysiwyg-area.wysiwyg-empty::before{inset-inline-start:10px}}

/* xstyle */
/* X Style: a topic row that carries .xstyle-head is laid out as a post of a timeline.
   Grid: the avatar in the first column; head, title (core .row-main) and body stacked in the second. */
.topic-row:has(> .slot .xstyle-head) {
  --xstyle-like: #f91880;
  display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 12px; row-gap: 4px;
  padding: 14px 16px 8px; cursor: pointer;
}
.topic-row:has(> .slot .xstyle-head) > * { grid-column: 2; }
.topic-row:has(> .slot .xstyle-head) > .slot[data-slot="topic_list.item.after"] { display: contents; }
.topic-row:has(> .slot .xstyle-head) > .row-avatar { grid-column: 1; grid-row: 1 / span 3; padding-top: 2px; }
.topic-row:has(> .slot .xstyle-head) > .row-main { grid-row: 2; }
.topic-row:has(> .slot .xstyle-head) .row-meta,
.topic-row:has(> .slot .xstyle-head) > .row-cat,
.topic-row:has(> .slot .xstyle-head) .row-icon-pin { display: none; }
.topic-row:has(> .slot .xstyle-head) .row-title { margin: 0; font-size: var(--font-size-lg); font-weight: 600; line-height: 1.4; }
.topic-row.read:has(> .slot .xstyle-head) .row-title a { font-weight: 500; }

/* a member's own list (no avatar): one column, and the name is not repeated */
.topic-row:has(> .slot .xstyle-head):not(:has(> .row-avatar)) { grid-template-columns: minmax(0, 1fr); }
.topic-row:has(> .slot .xstyle-head):not(:has(> .row-avatar)) > * { grid-column: 1; }
.topic-row:not(:has(> .row-avatar)) .xstyle-name, .topic-row:not(:has(> .row-avatar)) .xstyle-name + .xstyle-dot { display: none; }

.xstyle-head { grid-row: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-width: 0; font-size: var(--font-size-sm); color: var(--text-subtle); line-height: 1.4; }
.xstyle-pinned { flex-basis: 100%; display: inline-flex; align-items: center; gap: 4px; font-size: var(--font-size-xs); font-weight: 600; color: var(--text-subtle); }
.xstyle-pinned .icon { width: 12px; height: 12px; }
.xstyle-who { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.xstyle-head .xstyle-name { font-weight: 650; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xstyle-head .xstyle-name:hover { color: var(--text); text-decoration: underline; }
.xstyle-time { color: var(--text-subtle); white-space: nowrap; }
.xstyle-time:hover { color: var(--text-subtle); text-decoration: underline; }
.xstyle-cat { margin-inline-start: auto; padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--text-muted); font-size: var(--font-size-xs); white-space: nowrap; }
.xstyle-cat:hover { border-color: var(--text-subtle); color: var(--text); }

.xstyle-body { grid-row: 3; min-width: 0; }
/* paragraphs stay paragraphs (one line break each), with a little air between them */
.xstyle-text { color: var(--text); line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.xstyle-more { display: inline-block; margin-top: 2px; color: var(--brand); font-size: var(--font-size-sm); }
.xstyle-more:hover { text-decoration: underline; }
.xstyle-tags { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 6px; font-size: var(--font-size-sm); }
.xstyle-tags a { color: var(--brand); }
.xstyle-tags a:hover { text-decoration: underline; }

/* up to four pictures, the way a timeline shows them: one wide, two side by side, one tall beside two, or four squares; "+N" on the fourth */
.xstyle-media { display: grid; gap: 2px; max-width: 560px; margin-top: 12px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--panel-2); }
.xstyle-pic { position: relative; display: block; min-width: 0; min-height: 0; padding: 0; border: 0; background: none; cursor: zoom-in; }
a.xstyle-media .xstyle-pic { cursor: pointer; }
.xstyle-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.xstyle-media-1 img { height: auto; max-height: 420px; }
.xstyle-media-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); height: 260px; }
.xstyle-media-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); height: 280px; }
.xstyle-media-3 > :first-child { grid-row: 1 / span 2; }
.xstyle-media-4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); height: 280px; }
.xstyle-plus { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .45); color: #fff; font-size: 1.4rem; font-weight: 600; }
/* a video: its cover and a play button, the player takes its place when pressed */
.xstyle-video { position: relative; display: flex; align-items: center; justify-content: center; max-width: 560px; margin-top: 12px; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #1c1c1e; }
.xstyle-video img, .xstyle-video video, .xstyle-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.xstyle-video.is-file video { object-fit: contain; background: #000; }
.xstyle-play { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; width: 58px; height: 58px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .6); cursor: pointer; transition: transform .12s, background .12s; }
.xstyle-play:hover { background: var(--brand); transform: scale(1.06); }
.xstyle-tri { display: block; width: 0; height: 0; margin-left: 5px; border-style: solid; border-width: 11px 0 11px 18px; border-color: transparent transparent transparent #fff; }
.xstyle-badge { position: absolute; z-index: 1; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, .6); color: #fff; font-size: var(--font-size-xs); }
.xstyle-badge .icon { width: 13px; height: 13px; }
.xstyle-video.playing .xstyle-play, .xstyle-video.playing .xstyle-badge { display: none; }
/* the picture viewer */
.xstyle-viewer { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .92); }
.xstyle-viewer[hidden] { display: none; }
.xstyle-viewer img { max-width: 92vw; max-height: 86vh; object-fit: contain; border-radius: 4px; }
.xstyle-viewer button { position: absolute; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }
.xstyle-viewer button:hover { background: rgba(255, 255, 255, .24); }
.xstyle-v-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.xstyle-v-next { right: 16px; top: 50%; transform: translateY(-50%); }
.xstyle-v-close { top: 16px; right: 16px; }
.xstyle-viewer.single .xstyle-v-prev, .xstyle-viewer.single .xstyle-v-next, .xstyle-viewer.single .xstyle-count { display: none; }
.xstyle-count { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: rgba(255, 255, 255, .8); font-size: var(--font-size-sm); }
.xstyle-mature { display: flex; align-items: center; gap: 8px; max-width: 560px; margin-top: 12px; padding: 14px 16px; border: 1px dashed var(--line); border-radius: 16px; background: var(--panel-2); color: var(--text-muted); font-size: var(--font-size-sm); }
.xstyle-mature .icon { width: 18px; height: 18px; flex: none; }
.xstyle-mature:hover { color: var(--text); }

/* fixed columns (replies, like, views, last reply, then bookmark and share), so the buttons line up from one row to the next */
.xstyle-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.6fr) auto; align-items: center; gap: 8px; max-width: 600px; margin-top: 8px; margin-inline-start: -8px; color: var(--text-subtle); font-size: var(--font-size-sm); }
.xstyle-actions > * { justify-self: start; }
.xstyle-actions .action-form { display: inline-flex; margin: 0; }
.xstyle-act { display: inline-flex; align-items: center; gap: 6px; min-width: 0; padding: 5px 8px; border: 0; border-radius: 999px; background: none; color: var(--text-subtle); font: inherit; line-height: 1; cursor: pointer; white-space: nowrap; }
.xstyle-act .icon { width: 17px; height: 17px; flex: none; }
.xstyle-act span:empty { display: none; }
.xstyle-reply:hover { color: var(--brand); background: var(--brand-soft, var(--panel-2)); }
.xstyle-like:hover, .xstyle-like.active { color: var(--xstyle-like); }
.xstyle-like:hover { background: color-mix(in srgb, var(--xstyle-like) 10%, transparent); }
.xstyle-like.active .icon { fill: var(--xstyle-like); }
.xstyle-views { cursor: default; }
.xstyle-last { max-width: 100%; overflow: hidden; }
.xstyle-last time { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xstyle-last span { overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.xstyle-last time { color: var(--text-subtle); }
.xstyle-last:hover { color: var(--text); background: var(--panel-2); }
.xstyle-end { justify-self: end; display: inline-flex; align-items: center; gap: 2px; }
.xstyle-end .action-form { display: inline-flex; margin: 0; }
.xstyle-bookmark span { display: none; } /* the core script writes Bookmark / Bookmarked into it: it stays the tooltip only */
.xstyle-bookmark:hover, .xstyle-bookmark.active { color: var(--brand); }
.xstyle-bookmark:hover { background: var(--panel-2); }
.xstyle-bookmark.active .icon { fill: var(--brand); }
.xstyle-share:hover { color: var(--brand); background: var(--panel-2); }

@media (max-width: 640px) {
  .topic-row:has(> .slot .xstyle-head) { grid-template-columns: 36px minmax(0, 1fr); column-gap: 10px; padding: 12px 12px 8px; }
  .topic-row:has(> .slot .xstyle-head) .row-avatar .avatar { width: 36px; height: 36px; }
  .topic-row:has(> .slot .xstyle-head) .row-title { font-size: 15px; }
  .xstyle-cat { display: none; }
  .xstyle-media, .xstyle-video { border-radius: 12px; }
  .xstyle-media-2, .xstyle-media-3, .xstyle-media-4 { height: 200px; }
  .xstyle-v-prev, .xstyle-v-next { display: none !important; }
  .xstyle-last, .xstyle-actions > span:empty { display: none; } /* no room for the last reply (or its empty place) beside the buttons on a phone; the topic shows it */
  .xstyle-actions { max-width: none; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
}

