/* Shinsei Profile Feed - Zeina/prosilver-compatible profile updates. */

.profilefeed-page,
.profilefeed-tabs {
    --pf-accent: #a44635;
    --pf-accent-bright: #c8664e;
    --pf-accent-soft: rgba(164, 70, 53, 0.16);
    --pf-surface: #171512;
    --pf-surface-raised: #1d1916;
    --pf-field: #181512;
    --pf-field-focus: #201a17;
    --pf-line: rgba(164, 117, 96, 0.24);
    --pf-line-strong: rgba(164, 117, 96, 0.38);
    --pf-text: #e0d9d4;
    --pf-muted: rgba(214, 204, 198, 0.55);
}

.profilefeed-page {
    max-width: 980px;
    margin: 0 auto;
}

/* Profile / Feed segmented navigation */
.profilefeed-tabs {
    margin: 0 0 16px;
}

.profilefeed-tabs ul {
    display: inline-flex;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 4px;
    list-style: none;
    background: rgba(22, 19, 17, 0.88);
    border: 1px solid var(--pf-line);
    border-radius: 999px;
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.025), 0 6px 16px rgba(0, 0, 0, 0.13);
}

.profilefeed-tabs .profilefeed-tab {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.profilefeed-tabs .profilefeed-tab + .profilefeed-tab::before {
    content: "•";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    color: rgba(205, 178, 165, 0.32);
    font-size: 10px;
    line-height: 1;
}

.profilefeed-tabs .profilefeed-tab a {
    display: block;
    min-width: 78px;
    padding: 8px 14px;
    color: var(--pf-muted);
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
    transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.profilefeed-tabs .profilefeed-tab a:hover {
    color: var(--pf-text);
    background: rgba(255, 255, 255, 0.035);
}

.profilefeed-tabs .profilefeed-tab.is-active a {
    color: #f4dfd8;
    background: linear-gradient(180deg, rgba(164, 70, 53, 0.28), rgba(164, 70, 53, 0.17));
    border-color: rgba(198, 102, 78, 0.28);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.055);
}

.profilefeed-tabs .profilefeed-tab a:active {
    transform: translateY(1px);
}

.profilefeed-hero,
.profilefeed-composer,
.profilefeed-update,
.profilefeed-empty {
    box-sizing: border-box;
    color: var(--pf-text);
    background: var(--pf-surface);
    border: 1px solid var(--pf-line);
    border-radius: 10px;
    overflow: hidden;
}

/* Profile feed cover header */
.profilefeed-hero {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    min-height: 118px;
    margin-bottom: 14px;
    padding: 20px;
}

.profilefeed-hero__cover,
.profilefeed-hero__scrim {
    position: absolute;
    z-index: -2;
    inset: 0;
    pointer-events: none;
}

.profilefeed-hero__cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    filter: none;
}

/*
 * Keep the source image sharp and darken it with one predictable overlay.
 * The editor preview uses these exact same values so it matches the saved
 * profile header instead of becoming darker after submission.
 */
.profilefeed-hero__scrim {
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(12, 10, 9, 0.68) 0%, rgba(12, 10, 9, 0.30) 48%, rgba(12, 10, 9, 0.48) 100%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.24));
}

.profilefeed-hero:not(.has-cover)::after {
    content: "忍";
    position: absolute;
    z-index: -1;
    right: 20px;
    bottom: -24px;
    color: var(--pf-accent);
    font: 900 100px/1 serif;
    opacity: 0.035;
    pointer-events: none;
}

.profilefeed-hero__avatar,
.profilefeed-hero__text,
.profilefeed-hero__actions {
    position: relative;
    z-index: 1;
}

.profilefeed-hero__avatar img {
    display: block;
    width: 72px;
    height: 72px;
    object-fit: cover;
    background: var(--pf-surface);
    border: 3px solid rgba(205, 112, 88, 0.6);
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.38);
}

.profilefeed-hero__text h2 {
    margin: 0 0 4px;
    color: var(--pf-text);
    font-size: 22px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
}

.profilefeed-hero__text p {
    margin: 0;
    color: rgba(232, 224, 219, 0.65);
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.72);
}

.profilefeed-hero__actions {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    gap: 9px;
}

.profilefeed-cover-edit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    color: rgba(242, 231, 225, 0.8) !important;
    background: rgba(14, 12, 11, 0.62) !important;
    border-color: rgba(217, 181, 166, 0.2) !important;
    backdrop-filter: blur(5px);
    font-size: 10px;
}

.profilefeed-cover-edit:hover {
    color: #fff !important;
    background: rgba(164, 70, 53, 0.72) !important;
    border-color: rgba(215, 120, 95, 0.6) !important;
}

.profilefeed-hero__count {
    padding: 7px 10px;
    color: #e18068;
    background: rgba(68, 20, 14, 0.58);
    border: 1px solid rgba(185, 76, 53, 0.18);
    border-radius: 999px;
    backdrop-filter: blur(4px);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Composer and post cards */
.profilefeed-composer {
    margin-bottom: 16px;
    padding: 16px;
    border-top: 3px solid var(--pf-accent);
}

.profilefeed-composer h3 {
    margin: 0 0 12px;
}

.profilefeed-editor textarea {
    min-height: 135px;
    resize: vertical;
}

/* Replace Zeina's blue form fields inside the feed only. */
.profilefeed-page textarea.inputbox,
.profilefeed-page input.inputbox,
.profilefeed-page select.inputbox,
.profilefeed-cover-form input[type="text"] {
    box-sizing: border-box;
    color: var(--pf-text) !important;
    background: linear-gradient(180deg, rgba(25, 22, 19, 0.98), rgba(19, 17, 15, 0.98)) !important;
    border: 1px solid var(--pf-line-strong) !important;
    border-radius: 8px !important;
    box-shadow: inset 0 1px 8px rgba(0, 0, 0, 0.2) !important;
    caret-color: var(--pf-accent-bright);
}

.profilefeed-page textarea.inputbox:hover,
.profilefeed-page input.inputbox:hover,
.profilefeed-page select.inputbox:hover {
    border-color: rgba(185, 116, 91, 0.46) !important;
}

.profilefeed-page textarea.inputbox:focus,
.profilefeed-page input.inputbox:focus,
.profilefeed-page select.inputbox:focus {
    color: #f1ebe7 !important;
    background: var(--pf-field-focus) !important;
    border-color: rgba(198, 102, 78, 0.7) !important;
    outline: 0 !important;
    box-shadow: 0 0 0 3px rgba(164, 70, 53, 0.13), inset 0 1px 8px rgba(0, 0, 0, 0.22) !important;
}

.profilefeed-page textarea.inputbox::placeholder,
.profilefeed-page input.inputbox::placeholder {
    color: rgba(218, 205, 198, 0.37) !important;
    opacity: 1;
}

.profilefeed-form-footer,
.profilefeed-comment-form__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}

.profilefeed-form-hint,
.profilefeed-comment-form__footer span {
    color: var(--pf-muted);
    font-size: 11px;
}

.profilefeed-update {
    margin-bottom: 14px;
    padding: 0;
}

.profilefeed-update__header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 15px 17px;
    border-bottom: 1px solid var(--pf-line);
}

.profilefeed-avatar img {
    display: block;
    object-fit: cover;
    border-radius: 50%;
}

.profilefeed-avatar--update img {
    width: 46px;
    height: 46px;
}

.profilefeed-avatar--comment img {
    width: 32px;
    height: 32px;
}

.profilefeed-author {
    font-weight: 700;
}

.profilefeed-update__identity time,
.profilefeed-comment__meta time {
    display: block;
    margin-top: 3px;
    color: var(--pf-muted);
    font-size: 11px;
}

.profilefeed-message {
    overflow-wrap: anywhere;
}

.profilefeed-update > .profilefeed-message {
    padding: 18px 20px 20px;
    font-size: 14px;
    line-height: 1.7;
}

.profilefeed-update > .profilefeed-message > :first-child,
.profilefeed-comment .profilefeed-message > :first-child {
    margin-top: 0;
}

.profilefeed-update > .profilefeed-message > :last-child,
.profilefeed-comment .profilefeed-message > :last-child {
    margin-bottom: 0;
}

.profilefeed-delete-button {
    padding: 4px 9px;
    font-size: 10px;
}

.profilefeed-comment-heading {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 17px;
    color: var(--pf-muted);
    background: rgba(127, 127, 127, 0.035);
    border-top: 1px solid var(--pf-line);
    border-bottom: 1px solid var(--pf-line);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.profilefeed-comment-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    color: var(--pf-accent-bright);
    background: var(--pf-accent-soft);
    border-radius: 999px;
}

.profilefeed-comments {
    padding: 0 17px;
}

.profilefeed-comment {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    padding: 13px 0;
    border-bottom: 1px solid var(--pf-line);
}

.profilefeed-comment__meta {
    display: flex;
    align-items: baseline;
    gap: 9px;
    margin-bottom: 5px;
}

.profilefeed-comment__meta time {
    display: inline;
    margin: 0;
}

.profilefeed-comment .profilefeed-message {
    font-size: 12px;
    line-height: 1.55;
}

.profilefeed-comment-delete {
    width: 25px;
    height: 25px;
    padding: 0;
    color: var(--pf-muted);
    background: transparent;
    border: 0;
    border-radius: 50%;
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
}

.profilefeed-comment-delete:hover {
    color: #fff;
    background: var(--pf-accent);
}

.profilefeed-comment-form {
    padding: 14px 17px 17px;
}

.profilefeed-comment-form textarea {
    min-height: 62px;
    resize: vertical;
}

.profilefeed-empty {
    padding: 44px 24px;
    text-align: center;
}

.profilefeed-empty__symbol {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--pf-accent);
    font-size: 28px;
}

.profilefeed-empty p {
    margin: 0;
    color: var(--pf-muted);
}

.profilefeed-page .bbcode-status,
.profilefeed-page .bbcode-status-container {
    margin-bottom: 8px;
}

/* Cover upload modal */
html.profilefeed-modal-open,
html.profilefeed-modal-open body {
    overflow: hidden;
}

.profilefeed-cover-modal[hidden] {
    display: none !important;
}

.profilefeed-cover-modal {
    position: fixed;
    z-index: 10050;
    inset: 0;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    padding: 22px;
}

.profilefeed-cover-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 4, 4, 0.78);
    backdrop-filter: blur(5px);
}

.profilefeed-cover-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(1040px, 100%);
    max-height: calc(100vh - 44px);
    overflow-y: auto;
    color: var(--pf-text);
    background:
        radial-gradient(circle at 100% 0, rgba(164, 70, 53, 0.11), transparent 36%),
        var(--pf-surface-raised);
    border: 1px solid var(--pf-line-strong);
    border-radius: 13px;
    box-shadow: 0 24px 75px rgba(0, 0, 0, 0.62);
}

.profilefeed-cover-modal__close {
    position: absolute;
    z-index: 2;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    padding: 0;
    color: rgba(235, 224, 218, 0.65);
    background: rgba(10, 9, 8, 0.45);
    border: 1px solid var(--pf-line);
    border-radius: 50%;
    font-size: 23px;
    line-height: 30px;
    cursor: pointer;
}

.profilefeed-cover-modal__close:hover {
    color: #fff;
    background: var(--pf-accent);
}

.profilefeed-cover-modal__header {
    padding: 24px 58px 17px 24px;
    border-bottom: 1px solid var(--pf-line);
}

.profilefeed-cover-modal__eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--pf-accent-bright);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.profilefeed-cover-modal__header h3 {
    margin: 0 0 6px;
    font-size: 21px;
}

.profilefeed-cover-modal__header p {
    margin: 0;
    color: var(--pf-muted);
    font-size: 12px;
    line-height: 1.55;
}

.profilefeed-cover-form {
    padding: 19px 24px 24px;
}

.profilefeed-cover-upload {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding: 12px 14px;
    color: var(--pf-text);
    background: rgba(12, 11, 10, 0.36);
    border: 1px dashed var(--pf-line-strong);
    border-radius: 9px;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease;
}

.profilefeed-cover-upload:hover {
    background: rgba(164, 70, 53, 0.055);
    border-color: rgba(198, 102, 78, 0.64);
}

.profilefeed-cover-upload__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    color: var(--pf-accent-bright);
    background: var(--pf-accent-soft);
    border-radius: 50%;
    font-size: 22px;
}

.profilefeed-cover-upload strong,
.profilefeed-cover-upload small {
    display: block;
}

.profilefeed-cover-upload small {
    margin-top: 3px;
    color: var(--pf-muted);
    font-size: 10px;
}

.profilefeed-cover-upload input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.profilefeed-cover-preview {
    position: relative;
    isolation: isolate;
    box-sizing: border-box;
    height: 118px;
    overflow: hidden;
    background: #100e0d;
    border: 1px solid var(--pf-line-strong);
    border-radius: 10px;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.profilefeed-cover-preview.is-dragging {
    cursor: grabbing;
}

.profilefeed-cover-preview > img {
    position: absolute;
    z-index: -2;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    filter: none;
    pointer-events: none;
}

.profilefeed-cover-preview__overlay {
    position: absolute;
    z-index: -1;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(12, 10, 9, 0.68) 0%, rgba(12, 10, 9, 0.30) 48%, rgba(12, 10, 9, 0.48) 100%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.24));
    pointer-events: none;
}

.profilefeed-cover-preview__sample {
    position: absolute;
    left: 22px;
    top: 50%;
    display: flex;
    align-items: center;
    gap: 13px;
    transform: translateY(-50%);
    pointer-events: none;
}

.profilefeed-cover-preview__avatar img {
    display: block;
    width: 58px;
    height: 58px;
    object-fit: cover;
    background: var(--pf-surface);
    border: 3px solid rgba(205, 112, 88, 0.62);
    border-radius: 50%;
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.4);
}

.profilefeed-cover-preview__sample strong,
.profilefeed-cover-preview__sample span {
    display: block;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}

.profilefeed-cover-preview__sample strong {
    font-size: 17px;
}

.profilefeed-cover-preview__sample span {
    margin-top: 3px;
    color: rgba(232, 224, 219, 0.65);
    font-size: 11px;
}

.profilefeed-cover-preview__empty {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--pf-muted);
    text-align: center;
}

.profilefeed-cover-preview.is-empty .profilefeed-cover-preview__empty {
    display: flex;
}

.profilefeed-cover-preview.is-empty .profilefeed-cover-preview__sample,
.profilefeed-cover-preview.is-empty .profilefeed-cover-preview__hint {
    display: none;
}

.profilefeed-cover-preview__hint {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 5px 8px;
    color: rgba(239, 230, 225, 0.68);
    background: rgba(8, 7, 7, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    font-size: 9px;
    pointer-events: none;
}

.profilefeed-cover-positioning {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 15px 24px;
    margin-top: 17px;
}

.profilefeed-cover-positioning label {
    display: flex;
    justify-content: space-between;
    color: var(--pf-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.profilefeed-cover-positioning output {
    color: var(--pf-accent-bright);
}

.profilefeed-cover-positioning input[type="range"] {
    width: 100%;
    margin: 0;
    accent-color: var(--pf-accent-bright);
}


.profilefeed-cover-form__status {
    min-height: 18px;
    margin-top: 12px;
    color: var(--pf-accent-bright);
    font-size: 11px;
    line-height: 1.5;
}

.profilefeed-cover-form.is-processing {
    cursor: progress;
}

.profilefeed-cover-form.is-processing .profilefeed-cover-preview,
.profilefeed-cover-form.is-processing .profilefeed-cover-upload,
.profilefeed-cover-form.is-processing .profilefeed-cover-positioning {
    opacity: 0.62;
    pointer-events: none;
}

.profilefeed-cover-form__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--pf-line);
}

.profilefeed-cover-form__actions {
    display: flex;
    gap: 8px;
}

.profilefeed-cover-remove {
    color: #d58b78 !important;
}

@media (max-width: 700px) {
    .profilefeed-hero {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .profilefeed-hero__actions {
        grid-column: 1 / -1;
        align-items: center;
        flex-direction: row;
        justify-content: space-between;
    }

    .profilefeed-update__header {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .profilefeed-update__header .profilefeed-delete-form {
        grid-column: 2;
        justify-self: start;
    }

    .profilefeed-form-footer,
    .profilefeed-comment-form__footer {
        align-items: stretch;
        flex-direction: column;
    }

    .profilefeed-form-footer .button,
    .profilefeed-comment-form__footer .button {
        width: 100%;
    }

    .profilefeed-cover-positioning {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .profilefeed-tabs ul {
        display: flex;
        width: 100%;
        box-sizing: border-box;
    }

    .profilefeed-tabs .profilefeed-tab {
        flex: 1 1 0;
    }

    .profilefeed-tabs .profilefeed-tab a {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .profilefeed-tabs .profilefeed-tab + .profilefeed-tab::before {
        flex: 0 0 12px;
        width: 12px;
    }

    .profilefeed-cover-modal {
        padding: 10px;
    }

    .profilefeed-cover-modal__dialog {
        max-height: calc(100vh - 20px);
    }

    .profilefeed-cover-modal__header,
    .profilefeed-cover-form {
        padding-left: 16px;
        padding-right: 16px;
    }

    .profilefeed-cover-form__footer {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .profilefeed-cover-form__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 430px) {
    .profilefeed-hero {
        padding: 15px;
    }

    .profilefeed-hero__avatar img {
        width: 58px;
        height: 58px;
    }

    .profilefeed-update > .profilefeed-message {
        padding: 15px;
    }

    .profilefeed-comments,
    .profilefeed-comment-form {
        padding-left: 12px;
        padding-right: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .profilefeed-tabs .profilefeed-tab a,
    .profilefeed-cover-upload {
        transition: none;
    }
}

/* Server-rendered BBCode preview for new feed updates. */
.profilefeed-form-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.profilefeed-bbcode-preview[hidden] {
    display: none !important;
}

.profilefeed-bbcode-preview {
    margin-top: 12px;
    overflow: hidden;
    color: var(--pf-text);
    background: rgba(14, 13, 12, 0.72);
    border: 1px solid var(--pf-line-strong);
    border-radius: 8px;
}

.profilefeed-bbcode-preview__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--pf-line);
}

.profilefeed-bbcode-preview__header strong {
    color: var(--pf-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.profilefeed-bbcode-preview__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    color: var(--pf-muted);
    background: transparent;
    border: 0;
    border-radius: 6px;
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
}

.profilefeed-bbcode-preview__close:hover {
    color: var(--pf-text);
    background: rgba(255, 255, 255, 0.045);
}

.profilefeed-bbcode-preview__status {
    padding: 0 12px;
    color: var(--pf-accent-bright);
    font-size: 11px;
    line-height: 1.45;
}

.profilefeed-bbcode-preview__status:not(:empty) {
    padding-top: 10px;
    padding-bottom: 10px;
}

.profilefeed-bbcode-preview__body {
    width: auto;
    padding: 13px 14px;
}

.profilefeed-bbcode-preview__content {
    min-height: 32px;
    overflow-wrap: anywhere;
}

.profilefeed-bbcode-preview.is-loading .profilefeed-bbcode-preview__body {
    opacity: 0.48;
}

@media (max-width: 700px) {
    .profilefeed-form-actions {
        width: 100%;
    }

    .profilefeed-form-actions .button {
        flex: 1 1 0;
    }
}

/* 0.3.0: user status, editable updates, custom page backgrounds and header layouts. */
.profilefeed-page {
    position: relative;
    isolation: isolate;
}

/*
 * 0.3.1: the uploaded image belongs to Zeina's full page-body rather than a
 * rounded block behind the 980px feed column. JavaScript assigns the actual
 * background properties inline with !important so they override the forum's
 * global custom background CSS on this page only.
 */
.profilefeed-page.has-custom-background::before {
    content: none !important;
    display: none !important;
}

#page-body.profilefeed-page-body-background {
    position: relative;
}

#page-body.profilefeed-page-body-background > .layout-container {
    position: relative;
    z-index: 1;
    background: transparent !important;
}

.profilefeed-hero--expanded {
    min-height: 230px;
    align-items: end;
    padding: 24px;
}

.profilefeed-hero--expanded .profilefeed-hero__avatar img {
    width: 82px;
    height: 82px;
}

.profilefeed-hero__edit-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 7px;
}

.profilefeed-status {
    min-height: 22px;
}

.profilefeed-status p,
.profilefeed-status__display {
    margin: 0;
    color: rgba(232, 224, 219, 0.68);
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.72);
    font-size: 13px;
    line-height: 1.45;
}

.profilefeed-status__display {
    display: inline-flex;
    max-width: 100%;
    padding: 2px 0;
    overflow: hidden;
    background: transparent;
    border: 0;
    cursor: text;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profilefeed-status__display:hover {
    color: rgba(255, 245, 240, 0.9);
}

.profilefeed-status__display.is-placeholder {
    opacity: 0.52;
    font-style: italic;
}

.profilefeed-status__form {
    display: flex;
    align-items: center;
    gap: 6px;
    width: min(440px, 100%);
}

.profilefeed-status__form[hidden],
.profilefeed-status__display[hidden] {
    display: none !important;
}

.profilefeed-page .profilefeed-status__input.inputbox {
    height: 34px;
    min-width: 0;
    padding: 6px 9px;
    font-size: 12px;
}

.profilefeed-status__save,
.profilefeed-status__cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    padding: 0;
    color: rgba(236, 221, 214, 0.72);
    background: rgba(14, 12, 11, 0.64);
    border: 1px solid var(--pf-line);
    border-radius: 7px;
    cursor: pointer;
}

.profilefeed-status__save:hover,
.profilefeed-status__cancel:hover {
    color: #fff;
    border-color: var(--pf-accent-bright);
}

.profilefeed-status__save svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.profilefeed-status__cancel {
    font-size: 19px;
    line-height: 1;
}

.profilefeed-edited-marker {
    margin-left: 5px;
    opacity: 0.48;
    font-size: 10px;
}

.profilefeed-update__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.profilefeed-edit-form[hidden] {
    display: none !important;
}

.profilefeed-edit-form {
    margin: 0 18px 18px;
    padding: 14px;
    background: rgba(12, 11, 10, 0.42);
    border: 1px solid var(--pf-line);
    border-radius: 8px;
}

.profilefeed-edit-form textarea {
    min-height: 125px;
    resize: vertical;
}

.profilefeed-edit-form__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 9px;
}

.profilefeed-edit-form__footer > span {
    color: var(--pf-muted);
    font-size: 11px;
}

.profilefeed-edit-form__footer > div {
    display: flex;
    gap: 7px;
}

.profilefeed-cover-layout,
.profilefeed-background-modes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin: 17px 0 0;
    padding: 0;
    border: 0;
}

.profilefeed-cover-layout legend,
.profilefeed-background-modes legend {
    grid-column: 1 / -1;
    width: 100%;
    margin-bottom: 1px;
    color: var(--pf-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.profilefeed-cover-layout label,
.profilefeed-background-modes label {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 10px;
    background: rgba(20, 17, 15, 0.76);
    border: 1px solid var(--pf-line);
    border-radius: 8px;
    cursor: pointer;
}

.profilefeed-cover-layout label:has(input:checked),
.profilefeed-background-modes label:has(input:checked) {
    background: rgba(164, 70, 53, 0.08);
    border-color: rgba(198, 102, 78, 0.58);
}

.profilefeed-cover-layout input,
.profilefeed-background-modes input {
    flex: 0 0 auto;
    margin-top: 3px;
    accent-color: var(--pf-accent-bright);
}

.profilefeed-cover-layout strong,
.profilefeed-cover-layout small,
.profilefeed-background-modes strong,
.profilefeed-background-modes small {
    display: block;
}

.profilefeed-cover-layout strong,
.profilefeed-background-modes strong {
    color: var(--pf-text);
    font-size: 11px;
}

.profilefeed-cover-layout small,
.profilefeed-background-modes small {
    margin-top: 2px;
    color: var(--pf-muted);
    font-size: 9px;
    line-height: 1.4;
}

.profilefeed-cover-preview.is-expanded {
    height: 230px;
}

.profilefeed-cover-preview.is-expanded .profilefeed-cover-preview__sample {
    top: auto;
    bottom: 20px;
    transform: none;
}

.profilefeed-cover-preview.is-expanded .profilefeed-cover-preview__avatar img {
    width: 66px;
    height: 66px;
}

.profilefeed-background-modes {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.profilefeed-background-preview {
    position: relative;
    isolation: isolate;
    box-sizing: border-box;
    height: 300px;
    overflow: hidden;
    background-color: #100e0d;
    background-image:
        linear-gradient(rgba(10, 9, 8, 0.28), rgba(10, 9, 8, 0.28)),
        var(--pf-preview-background);
    background-position: center, var(--pf-preview-x, 50%) var(--pf-preview-y, 50%);
    border: 1px solid var(--pf-line-strong);
    border-radius: 10px;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.profilefeed-background-preview.is-dragging {
    cursor: grabbing;
}

.profilefeed-background-preview--fill {
    background-repeat: no-repeat, no-repeat;
    background-size: cover, cover;
}

.profilefeed-background-preview--fit {
    background-repeat: no-repeat, no-repeat;
    background-size: cover, contain;
}

.profilefeed-background-preview--free {
    background-repeat: no-repeat, no-repeat;
    background-size: cover, auto;
}

.profilefeed-background-preview--tile {
    background-repeat: no-repeat, repeat;
    background-size: cover, auto;
}

.profilefeed-background-preview__sample {
    position: absolute;
    inset: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(238, 229, 224, 0.72);
    background: rgba(23, 21, 18, 0.88);
    border: 1px solid rgba(164, 117, 96, 0.28);
    border-radius: 10px;
    font-size: 12px;
    pointer-events: none;
}

.profilefeed-background-preview.is-empty {
    background-image: none;
}

.profilefeed-background-preview.is-empty .profilefeed-background-preview__sample,
.profilefeed-background-preview.is-empty .profilefeed-cover-preview__hint {
    display: none;
}

.profilefeed-background-preview .profilefeed-cover-preview__empty {
    z-index: 2;
}

@media (max-width: 700px) {
    .profilefeed-page.has-custom-background::before {
        inset: -8px;
    }

    .profilefeed-hero--expanded {
        min-height: 210px;
        align-items: end;
    }

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

    .profilefeed-edit-form__footer {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 520px) {
    .profilefeed-hero--expanded {
        min-height: 190px;
    }

    .profilefeed-cover-layout,
    .profilefeed-background-modes {
        grid-template-columns: 1fr;
    }

    .profilefeed-background-preview {
        height: 230px;
    }
}

/* ---------------------------------------------------------------------
   0.3.2 — Fixed full-page background and index latest-feed widget
   --------------------------------------------------------------------- */

/* The member background sits above Shinsei's global html::before image but
   remains behind every page element. Because this layer is fixed to the
   viewport, opening a spoiler cannot resize or re-crop it. */
html.profilefeed-custom-page-background::after {
    content: "";
    position: fixed;
    z-index: -9998;
    inset: 0;
    pointer-events: none;
    background-color: #100e0d;
    background-image:
        linear-gradient(rgba(10, 9, 8, 0.38), rgba(10, 9, 8, 0.38)),
        var(--pf-page-background-image);
    background-position:
        center,
        var(--pf-page-background-x, 50%) var(--pf-page-background-y, 50%);
    background-repeat: no-repeat, no-repeat;
    background-size: cover, cover;
}

html.profilefeed-custom-page-background--fit::after {
    background-size: cover, contain;
}

html.profilefeed-custom-page-background--free::after {
    background-size: cover, auto;
}

html.profilefeed-custom-page-background--tile::after {
    background-repeat: no-repeat, repeat;
    background-size: cover, auto;
}

/* Compact card inserted as the third section in the existing custom left
   sidebar. The outer .shinsei-sidebar-section styling comes from Shinsei's
   Zeina custom CSS; these rules only define the internal feed list. */
.profilefeed-latest-widget {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    min-width: 0;
}

.profilefeed-latest-icon {
    flex: 0 0 24px;
}

.profilefeed-latest-details {
    flex: 1 1 auto;
    min-width: 0;
}

.shinsei-sidebar-section .profilefeed-latest-title {
    margin: 0 0 8px !important;
    color: #d97c63 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
}

.profilefeed-latest-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.profilefeed-latest-item {
    margin: 0 !important;
    padding: 7px 0 !important;
    border-bottom: 1px solid rgba(217, 124, 99, 0.12);
    list-style: none !important;
}

.profilefeed-latest-item:first-child {
    padding-top: 0 !important;
}

.profilefeed-latest-item:last-child {
    padding-bottom: 0 !important;
    border-bottom: 0;
}

.profilefeed-latest-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    margin-bottom: 2px;
}

.profilefeed-latest-author {
    min-width: 0;
    overflow: hidden;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    text-decoration: none !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profilefeed-latest-author:hover {
    opacity: 0.76;
}

.profilefeed-latest-time {
    flex: 0 0 auto;
    max-width: 95px;
    overflow: hidden;
    color: rgba(163, 156, 148, 0.58);
    font-size: 8.5px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profilefeed-latest-excerpt {
    display: -webkit-box;
    overflow: hidden;
    color: #b4aca4 !important;
    font-size: 10.5px !important;
    font-weight: 500 !important;
    line-height: 1.42 !important;
    text-decoration: none !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.profilefeed-latest-excerpt:hover {
    color: #e8dfd5 !important;
}

.profilefeed-latest-empty {
    margin: 0 !important;
    padding: 0 !important;
    color: rgba(163, 156, 148, 0.72);
    font-size: 10.5px;
    line-height: 1.45;
    list-style: none !important;
}


/* ================================================================
   0.4.0 — Cross-profile updates, posting privacy, and comment BBCode controls
   ================================================================ */
.profilefeed-update-settings-modal[hidden] {
    display: none !important;
}

.profilefeed-update-settings-modal {
    position: fixed;
    inset: 0;
    z-index: 10070;
    display: grid;
    place-items: center;
    padding: 20px;
}

.profilefeed-update-settings-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .74);
    backdrop-filter: blur(5px);
}

.profilefeed-update-settings-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(620px, 100%);
    max-height: min(760px, calc(100vh - 40px));
    overflow-y: auto;
    border: 1px solid rgba(159, 82, 54, .48);
    border-radius: 12px;
    background: #1b1815;
    box-shadow: 0 22px 65px rgba(0, 0, 0, .58);
}

.profilefeed-update-settings-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid rgba(217, 124, 99, .28);
    border-radius: 50%;
    background: rgba(12, 11, 10, .52);
    color: rgba(237, 225, 218, .68);
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
}

.profilefeed-update-settings-modal__close:hover {
    color: #fff;
    border-color: rgba(217, 124, 99, .58);
}

.profilefeed-update-settings-modal__header {
    padding: 22px 58px 17px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.profilefeed-update-settings-modal__header > span {
    display: block;
    margin-bottom: 6px;
    color: #d97c63;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.profilefeed-update-settings-modal__header h3 {
    margin: 0;
    color: #f0e7e1;
    font-size: 20px;
    line-height: 1.2;
}

.profilefeed-update-settings-modal__header p {
    margin: 7px 0 0;
    color: rgba(220, 210, 202, .58);
    font-size: 11px;
    line-height: 1.5;
}

.profilefeed-update-settings-form {
    display: grid;
    gap: 17px;
    padding: 20px 22px 22px;
}

.profilefeed-update-settings-toggle {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid rgba(255, 255, 255, .075);
    border-radius: 9px;
    background: rgba(10, 9, 8, .24);
    cursor: pointer;
}

.profilefeed-update-settings-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.profilefeed-update-settings-toggle__control {
    position: relative;
    width: 42px;
    height: 23px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    background: #12100e;
    transition: background-color .16s ease, border-color .16s ease;
}

.profilefeed-update-settings-toggle__control::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: rgba(233, 223, 216, .6);
    transition: transform .16s ease, background-color .16s ease;
}

.profilefeed-update-settings-toggle input:checked + .profilefeed-update-settings-toggle__control {
    border-color: rgba(217, 124, 99, .62);
    background: rgba(159, 72, 45, .42);
}

.profilefeed-update-settings-toggle input:checked + .profilefeed-update-settings-toggle__control::after {
    transform: translateX(19px);
    background: #e29a82;
}

.profilefeed-update-settings-toggle strong,
.profilefeed-update-settings-field > span,
.profilefeed-update-settings-current > strong {
    display: block;
    color: #e8ddd7;
    font-size: 11px;
    font-weight: 700;
}

.profilefeed-update-settings-toggle small,
.profilefeed-update-settings-field small {
    display: block;
    margin-top: 4px;
    color: rgba(217, 207, 199, .5);
    font-size: 9px;
    line-height: 1.45;
}

.profilefeed-update-settings-field {
    display: grid;
    gap: 7px;
}

.profilefeed-update-settings-field textarea {
    min-height: 116px;
    resize: vertical;
    background: #171513;
    border-color: rgba(217, 124, 99, .18);
}

.profilefeed-update-settings-current {
    display: grid;
    gap: 8px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, .07);
}

.profilefeed-update-settings-current p {
    margin: 0;
    color: rgba(214, 204, 196, .46);
    font-size: 10px;
}

.profilefeed-update-settings-current__list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.profilefeed-update-settings-current__list > span {
    padding: 5px 8px;
    border: 1px solid rgba(255, 255, 255, .075);
    border-radius: 7px;
    background: rgba(10, 9, 8, .28);
    font-size: 9px;
}

.profilefeed-update-settings-form__footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 4px;
}

/* Expandable BBCode strip on each comment form. */
.profilefeed-comment-editor {
    display: grid;
    gap: 7px;
}

.profilefeed-comment-toolbar[hidden] {
    display: none !important;
}

.profilefeed-comment-toolbar {
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 8px;
    background: rgba(12, 11, 10, .32);
}

.profilefeed-comment-toolbar__buttons {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px !important;
}

.profilefeed-comment-toolbar__buttons button,
.profilefeed-comment-toolbar__buttons select {
    min-height: 30px;
}

.profilefeed-comment-form__tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.profilefeed-comment-bbcode-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 7px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: rgba(220, 211, 204, .5);
    font-size: 9px;
    font-weight: 700;
    cursor: pointer;
}

.profilefeed-comment-bbcode-toggle:hover,
.profilefeed-comment-bbcode-toggle.is-active {
    background: rgba(217, 124, 99, .09);
    color: #dd8a70;
}

.profilefeed-comment-bbcode-toggle span {
    font-family: monospace;
    font-size: 10px;
}

.profilefeed-comment-disabled {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 12px;
    padding: 9px 2px 0;
    border-top: 1px solid rgba(255, 255, 255, .065);
    color: rgba(215, 205, 197, .42);
    font-size: 9.5px;
}

.profilefeed-comment-toolbar-source {
    display: none !important;
}

@media (max-width: 600px) {
    .profilefeed-update-settings-modal {
        padding: 10px;
    }

    .profilefeed-update-settings-modal__dialog {
        max-height: calc(100vh - 20px);
    }

    .profilefeed-update-settings-modal__header,
    .profilefeed-update-settings-form {
        padding-left: 15px;
        padding-right: 15px;
    }

    .profilefeed-update-settings-form__footer {
        flex-direction: column-reverse;
    }

    .profilefeed-update-settings-form__footer .button {
        width: 100%;
    }

    .profilefeed-comment-form__footer {
        align-items: flex-end;
    }

    .profilefeed-comment-form__tools > span {
        display: none;
    }
}


/* Cross-profile update route and visitor composer. */
.profilefeed-update__route {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.profilefeed-update__route-arrow {
    color: rgba(217, 124, 99, .48);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.profilefeed-update__target {
    min-width: 0;
    color: rgba(224, 215, 208, .68);
    font-size: inherit;
    font-weight: 650;
}

.profilefeed-update__target a {
    color: inherit;
    text-decoration: none;
}

.profilefeed-update__target a:hover {
    color: #e19a83;
}

.profilefeed-composer__heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 12px;
}

.profilefeed-composer__heading h3 {
    margin: 0;
}

.profilefeed-composer__heading > span {
    color: rgba(213, 204, 197, .46);
    font-size: 9px;
}

.profilefeed-composer--visitor {
    border-color: rgba(217, 124, 99, .16);
}

.profilefeed-posting-disabled {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 15px;
    color: rgba(218, 208, 200, .54);
}

.profilefeed-posting-disabled > span {
    color: rgba(217, 124, 99, .54);
    font-size: 18px;
}

.profilefeed-posting-disabled strong {
    display: block;
    color: rgba(235, 226, 220, .72);
    font-size: 10px;
}

.profilefeed-posting-disabled p {
    margin: 3px 0 0;
    font-size: 9px;
    line-height: 1.4;
}


/* ================================================================
   0.4.1 — BBVideo popup must dim, not blur, the Profile Feed
   ================================================================ */

/*
 * Several BBVideo/custom-BBCode popup implementations use either phpBB's
 * #darken layer, a native dialog backdrop, or their own modal backdrop.
 * On the feed page those layers could stack with cloned comment toolbars,
 * making the complete screen heavily blurred.
 */
html.profilefeed-bbvideo-popup-active #darken,
html.profilefeed-bbvideo-popup-active #darkenwrapper,
html.profilefeed-bbvideo-popup-active [class*="bbvideo"][class*="backdrop"],
html.profilefeed-bbvideo-popup-active [class*="video-popup"][class*="backdrop"],
html.profilefeed-bbvideo-popup-active [class*="video-modal"][class*="backdrop"],
html.profilefeed-bbvideo-popup-active [class*="modal-backdrop"],
html.profilefeed-bbvideo-popup-active [class*="popup-backdrop"],
html.profilefeed-bbvideo-popup-active [class*="dialog-backdrop"],
html.profilefeed-bbvideo-popup-active .profilefeed-bbvideo-no-blur {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    filter: none !important;
}

/* Some popup scripts blur the page wrapper itself rather than the backdrop. */
html.profilefeed-bbvideo-popup-active body,
html.profilefeed-bbvideo-popup-active #page-body,
html.profilefeed-bbvideo-popup-active #page-header,
html.profilefeed-bbvideo-popup-active #page-footer,
html.profilefeed-bbvideo-popup-active .profilefeed-page {
    filter: none !important;
}

/* Native <dialog> implementations. */
html.profilefeed-bbvideo-popup-active dialog::backdrop {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    background: rgba(5, 4, 4, 0.72);
}

/*
 * Do not change the extension's own cover/background/privacy modal design.
 * Those backdrops are intentionally independent from the BBVideo fix.
 */
html.profilefeed-bbvideo-popup-active .profilefeed-cover-modal__backdrop,
html.profilefeed-bbvideo-popup-active .profilefeed-update-settings-modal__backdrop {
    filter: none !important;
}

/* ================================================================
   0.5.0 — avatar appearance, friends shortcuts and feed discoverability
   ================================================================ */

.profilefeed-page.has-friends-widget {
    max-width: 1190px;
}

/* Give the composer title, BBCode controls and textarea room to breathe. */
.profilefeed-composer__heading {
    margin-bottom: 18px;
}

.profilefeed-editor #format-buttons,
.profilefeed-editor .format-buttons {
    margin-bottom: 13px !important;
}

.profilefeed-editor textarea.inputbox {
    margin-top: 8px !important;
}

.profilefeed-comment {
    scroll-margin-top: 96px;
}

/* Avatar shapes use the same variables in the saved hero and live modal preview. */
.profilefeed-hero__avatar,
.profilefeed-avatar-preview {
    --pf-avatar-stroke-color: #CD7058;
    --pf-avatar-stroke-width: 3px;
}

.profilefeed-hero__avatar img,
.profilefeed-avatar-preview img {
    box-sizing: border-box;
    border: var(--pf-avatar-stroke-width) solid var(--pf-avatar-stroke-color) !important;
    transition: width .18s ease, height .18s ease, border-radius .18s ease, border-width .18s ease;
}

.profilefeed-hero__avatar.is-stroke-disabled img,
.profilefeed-avatar-preview.is-stroke-disabled img {
    border: 0 !important;
}

.profilefeed-avatar-shape--circle img {
    border-radius: 50% !important;
}

.profilefeed-avatar-shape--square img {
    border-radius: 9px !important;
}

.profilefeed-avatar-shape--original img {
    width: 58px !important;
    height: 101px !important;
    border-radius: 8px !important;
    object-fit: cover;
}

.profilefeed-hero--expanded .profilefeed-avatar-shape--original img {
    width: 64px !important;
    height: 111px !important;
}

/* Avatar appearance modal. */
.profilefeed-avatar-modal[hidden] {
    display: none !important;
}

.profilefeed-avatar-modal {
    position: fixed;
    inset: 0;
    z-index: 10075;
    display: grid;
    place-items: center;
    padding: 20px;
}

.profilefeed-avatar-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .74);
    backdrop-filter: blur(5px);
}

.profilefeed-avatar-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(590px, 100%);
    max-height: min(760px, calc(100vh - 40px));
    overflow-y: auto;
    color: #e8ddd7;
    border: 1px solid rgba(159, 82, 54, .48);
    border-radius: 12px;
    background: #1b1815;
    box-shadow: 0 22px 65px rgba(0, 0, 0, .58);
}

.profilefeed-avatar-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 34px;
    height: 34px;
    padding: 0;
    color: rgba(237, 225, 218, .68);
    background: rgba(12, 11, 10, .52);
    border: 1px solid rgba(217, 124, 99, .28);
    border-radius: 50%;
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
}

.profilefeed-avatar-modal__header {
    padding: 22px 58px 17px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.profilefeed-avatar-modal__header > span {
    display: block;
    margin-bottom: 6px;
    color: #d97c63;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.profilefeed-avatar-modal__header h3 {
    margin: 0;
    color: #f0e7e1;
    font-size: 20px;
}

.profilefeed-avatar-modal__header p {
    margin: 7px 0 0;
    color: rgba(220, 210, 202, .58);
    font-size: 11px;
    line-height: 1.5;
}

.profilefeed-avatar-form {
    display: grid;
    gap: 17px;
    padding: 20px 22px 22px;
}

.profilefeed-avatar-preview-wrap {
    display: grid;
    place-items: center;
    min-height: 132px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 10px;
    background: rgba(8, 7, 6, .24);
}

.profilefeed-avatar-preview img {
    display: block;
    width: 82px;
    height: 82px;
    object-fit: cover;
    background: var(--pf-surface, #171512);
    box-shadow: 0 8px 24px rgba(0,0,0,.42);
}

.profilefeed-avatar-preview.profilefeed-avatar-shape--original img {
    width: 64px !important;
    height: 111px !important;
}

.profilefeed-avatar-shapes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
}

.profilefeed-avatar-shapes legend {
    grid-column: 1 / -1;
    margin-bottom: 2px;
    color: #e8ddd7;
    font-size: 11px;
    font-weight: 700;
}

.profilefeed-avatar-shapes label {
    position: relative;
    display: block;
    cursor: pointer;
}

.profilefeed-avatar-shapes input {
    position: absolute;
    opacity: 0;
}

.profilefeed-avatar-shapes label > span {
    display: grid;
    gap: 3px;
    height: 100%;
    padding: 10px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 8px;
    background: rgba(10,9,8,.25);
}

.profilefeed-avatar-shapes input:checked + span {
    border-color: rgba(217,124,99,.58);
    background: rgba(159,72,45,.18);
}

.profilefeed-avatar-shapes strong {
    color: #eadfd9;
    font-size: 10px;
}

.profilefeed-avatar-shapes small {
    color: rgba(217,207,199,.48);
    font-size: 8px;
    line-height: 1.35;
}

.profilefeed-avatar-stroke-controls {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 14px;
}

.profilefeed-avatar-stroke-controls label {
    display: grid;
    gap: 7px;
    color: #e8ddd7;
    font-size: 10px;
    font-weight: 700;
}

.profilefeed-avatar-stroke-controls input[type="color"] {
    width: 100%;
    min-height: 38px;
    padding: 3px;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 7px;
    background: #12100e;
}

.profilefeed-avatar-stroke-controls input[type="range"] {
    width: 100%;
}

.profilefeed-avatar-form__footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Main stream + optional own-feed friends rail. */
.profilefeed-main-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.profilefeed-main-layout.has-friends-widget {
    grid-template-columns: minmax(0, 1fr) 194px;
}

.profilefeed-stream {
    min-width: 0;
}

.profilefeed-friends-widget {
    position: sticky;
    top: 18px;
    box-sizing: border-box;
    margin: 0;
    padding: 12px;
    color: var(--pf-text);
    background: rgba(23, 21, 18, .96);
    border: 1px solid var(--pf-line);
    border-radius: 10px;
}

.profilefeed-friends-widget__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 9px;
    margin-bottom: 5px;
    border-bottom: 1px solid rgba(255,255,255,.065);
}

.profilefeed-friends-widget__header span {
    color: #df8b73;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.profilefeed-friends-widget__header strong {
    color: rgba(226,217,210,.52);
    font-size: 9px;
}

.profilefeed-friends-widget__list {
    display: grid;
    gap: 1px;
}

.profilefeed-friends-widget__friend {
    display: block;
    min-width: 0;
    padding: 7px 6px;
    overflow: hidden;
    color: #ddd4cd;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 650;
    text-decoration: none !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profilefeed-friends-widget__friend:hover {
    color: #fff;
    background: rgba(217,124,99,.09);
}

.profilefeed-friends-widget__empty {
    margin: 8px 3px 3px;
    color: rgba(216,207,199,.42);
    font-size: 9px;
    line-height: 1.45;
}

/* Feed shortcut beside the standard post Contact row. */
.postprofile dd.profile-contact,
.postprofile dd.profilefeed-post-feed-link {
    display: inline-flex !important;
    align-items: center;
    vertical-align: middle;
}

.postprofile dd.profilefeed-post-feed-link {
    gap: 5px;
    width: auto !important;
    margin-left: 4px !important;
}

.profilefeed-post-feed-link__divider {
    color: rgba(255,255,255,.28);
    font-size: 9px;
}

.profilefeed-post-feed-link a {
    color: rgba(226,218,212,.68) !important;
    font-size: 9px !important;
    font-weight: 850 !important;
    letter-spacing: .14em;
    line-height: 1;
    text-decoration: none !important;
}

.profilefeed-post-feed-link a:hover {
    color: #fff !important;
}

@media (max-width: 1000px) {
    .profilefeed-page.has-friends-widget {
        max-width: 980px;
    }

    .profilefeed-main-layout.has-friends-widget {
        grid-template-columns: minmax(0, 1fr);
    }

    .profilefeed-friends-widget {
        position: static;
        order: -1;
    }

    .profilefeed-friends-widget__list {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    }
}

@media (max-width: 600px) {
    .profilefeed-avatar-modal {
        padding: 10px;
    }

    .profilefeed-avatar-modal__dialog {
        max-height: calc(100vh - 20px);
    }

    .profilefeed-avatar-modal__header,
    .profilefeed-avatar-form {
        padding-left: 15px;
        padding-right: 15px;
    }

    .profilefeed-avatar-shapes,
    .profilefeed-avatar-stroke-controls {
        grid-template-columns: 1fr;
    }

    .profilefeed-avatar-form__footer {
        flex-direction: column-reverse;
    }

    .profilefeed-avatar-form__footer .button {
        width: 100%;
    }
}

/* Keep BBVideo dimming logic from treating the avatar editor as a video popup. */
html.profilefeed-bbvideo-popup-active .profilefeed-avatar-modal__backdrop {
    filter: none !important;
}

/* ================================================================
   0.5.1 — Zeina integration fixes + per-feed update-card tint
   ================================================================ */

/*
 * The site header logo is injected into its own stacking context by the
 * forum's global custom JS. Profile Feed dialogs are portalled to <body>
 * by profilefeed.js; give those body-level dialogs a guaranteed layer above
 * the header/search effects and restore the feed design variables they used
 * to inherit from .profilefeed-page before being portalled.
 */
.profilefeed-cover-modal,
.profilefeed-update-settings-modal,
.profilefeed-avatar-modal {
    --pf-accent: #a44635;
    --pf-accent-bright: #c8664e;
    --pf-accent-soft: rgba(164, 70, 53, 0.16);
    --pf-surface: #171512;
    --pf-surface-raised: #1d1916;
    --pf-field: #181512;
    --pf-field-focus: #201a17;
    --pf-line: rgba(164, 117, 96, 0.24);
    --pf-line-strong: rgba(164, 117, 96, 0.38);
    --pf-text: #e0d9d4;
    --pf-muted: rgba(214, 204, 198, 0.55);
}

body > .profilefeed-cover-modal {
    z-index: 1001005 !important;
}

body > .profilefeed-update-settings-modal {
    z-index: 1001006 !important;
}

body > .profilefeed-avatar-modal {
    z-index: 1001007 !important;
}

/* Make the injected Feed row indistinguishable from Zeina's native rows. */
body .zn-dropdown-menu.dropdown li.profilefeed-navbar-feed-link {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    list-style: none !important;
}

body .zn-dropdown-menu.dropdown li.profilefeed-navbar-feed-link > a.profilefeed-navbar-feed-link__anchor,
body a.profilefeed-navbar-feed-link__anchor.dropdown-item {
    display: flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 9px 14px !important;
    color: #d8cec4 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 6px !important;
    font: inherit !important;
    line-height: 1.35 !important;
    letter-spacing: normal !important;
    text-align: left !important;
    text-transform: none !important;
    text-decoration: none !important;
}

body .zn-dropdown-menu.dropdown li.profilefeed-navbar-feed-link > a.profilefeed-navbar-feed-link__anchor:hover,
body .zn-dropdown-menu.dropdown li.profilefeed-navbar-feed-link > a.profilefeed-navbar-feed-link__anchor:focus {
    color: #f0e8df !important;
    background: rgba(217, 124, 99, 0.14) !important;
}

/*
 * The friends rail must never participate in the 980px feed's width.
 * On wide screens it lives in the right gutter; where the gutter is not wide
 * enough it falls below the stream rather than squeezing or re-centering it.
 */
.profilefeed-page.has-friends-widget {
    max-width: 980px !important;
}

.profilefeed-main-layout,
.profilefeed-main-layout.has-friends-widget {
    position: relative;
    display: block;
    grid-template-columns: none;
    gap: 0;
}

.profilefeed-friends-widget {
    position: static;
    width: auto;
    margin: 16px 0 0;
}

@media (min-width: 1400px) {
    .profilefeed-friends-widget {
        position: absolute;
        top: 0;
        left: calc(100% + 16px);
        width: 194px;
        margin: 0;
    }
}

@media (max-width: 1399px) {
    .profilefeed-friends-widget__list {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    }
}

/*
 * The template event sits after Zeina's Contact <dd>. profilefeed_global.js
 * moves its link into that existing row so Contact, the PM icon and FEED are
 * one compact line regardless of Zeina's dl/grid rules.
 */
body .postprofile dd.profile-contact {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 0 !important;
    width: auto !important;
}

body dd.profilefeed-post-feed-link[hidden] {
    display: none !important;
}

.profilefeed-post-feed-inline {
    display: inline-flex !important;
    align-items: center !important;
    flex: 0 0 auto;
    gap: 6px;
    margin-left: 6px;
    white-space: nowrap;
    vertical-align: middle;
}

.profilefeed-post-feed-inline__divider {
    color: rgba(255, 255, 255, .26);
    font-size: 9px;
    line-height: 1;
}

.profilefeed-post-feed-inline a {
    color: rgba(226, 218, 212, .68) !important;
    font-size: 9px !important;
    font-weight: 850 !important;
    letter-spacing: .14em !important;
    line-height: 1 !important;
    text-decoration: none !important;
}

.profilefeed-post-feed-inline a:hover {
    color: #fff !important;
}

/* Per-profile card tint. Updates are always tinted; the composer can opt in. */
.profilefeed-page {
    --pf-feed-card-bg: #171512;
    --pf-feed-card-text: #e0d9d4;
    --pf-feed-card-muted: rgba(214, 204, 198, .55);
    --pf-feed-card-line: rgba(164, 117, 96, .24);
    --pf-feed-card-subtle: rgba(127, 127, 127, .035);
    --pf-composer-card-bg: #171512;
    --pf-composer-card-text: #e0d9d4;
    --pf-composer-card-muted: rgba(214, 204, 198, .55);
    --pf-composer-card-line: rgba(164, 117, 96, .24);
}

.profilefeed-page.profilefeed-panels--dark-text {
    --pf-feed-card-text: #171411;
    --pf-feed-card-muted: rgba(23, 20, 17, .64);
    --pf-feed-card-line: rgba(20, 17, 14, .16);
    --pf-feed-card-subtle: rgba(0, 0, 0, .045);
}

.profilefeed-page.profilefeed-composer-tint-enabled {
    --pf-composer-card-bg: var(--pf-feed-card-bg);
    --pf-composer-card-text: var(--pf-feed-card-text);
    --pf-composer-card-muted: var(--pf-feed-card-muted);
    --pf-composer-card-line: var(--pf-feed-card-line);
}

body .profilefeed-page .profilefeed-update.panel {
    color: var(--pf-feed-card-text) !important;
    background: var(--pf-feed-card-bg) !important;
    border-color: var(--pf-feed-card-line) !important;
}

body .profilefeed-page .profilefeed-composer.panel {
    color: var(--pf-composer-card-text) !important;
    background: var(--pf-composer-card-bg) !important;
    border-color: var(--pf-composer-card-line) !important;
}

body .profilefeed-page .profilefeed-update > .profilefeed-message,
body .profilefeed-page .profilefeed-update .profilefeed-comment .profilefeed-message,
body .profilefeed-page .profilefeed-update .profilefeed-comment-form__footer > span,
body .profilefeed-page .profilefeed-update .profilefeed-update__target {
    color: var(--pf-feed-card-text) !important;
}

body .profilefeed-page .profilefeed-update .profilefeed-update__identity time,
body .profilefeed-page .profilefeed-update .profilefeed-comment__meta time,
body .profilefeed-page .profilefeed-update .profilefeed-comment-heading,
body .profilefeed-page .profilefeed-update .profilefeed-comment-delete,
body .profilefeed-page .profilefeed-update .profilefeed-comment-bbcode-toggle,
body .profilefeed-page .profilefeed-update .profilefeed-comment-disabled {
    color: var(--pf-feed-card-muted) !important;
}

body .profilefeed-page .profilefeed-update .profilefeed-update__header,
body .profilefeed-page .profilefeed-update .profilefeed-comment-heading,
body .profilefeed-page .profilefeed-update .profilefeed-comment,
body .profilefeed-page .profilefeed-update .profilefeed-comment-disabled {
    border-color: var(--pf-feed-card-line) !important;
}

body .profilefeed-page .profilefeed-update .profilefeed-comment-heading {
    background: var(--pf-feed-card-subtle) !important;
}

body .profilefeed-page .profilefeed-composer .profilefeed-composer__heading h3,
body .profilefeed-page .profilefeed-composer .profilefeed-composer__heading > span {
    color: var(--pf-composer-card-text) !important;
}

body .profilefeed-page .profilefeed-composer .profilefeed-composer__heading > span,
body .profilefeed-page .profilefeed-composer .profilefeed-form-hint {
    color: var(--pf-composer-card-muted) !important;
}

/* Keep dark editors legible even when their surrounding card is very light. */
body .profilefeed-page.profilefeed-panels--dark-text .profilefeed-update textarea.inputbox,
body .profilefeed-page.profilefeed-panels--dark-text .profilefeed-edit-form,
body .profilefeed-page.profilefeed-panels--dark-text .profilefeed-bbcode-preview,
body .profilefeed-page.profilefeed-composer-tint-enabled.profilefeed-panels--dark-text .profilefeed-composer textarea.inputbox {
    --pf-text: #e0d9d4;
    --pf-muted: rgba(214, 204, 198, .55);
    --pf-line: rgba(164, 117, 96, .24);
    --pf-line-strong: rgba(164, 117, 96, .38);
}

/* Edit Feed: combined page-background + card-colour controls. */
.profilefeed-panel-tint {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--pf-line);
}

.profilefeed-panel-tint__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.profilefeed-panel-tint__heading strong,
.profilefeed-panel-tint__heading small {
    display: block;
}

.profilefeed-panel-tint__heading strong {
    color: var(--pf-text);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
}

.profilefeed-panel-tint__heading small {
    max-width: 650px;
    margin-top: 4px;
    color: var(--pf-muted);
    font-size: 9px;
    line-height: 1.45;
}

.profilefeed-panel-tint__reset {
    flex: 0 0 auto;
    padding: 5px 8px !important;
    font-size: 9px !important;
}

.profilefeed-panel-tint__controls {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
}

.profilefeed-panel-tint__controls > label {
    display: grid;
    align-content: start;
    gap: 7px;
    padding: 11px;
    color: var(--pf-text);
    background: rgba(12, 11, 10, .32);
    border: 1px solid var(--pf-line);
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
}

.profilefeed-panel-tint__controls input[type="color"] {
    box-sizing: border-box;
    width: 100%;
    height: 48px;
    padding: 4px;
    background: #100e0d;
    border: 1px solid var(--pf-line-strong);
    border-radius: 8px;
    cursor: pointer;
}

.profilefeed-panel-tint__preview {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-height: 74px;
    padding: 13px 15px;
    color: #e0d9d4;
    background: var(--pf-tint-preview-bg, #171512);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 10px;
    transition: color .16s ease, background-color .16s ease, border-color .16s ease;
}

.profilefeed-panel-tint__preview.uses-dark-text {
    color: #171411;
    border-color: rgba(0, 0, 0, .16);
}

.profilefeed-panel-tint__preview strong {
    color: inherit;
    font-size: 11px;
}

.profilefeed-panel-tint__preview span {
    color: inherit;
    opacity: .66;
    font-size: 9px;
}

.profilefeed-panel-tint__contrast {
    margin: 8px 0 0;
    color: var(--pf-muted);
    font-size: 9px;
}

@media (max-width: 600px) {
    .profilefeed-panel-tint__heading {
        display: grid;
    }

    .profilefeed-panel-tint__reset {
        justify-self: start;
    }

    .profilefeed-panel-tint__controls {
        grid-template-columns: 1fr;
    }
}

/* Remaining inline comment controls also follow automatic card contrast. */
body .profilefeed-page .profilefeed-comment-form__footer span,
body .profilefeed-page .profilefeed-comment-bbcode-toggle,
body .profilefeed-page .profilefeed-comment-disabled {
    color: var(--pf-feed-card-muted) !important;
}

body .profilefeed-page .profilefeed-comment-disabled {
    border-color: var(--pf-feed-card-line) !important;
}

/* ================================================================
   0.5.2 — compact friend activity + single-line post Contact shortcut
   ================================================================ */

/* Friend names are deliberately quieter than feed authors on the main page. */
.profilefeed-friends-widget__friend {
    display: block;
    min-width: 0;
    padding: 7px 5px 8px;
    overflow: hidden;
    border-radius: 6px;
    white-space: normal;
}

.profilefeed-friends-widget__friend:hover {
    background: rgba(217,124,99,.055);
}

.profilefeed-friends-widget__name {
    display: block;
    min-width: 0;
    overflow: hidden;
    font-size: 9px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    text-decoration: none !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profilefeed-friends-widget__name:hover {
    opacity: .78;
}

.profilefeed-friends-widget__updates {
    display: grid;
    gap: 0;
    margin-top: 4px;
    border-top: 1px solid rgba(255,255,255,.045);
}

.profilefeed-friends-widget__update {
    display: block;
    min-width: 0;
    padding: 4px 1px 3px;
    overflow: hidden;
    color: rgba(218,209,202,.48) !important;
    border-bottom: 1px solid rgba(255,255,255,.035);
    font-size: 7.75px !important;
    font-weight: 500 !important;
    line-height: 1.3 !important;
    text-decoration: none !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profilefeed-friends-widget__update:last-child {
    border-bottom: 0;
    padding-bottom: 1px;
}

.profilefeed-friends-widget__update:hover {
    color: rgba(240,232,226,.86) !important;
}

/*
 * Zeina can give Contact children block/flex-column utility styles. Force the
 * entire label + message trigger + FEED shortcut into one compact horizontal
 * line and shrink only the message trigger on post profiles.
 */
body .postprofile dd.profile-contact {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    min-width: 0 !important;
    gap: 0 !important;
    white-space: nowrap !important;
}

body .postprofile dd.profile-contact > strong {
    flex: 0 0 auto !important;
    margin-right: 4px !important;
}

body .postprofile dd.profile-contact > .dropdown-container,
body .postprofile dd.profile-contact > div.dropdown-container {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    width: 16px !important;
    min-width: 16px !important;
    max-width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    align-items: center !important;
    justify-content: center !important;
}

body .postprofile dd.profile-contact .dropdown-trigger {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 16px !important;
    min-width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
}

body .postprofile dd.profile-contact .dropdown-trigger .icon,
body .postprofile dd.profile-contact .dropdown-trigger i,
body .postprofile dd.profile-contact .fa-commenting-o {
    width: 12px !important;
    height: 12px !important;
    font-size: 12px !important;
    line-height: 12px !important;
}

body .postprofile dd.profile-contact .profilefeed-post-feed-inline {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 0 0 5px !important;
    gap: 4px !important;
    white-space: nowrap !important;
}

body .postprofile dd.profile-contact .profilefeed-post-feed-inline__divider {
    font-size: 7px !important;
}

body .postprofile dd.profile-contact .profilefeed-post-feed-inline a {
    font-size: 8px !important;
    letter-spacing: .11em !important;
    line-height: 1 !important;
}


/* ================================================================
   0.5.3 — intentional standalone post-profile FEED shortcut
   ================================================================ */

/*
 * Zeina's narrow post-profile column can wrap injected content even when the
 * Contact row is forced to nowrap. Keep FEED as a deliberate second row so it
 * looks intentional instead of broken.
 */
body .postprofile dd.profilefeed-post-feed-link {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 3px 0 0 5px !important;
    padding: 0 !important;
    line-height: 1 !important;
    vertical-align: top !important;
}

/* Old cached 0.5.2 markup/JS may briefly leave a divider behind. Never show it. */
body .postprofile .profilefeed-post-feed-link__divider,
body .postprofile .profilefeed-post-feed-inline__divider {
    display: none !important;
}

body .postprofile dd.profilefeed-post-feed-link a,
body .postprofile .profilefeed-post-feed-inline a {
    color: rgba(232, 223, 213, .88) !important;
    opacity: 1 !important;
    font-size: 10px !important;
    font-weight: 850 !important;
    letter-spacing: .14em !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
    text-transform: uppercase !important;
}

body .postprofile dd.profilefeed-post-feed-link a:hover,
body .postprofile .profilefeed-post-feed-inline a:hover {
    color: #d97c63 !important;
    opacity: 1 !important;
}

/*
 * Cache-safe fallback: if an older copy of profilefeed_global.js has already
 * moved FEED inside Contact, make that injected span behave like a clear
 * second line too, and remove its old bullet.
 */
body .postprofile dd.profile-contact.profilefeed-contact-has-feed {
    flex-wrap: wrap !important;
}

body .postprofile dd.profile-contact .profilefeed-post-feed-inline {
    display: block !important;
    flex: 0 0 100% !important;
    width: 100% !important;
    margin: 3px 0 0 5px !important;
    padding: 0 !important;
    line-height: 1 !important;
}

/* ================================================================
   0.5.4 — HEX-first colour controls + opacity/composer tint options
   ================================================================ */
.profilefeed-panel-tint__controls {
    grid-template-columns: minmax(250px, 310px) minmax(0, 1fr);
}

.profilefeed-color-editor {
    display: grid;
    gap: 8px;
    padding: 11px;
    color: var(--pf-text, #e8ddd7);
    background: rgba(12, 11, 10, .32);
    border: 1px solid var(--pf-line, rgba(255,255,255,.1));
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
}

.profilefeed-color-editor__label {
    color: inherit;
    font-size: 10px;
    font-weight: 800;
}

.profilefeed-color-editor__tabs {
    display: inline-flex;
    justify-self: start;
    padding: 2px;
    background: rgba(0, 0, 0, .22);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 7px;
}

.profilefeed-color-editor__tabs button {
    min-width: 46px;
    padding: 5px 8px;
    color: rgba(230,220,214,.52);
    background: transparent;
    border: 0;
    border-radius: 5px;
    font: inherit;
    font-size: 9px;
    cursor: pointer;
}

.profilefeed-color-editor__tabs button.is-active {
    color: #f0e6df;
    background: rgba(217,124,99,.18);
}

.profilefeed-color-editor__row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 8px;
    align-items: end;
}

.profilefeed-color-editor__row > input[type="color"] {
    box-sizing: border-box !important;
    width: 42px !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 2px !important;
    background: #100e0d !important;
    border: 1px solid rgba(255,255,255,.12) !important;
    border-radius: 7px !important;
    cursor: pointer;
}

.profilefeed-color-editor__panel {
    min-width: 0;
}

.profilefeed-color-editor__panel[hidden] {
    display: none !important;
}

.profilefeed-color-editor__panel label {
    display: grid;
    gap: 4px;
    min-width: 0;
    color: rgba(230,220,214,.62);
    font-size: 8px;
    font-weight: 800;
}

.profilefeed-color-editor__panel input[type="text"],
.profilefeed-color-editor__panel input[type="number"] {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 34px;
    padding: 6px 8px;
    color: #eee4de;
    background: #12100e;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 6px;
    font: 700 10px/1 monospace;
    outline: 0;
}

.profilefeed-color-editor__panel input:focus {
    border-color: rgba(217,124,99,.58);
    box-shadow: 0 0 0 2px rgba(217,124,99,.10);
}

.profilefeed-color-editor__panel[data-profilefeed-color-panel="rgb"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.profilefeed-color-editor__panel[data-profilefeed-color-panel="rgb"]:not([hidden]) {
    display: grid;
}

.profilefeed-panel-tint__opacity {
    display: grid;
    gap: 7px;
    margin-top: 12px;
    padding: 11px 12px;
    color: var(--pf-text);
    background: rgba(12,11,10,.22);
    border: 1px solid var(--pf-line);
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
}

.profilefeed-panel-tint__opacity > span {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.profilefeed-panel-tint__opacity input[type="range"] {
    width: 100%;
}

.profilefeed-panel-tint__composer-toggle {
    margin-top: 10px;
}

.profilefeed-avatar-stroke-controls {
    grid-template-columns: minmax(250px, 310px) minmax(0, 1fr);
    align-items: end;
}

.profilefeed-avatar-stroke-controls > label {
    align-self: end;
}

.profilefeed-color-editor--avatar {
    color: #e8ddd7;
    --pf-line: rgba(255,255,255,.1);
}

@media (max-width: 600px) {
    .profilefeed-panel-tint__controls,
    .profilefeed-avatar-stroke-controls {
        grid-template-columns: 1fr;
    }
}

/* 0.5.4 exact notification destinations should clear fixed headers. */
.profilefeed-update {
    scroll-margin-top: 96px;
}
