.wall-page {
    width: min(1100px, 100%);
    overflow: visible;
}

.profile-wall {
    overflow: visible;
}

.wall-live-status:empty {
    display: none;
}

.wall-live-status {
    position: sticky;
    top: 68px;
    z-index: 12;
    padding: 10px 12px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.wall-live-status.is-error {
    color: var(--danger);
}

.wall-header {
    align-items: center;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.wall-header-title {
    min-width: 0;
}

.wall-header-title h1 {
    margin: 0;
    letter-spacing: 0;
}

.wall-header-actions {
    display: flex;
    align-items: center;
    justify-content: end;
    gap: 10px;
    margin-left: auto;
}

.wall-header-actions [hidden] {
    display: none !important;
}

.wall-meter {
    display: grid;
    gap: 4px;
    min-width: 126px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    justify-items: stretch;
}

.wall-meter-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.wall-meter strong {
    color: var(--text-strong);
    font-size: 0.86rem;
    line-height: 1.1;
    text-align: center;
}

.wall-meter span,
.wall-meter small {
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.1;
    text-align: center;
}

.wall-meter-track {
    height: 3px;
    width: 100%;
    overflow: hidden;
    background: rgba(152, 164, 179, 0.12);
    border-radius: 999px;
}

.wall-meter-track span {
    display: block;
    height: 100%;
    background: var(--accent-strong);
    border-radius: inherit;
}

.file-dropzone-meta {
    max-width: 100%;
    color: var(--muted);
    font-size: 0.82rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wall-upload-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    align-items: start;
    gap: 18px;
    overflow: visible;
}

.media-grid.is-empty {
    display: none;
}

.media-card {
    position: relative;
    display: grid;
    min-width: 0;
    overflow: visible;
    color: var(--text);
    background: rgba(17, 23, 32, 0.86);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    transition: border-color 140ms ease, transform 140ms ease;
}

.wall-page .media-card,
.profile-wall .media-card {
    overflow: visible;
    transform: none;
}

.media-card:hover,
.wall-page .media-card:hover,
.profile-wall .media-card:hover {
    border-color: rgba(157, 178, 200, 0.3);
    transform: none;
}

.media-card:has(.action-menu[open]),
.media-card:has(.report-control[open]) {
    z-index: 1200;
}

.media-preview {
    overflow: hidden;
    background: #030509;
    border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0;
}

.media-preview img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.media-preview video {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    max-height: 520px;
    object-fit: cover;
}

.media-card-body {
    position: relative;
    z-index: 2;
    display: grid;
    gap: 12px;
    padding: 14px;
    overflow: visible;
}

.media-card-header,
.media-card-footer {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    overflow: visible;
}

.media-author {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    color: var(--text);
}

.media-author span {
    display: grid;
    min-width: 0;
}

.media-author strong,
.media-author small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-author strong {
    color: var(--text-strong);
}

.media-author small,
.media-card-footer small {
    color: var(--muted);
    font-size: 0.78rem;
}

.media-caption {
    margin: 0;
    color: var(--text);
    overflow-wrap: break-word;
}

.media-card form,
.report-control form {
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
}

.wall-action,
.wall-action-static {
    min-height: 31px;
    padding: 5px 10px;
}

.wall-action:hover,
.wall-action.is-active {
    color: #071018;
    background: var(--accent-strong);
    border-color: var(--accent-strong);
}

.report-control {
    position: relative;
    z-index: 10;
    overflow: visible;
}

.report-control[open] {
    z-index: 1300;
}

.report-control summary {
    list-style: none;
}

.report-control summary::-webkit-details-marker {
    display: none;
}

.report-control form {
    position: absolute;
    top: auto;
    right: 0;
    bottom: calc(100% + 8px);
    left: auto;
    z-index: 1400;
    display: grid;
    box-sizing: border-box;
    gap: 6px;
    width: min(240px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    padding: 10px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.report-control input,
.report-control select {
    margin-bottom: 9px;
}

.empty-wall {
    text-align: center;
}

.empty-wall h2,
.empty-wall p {
    margin: 0;
}

@media (max-width: 640px) {
    .wall-meter {
        min-width: 118px;
    }

    .media-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .media-card {
        border-radius: 12px;
    }

    .media-preview {
        border-radius: 11px 11px 0 0;
    }

    .media-preview img {
        width: 100%;
        height: auto;
        object-fit: contain;
    }

    .media-preview video {
        width: 100%;
        height: auto;
        max-height: 260px;
        aspect-ratio: auto;
        object-fit: contain;
        background: #030509;
    }

    .media-card-body {
        gap: 8px;
        padding: 9px;
    }

    .media-card-header,
    .media-card-footer {
        position: relative;
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 6px;
        min-width: 0;
        overflow: visible;
    }

    .media-author {
        gap: 6px;
    }

    .media-author .avatar-sm,
    .media-author .avatar-image,
    .media-author .avatar-fallback {
        width: 24px;
        height: 24px;
        font-size: 0.68rem;
    }

    .media-author strong {
        font-size: 0.78rem;
    }

    .media-author small,
    .media-card-footer small {
        font-size: 0.68rem;
    }

    .media-caption {
        font-size: 0.78rem;
        line-height: 1.35;
    }

    .media-card .btn-sm {
        min-height: 28px;
        padding: 4px 7px;
        font-size: 0.68rem;
    }

    .report-control {
        margin-left: auto;
        position: static;
    }

    .report-control form {
        position: absolute;
        top: auto;
        right: 0;
        bottom: calc(100% + 7px);
        left: auto;
        width: min(190px, 100%, calc(100dvw - 24px));
        max-width: min(100%, calc(100dvw - 24px));
        padding: 8px;
        gap: 4px;
        box-sizing: border-box;
        overflow-wrap: anywhere;
        border-radius: 10px;
        transform: none;
    }

    .report-control form label {
        font-size: 0.68rem;
        line-height: 1.1;
    }

    .report-control input,
    .report-control select {
        min-height: 28px;
        margin-bottom: 4px;
        padding: 4px 6px;
        font-size: 0.72rem;
    }

    .report-control form .btn-sm {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 340px) {
    .media-grid {
        grid-template-columns: 1fr;
    }
}

.wall-upload-status {
    color: var(--muted);
    background: rgba(8, 13, 19, 0.66);
    border: 1px solid var(--line-soft);
    cursor: default;
    font-size: 0.83rem;
}

.wall-upload-status:hover,
.wall-upload-status:focus-visible {
    color: var(--muted);
    background: rgba(8, 13, 19, 0.66);
    border-color: var(--line-soft);
    box-shadow: none;
    transform: none;
}

.wall-upload-pill {
    min-height: 36px;
    padding: 8px 13px;
    border-radius: 999px;
    font-weight: 900;
    white-space: nowrap;
}

.wall-login-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-strong);
    background: rgba(15, 17, 20, 0.9);
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    box-shadow: none;
    font-size: 0.84rem;
    line-height: 1;
    text-decoration: none;
}

.wall-login-cta:hover,
.wall-login-cta:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: none;
    transform: none;
}

@media (max-width: 640px) {
    .wall-login-cta {
        min-height: 34px;
        padding: 7px 10px;
        font-size: 0.78rem;
    }
}

.wall-modal {
    width: min(560px, calc(100% - 24px));
    padding: 0;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.wall-modal::backdrop {
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.modal-head h2 {
    margin: 0;
}

.wall-upload-form {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 18px;
    background: transparent;
    border: 0;
}

.wall-upload-picker {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 230px;
    margin: 0;
    overflow: hidden;
    color: var(--text);
    background: rgba(6, 10, 15, 0.86);
    border: 1px dashed rgba(157, 178, 200, 0.34);
    border-radius: var(--radius);
    cursor: pointer;
}

.wall-upload-picker:hover,
.wall-upload-picker.is-dragging {
    border-color: rgba(196, 212, 228, 0.58);
    background: rgba(10, 16, 24, 0.94);
}

.wall-upload-picker img,
.wall-upload-picker video {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.wall-upload-picker > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 8px 13px;
    color: var(--text-strong);
    background: rgba(152, 164, 179, 0.1);
    border: 1px solid rgba(157, 178, 200, 0.28);
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 850;
}

.wall-upload-picker:hover > span,
.wall-upload-picker.is-dragging > span {
    background: rgba(157, 178, 200, 0.18);
    border-color: rgba(196, 212, 228, 0.46);
}

.wall-upload-picker input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.wall-upload-limits,
.file-dropzone-meta {
    color: var(--muted);
    font-size: 0.82rem;
}

.wall-upload-fields {
    display: grid;
    gap: 7px;
}

.wall-upload-fields input {
    margin: 0;
}

.media-viewer-trigger {
    display: block;
    width: 100%;
    min-height: 0;
    padding: 0;
    color: inherit;
    background: transparent;
    border: 0;
    border-radius: 0;
    cursor: zoom-in;
}

.media-viewer-trigger:hover {
    background: transparent;
}

.media-lightbox {
    width: min(1120px, calc(100% - 24px));
    max-height: calc(100dvh - 24px);
    background: rgba(4, 6, 10, 0.96);
}

.media-lightbox-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
}

.media-lightbox-stage {
    display: grid;
    place-items: center;
    min-height: min(72dvh, 760px);
    padding: 42px 16px 16px;
}

.media-lightbox-stage img,
.media-lightbox-stage video {
    display: block;
    max-width: 100%;
    max-height: calc(100dvh - 96px);
    border-radius: var(--radius);
    object-fit: contain;
}

.media-lightbox {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.media-lightbox::backdrop {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: none;
}

.media-lightbox-close {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 5;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    color: rgba(245, 247, 250, 0.9);
    background: rgba(4, 6, 10, 0.48);
    border: 1px solid rgba(245, 247, 250, 0.16);
    border-radius: 999px;
    line-height: 1;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.3);
}

.media-lightbox-close:hover,
.media-lightbox-close:focus-visible {
    color: #fff;
    background: rgba(18, 22, 28, 0.74);
    border-color: rgba(245, 247, 250, 0.3);
    transform: none;
}

.media-lightbox-close-icon {
    position: relative;
    display: block;
    width: 18px;
    height: 18px;
}

.media-lightbox-close-icon::before,
.media-lightbox-close-icon::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
    transform-origin: center;
}

.media-lightbox-close-icon::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.media-lightbox-close-icon::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.media-lightbox-stage {
    min-height: 100dvh;
    padding: 30px;
    cursor: zoom-out;
}

.media-lightbox-stage img,
.media-lightbox-stage video {
    max-width: min(100%, 1180px);
    max-height: calc(100dvh - 60px);
    border-radius: 8px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.42);
    cursor: auto;
}

@media (max-width: 640px) {
    .media-lightbox-stage {
        padding: 18px;
    }

    .media-lightbox-stage img,
    .media-lightbox-stage video {
        max-height: calc(100dvh - 36px);
    }
}

@media (max-width: 940px) {
    .wall-header-actions {
        justify-content: end;
    }
}

@media (max-width: 640px) {
    .wall-header {
        flex-wrap: wrap;
    }

    .wall-header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .wall-upload-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .wall-upload-actions .btn {
        width: 100%;
    }
}

/* Final Wall upload polish */
.wall-upload-form [hidden] {
    display: none !important;
}

.wall-upload-dialog {
    width: min(500px, calc(100% - 24px));
}

.wall-upload-dialog .modal-head {
    justify-content: start;
}

.wall-upload-form {
    gap: 12px;
}

.wall-upload-picker {
    min-height: 128px;
    padding: 14px;
}

.wall-upload-form.is-previewing .wall-upload-picker {
    min-height: 0;
    padding: 0;
    overflow: hidden;
    background: #05070b;
    border-style: solid;
}

.wall-upload-form.is-previewing .wall-upload-picker:hover {
    background: #05070b;
}

.wall-upload-picker img,
.wall-upload-picker video {
    max-height: 420px;
    background: #05070b;
    object-fit: contain;
}

.wall-upload-fields[hidden],
.wall-upload-preview[hidden],
.wall-upload-picker img[hidden],
.wall-upload-picker video[hidden],
.wall-upload-preview img[hidden],
.wall-upload-preview video[hidden],
.wall-upload-picker span[hidden] {
    display: none !important;
}

.wall-upload-preview {
    overflow: hidden;
    background: #05070b;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
}

.wall-upload-preview img,
.wall-upload-preview video {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    max-height: 420px;
    object-fit: contain;
}

.wall-action-disabled {
    cursor: default;
    opacity: 0.62;
}

.wall-action-disabled:hover {
    color: var(--muted);
    background: rgba(8, 13, 19, 0.68);
    border-color: var(--line-soft);
}
