/* =========================
   RESET / BASE
========================= */
* {
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #fafafa;
    margin: 0;
    padding: 0;
    color: #262626;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
textarea {
    font: inherit;
}

a {
    text-decoration: none;
    color: inherit;
}

/* =========================
   HEADER
========================= */
header {
    background-color: #ffffff;
    border-bottom: 1px solid #dbdbdb;
    padding: 10px 0;
    text-align: center;
    position: fixed;
    width: 100%;
    z-index: 1000;
    top: 0;
}

header h1 {
    font-size: 2rem;
    font-weight: 300;
    margin: 0;
    color: #262626;
}

.feed-page-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #dbdbdb;
    z-index: 1000;
}

.feed-page-header-inner {
    max-width: 980px;
    margin: 0 auto;
    padding: 10px 16px;
    position: relative;
    min-height: 56px;
}

.feed-page-header h1 {
    margin: 0;
    text-align: center;
    font-size: 2rem;
    font-weight: 300;
    color: #262626;
    line-height: 36px;
}

.feed-page-add-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

/* =========================
   MAIN LAYOUT
========================= */
main {
    margin-top: 60px;
    padding: 20px;
}

.feed-layout {
    display: flex;
    gap: 24px;
    justify-content: center;
    align-items: flex-start;
    max-width: 1200px;
    margin: 76px auto 0;
    padding: 20px 12px 100px;
}

.feed-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 0 auto;
    max-width: 1200px;
    padding: 10px;
}

.feed-section {
    width: 100%;
    max-width: 640px;
}

.feed {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    padding: 0 10px;
    flex: 1;
    min-width: 0;
}

.sidebar-ad {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: 90px;
}

/* =========================
   BUTTONS
========================= */
#addPostButton {
    background-color: #3897f0;
    color: #ffffff;
    border: none;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    transition: background-color 0.2s ease;
    display: inline-block;
    text-align: center;
}

#addPostButton:hover {
    background-color: #3578e5;
}

.follow-btn,
.small-btn {
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.follow-btn {
    background: #0095f6;
    color: #fff;
}

.follow-btn.following {
    background: #efefef;
    color: #222;
}

.small-btn {
    background: #f2f2f2;
    color: #222;
}

.submit-btn {
    width: 100%;
    border: none;
    background: #111;
    color: #fff;
    border-radius: 10px;
    padding: 12px;
    font-weight: 700;
    cursor: pointer;
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

/* =========================
   OLD POST STYLE SUPPORT
========================= */
.post {
    border: 1px solid #dbdbdb;
    background-color: #ffffff;
    margin-bottom: 20px;
    border-radius: 4px;
}

.post-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #dbdbdb;
}

.post-header .profile-image {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}

.post-header .username-box {
    display: flex;
    align-items: center;
    flex: 1;
}

.post-header .username {
    font-weight: 600;
    font-size: 14px;
    flex: 1;
}

.post-header .timestamp {
    font-size: 12px;
    color: #8e8e8e;
    margin-left: auto;
}

.post img,
.post-video {
    width: 100%;
    height: 500px;
    object-fit: cover;
    border-radius: 4px 4px 0 0;
}

.post-footer {
    padding: 10px 16px;
}

.post-footer .actions {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.post-footer .actions svg {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    cursor: pointer;
}

.post-footer .likes {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
}

.post-footer .caption {
    margin-top: 6px;
}

.post-footer .comments {
    margin-top: 8px;
    max-height: 150px;
    overflow-y: auto;
}

/* =========================
   NEW FEED CARD STYLE
========================= */
.post-card {
    background: #fff;
    border: 1px solid #dbdbdb;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}

.post-card .post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    gap: 12px;
    border-bottom: 1px solid #f3f3f3;
}

.post-user {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.post-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #eee;
    background: #fafafa;
}

.post-user-meta {
    min-width: 0;
    flex: 1;
}

.post-nic {
    font-weight: 700;
    font-size: 14px;
    color: #111;
    line-height: 1.3;
}

.post-stats-line {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.stats-link {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: #666;
    cursor: pointer;
    font-size: 12px;
}

.post-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.post-image-wrap img,
.swiper-slide img,
.swiper-slide-video video {
    width: 100%;
    display: block;
    max-height: min(75vh, 720px);
    object-fit: contain;
    background: #fff;
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px 0;
}

.icon-btn {
    border: none;
    background: none;
    font-size: 22px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.post-like-count {
    font-size: 13px;
    font-weight: 700;
    color: #111;
}

.post-content {
    padding: 10px 16px 8px;
    font-size: 14px;
    line-height: 1.55;
    color: #222;
    word-break: break-word;
}

.post-time {
    padding: 0 16px 16px;
    font-size: 12px;
    color: #999;
}

.feed-loader,
.empty-feed {
    text-align: center;
    padding: 24px 12px;
    color: #777;
}

/* =========================
   CAPTION / COMMENTS
========================= */
.caption {
    padding: 8px 16px;
    font-size: 14px;
    line-height: 1.4;
}

.caption.username {
    font-weight: 600;
}

.caption.content {
    margin-top: 8px;
    color: #262626;
    font-size: 14px;
    line-height: 1.6;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

/* ===== 댓글 영역 업그레이드 ===== */
.post-comments-wrap {
    padding: 2px 16px 14px;
    border-top: 1px solid #f5f5f5;
    background: #fff;
}

.comments {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 6px 0 10px;
}

.comment {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    line-height: 1.45;
    padding: 0;
    margin: 0;
    position: relative;
}

.comment img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    margin: 0;
}

.comment .username {
    font-weight: 700;
    color: #262626;
    margin-right: 4px;
    flex-shrink: 0;
}

.comment .text {
    flex: 1;
    color: #262626;
    word-break: break-word;
    padding-top: 2px;
}

.comment .small-btn.delete-comment-btn {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 6px;
    background: #f2f2f2;
    color: #444;
    flex-shrink: 0;
}

.comment-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding-top: 6px;
    border-top: 1px solid #f3f3f3;
}

.comment-form input[type="text"] {
    flex: 1;
    min-width: 0;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #dbdbdb;
    border-radius: 999px;
    margin: 0;
    font-size: 13px;
    background: #fff;
}

.comment-form input[type="text"]:focus {
    outline: none;
    border-color: #b9d8ff;
}

.comment-form button[type="submit"] {
    height: 38px;
    padding: 0 14px;
    border: none;
    border-radius: 999px;
    background: #0095f6;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
}

.comment-form button[type="submit"]:hover {
    background: #1877f2;
}

@media (max-width: 600px) {
    .post-comments-wrap {
        padding: 2px 12px 12px;
    }

    .comment img {
        width: 24px;
        height: 24px;
    }

    .comment-form input[type="text"] {
        height: 36px;
        font-size: 12px;
    }

    .comment-form button[type="submit"] {
        height: 36px;
        font-size: 12px;
        padding: 0 12px;
    }
}
.delete-button {
    position: absolute;
    left: -50px;
    width: 50px;
    height: 100%;
    background-color: red;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: left 0.3s ease;
}

.comment:hover .delete-button {
    left: 0;
}

/* =========================
   ICONS
========================= */
.share-icon {
    cursor: pointer;
    margin-right: 0;
    margin-left: 5px;
}

.share-icon svg {
    vertical-align: middle;
}

.share-icon:hover svg {
    fill: #262626;
}

.edit-icon {
    cursor: pointer;
    margin-right: 0;
    margin-left: 5px;
}

.edit-icon svg {
    vertical-align: middle;
}

.edit-icon:hover svg {
    fill: #262626;
}

.delete-icon {
    cursor: pointer;
    margin-left: 3px;
}

.delete-icon svg {
    vertical-align: middle;
}

.delete-icon:hover svg {
    fill: #b20710;
}

.like-active {
    fill: red;
}

/* =========================
   MODAL - COMMON
========================= */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.58);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

.modal.active {
    display: flex;
}

.modal-content {
    width: min(520px, 95vw);
    max-height: min(88vh, 820px);
    overflow: auto;
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    position: relative;
    animation: fadeIn 0.25s ease-in-out;
}

.modal-close,
.close-btn {
    position: absolute;
    right: 14px;
    top: 10px;
    border: none;
    background: none;
    font-size: 28px;
    cursor: pointer;
    color: #333;
}

.user-list {
    list-style: none;
    padding: 0;
    margin: 20px 0 0;
    max-height: 400px;
    overflow-y: auto;
}

.user-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.profile-image {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.nickname {
    font-size: 16px;
    font-weight: bold;
    color: #262626;
}

/* =========================
   FOLLOW MODAL
========================= */
.follow-list-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.follow-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.follow-item-user {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.follow-item-user img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #eee;
    background: #fafafa;
}

.follow-item-nic {
    font-weight: 700;
    color: #111;
    font-size: 14px;
}

.follow-item-id {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

/* =========================
   SWIPER
========================= */
.swiper-container {
    width: 100%;
    height: auto;
    overflow: hidden;
}

.swiper-slide {
    text-align: center;
}

.swiper-button-next,
.swiper-button-prev {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
}

.swiper-button-next {
    right: 10px;
}

.swiper-button-prev {
    left: 10px;
}

/* =========================
   FOOTER
========================= */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: rgba(255,255,255,0.96);
    backdrop-filter: blur(10px);
    border-top: 1px solid #dbdbdb;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -1px 5px rgba(0,0,0,0.08);
}

.footer-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.2s ease;
}

.footer-icon.footer-btn {
    border: none;
    background: none;
    padding: 0;
}

.footer-icon svg {
    width: 24px;
    height: 24px;
    fill: #262626;
    transition: fill 0.2s ease;
}

.footer-icon:hover svg {
    fill: #3897f0;
}

.footer-icon img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
}

.footer-icon.is-disabled {
    opacity: 0.7;
    cursor: default;
}

/* =========================
   EDIT MODAL (LEGACY SUPPORT)
========================= */
.edit-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.edit-modal-content {
    background-color: #ffffff;
    width: 90%;
    max-width: 400px;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    animation: fadeIn 0.3s ease-in-out;
}

.edit-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    cursor: pointer;
    color: #888;
    transition: color 0.2s ease;
}

.edit-close:hover {
    color: #333;
}

.edit-modal-content h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    color: #333;
}

.edit-post-form {
    display: flex;
    flex-direction: column;
}

.edit-post-form label {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
}

.edit-post-form input[type="text"],
.edit-post-form textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    margin-bottom: 15px;
    transition: border-color 0.2s ease;
}

.edit-post-form input[type="text"]:focus,
.edit-post-form textarea:focus {
    border-color: #3897f0;
    outline: none;
}

#updateButton {
    background-color: #4CAF50;
    color: #ffffff;
    border: none;
    padding: 10px 0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    transition: background-color 0.3s ease;
    width: 100%;
    margin-top: 10px;
}

#updateButton:hover {
    background-color: #45a049;
}

/* =========================
   POST CREATE MODAL
========================= */
.post-create-modal .modal-content.post-create-modal-content {
    width: min(1120px, calc(100vw - 24px));
    max-width: 1120px;
    height: min(88vh, 860px);
    max-height: min(88vh, 860px);
    padding: 0;
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.modal-close-ig {
    position: absolute;
    top: 10px;
    left: 12px !important;
    right: auto !important;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(0,0,0,0.05);
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    color: #222;
    cursor: pointer;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.post-create-header {
    flex: 0 0 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 56px;
    border-bottom: 1px solid #dbdbdb;
    background: #fff;
}

.post-create-title {
    font-size: 16px;
    font-weight: 700;
    color: #262626;
}

.post-create-submit-top {
    position: absolute;
    right: 16px;
    left: auto;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: #0095f6;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    z-index: 30;
}

.post-create-submit-top:disabled {
    opacity: 0.55;
    cursor: default;
}

.post-create-form {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.post-create-body {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

.post-create-left {
    min-width: 0;
    min-height: 0;
    background: #fafafa;
    border-right: 1px solid #dbdbdb;
    display: flex;
}

.upload-dropzone {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #fafafa;
}

.upload-dropzone.is-dragover {
    background: #f0f8ff;
}

.upload-dropzone-inner {
    text-align: center;
    padding: 30px;
    width: 100%;
}

.upload-icon {
    font-size: 56px;
    margin-bottom: 14px;
}

.upload-title {
    font-size: 22px;
    font-weight: 300;
    color: #262626;
    margin-bottom: 8px;
}

.upload-subtitle {
    font-size: 14px;
    color: #8e8e8e;
    margin-bottom: 20px;
}

.select-image-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0095f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.select-image-btn:hover {
    background: #1877f2;
}

.select-image-btn.small {
    padding: 8px 12px;
    font-size: 13px;
}

.preview-stage {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.preview-stage.hidden,
.upload-dropzone-inner.hidden {
    display: none;
}

.preview-main-wrap {
    flex: 1;
    min-height: 0;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.preview-toolbar {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-top: 1px solid #dbdbdb;
    background: #fff;
}

.preview-count {
    font-size: 13px;
    font-weight: 700;
    color: #262626;
}

.preview-thumb-list {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    padding: 12px 14px 16px;
    overflow-x: auto;
    overflow-y: hidden;
    background: #fff;
    border-top: 1px solid #f1f1f1;
}

.preview-thumb-item {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    flex: 0 0 auto;
    border: 2px solid transparent;
    cursor: pointer;
    background: #f2f2f2;
}

.preview-thumb-item.active {
    border-color: #0095f6;
}

.preview-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-thumb-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.65);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
}

.post-create-right {
    min-width: 0;
    min-height: 0;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.composer-user {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 18px 12px;
    border-bottom: 1px solid #f3f3f3;
}

.composer-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    background: #f2f2f2;
    flex-shrink: 0;
}

.composer-user-meta {
    min-width: 0;
}

.composer-nickname {
    font-size: 14px;
    font-weight: 700;
    color: #262626;
}

.composer-subtext {
    font-size: 12px;
    color: #8e8e8e;
    margin-top: 2px;
}

.post-create-textarea {
    flex: 1;
    min-height: 0;
    width: 100%;
    border: none !important;
    outline: none;
    resize: none;
    padding: 16px 18px;
    font-size: 15px;
    line-height: 1.6;
    color: #262626;
    background: #fff;
    margin: 0 !important;
    overflow-y: auto;
    -webkit-appearance: none;
}

.post-create-meta {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 10px 18px 12px;
    font-size: 12px;
    color: #8e8e8e;
    border-top: 1px solid #f5f5f5;
    background: #fff;
}

.post-create-submit-bottom {
    flex: 0 0 auto;
    margin: 0;
    border-radius: 0;
    background: #111;
    min-height: 52px;
    position: sticky;
    bottom: 0;
    z-index: 2;
}

.post-create-submit-bottom:hover {
    background: #000;
}

/* =========================
   LIKE ANIMATION
========================= */
.heart-explosion {
    position: absolute;
    pointer-events: none;
    z-index: 9999;
    animation: burst 0.8s ease-out forwards;
}

.heart-shrink {
    position: absolute;
    pointer-events: none;
    z-index: 9999;
    animation: shrink 0.8s ease-out forwards;
}

@keyframes burst {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(3) translateY(-50px);
        opacity: 0;
    }
}

@keyframes shrink {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 980px) {
    .feed-layout {
        gap: 18px;
    }

    .post-create-modal .modal-content.post-create-modal-content {
        width: min(100vw - 20px, 1040px);
    }

    .post-create-body {
        grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    }
}

@media (max-width: 860px) {
    .feed-layout,
    .feed-container {
        display: block;
        padding: 12px 0 96px;
        margin-top: 64px;
    }

    .feed-section {
        max-width: 100%;
    }

    .sidebar-ad {
        display: none;
        position: static;
        margin-top: 20px;
    }

    .post-create-modal {
        padding: 0;
    }

    .post-create-modal .modal-content.post-create-modal-content {
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }

    .post-create-header {
        position: sticky;
        top: 0;
        z-index: 5;
    }

    .post-create-body {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        height: calc(100dvh - 56px);
        min-height: 0;
    }

    .post-create-left {
        border-right: none;
        border-bottom: 1px solid #dbdbdb;
    }

    .upload-dropzone {
        min-height: 0;
        height: auto;
    }

    .preview-main-wrap {
        height: min(42dvh, 360px);
        min-height: 220px;
        max-height: 42dvh;
    }

    .upload-dropzone-inner {
        min-height: 260px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .post-create-right {
        min-height: 0;
        overflow: hidden;
    }

    .post-create-textarea {
        min-height: 0;
    }

    .post-create-submit-bottom {
        min-height: 54px;
    }
}

@media (max-width: 600px) {
    header {
        padding: 8px 0;
    }

    header h1,
    .feed-page-header h1 {
        font-size: 1.5rem;
    }

    .feed-page-header-inner {
        padding: 8px 10px;
        min-height: 52px;
    }

    .feed-page-header h1 {
        line-height: 34px;
    }

    .feed-page-add-btn {
        right: 10px;
    }

    #addPostButton {
        padding: 8px 12px;
        font-size: 13px;
        border-radius: 7px;
    }

    main {
        padding: 10px;
        margin-top: 0;
    }

    .feed-layout {
        margin-top: 60px;
    }

    .feed {
        padding: 0;
        margin-top: 10px;
    }

    .post,
    .post-card {
        border-radius: 0;
        margin-bottom: 10px;
        border-left: none;
        border-right: none;
    }

    .post-header,
    .post-card .post-header {
        padding: 10px 12px;
    }

    .post-header .profile-image {
        width: 24px;
        height: 24px;
        margin-right: 8px;
    }

    .post-avatar {
        width: 36px;
        height: 36px;
    }

    .post-header .username {
        font-size: 12px;
    }

    .post-header .timestamp,
    .post-stats-line {
        font-size: 11px;
    }

    .post img,
    .post-video {
        height: 500px;
    }

    .post-footer {
        padding: 8px;
    }

    .post-footer .actions {
        margin-bottom: 6px;
    }

    .post-footer .likes,
    .post-footer .caption,
    .post-content {
        font-size: 14px;
    }

    .post-content {
        padding: 10px 12px 8px;
    }

    .post-time {
        padding: 0 12px 14px;
    }

    .post-footer .comments {
        margin-top: 6px;
        max-height: 120px;
    }

    .comment img {
        width: 20px;
        height: 20px;
        margin-right: 6px;
    }

    .comment .username,
    .comment .text,
    .comment-form input[type="text"],
    .comment-form button[type="submit"] {
        font-size: 12px;
    }

    .comment-form button[type="submit"] {
        padding: 6px 12px;
    }

    .modal-content {
        width: calc(100vw - 20px);
        max-height: 90dvh;
        border-radius: 14px;
        padding: 15px;
    }

    .close-btn {
        font-size: 20px;
        top: 5px;
        right: 5px;
    }

    .user-list {
        margin-top: 10px;
        max-height: 300px;
    }

    .user-item {
        margin-bottom: 10px;
    }

    .preview-toolbar {
        padding: 10px 12px;
    }

    .preview-thumb-list {
        padding: 10px 12px 14px;
    }

    .preview-thumb-item {
        width: 64px;
        height: 64px;
    }

    .composer-user {
        padding: 14px 14px 10px;
    }

    .post-create-textarea {
        padding: 14px;
        font-size: 14px;
    }

    .post-create-meta {
        padding: 8px 14px 10px;
    }
}
.post-user-link {
    text-decoration: none;
    color: inherit;
}

.post-user-link:hover .post-nic {
    text-decoration: underline;
}
/* =========================
   EDIT POST MODAL
========================= */
.edit-post-modal .modal-content.edit-post-modal-content {
    width: min(760px, calc(100vw - 24px));
    max-width: 760px;
    height: min(82vh, 720px);
    max-height: min(82vh, 720px);
    padding: 0;
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.edit-close-ig {
    left: 12px !important;
    right: auto !important;
}

.edit-post-header {
    flex: 0 0 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 56px;
    border-bottom: 1px solid #dbdbdb;
    background: #fff;
}

.edit-post-title {
    font-size: 16px;
    font-weight: 700;
    color: #262626;
}

.edit-post-submit-top {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: #0095f6;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.edit-post-submit-top:disabled {
    opacity: 0.55;
    cursor: default;
}

.edit-post-form-modern {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.edit-post-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.edit-post-user {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 18px 12px;
    border-bottom: 1px solid #f3f3f3;
}

.edit-post-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    background: #f2f2f2;
    flex-shrink: 0;
}

.edit-post-user-meta {
    min-width: 0;
}

.edit-post-nickname {
    font-size: 14px;
    font-weight: 700;
    color: #262626;
}

.edit-post-subtext {
    font-size: 12px;
    color: #8e8e8e;
    margin-top: 2px;
}

.edit-post-textarea {
    flex: 1;
    min-height: 0;
    width: 100%;
    border: none !important;
    outline: none;
    resize: none;
    padding: 18px;
    font-size: 15px;
    line-height: 1.7;
    color: #262626;
    background: #fff;
    margin: 0 !important;
    overflow-y: auto;
    -webkit-appearance: none;
}

.edit-post-meta {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 10px 18px 12px;
    font-size: 12px;
    color: #8e8e8e;
    border-top: 1px solid #f5f5f5;
    background: #fff;
}

.edit-post-submit-bottom {
    flex: 0 0 auto;
    margin: 0;
    border-radius: 0;
    background: #111;
    min-height: 52px;
    position: sticky;
    bottom: 0;
    z-index: 2;
}

.edit-post-submit-bottom:hover {
    background: #000;
}

@media (max-width: 860px) {
    .edit-post-modal {
        padding: 0;
    }

    .edit-post-modal .modal-content.edit-post-modal-content {
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }

    .edit-post-header {
        position: sticky;
        top: 0;
        z-index: 5;
    }
}

@media (max-width: 600px) {
    .edit-post-user {
        padding: 14px 14px 10px;
    }

    .edit-post-textarea {
        padding: 14px;
        font-size: 14px;
    }

    .edit-post-meta {
        padding: 8px 14px 10px;
    }
}
.noti-badge {
    position: absolute;
    top: -4px;
    right: -10px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ed4956;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}