/* =========================================================
   LOSTVERSE
   COMMUNITY STYLESHEET
   Community Feed / Post Detail / Social Interactions
   Reports / Saved Posts / Reputation / Notifications
   ========================================================= */


/* =========================================================
   01. DESIGN TOKENS
   ========================================================= */

.community-page {
    --community-navy: #142b4b;
    --community-blue: #2563eb;
    --community-blue-hover: #1d4ed8;
    --community-muted: #64748b;
    --community-border: #dbe3ee;
    --community-background: #f4f6fa;
    --community-surface: #ffffff;
    --community-soft: #f8fafc;
    --community-danger: #b91c1c;
    --community-success: #15803d;
    --community-radius: 12px;

    background: var(--community-background);
    color: var(--community-navy);
    min-height: 100vh;
}

.community-page *,
.community-page *::before,
.community-page *::after {
    box-sizing: border-box;
}

.community-page button,
.community-page input,
.community-page select,
.community-page textarea {
    font-family: inherit;
}

.community-page button,
.community-page select {
    cursor: pointer;
}

.community-page button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.community-page button:focus-visible,
.community-page a:focus-visible,
.community-page select:focus-visible,
.community-page input:focus-visible,
.community-page textarea:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 3px;
}

.community-page [hidden],
#modal [hidden] {
    display: none !important;
}


/* =========================================================
   02. PAGE CONTAINER
   ========================================================= */

.community-page .community-container {
    width: 100%;
    max-width: 1440px;
    min-width: 0;
    margin: 0 auto;
    padding: 28px 32px 0;
}

.community-page .breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    color: #64748b;
    font-size: 12px;
}

.community-page .breadcrumb a {
    color: #64748b;
    text-decoration: none;
}

.community-page .breadcrumb a:hover {
    color: #2563eb;
}

.community-page .breadcrumb svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.community-page .community-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

.community-page .community-heading h1 {
    margin: 0 0 8px;
    color: #142b4b;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -.5px;
}

.community-page .community-heading p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.8;
}

.community-page .create-post {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    gap: 9px;
    min-height: 46px;
    padding: 12px 22px;
    background: #2563eb;
    color: #ffffff;
    border: 1px solid #2563eb;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: background .18s, border-color .18s;
}

.community-page .create-post:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.community-page .create-post svg {
    width: 19px;
    height: 19px;
}


/* =========================================================
   03. SEARCH BAR
   ========================================================= */

.community-page .community-search {
    width: 100%;
    margin-bottom: 28px;
}

.community-page #search {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
    padding: 9px;
    background: #ffffff;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    transition: border-color .18s, box-shadow .18s;
}

.community-page #search:focus-within {
    border-color: #a8bfea;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .05);
}

.community-page .search-field,
.community-page .province-field {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 0 12px;
}

.community-page .search-field {
    flex: 1;
}

.community-page .province-field {
    width: 220px;
    flex-shrink: 0;
    border-left: 1px solid #e2e8f0;
}

.community-page .search-field svg,
.community-page .province-field svg {
    width: 19px;
    height: 19px;
    color: #64748b;
    flex-shrink: 0;
}

.community-page #query,
.community-page #province {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 10px 0;
    background: transparent;
    color: #142b4b;
    border: none;
    outline: none;
    font-size: 14px;
}

.community-page #query:focus,
.community-page #province:focus {
    outline: none;
}

.community-page #query::placeholder {
    color: #94a3b8;
}

.community-page .search-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 100px;
    min-height: 42px;
    padding: 10px 18px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}

.community-page .search-submit:hover {
    background: #1d4ed8;
}


/* =========================================================
   04. MAIN LAYOUT
   ========================================================= */

.community-page .community-layout {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    align-items: start;
    gap: 28px;
    width: 100%;
    min-width: 0;
}

.community-page .filter-panel {
    display: block;
    position: sticky;
    top: 85px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    max-height: calc(100vh - 105px);
    height: auto;
    margin: 0;
    padding: 20px;
    background: #ffffff;
    color: #142b4b;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.community-page .filter-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.community-page .filter-heading h2 {
    margin: 0;
    color: #142b4b;
    font-size: 17px;
    font-weight: 700;
    white-space: nowrap;
}

.community-page .filter-heading #all {
    width: auto;
    margin: 0;
    padding: 4px 0;
    background: transparent;
    color: #2563eb;
    border: none;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.community-page .filter-heading #all:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.community-page .filter-group {
    width: 100%;
    min-width: 0;
    padding: 18px 0;
    border-bottom: 1px solid #e2e8f0;
}

.community-page .filter-group:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.community-page .filter-group h3 {
    margin: 0 0 12px;
    color: #142b4b;
    font-size: 13px;
    font-weight: 600;
}


/* =========================================================
   05. TYPE FILTER
   ========================================================= */

.community-page .type-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.community-page .type-options button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    min-height: 40px;
    padding: 10px;
    background: transparent;
    color: #526078;
    border: none;
    border-radius: 7px;
    text-align: left;
    font-size: 13px;
    font-weight: 400;
    transition: background .15s, color .15s;
}

.community-page .type-options button:hover {
    background: #f5f7fb;
    color: #142b4b;
}

.community-page .type-options button.primary,
.community-page .type-options button[aria-pressed="true"] {
    background: #edf3ff;
    color: #2563eb;
    font-weight: 600;
}

.community-page .radio-dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    background: #ffffff;
    border: 1.5px solid #aeb9c8;
    border-radius: 50%;
}

.community-page .primary .radio-dot,
.community-page [aria-pressed="true"] .radio-dot {
    background: #ffffff;
    border: 4px solid #2563eb;
}


/* =========================================================
   06. CATEGORY FILTER
   ========================================================= */

.community-page #category[hidden] {
    display: none;
}

.community-page #categories {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 0;
    margin: 0;
}

.community-page #categories button {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 11px;
    width: 100%;
    min-width: 0;
    min-height: 42px;
    height: auto;
    padding: 10px;
    background: transparent;
    color: #526078;
    border: none;
    border-radius: 7px;
    text-align: left;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.6;
    transition: background .15s, color .15s;
}

.community-page #categories button svg {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
}

.community-page #categories button span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.community-page #categories button:hover {
    background: #f5f7fb;
    color: #142b4b;
}

.community-page #categories button.selected,
.community-page #categories button[aria-pressed="true"] {
    background: #edf3ff;
    color: #2563eb;
    font-weight: 600;
}


/* =========================================================
   07. SAFETY NOTE
   ========================================================= */

.community-page .safety-note {
    min-width: 0;
}

.community-page .safety-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.community-page .safety-heading h3 {
    margin: 0;
    font-size: 13px;
}

.community-page .safety-heading svg {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
    color: #2563eb;
}

.community-page .safety-note p {
    margin: 0 0 12px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.9;
}

.community-page .safety-note button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    background: transparent;
    color: #2563eb;
    border: none;
    font-size: 12px;
    font-weight: 600;
}

.community-page .safety-note button:hover {
    text-decoration: underline;
}


/* =========================================================
   08. COMMUNITY VIEW NAVIGATION
   ========================================================= */

.community-view-tabs {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    width: fit-content;
    max-width: 100%;
    margin: 0 0 24px;
    padding: 5px;
    background: #e7ecf4;
    border: none;
    border-radius: 12px;
}

.community-view-tabs a {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 10px 22px;
    background: transparent;
    color: #64748b;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 500;
    transition: background .18s, color .18s;
}

.community-view-tabs a svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

.community-view-tabs a:hover {
    color: #2563eb;
}

.community-view-tabs a.active,
.community-view-tabs a[aria-current="page"] {
    background: #ffffff;
    color: #18365f;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(15, 23, 42, .07);
}

.community-view-tabs a::after {
    display: none;
}


/* =========================================================
   09. LISTINGS HEADER
   ========================================================= */

.community-page .listings {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.community-page .listings .section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 20px;
}

.community-page .listings .section-head h2 {
    margin: 0 0 6px;
    color: #142b4b;
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -.4px;
    line-height: 1.5;
}

.community-page #result-count {
    color: #64748b;
    font-size: 12px;
}

.community-page #sort-order {
    min-height: 38px;
    padding: 8px 12px;
    background: #ffffff;
    color: #142b4b;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    font-size: 13px;
}


/* =========================================================
   10. POST GRID
   ========================================================= */

.community-page #cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 20px;
    width: 100%;
    min-width: 0;
}

.community-page #cards > .lv-loading,
.community-page #cards > .lv-error,
.community-page #cards > .lv-empty,
.community-page #cards > .loading-state,
.community-page #cards > .error-state,
.community-page #cards > .empty-state {
    grid-column: 1 / -1;
}


/* =========================================================
   11. POST CARDS
   ========================================================= */

.community-page #cards .item {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0;
    background: #ffffff;
    border: 1px solid #dfe5ee;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: none;
    transition:
        border-color .2s,
        box-shadow .2s,
        transform .2s;
}

.community-page #cards .item:hover {
    border-color: #b8c9e0;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(20, 43, 75, .07);
}

.community-page #cards .item:focus-within {
    border-color: #93b4ff;
}

.community-page #cards .item > img,
.community-page #cards .item > .post-placeholder {
    display: block;
    width: 100%;
    height: 185px;
    min-height: 185px;
    max-height: 185px;
    margin: 0;
    border-radius: 0;
    object-fit: cover;
    flex-shrink: 0;
}

.community-page #cards .item > .post-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9eef6;
    color: #94a3b8;
}

.post-placeholder svg {
    width: 48px;
    height: 48px;
}

.community-page #cards .item-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
    min-width: 0;
    padding: 16px;
}

.community-page #cards .item-body h3 {
    min-height: 0;
    margin: 0;
    color: #142b4b;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.community-page #cards .item-body h3 button {
    display: inline;
    width: auto;
    margin: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    border: none;
    font: inherit;
    text-align: left;
    overflow-wrap: anywhere;
}

.community-page #cards .item-body h3 button:hover {
    color: #2563eb;
}

.community-page #cards .item-body p {
    min-height: 0;
    margin: 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.community-page #cards .item-body small {
    display: block;
    margin: 0;
    padding: 0;
    color: #64748b;
    font-size: 11px;
    line-height: 1.6;
}


/* =========================================================
   12. POST STATUS AND AUTHOR
   ========================================================= */

.community-page .tag,
#modal .tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    gap: 5px;
    width: fit-content;
    max-width: 100%;
    margin: 0;
    padding: 5px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
}

.community-page .tag.lost,
#modal .tag.lost {
    background: #fef2f2;
    color: #b91c1c;
}

.community-page .tag.found,
#modal .tag.found {
    background: #ecfdf3;
    color: #15803d;
}

.resolved-label,
.post-status.resolved {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
    padding: 5px 9px;
    background: #dcfce7;
    color: #15803d;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.post-status.active {
    background: #eff6ff;
    color: #1d4ed8;
}

.post-status.closed {
    background: #f1f5f9;
    color: #475569;
}

.post-status.deleted {
    background: #fef2f2;
    color: #b91c1c;
}

.post-status.active,
.post-status.closed,
.post-status.deleted {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 5px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    color: #64748b;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.post-author svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.community-page #cards .post-author {
    margin: 6px 0 0;
    padding: 0;
    color: #334155;
    border: none;
    font-weight: 500;
}

.own-post-label,
.own-post-badge,
.my-post-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
    padding: 5px 9px;
    background: #edf3ff;
    color: #2563eb;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.ghost-badge,
.ghost-label,
.ghost-mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
    padding: 5px 9px;
    background: #eef2f7;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
}

.ghost-badge svg,
.ghost-label svg,
.ghost-mode-badge svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.ghost-notice,
.ghost-mode-notice {
    padding: 12px 14px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.8;
}


/* =========================================================
   13. POST MANAGEMENT
   ========================================================= */

.post-menu {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
}

.post-menu button,
.post-menu-btn,
.post-menu-trigger {
    padding: 7px 10px;
    background: #ffffff;
    color: #142b4b;
    border: 1px solid #dbe3ee;
    border-radius: 7px;
}

.community-page #cards .item > .post-manage-button {
    position: absolute;
    top: 12px;
    right: 12px;
    left: auto;
    bottom: auto;
    z-index: 10;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    min-width: 36px;
    max-width: 36px;
    height: 36px;
    min-height: 36px;

    margin: 0;
    padding: 0;

    background: #ffffff;
    color: #142b4b;
    border: 1px solid #e2e8f0;
    border-radius: 8px;

    font-size: 23px;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
    cursor: pointer;
}

.community-page #cards .item > .post-manage-button svg {
    width: 20px;
    height: 20px;
}

.community-page #cards .item > .post-manage-button:hover {
    background: #edf3ff;
    color: #2563eb;
}

.post-menu-dropdown,
.post-menu-list {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    z-index: 12;
    min-width: 160px;
    padding: 6px;
    background: #ffffff;
    border: 1px solid #dbe3ee;
    border-radius: 9px;
    box-shadow: 0 8px 24px rgba(20, 43, 75, .12);
}

.post-menu-dropdown button,
.post-menu-list button {
    display: block;
    width: 100%;
    padding: 10px;
    background: transparent;
    color: #142b4b;
    border: none;
    border-radius: 6px;
    text-align: left;
    font-size: 13px;
}

.post-menu-dropdown button:hover,
.post-menu-list button:hover {
    background: #edf3ff;
    color: #2563eb;
}


/* =========================================================
   14. SOCIAL INTERACTIONS
   ========================================================= */

.card-interactions {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #edf0f5;
}

.interaction-buttons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.interaction-buttons button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto;
    min-width: 36px;
    min-height: 34px;
    padding: 6px 9px;
    background: transparent;
    color: #64748b;
    border: none;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    transition: background .15s, color .15s;
}

.interaction-buttons button svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.interaction-buttons button:hover {
    background: #f1f5f9;
    color: #142b4b;
}

.interaction-buttons button.liked,
.interaction-buttons [data-like][aria-pressed="true"],
.interaction-buttons [data-like][data-selected="true"] {
    color: #e11d48;
}

.interaction-buttons button.interaction-active,
.interaction-buttons [data-save][aria-pressed="true"],
.interaction-buttons [data-save][data-selected="true"] {
    color: #2563eb;
}

.interaction-buttons [data-like].liked svg,
.interaction-buttons [data-like][aria-pressed="true"] svg {
    fill: #e11d48;
    stroke: #e11d48;
}

.interaction-buttons [data-save].interaction-active svg,
.interaction-buttons [data-save][aria-pressed="true"] svg {
    fill: #2563eb;
    stroke: #2563eb;
}

.interaction-buttons [data-save] {
    margin-left: auto;
}

.interaction-buttons button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.community-page #cards .interaction-buttons {
    gap: 10px;
}

.community-page #cards .interaction-buttons button {
    min-height: 34px;
    padding: 5px 8px;
}

[data-interaction-error],
[data-comment-error] {
    margin: 5px 0;
    color: #b91c1c;
    font-size: 12px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

[data-comment-status] {
    color: #64748b;
    font-size: 12px;
    line-height: 1.7;
}

[data-interaction-error]:empty,
[data-comment-error]:empty,
[data-comment-status]:empty {
    display: none;
}


/* =========================================================
   15. POST DETAIL MODAL
   ========================================================= */

#modal.post-detail-modal {
    width: min(1240px, 94vw);
    max-width: 1240px;
    height: min(820px, 92vh);
    max-height: 92vh;
    margin: auto;
    padding: 20px 24px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    box-sizing: border-box;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(15, 23, 42, .16);
}

#modal.post-detail-modal::backdrop {
    background: rgba(15, 23, 42, .58);
}

.post-detail-modal #modal-title {
    margin: 0;
    color: #142b4b;
    font-size: 23px;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: -.4px;
}

.post-detail-modal #close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
    background: #f1f5f9;
    color: #475569;
    border: none;
    border-radius: 50%;
}

.post-detail-modal #close:hover {
    background: #e2e8f0;
    color: #142b4b;
}

.post-detail-modal #modal-body {
    height: calc(100% - 52px);
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.post-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
    gap: 28px;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

.post-detail-media {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    height: 100%;
    background: #182331;
    border-radius: 12px;
    overflow: hidden;
}

.post-detail-media img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.post-detail-no-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
    padding: 24px;
    color: #cbd5e1;
    text-align: center;
    font-size: 13px;
}

.post-detail-no-image svg {
    width: 64px;
    height: 64px;
    color: #94a3b8;
}

.post-detail-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: 4px 6px 0 0;
    overflow: hidden;
}

.post-detail-info {
    flex-shrink: 0;
    min-width: 0;
    max-height: 48%;
    padding: 0 8px 18px 0;
    background: transparent;
    border: none;
    border-radius: 0;
    text-align: left;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #dce3ec transparent;
    overscroll-behavior: contain;
}

.post-detail-info p {
    margin: 7px 0;
    color: #475569;
    font-size: 14px;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.post-detail-info p strong,
.post-detail-info p b {
    color: #142b4b;
    font-weight: 600;
}

.post-detail-info .muted {
    color: #64748b;
    font-size: 12px;
}


/* =========================================================
   16. MODERN POST AUTHOR
   ========================================================= */

.modern-author {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    margin-bottom: 18px;
}

.modern-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: #e8eef8;
    color: #244675;
    border-radius: 50%;
    font-size: 17px;
    font-weight: 600;
    overflow: hidden;
}

.modern-avatar svg {
    width: 22px;
    height: 22px;
}

.modern-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modern-author-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 3px;
    min-width: 0;
}

.modern-author-text strong {
    color: #142b4b;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.modern-author-text span {
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.modern-owner {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 5px 9px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
}


/* =========================================================
   17. POST DETAIL INFORMATION
   ========================================================= */

.modern-post-title {
    margin: 0;
    padding: 0;
    text-align: left;
}

.modern-post-title .tag {
    margin: 0;
    padding: 5px 10px;
}

.modern-post-title h2 {
    margin: 8px 0 10px;
    color: #142b4b;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -.4px;
    overflow-wrap: anywhere;
}

.modern-description {
    display: block;
    width: 100%;
    margin: 0 0 18px;
    padding: 0;
    color: #334155;
    font-size: 14px;
    line-height: 1.85;
    text-align: left;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.modern-metadata {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 14px 0 0;
    border-top: 1px solid #edf0f5;
}

.modern-meta-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    color: #475569;
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.modern-meta-row svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
    color: #64748b;
}

.modern-meta-row span {
    min-width: 0;
    overflow-wrap: anywhere;
}


/* =========================================================
   18. CONTACT POST OWNER
   ========================================================= */

.contact-post-owner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    gap: 9px;
    width: 100%;
    min-height: 44px;
    margin: 12px 0;
    padding: 11px 16px;
    background: #2456b8;
    color: #ffffff;
    border: none;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s;
}

.contact-post-owner svg {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
}

.contact-post-owner:hover {
    background: #1d4698;
}

.contact-post-owner:disabled {
    opacity: .55;
    cursor: not-allowed;
}


/* =========================================================
   19. DETAIL INTERACTIONS
   ========================================================= */

.post-detail-content #post-interactions {
    flex-shrink: 0;
    min-width: 0;
    margin: 0;
    padding: 8px 0;
    border-top: 1px solid #e8edf3;
}

#post-interactions .interaction-buttons {
    gap: 12px;
}

#post-interactions .interaction-buttons button {
    min-width: 42px;
    min-height: 38px;
    padding: 7px 12px;
    font-size: 13px;
}

#post-interactions .interaction-buttons button svg {
    width: 20px;
    height: 20px;
}

#post-interactions [data-save] {
    margin-left: auto;
}


/* =========================================================
   20. COMMENTS SECTION
   ========================================================= */

#post-comments {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    min-height: 0;
    margin-top: 0;
    padding-top: 12px;
    border-top: 1px solid #e8edf3;
}

#post-comments h3 {
    flex-shrink: 0;
    margin: 0 0 10px;
    color: #142b4b;
    font-size: 16px;
    font-weight: 600;
}

.comments-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

#post-comments .comments-heading-row h3 {
    margin: 0;
}

#post-comments [data-comment-list] {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 3px;
    min-width: 0;
    min-height: 0;
    margin-bottom: 10px;
    padding: 0 8px 10px 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #dbe3ee transparent;
}

#post-comments .comment-item {
    position: relative;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    min-width: 0;
    padding: 10px 4px 10px 46px;
    background: transparent;
    border: none;
    border-radius: 0;
    text-align: left;
    overflow-wrap: anywhere;
}

#post-comments .comment-avatar {
    position: absolute;
    top: 10px;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    background: #e8eef8;
    color: #294b78;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 600;
    user-select: none;
    overflow: hidden;
}

#post-comments .comment-avatar svg {
    width: 18px;
    height: 18px;
}

#post-comments .comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#post-comments .comment-item strong {
    display: block;
    margin: 0 0 3px;
    color: #142b4b;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

#post-comments .comment-item p {
    margin: 4px 0;
    color: #334155;
    font-size: 14px;
    line-height: 1.65;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

#post-comments .comment-item small {
    display: block;
    margin: 3px 0;
    color: #64748b;
    font-size: 11px;
    line-height: 1.6;
}

#post-comments .comment-reply-info {
    display: block;
    margin: 3px 0;
    color: #2563eb;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

#post-comments .comment-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 3px;
}

#post-comments .comment-actions button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 26px;
    padding: 3px 0;
    background: transparent;
    color: #64748b;
    border: none;
    font-size: 12px;
    font-weight: 500;
}

#post-comments .comment-actions button svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

#post-comments .comment-actions button:hover {
    color: #2563eb;
}

#post-comments .comment-actions button.liked,
#post-comments .comment-actions button[aria-pressed="true"] {
    color: #e11d48;
}

#post-comments .comment-actions [data-delete-comment]:hover,
#post-comments .comment-actions .content-report-button:hover {
    color: #b91c1c;
}

#post-comments .comment-deleted,
#post-comments .comment-item.deleted {
    color: #94a3b8;
    font-style: italic;
}

#post-comments .comment-empty,
#post-comments .comments-empty {
    padding: 24px 12px;
    color: #64748b;
    text-align: center;
    font-size: 13px;
    line-height: 1.8;
}


/* =========================================================
   21. COMMENT COMPOSER
   ========================================================= */

#post-comments [data-comment-form] {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    flex-shrink: 0;
    gap: 10px;
    min-width: 0;
    margin: 0;
    padding-top: 12px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}

#post-comments [data-comment-form] textarea {
    width: 100%;
    min-width: 0;
    height: 46px;
    min-height: 46px;
    max-height: 140px;
    margin: 0;
    padding: 12px 15px;
    background: #f4f6f9;
    color: #142b4b;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    outline: none;
    box-sizing: border-box;
    font: inherit;
    font-size: 13px;
    line-height: 20px;
    resize: vertical;
    transition: background .18s, border-color .18s;
}

#post-comments [data-comment-form] textarea:focus {
    background: #ffffff;
    border-color: #93b4ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .06);
}

#post-comments [data-comment-form] textarea::placeholder {
    color: #94a3b8;
}

#post-comments [data-comment-form] button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 10px 16px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
}

#post-comments [data-comment-form] button[type="submit"]:hover {
    background: #1d4ed8;
}

#post-comments [data-comment-form] .comment-send {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border-radius: 50%;
}

#post-comments .comment-send svg {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
}

#post-comments .comment-send:disabled {
    opacity: .5;
    cursor: not-allowed;
}

#post-comments [data-reply-label],
#post-comments [data-cancel-reply],
#post-comments [data-comment-error],
#post-comments [data-comment-status] {
    grid-column: 1 / -1;
}

#post-comments [data-reply-label] {
    margin: 0;
    padding: 10px 12px;
    background: #eff6ff;
    color: #2456b8;
    border: none;
    border-left: 3px solid #2563eb;
    border-radius: 7px;
    font-size: 12px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

#post-comments [data-cancel-reply] {
    justify-self: start;
    padding: 3px 0;
    background: transparent;
    color: #64748b;
    border: none;
    font-size: 12px;
}

#post-comments [data-cancel-reply]:hover {
    color: #2563eb;
}


/* =========================================================
   22. REPORT POST
   ========================================================= */

#post-report {
    flex-shrink: 0;
    min-width: 0;
    max-height: 42%;
    overflow-y: auto;
    scrollbar-width: thin;
    overscroll-behavior: contain;
}

#post-report [hidden] {
    display: none !important;
}

.report-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 6px;
    padding: 7px 9px;
    background: transparent;
    color: #64748b;
    border: none;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.report-trigger svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.report-trigger:hover {
    background: #fef2f2;
    color: #b91c1c;
}

.comments-heading-row .report-trigger {
    margin: 0;
    white-space: nowrap;
}

.report-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    margin: 8px 0 14px;
    padding: 18px;
    background: #ffffff;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
}

.report-form-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.report-form-heading h3 {
    margin: 0;
    color: #142b4b;
    font-size: 17px;
    font-weight: 600;
}

.report-form-heading button {
    padding: 0 5px;
    background: transparent;
    color: #64748b;
    border: none;
    font-size: 23px;
}

.report-description {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.8;
}

.report-form label {
    color: #334155;
    font-size: 13px;
    font-weight: 600;
}

.report-form select,
.report-form textarea {
    width: 100%;
    min-width: 0;
    padding: 11px 12px;
    background: #f8fafc;
    color: #142b4b;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    box-sizing: border-box;
    font: inherit;
    font-size: 13px;
}

.report-form select:focus,
.report-form textarea:focus {
    background: #ffffff;
    border-color: #93b4ff;
    outline: none;
}

.report-form textarea {
    min-height: 90px;
    resize: vertical;
}

.report-note {
    padding: 10px 12px;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.8;
}

.report-form-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.report-form-actions button {
    min-height: 38px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}

.report-form-actions [data-cancel-report] {
    background: #ffffff;
    color: #475569;
    border: 1px solid #dbe3ee;
}

.report-submit {
    background: #b91c1c;
    color: #ffffff;
    border: none;
}

.report-submit:hover {
    background: #991b1b;
}

.report-submit:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.report-result {
    padding: 8px 0;
    color: #475569;
    font-size: 12px;
    line-height: 1.7;
}

.report-error {
    margin: 0;
    color: #b91c1c;
    font-size: 12px;
    line-height: 1.7;
}

.report-success {
    color: #15803d;
    font-size: 12px;
    line-height: 1.7;
}

.report-character-count,
.report-counter {
    color: #64748b;
    font-size: 11px;
    text-align: right;
}

.report-error:empty,
.report-result:empty,
.report-success:empty {
    display: none;
}


/* =========================================================
   23. POST MANAGEMENT MODAL
   ========================================================= */

#modal:has(.manage-post-actions) {
    width: 460px;
    max-width: 92vw;
    max-height: 90vh;
    height: auto;
    padding: 28px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-sizing: border-box;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(15, 23, 42, .18);
}

#modal:has(.manage-post-actions) #modal-title {
    color: #142b4b;
    font-size: 23px;
    font-weight: 700;
}

#modal .manage-post-heading {
    margin: 16px 0 20px;
    padding: 20px;
    background: #f4f7fc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

#modal .manage-post-heading h3 {
    margin: 12px 0 6px;
    color: #142b4b;
    font-size: 20px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

#modal .manage-post-heading p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.7;
}

#modal .manage-post-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

#modal .manage-post-actions button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 56px;
    padding: 15px 18px;
    background: #ffffff;
    color: #142b4b;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
    transition:
        background .18s,
        border-color .18s,
        color .18s;
}

#modal .manage-post-actions button::after {
    content: '›';
    flex-shrink: 0;
    color: #94a3b8;
    font-size: 24px;
    font-weight: 400;
}

#modal .manage-post-actions button:hover {
    background: #f0f5ff;
    color: #2563eb;
    border-color: #93b4ff;
}

#modal .manage-post-actions #edit-post {
    color: #2563eb;
}

#modal .manage-post-actions #delete-post {
    margin-top: 6px;
    background: #fff5f5;
    color: #b91c1c;
    border-color: #fecaca;
}

#modal .manage-post-actions #delete-post::after {
    color: #dc2626;
}

#modal .manage-post-actions #delete-post:hover {
    background: #fee2e2;
    border-color: #ef4444;
}

#modal .manage-post-actions button:disabled {
    opacity: .5;
    cursor: not-allowed;
}


/* =========================================================
   24. CREATE AND EDIT POST FORMS
   ========================================================= */

#modal #photo-preview,
#modal #edit-photo-preview {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 220px;
    margin: 10px auto;
    object-fit: contain;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

#modal input[type="file"] {
    width: 100%;
    max-width: 100%;
    color: #475569;
    font: inherit;
    font-size: 13px;
}

#modal input[type="file"]::file-selector-button {
    margin-right: 10px;
    padding: 9px 14px;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #dbeafe;
    border-radius: 7px;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}

#modal .date-fields,
#modal .date-selects,
#modal .date-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
}

#modal .date-fields select,
#modal .date-selects select,
#modal .date-row select {
    width: 100%;
    min-width: 0;
}

#modal .ghost-option,
#modal .ghost-mode-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

#modal .ghost-option input,
#modal .ghost-mode-option input {
    flex-shrink: 0;
    width: 17px;
    height: 17px;
    margin-top: 3px;
    accent-color: #2563eb;
}

#modal .form-error,
#modal .post-form-error {
    color: #b91c1c;
    font-size: 13px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

#modal .form-success,
#modal .post-form-success {
    color: #15803d;
    font-size: 13px;
    line-height: 1.7;
}

#modal .form-error:empty,
#modal .post-form-error:empty,
#modal .form-success:empty,
#modal .post-form-success:empty {
    display: none;
}


/* =========================================================
   25. SAVED POSTS AND EMPTY STATES
   ========================================================= */

.community-page #empty:not([hidden]) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 280px;
    padding: 30px;
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    text-align: center;
}

.community-page #empty svg {
    width: 40px;
    height: 40px;
    color: #94a3b8;
}

.community-page #empty h3 {
    margin: 8px 0 0;
    color: #142b4b;
    font-size: 18px;
    font-weight: 600;
}

.community-page #empty p {
    max-width: 460px;
    margin: 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.8;
}

.saved-empty,
.saved-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 260px;
    padding: 30px;
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    text-align: center;
}

.saved-empty svg,
.saved-empty-state svg {
    width: 40px;
    height: 40px;
    color: #94a3b8;
}

.saved-browse-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    margin-top: 12px;
    padding: 10px 18px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.saved-browse-link:hover {
    background: #1d4ed8;
    color: #ffffff;
}


/* =========================================================
   26. SHARED FEATURE COMPONENTS
   ========================================================= */

#modal .lv-button,
.community-page .lv-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 9px 15px;
    background: #ffffff;
    color: #142b4b;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

#modal .lv-button:hover,
.community-page .lv-button:hover {
    background: #f1f5f9;
}

#modal .lv-button.primary,
#modal .lv-button-primary,
.community-page .lv-button.primary,
.community-page .lv-button-primary {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

#modal .lv-button.primary:hover,
#modal .lv-button-primary:hover,
.community-page .lv-button.primary:hover,
.community-page .lv-button-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

#modal .lv-button.danger,
#modal .lv-button-danger {
    background: #ffffff;
    color: #b91c1c;
    border-color: #fecaca;
}

#modal .lv-button.danger:hover,
#modal .lv-button-danger:hover {
    background: #fef2f2;
}

#modal .lv-button:disabled,
.community-page .lv-button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

#modal .lv-button svg,
.community-page .lv-button svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

#modal .lv-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
    margin-bottom: 14px;
}

#modal .lv-field label {
    color: #334155;
    font-size: 13px;
    font-weight: 600;
}

#modal .lv-field input:not([type="checkbox"]):not([type="radio"]),
#modal .lv-field select,
#modal .lv-field textarea {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 10px 12px;
    background: #ffffff;
    color: #142b4b;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    font: inherit;
    font-size: 13px;
}

#modal .lv-field textarea {
    min-height: 90px;
    resize: vertical;
}

#modal .lv-field input:focus,
#modal .lv-field select:focus,
#modal .lv-field textarea:focus {
    border-color: #93b4ff;
    outline: none;
}

#modal .lv-loading,
#modal .lv-empty,
.community-page .lv-loading,
.community-page .lv-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 110px;
    padding: 24px;
    color: #64748b;
    text-align: center;
    font-size: 13px;
    line-height: 1.8;
}

#modal .lv-error,
.community-page .lv-error {
    padding: 14px;
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 9px;
    font-size: 13px;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

#modal .lv-success,
.community-page .lv-success {
    padding: 14px;
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
    border-radius: 9px;
    font-size: 13px;
    line-height: 1.8;
}

#modal .lv-spinner,
.community-page .lv-spinner {
    display: inline-block;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 2px solid #dbeafe;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: community-spin .75s linear infinite;
}

@keyframes community-spin {
    to {
        transform: rotate(360deg);
    }
}


/* =========================================================
   27. LOSTMATCH
   ========================================================= */

#modal:has(.lostmatch-panel),
#modal:has(#lostmatch-root),
#modal:has(.lostmatch-list) {
    width: min(760px, 94vw);
    max-width: 760px;
    max-height: 88vh;
    height: auto;
    overflow-y: auto;
}

.lostmatch-panel,
.lostmatch-container,
#lostmatch-root {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    color: #142b4b;
}

.lostmatch-intro,
.lostmatch-notice,
.lostmatch-disclaimer {
    padding: 14px 16px;
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.8;
}

.lostmatch-header,
.lostmatch-heading,
.lostmatch-toolbar,
.lostmatch-actions,
.lostmatch-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
}

.lostmatch-header h3,
.lostmatch-heading h3 {
    margin: 0;
    color: #142b4b;
    font-size: 18px;
    font-weight: 600;
}

.lostmatch-list,
.lostmatch-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.lostmatch-card,
.lostmatch-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    padding: 16px;
    background: #ffffff;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
}

.lostmatch-card h3,
.lostmatch-card h4,
.lostmatch-item h3,
.lostmatch-item h4 {
    margin: 0;
    color: #142b4b;
    font-size: 15px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.lostmatch-card p,
.lostmatch-item p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.lostmatch-card img,
.lostmatch-item img {
    display: block;
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    background: #f1f5f9;
    border-radius: 8px;
}

.lostmatch-score,
.match-score {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    padding: 5px 9px;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.lostmatch-reasons,
.match-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
}

.lostmatch-reason,
.match-reason {
    padding: 5px 8px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 5px;
    font-size: 11px;
    line-height: 1.6;
}

.lostmatch-status,
.match-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 5px 9px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.lostmatch-status.accepted,
.match-status.accepted {
    background: #dcfce7;
    color: #15803d;
}

.lostmatch-status.pending,
.match-status.pending {
    background: #fffbeb;
    color: #92400e;
}

.lostmatch-status.dismissed,
.match-status.dismissed {
    background: #f1f5f9;
    color: #64748b;
}

.lostmatch-empty,
.lostmatch-loading {
    padding: 28px 16px;
    color: #64748b;
    text-align: center;
    font-size: 13px;
    line-height: 1.8;
}

.lostmatch-error {
    padding: 12px 14px;
    background: #fef2f2;
    color: #b91c1c;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.7;
}

.lostmatch-error:empty {
    display: none;
}


/* =========================================================
   28. NOTIFICATIONS
   ========================================================= */

.lv-notification-button {
    position: relative;
}

.notification-count-badge {
    position: absolute;
    top: -5px;
    right: -6px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: #2563eb;
    color: #ffffff;
    border: 2px solid #ffffff;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
}

.notification-count-badge[hidden] {
    display: none !important;
}

#modal:has(#notification-root) {
    width: min(620px, 94vw);
    max-width: 620px;
    max-height: 88vh;
    height: auto;
    overflow-y: auto;
}

#notification-root,
.notification-panel,
.notifications-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.notification-header,
.notification-toolbar,
.notification-controls,
.notification-filters,
.notification-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.notification-header,
.notification-toolbar {
    justify-content: space-between;
}

.notification-filters {
    width: fit-content;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 8px;
}

.notification-filters button,
.notification-filter {
    min-height: 32px;
    padding: 7px 13px;
    background: transparent;
    color: #64748b;
    border: none;
    border-radius: 6px;
    font: inherit;
    font-size: 12px;
    font-weight: 500;
}

.notification-filters button.active,
.notification-filters button[aria-pressed="true"],
.notification-filter.active {
    background: #ffffff;
    color: #2563eb;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .07);
}

.notification-list,
.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.notification-group,
.notification-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.notification-group-title,
.notification-group-heading,
.notification-date {
    margin: 10px 0 6px;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.notification-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    min-width: 0;
    padding: 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-align: left;
}

.notification-item.unread,
.notification-item.is-unread {
    background: #f5f8ff;
    border-color: #dbeafe;
}

.notification-item:hover {
    border-color: #b8c9e0;
}

.notification-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    background: #e8eef8;
    color: #2456b8;
    border-radius: 10px;
}

.notification-icon svg {
    width: 19px;
    height: 19px;
}

.notification-content,
.notification-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 4px;
    min-width: 0;
}

.notification-title,
.notification-content strong {
    margin: 0;
    color: #142b4b;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.notification-body,
.notification-content p {
    margin: 0;
    color: #475569;
    font-size: 12px;
    line-height: 1.8;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.notification-time,
.notification-content small {
    color: #64748b;
    font-size: 11px;
    line-height: 1.6;
}

.notification-unread-dot {
    display: inline-block;
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    margin-top: 7px;
    background: #2563eb;
    border-radius: 50%;
}

.notification-actions button,
.notification-mark-read,
.notification-mark-all {
    padding: 6px 8px;
    background: transparent;
    color: #2563eb;
    border: none;
    border-radius: 6px;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.notification-actions button:hover,
.notification-mark-read:hover,
.notification-mark-all:hover {
    background: #eff6ff;
}

.notification-empty,
.notification-loading {
    padding: 32px 16px;
    color: #64748b;
    text-align: center;
    font-size: 13px;
    line-height: 1.8;
}

.notification-error {
    padding: 12px 14px;
    background: #fef2f2;
    color: #b91c1c;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.8;
}

.notification-error:empty {
    display: none;
}

.notification-load-more {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}


/* =========================================================
   29. REPUTATION
   ========================================================= */

.lv-reputation,
.reputation-panel,
.reputation-public-panel,
.reputation-private-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.reputation-panel,
.reputation-public-panel,
.reputation-private-panel {
    padding: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.reputation-heading,
.reputation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.reputation-heading h3,
.reputation-header h3,
.reputation-panel h3 {
    margin: 0;
    color: #142b4b;
    font-size: 14px;
    font-weight: 600;
}

.reputation-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    max-width: 100%;
    padding: 5px 9px;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #dbeafe;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.6;
}

.reputation-badge svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.reputation-grid,
.reputation-stats,
.reputation-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    min-width: 0;
}

.reputation-stat,
.reputation-stat-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.reputation-value,
.reputation-stat-value,
.reputation-stat strong {
    color: #142b4b;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
}

.reputation-label,
.reputation-stat-label,
.reputation-stat small {
    color: #64748b;
    font-size: 11px;
    line-height: 1.6;
}

.reputation-note,
.reputation-description,
.reputation-disclaimer {
    margin: 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.reputation-history,
.reputation-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.reputation-history-item,
.reputation-event {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.reputation-empty,
.reputation-loading {
    padding: 14px;
    color: #64748b;
    font-size: 12px;
    text-align: center;
    line-height: 1.8;
}

.reputation-error {
    color: #b91c1c;
    font-size: 12px;
    line-height: 1.8;
}

.reputation-error:empty {
    display: none;
}

.post-detail-info .reputation-panel,
.post-detail-info .reputation-public-panel,
.post-detail-info .lv-reputation {
    margin-top: 12px;
}


/* =========================================================
   30. RETURN TESTIMONIALS
   ========================================================= */

.reputation-testimonials,
.testimonials-panel,
.return-testimonials {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    margin-top: 14px;
}

.reputation-testimonials h3,
.testimonials-panel h3,
.return-testimonials h3 {
    margin: 0;
    color: #142b4b;
    font-size: 14px;
    font-weight: 600;
}

.testimonials-list,
.reputation-testimonial-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.testimonial-card,
.testimonial-item,
.reputation-testimonial {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
    padding: 13px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
}

.testimonial-card strong,
.testimonial-item strong,
.reputation-testimonial strong {
    color: #142b4b;
    font-size: 12px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.testimonial-card p,
.testimonial-item p,
.reputation-testimonial p,
.testimonial-content {
    margin: 0;
    color: #334155;
    font-size: 13px;
    line-height: 1.8;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.testimonial-card small,
.testimonial-item small,
.reputation-testimonial small {
    color: #64748b;
    font-size: 11px;
}


/* =========================================================
   31. COMMUNITY FOOTER
   ========================================================= */

.community-page .community-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    max-width: none;
    margin: 48px 0 0;
    padding: 24px 0;
    color: #64748b;
    border-top: 1px solid #dbe3ee;
    font-size: 12px;
    line-height: 1.8;
}

.community-page .community-footer strong {
    color: #142b4b;
    font-size: 14px;
    font-weight: 600;
}

.community-page .community-footer p {
    margin: 3px 0 0;
}

.community-page .community-footer a {
    color: #64748b;
    text-decoration: none;
}

.community-page .community-footer a:hover {
    color: #2563eb;
}


/* =========================================================
   32. RESPONSIVE — LARGE TABLET
   ========================================================= */

@media (max-width: 1200px) {

    .community-page .community-layout {
        grid-template-columns: 230px minmax(0, 1fr);
        gap: 22px;
    }

    .community-page #cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .community-page .filter-panel {
        padding: 18px;
    }

    .post-detail-layout {
        gap: 20px;
    }

}


/* =========================================================
   33. RESPONSIVE — TABLET
   ========================================================= */

@media (max-width: 950px) {

    .community-page .community-container {
        padding: 24px 22px 0;
    }

    .community-page .community-layout {
        grid-template-columns: 200px minmax(0, 1fr);
        gap: 16px;
    }

    .community-page .filter-panel {
        padding: 15px;
    }

    .community-page .province-field {
        width: 175px;
    }

    .community-page #cards {
        gap: 14px;
    }

    .community-page #cards .item-body {
        padding: 13px;
    }

    .community-page #cards .item > img,
    .community-page #cards .item > .post-placeholder {
        height: 165px;
        min-height: 165px;
        max-height: 165px;
    }

    .community-view-tabs a {
        padding: 10px 15px;
        font-size: 12px;
    }

    .community-page #cards .interaction-buttons {
        gap: 4px;
    }

    .community-page #cards .interaction-buttons button {
        padding: 5px 6px;
    }

    #modal.post-detail-modal {
        width: 96vw;
        padding: 18px;
    }

    .post-detail-layout {
        grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
        gap: 18px;
    }

    .modern-post-title h2 {
        font-size: 23px;
    }

}


/* =========================================================
   34. RESPONSIVE — SMALL TABLET
   ========================================================= */

@media (max-width: 760px) {

    #modal.post-detail-modal {
        width: 94vw;
        max-width: 94vw;
        height: auto;
        max-height: 92vh;
        padding: 16px;
        border-radius: 14px;
        overflow-y: auto;
    }

    .post-detail-modal #modal-title {
        font-size: 20px;
    }

    .post-detail-modal #modal-body {
        height: auto;
        overflow: visible;
    }

    .post-detail-layout,
    .modern-detail {
        display: flex;
        flex-direction: column;
        gap: 20px;
        height: auto;
        min-height: 0;
    }

    .post-detail-media {
        width: 100%;
        height: 280px;
        min-height: 280px;
        max-height: 280px;
    }

    .post-detail-content {
        height: auto;
        min-height: 0;
        padding: 0;
        overflow: visible;
    }

    .post-detail-info,
    .modern-detail .post-detail-info {
        max-height: none;
        padding: 0 0 14px;
        overflow: visible;
    }

    .modern-post-title h2 {
        font-size: 23px;
    }

    .modern-author {
        margin-bottom: 14px;
    }

    #post-comments {
        flex: initial;
        min-height: 180px;
    }

    #post-comments [data-comment-list] {
        flex: initial;
        min-height: 80px;
        max-height: 360px;
        overflow-y: auto;
    }

    #post-report {
        max-height: none;
        overflow: visible;
    }

    #post-comments [data-comment-form] textarea {
        font-size: 16px;
    }

}


/* =========================================================
   35. RESPONSIVE — MOBILE
   ========================================================= */

@media (max-width: 650px) {

    .community-page .community-container {
        padding: 20px 14px 0;
    }

    .community-page .breadcrumb {
        margin-bottom: 18px;
    }

    .community-page .community-heading {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        margin-bottom: 20px;
    }

    .community-page .community-heading h1 {
        font-size: 25px;
    }

    .community-page .community-heading p {
        font-size: 13px;
    }

    .community-page .create-post {
        width: 100%;
        min-height: 44px;
    }

    .community-page .community-search {
        margin-bottom: 20px;
    }

    .community-page #search {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px;
    }

    .community-page .search-field {
        flex-basis: 100%;
        border-bottom: 1px solid #e2e8f0;
    }

    .community-page .province-field {
        flex: 1;
        width: auto;
        border-left: none;
    }

    .community-page #query,
    .community-page #province {
        font-size: 16px;
    }

    .community-page .search-submit {
        min-width: 80px;
    }

    .community-page .community-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }

    .community-page .filter-panel {
        position: static;
        max-height: none;
        padding: 16px;
        overflow: visible;
    }

    .community-page .filter-group {
        padding: 14px 0;
    }

    .community-page .type-options {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .community-page .type-options button {
        flex: 1 1 95px;
        width: auto;
        justify-content: center;
        padding: 9px 7px;
        font-size: 12px;
    }

    .community-page #categories {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px;
    }

    .community-page #categories button {
        min-height: 40px;
        padding: 8px;
        font-size: 12px;
    }

    .community-page .safety-note p {
        margin-bottom: 8px;
    }

    .community-view-tabs {
        display: flex;
        width: 100%;
        margin-bottom: 20px;
    }

    .community-view-tabs a {
        flex: 1 1 auto;
        gap: 5px;
        padding: 10px 8px;
        font-size: 11px;
    }

    .community-view-tabs a svg {
        width: 15px;
        height: 15px;
    }

    .community-page .listings .section-head {
        flex-wrap: wrap;
        gap: 12px;
        margin-bottom: 16px;
    }

    .community-page .listings .section-head h2 {
        font-size: 20px;
    }

    .community-page #cards {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .community-page #cards .item > img,
    .community-page #cards .item > .post-placeholder {
        height: 210px;
        min-height: 210px;
        max-height: 210px;
    }

    .community-page #cards .item-body {
        padding: 16px;
    }

    .community-page #cards .interaction-buttons {
        gap: 12px;
    }

    .community-page #cards .interaction-buttons button {
        min-height: 38px;
        padding: 7px 10px;
    }

    .community-page .community-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-top: 30px;
    }

    .notification-item {
        gap: 10px;
        padding: 12px;
    }

    .notification-icon {
        width: 34px;
        height: 34px;
    }

    .notification-actions {
        flex-wrap: wrap;
    }

    .lostmatch-card,
    .lostmatch-item {
        padding: 13px;
    }

    .reputation-stat,
    .reputation-stat-card {
        padding: 10px;
    }

}


/* =========================================================
   36. RESPONSIVE — SMALL MOBILE
   ========================================================= */

@media (max-width: 380px) {

    .community-page .community-container {
        padding-right: 10px;
        padding-left: 10px;
    }

    .community-page .community-heading h1 {
        font-size: 22px;
    }

    .community-view-tabs {
        gap: 2px;
        padding: 4px;
    }

    .community-view-tabs a {
        gap: 4px;
        padding: 8px 6px;
        font-size: 10px;
    }

    .community-view-tabs a svg {
        width: 13px;
        height: 13px;
    }

    .community-page #cards .item > img,
    .community-page #cards .item > .post-placeholder {
        height: 185px;
        min-height: 185px;
        max-height: 185px;
    }

    .post-detail-media {
        height: 220px;
        min-height: 220px;
        max-height: 220px;
    }

    .modern-post-title h2 {
        font-size: 21px;
    }

    .modern-author {
        gap: 9px;
    }

    .modern-avatar {
        width: 38px;
        height: 38px;
    }

    .modern-owner {
        padding: 4px 6px;
        font-size: 10px;
    }

    #post-comments .comment-item {
        padding-left: 40px;
    }

    #post-comments .comment-avatar {
        width: 30px;
        height: 30px;
    }

    #post-comments .comment-actions {
        gap: 10px;
    }

    .report-form {
        padding: 12px;
    }

    .reputation-grid,
    .reputation-stats,
    .reputation-stat-grid {
        gap: 7px;
    }

}


/* =========================================================
   37. ACCESSIBILITY
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .community-page *,
    .community-page *::before,
    .community-page *::after,
    #modal.post-detail-modal *,
    #modal.post-detail-modal *::before,
    #modal.post-detail-modal *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }

    .community-page #cards .item:hover {
        transform: none;
    }

}


/* =========================================================
   END OF COMMUNITY STYLESHEET
   LOSTVERSE
   ========================================================= */