@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@800&family=Noto+Sans+Thai:wght@800&display=swap');

body {
    overflow-y: auto;
}

/* Twemoji Fix */
img.emoji {
    height: 1em;
    width: 1em;
    margin: 0 .05em 0 .1em;
    vertical-align: -0.1em;
}

/* User List (Modal & General) */
.user-list-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s;
}

.user-list-item:hover {
    background-color: var(--hover-color);
}

.user-list-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 12px;
    overflow: hidden;
}

.user-list-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-list-info {
    flex: 1;
    overflow: hidden;
}

.user-list-name {
    font-weight: bold;
    font-size: 15px;
    color: var(--text-color);
}

.user-list-handle {
    color: var(--secondary-text);
    font-size: 14px;
}

.user-list-bio {
    font-size: 13px;
    color: var(--text-color);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-list-action {
    margin-left: 10px;
    flex-shrink: 0;
}

@media (max-width: 500px) {
    .user-list-item {
        align-items: center;
    }

    .user-list-name {
        font-size: 14px;
    }

    .user-list-handle {
        font-size: 13px;
    }

    .user-list-action .btn-follow {
        padding: 4px 10px;
        font-size: 13px;
    }
}

/* Follow Button */
.btn-follow {
    background-color: #0f1419;
    color: #fff;
    border: 1px solid transparent;
    padding: 6px 16px;
    border-radius: 9999px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.light-mode .btn-follow {
    background-color: #0f1419;
    color: #fff;
}

.btn-follow.following {
    background-color: transparent;
    color: inherit;
    border: 1px solid var(--border-color);
}

.btn-follow:hover {
    opacity: 0.9;
}

.avatar-img {
    width: 40px !important;
    height: 40px !important;
    max-width: 40px;
    max-height: 40px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.tweet-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    margin-right: 12px;
    overflow: hidden;
}

.tweet-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

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

.tweet-more {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
}

.tweet-more:hover {
    background-color: var(--hover-color);
}

.tweet-more i {
    font-size: 16px;
}

.tweet-more-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px 0;
    min-width: 120px;
    z-index: 1500;
}

.tweet-more-menu button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: var(--text-color);
    text-align: left;
    font-size: 14px;
    cursor: pointer;
}

.tweet-more-menu button:hover {
    background-color: var(--hover-color);
}

.profile-avatar-container {
    position: absolute;
    top: 130px;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: fit-content;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    z-index: 5;
}

.profile-bio-text {
    margin-top: 15px;
    text-align: center;
    font-size: 15px;
    color: var(--text-color);
    font-weight: 600;
    white-space: nowrap;
}

.profile-cover {
    height: 200px;
    background-color: #cfd9de;
    position: relative;
    /* Background image set inline */
}

.profile-header {
    position: relative;
    padding-bottom: 10px;
}

.profile-action-btn-container {
    position: absolute;
    right: 16px;
    top: 212px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10;
}

.profile-gear-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background-color: transparent;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 18px;
}

.profile-gear-btn:hover {
    background-color: var(--hover-color);
}

.btn-upload-cover {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.btn-upload-cover:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.profile-avatar-ring {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid #ffffff;
    box-sizing: border-box;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.gold-btn {
    position: absolute;
    bottom: -65px;
    right: 20px;
    z-index: 10;

    /* Modern Button Styles */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;

    /* Sophisticated Gold Gradient */
    background: linear-gradient(135deg, #FFD700 0%, #FFB300 100%);

    /* Readable Text */
    color: #2c1a00;
    /* Dark Brown/Black for elegance */
    font-family: 'Montserrat', 'Noto Sans Thai', sans-serif;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.5px;

    /* Shape & Depth */
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 15px rgba(255, 179, 0, 0.25);

    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    white-space: nowrap;
}

.gold-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 179, 0, 0.4);
    filter: brightness(1.05);
}

.gold-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 179, 0, 0.3);
}

/* Disable old effects */
.gold-btn::before {
    display: none;
}

/* Ensure the main text (Black) sits on top cleanly */
.gold-btn::after {
    display: none;
}

@keyframes rotateShimmer {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

.profile-avatar-ring img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-info-center {
    margin-top: 95px;
}

.profile-name {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-color);
}

.profile-handle {
    margin-top: 4px;
    font-size: 16px;
    /* Reduced by 2pt (approx 2px) from 18px */
    font-weight: 700;
    color: var(--secondary-text);
}

.profile-joined {
    margin-top: 10px;
    font-size: 14px;
    color: var(--secondary-text);
}

.profile-follow-stats {
    margin-top: 10px;
    font-size: 14px;
}

.profile-follow-number {
    font-weight: 700;
    color: var(--text-color);
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    align-items: flex-start;
    justify-content: center;
    padding-top: 60px;
}

.modal-content {
    background-color: var(--background-color);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 600px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
    padding: 12px;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .modal-content {
        width: 90%;
        max-width: 560px;
    }

    .modal {
        align-items: flex-start;
        padding-top: 40px;
    }
}

#postModal .modal-content.post-modal-content.twitter-style-modal {
    margin-top: 0;
    border: none;
}

.twitter-style-modal .home-composer {
    display: flex;
    flex-direction: column;
    height: 100%;
}
}

.post-modal-body {
    display: flex;
    padding: 16px;
    gap: 12px;
}

.post-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.post-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-input-area {
    flex: 1;
}

.post-input-area textarea {
    width: 100%;
    background-color: transparent;
    border: none;
    outline: none;
    resize: none;
    color: var(--text-color);
    font-size: 18px;
    min-height: 45px;
    padding-top: 12px;
}

.post-input-area textarea::placeholder {
    color: var(--secondary-text);
}

.post-input-area textarea:focus {
    outline: none;
}

.post-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px 16px;
    border-top: 1px solid var(--border-color);
}

.twitter-style-modal .post-modal-footer {
    border-top: none;
    padding-top: 0;
}

.user-badge img {
    width: 48px;
    height: 48px;
    max-width: 80px;
    max-height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.who-to-follow-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
}

.who-to-follow-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

:root {
    --background-color: #000000;
    --text-color: #e7e9ea;
    --secondary-text: #71767b;
    --border-color: #2f3336;
    --card-bg: #16181c;
    --hover-color: rgba(255, 255, 255, 0.03);
    --input-bg: #202327;
    --primary-color: #1d9bf0;
}

html.light-mode {
    --background-color: #ffffff;
    --text-color: #0f1419;
    --secondary-text: #536471;
    --border-color: #e5e7eb;
    --card-bg: #ffffff;
    --hover-color: rgba(15, 20, 25, 0.03);
    --input-bg: #f7f9f9;
}

:root.jb-mode {
    --background-color: #15202b;
    --text-color: #e7e9ea;
    --secondary-text: #8899a6;
    --border-color: #38444d;
    --card-bg: #1c2732;
    --hover-color: rgba(255, 255, 255, 0.03);
    --input-bg: #1c2732;
    --primary-color: #1d9bf0;
    --primary-color-dark: #1a8cd8;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    /* overflow: hidden; Removed to allow browser scroll */
    min-height: 100vh;
}

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

.app-layout {
    display: flex;
    justify-content: center;
    max-width: 1350px;
    margin: 0 auto;
    /* min-height: 100vh; Removed for natural scroll flow */
}

/* overflow: hidden; Removed */
}

.left-sidebar {
    width: 235px;
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    overflow-y: auto;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
    border-right: 1px solid var(--border-color);
    box-sizing: border-box;
}

.left-sidebar::-webkit-scrollbar {
    display: none;
}

.logo-area {
    padding: 12px;
    margin-bottom: 4px;
}

.logo-brand {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
}

.logo-circle {
    min-width: auto;
    height: auto;
    border-radius: 0;
    border: none;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    font-weight: 800;
    font-family: "Kanit", "Prompt", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    cursor: pointer;
    padding: 0;
}

.logo-text {
    display: inline-flex;
    align-items: baseline;
    font-size: 24px;
    letter-spacing: 1px;
    line-height: 1;
}

.logo-img {
    height: 60px;
    width: auto;
    display: block;
}

/* Header specific logo sizing */
.header .logo-img,
.mobile-header .logo-img {
    height: 32px;
}

.logo-nine {
    margin-left: 2px;
}

.logo-beta {
    font-size: 10px;
    font-weight: 700;
    color: var(--secondary-text);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    padding: 1px 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    border-radius: 9999px;
    font-size: 20px;
    color: var(--text-color);
    transition: background-color 0.2s;
    width: fit-content;
}

.nav-item i {
    margin-right: 20px;
    font-size: 24px;
    width: 24px;
    text-align: center;
}

.nav-avatar-img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 20px;
}

.nav-item span {
    font-weight: 400;
}

.nav-item.active span {
    font-weight: 700;
}

.nav-item:hover {
    background-color: var(--hover-color);
}

.sidebar-actions {
    padding: 0 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-pro-subscribe,
.btn-post-action {
    width: 100%;
    border-radius: 9999px;
    padding: 12px 0;
    border: none;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    background: radial-gradient(circle at 30% 30%, #ffe89a, #f2c24b);
    color: #2a1c00;
}

.btn-pro-remaining {
    margin-left: 6px;
    font-size: 12px;
}

.user-badge {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 9999px;
    cursor: pointer;
    margin-bottom: 12px;
    transition: background-color 0.2s;
}

.user-badge:hover {
    background-color: var(--hover-color);
}

.user-badge-info {
    flex: 1;
    overflow: hidden;
}

.user-badge-name {
    font-weight: bold;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-badge-handle {
    color: var(--secondary-text);
    font-size: 14px;
}

.badge-pro,
.badge-premium {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    margin-top: 4px;
}

.badge-pro {
    background: #1d9bf0;
    color: #ffffff;
}

.badge-premium {
    background: #ffd700;
    color: #000000;
}

.user-menu {
    position: absolute;
    left: 12px;
    bottom: 80px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    display: none;
    min-width: 180px;
    z-index: 1100;
}

.user-menu a {
    display: block;
    padding: 10px 12px;
}

.user-menu a:hover {
    background-color: var(--hover-color);
}

.main-feed {
    width: 650px;
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
    padding-bottom: 80px;
    /* height: 100%; Removed for global scroll */
    /* overflow-y: auto; Removed for global scroll */
}

.main-feed::-webkit-scrollbar {
    display: none;
}

.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0 16px;
    height: 53px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-center {
    justify-content: center;
}

html.light-mode .header {
    background-color: var(--background-color);
}

.header h1 {
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
}

.header h1 .logo-text {
    font-size: 24px;
}

.home-composer {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
    box-sizing: border-box;
}

/* Twitter-style inline composer card */
.twitter-inline-composer {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin: 12px 16px;
}

.home-composer.twitter-inline-composer {
    border-bottom: none;
    padding: 12px 16px 8px;
    box-sizing: border-box;
    width: calc(100% - 4px);
    margin: 12px auto;
}

.twitter-style-modal .twitter-inline-composer {
    margin: 12px auto;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background-color: var(--card-bg);
    box-shadow: none;
    width: calc(100% - 4px);
    box-sizing: border-box;
}

.post-modal-body-twitter {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-modal-content.twitter-style-modal {
    position: relative;
    padding-top: 32px;
    padding-bottom: 16px;
    border: none;
    width: 100%;
    box-sizing: border-box;
    min-height: 520px;
    display: flex;
    flex-direction: column;
}

.post-modal-header-twitter {
    position: absolute;
    top: 10px;
    left: 10px;
}

.home-composer-inner {
    display: flex;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.home-composer-textarea {
    flex: 1;
    width: 100%;
    background-color: transparent;
    border: none;
    outline: none;
    resize: none;
    color: var(--text-color);
    font-size: 18px;
    min-height: 80px;
    padding-top: 16px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
    max-width: 100%;
    box-sizing: border-box;
}

.twitter-style-modal .home-composer-textarea {
    min-height: 120px;
}

.home-composer-textarea::placeholder {
    color: var(--secondary-text);
    font-size: 20px;
}

.home-composer-textarea[contenteditable="true"][data-empty="true"]::before {
    content: attr(data-placeholder);
    color: var(--secondary-text);
    font-size: 20px;
    pointer-events: none;
}

.home-composer-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    width: 100%;
    box-sizing: border-box;
}

.twitter-style-modal .home-composer-tools {
    margin-top: auto;
}

.home-composer-icons {
    display: flex;
    gap: 4px;
}

.composer-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--primary-color);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.composer-icon-btn:hover {
    background-color: rgba(29, 155, 240, 0.1);
}

.composer-icon-btn input[type="file"] {
    display: none;
}

.emoji-picker {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 8px 8px 4px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.6);
    width: 100%;
    max-width: none;
    max-height: 360px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: hidden;
    margin-top: 8px;
}

.emoji-picker-header {
    padding: 4px 4px 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.emoji-picker-search-wrap {
    width: 100%;
}

.emoji-picker-search-input {
    width: 100%;
    box-sizing: border-box;
    border-radius: 9999px;
    border: 1px solid var(--border-color);
    background-color: var(--input-bg);
    color: var(--text-color);
    padding: 6px 10px;
    font-size: 13px;
}

.emoji-picker-search-input::placeholder {
    color: var(--secondary-text);
}

.emoji-picker-preview {
    border-radius: 12px;
    background-color: rgba(29, 155, 240, 0.12);
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 34px;
    flex: 1 1 auto;
}

.emoji-picker-preview img {
    width: 29px;
    height: 29px;
}

.emoji-picker-preview-icon {
    width: 29px;
    height: 29px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-size: 19px;
}

.emoji-picker-preview-text {
    font-size: 14px;
    color: var(--text-color);
}

.emoji-picker-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 4px;
    min-height: 0;
    overflow: hidden;
}

.emoji-picker-quick-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.emoji-picker-recents {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 32px;
    overflow-x: auto;
}

.emoji-picker-recents-label {
    font-size: 12px;
    color: var(--secondary-text);
    padding-right: 4px;
}

.emoji-picker-recents-empty {
    font-size: 12px;
    color: var(--secondary-text);
}

.emoji-picker-recent-item {
    width: 32px;
    height: 32px;
}

.emoji-picker-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px;
    margin-bottom: 4px;
}

.emoji-picker-tab {
    flex: 0 0 auto;
    min-width: 32px;
    height: 32px;
    border-radius: 9999px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--secondary-text);
    font-size: 18px;
    padding: 0 8px;
}

.emoji-picker-tab.active {
    background-color: rgba(29, 155, 240, 0.15);
    color: var(--primary-color);
}

.emoji-picker-grid {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 42px;
    gap: 0.5px;
    padding-top: 1px;
    height: 150px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.emoji-picker-footer {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    position: sticky;
    bottom: 0;
    background-color: var(--card-bg);
}

.emoji-picker-close-btn {
    width: 28px;
    height: 28px;
    border-radius: 9999px;
    border: none;
    background-color: rgba(29, 155, 240, 0.9);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
}

.emoji-picker-close-btn:hover {
    background-color: rgba(29, 155, 240, 1);
}

/* Center within post modal and set width to 70% of modal */
#postModal .emoji-picker {
    width: 70%;
    border-radius: 16px;
}

/* Hide scrollbars completely but keep touch/scroll behavior */
.emoji-picker-grid {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.emoji-picker-grid::-webkit-scrollbar {
    display: none;
}

/* Prevent horizontal shake on whole page */
html,
body {
    overflow-x: hidden;
}

.emoji-picker-item {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    font-size: 18px;
    line-height: 1;
}

.emoji-picker-clear-recent {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: var(--secondary-text);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.emoji-picker-item img {
    max-width: 100%;
    max-height: 100%;
}

.emoji-picker-empty {
    font-size: 13px;
    color: var(--secondary-text);
    padding: 8px 4px;
}

.emoji-icon {
    width: 20px;
    height: 20px;
    vertical-align: -4px;
}

.preview-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.preview-container.single-image {
    grid-template-columns: 1fr;
}

.image-preview-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background-color: #333;
}

.image-preview-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.75);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin: 4px;
}

.remove-image-btn:hover {
    background-color: rgba(0, 0, 0, 0.9);
}

.post-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.post-tools-icons {
    display: flex;
    gap: 4px;
}

.post-privacy {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 9999px;
    cursor: pointer;
    margin-bottom: 12px;
    width: fit-content;
}

.post-privacy:hover {
    background-color: rgba(29, 155, 240, 0.1);
}

.post-audience {
    color: var(--primary-color);
    padding: 4px 10px;
    font-size: 13px;
}

.twitter-style-modal .reply-restriction {
    margin-top: -6px;
}

.btn-post-submit {
    padding: 8px 16px;
    border-radius: 9999px;
    border: none;
    background: radial-gradient(circle at 30% 30%, #ffe89a, #f2c24b);
    color: #2a1c00;
    font-weight: 700;
    cursor: pointer;
}

.btn-post-submit[disabled] {
    opacity: 0.5;
    cursor: default;
}

.twitter-textarea {
    display: block;
    width: 100%;
    background-color: transparent;
    border: none;
    outline: none;
    resize: none;
    color: var(--text-color);
    font-size: 18px;
    min-height: 80px;
    padding-top: 16px;
    padding-left: 8px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.twitter-textarea::-webkit-scrollbar {
    display: none;
}

.twitter-textarea::placeholder {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.post-tools-twitter {
    margin-left: 52px;
}

.close-modal-btn-twitter {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 20px;
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    margin-bottom: 15px;
    /* Added spacing from user avatar */
}

.close-modal-btn-twitter:hover {
    color: var(--primary-color);
}

.close-modal-btn-twitter i {
    font-size: 24px;
    font-weight: 900;
}

.right-sidebar {
    width: 300px;
    padding: 12px 0 100px 24px;
    /* Increased bottom padding to prevent cut-off */
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
    overflow-y: auto;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
    box-sizing: border-box;
}

.right-sidebar::-webkit-scrollbar {
    display: none;
}

.search-container {
    position: sticky;
    top: 0;
    background-color: var(--background-color);
    padding-bottom: 12px;
    z-index: 900;
}

.search-bar {
    background-color: var(--input-bg);
    border-radius: 9999px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    color: var(--secondary-text);
    border: 1px solid transparent;
}

.search-bar:focus-within {
    background-color: var(--background-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.search-bar input {
    background: transparent;
    border: none;
    outline: none;
    margin-left: 12px;
    font-size: 15px;
    color: var(--text-color);
    width: 100%;
}

.trend-card {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 16px;
}

.trend-card h3 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 16px;
}

.icon-youtube,
.trend-title-youtube {
    color: #ff0000;
}

.icon-tiktok,
.trend-title-tiktok {
    color: #00f2ea;
}

.icon-instagram,
.trend-title-instagram {
    color: #e1306c;
}

.trend-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    cursor: pointer;
}

.trend-item:last-child {
    margin-bottom: 0;
}

.trend-meta {
    font-size: 13px;
    color: var(--secondary-text);
}

.trend-name {
    font-weight: bold;
    font-size: 15px;
    margin: 2px 0;
}

.tweet {
    display: flex;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

.tweet:hover {
    background-color: var(--hover-color);
}

@keyframes highlightReply {
    0% {
        background-color: rgba(29, 155, 240, 0.2);
    }

    100% {
        background-color: transparent;
    }
}

.highlight-reply {
    animation: highlightReply 2s ease-out;
}

.tweet-content {
    flex: 1;
    min-width: 0;
}

.tweet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
    flex-wrap: wrap;
}

.username {
    font-weight: 700;
    color: var(--text-color);
    margin-right: 4px;
}

.handle,
.time,
.dot {
    color: var(--secondary-text);
    font-size: 15px;
}

.dot {
    margin: 0 4px;
}

.hashtag {
    color: var(--primary-color);
    font-weight: normal;
}

.highlight {
    font-weight: 700;
}

.tweet-text-container {
    position: relative;
    max-height: 250px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.tweet-text-container.has-image {
    max-height: 250px;
}

.tweet-text-container.expanded {
    max-height: none;
    overflow: visible;
}

.tweet-text-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: linear-gradient(to bottom, transparent, var(--background-color));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.tweet-text-container.is-truncated::after {
    opacity: 1;
}

.tweet-text-container.expanded::after {
    opacity: 0;
}

.tweet-more-btn {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: bold;
    padding: 8px 0;
    cursor: pointer;
    text-align: left;
    margin-top: -10px;
    position: relative;
    z-index: 10;
}

.tweet-more-btn:hover {
    text-decoration: underline;
}

.tweet-text {
    font-size: 16px;
    color: var(--text-color);
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 12px;
    line-height: 20px;
    text-align: left;
}

.jump-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #ff8a00;
}

.jump-badge .fa-bolt {
    color: #ffd700;
}

.tweet-images {
    margin-top: 12px;
    border-radius: 16px;
    overflow: hidden;
    display: grid;
    gap: 2px;
    border: 1px solid var(--border-color);
}

.tweet-images-1 {
    grid-template-columns: 1fr;
}

.tweet-images-2 {
    grid-template-columns: 1fr 1fr;
}

.tweet-images-3 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.tweet-images-3 .tweet-image-item:first-child {
    grid-row: span 2;
}

.tweet-images-4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}


.tweet-image-item {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 150px;
    overflow: hidden;
    /* Ensure constraints clip */
}

.tweet-image-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    /* SOLO Builder Constraints */
    max-width: 100%;
    /* aspect-ratio is handled by grid container usually, but let's ensure image fits */
}

/* Force constraints if not in grid */
.tweet-images-1 .tweet-image-item {
    aspect-ratio: 16/9;
    /* Standard */
    max-height: 500px;
}


.tweet-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    max-width: 425px;
}

.tweet-action {
    display: flex;
    align-items: center;
    color: var(--secondary-text);
    font-size: 13px;
    cursor: pointer;
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 0;
}

.tweet-action i {
    margin-right: 8px;
    font-size: 18px;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.tweet-action:hover i {
    background-color: rgba(29, 155, 240, 0.1);
    color: var(--primary-color);
}

.tweet-action:hover {
    color: var(--primary-color);
}

.tweet-action.retweeted {
    color: #00ba7c;
}

.tweet-action.retweeted i {
    color: #00ba7c;
}

.tweet-action.retweeted:hover i {
    background-color: rgba(0, 186, 124, 0.1);
}

.tweet-action.liked {
    color: #f91880;
}

.tweet-action.liked i {
    color: #f91880;
    font-weight: 900;
}

.tweet-action.liked:hover i {
    background-color: rgba(249, 24, 128, 0.1);
}

.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 53px;
    background-color: var(--background-color);
    border-top: 1px solid var(--border-color);
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
}

.nav-icon-container {
    position: relative;
    display: inline-block;
}

.nav-badge {
    position: absolute;
    top: -4px;
    right: -10px;
    background-color: #f91880;
    color: #ffffff;
    border-radius: 999px;
    padding: 1px 5px;
    font-size: 10px;
    font-weight: 700;
    border: 2px solid var(--background-color);
    display: none;
    line-height: 1.2;
}

.bottom-nav-item {
    color: var(--text-color);
    font-size: 24px;
    padding: 8px;
}

/* Mobile Drawer */
.mobile-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.mobile-drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

.mobile-drawer {
    width: 280px;
    height: 100%;
    background-color: var(--background-color);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
}

.mobile-drawer-overlay.open .mobile-drawer {
    transform: translateX(0);
}

.mobile-drawer-header {
    margin-bottom: 24px;
}

.mobile-drawer-user {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.mobile-drawer-avatar-row {
    display: flex;
    align-items: center;
}

.mobile-drawer-user-info {
    margin-top: 10px;
    flex: 1;
    overflow: hidden;
}

.mobile-drawer-user img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0;
}

.mobile-drawer-name {
    font-weight: bold;
    font-size: 15px;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-drawer-handle {
    font-size: 14px;
    font-weight: 400;
    margin-top: 2px;
    color: var(--secondary-text);
}

.mobile-drawer-user .badge-pro,
.mobile-drawer-user .badge-premium {
    margin-left: 10px;
    margin-top: 0;
    font-size: 13px;
    padding: 3px 10px;
}

.mobile-drawer-menu {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mobile-drawer-menu a {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
}

.mobile-header {
    display: none;
}

@media (max-width: 900px) {
    .left-sidebar {
        display: none;
    }

    .right-sidebar {
        display: none;
    }

    .main-feed {
        width: 100%;
        border-right: none;
    }

    .bottom-nav {
        display: flex;
    }

    .header {
        display: none;
    }

    body.settings-page .header {
        display: flex;
    }

    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 53px;
        padding: 0 16px;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        box-sizing: border-box;
        z-index: 1000;
        background-color: var(--background-color);
        border-bottom: 1px solid var(--border-color);
    }

    .app-layout {
        padding-top: 54px;
    }

    .mobile-avatar-btn {
        background: transparent;
        border: none;
        padding: 0;
        cursor: pointer;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        overflow: hidden;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    .mobile-avatar-btn img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .mobile-avatar-btn i {
        font-size: 20px;
        color: var(--text-color);
    }

    .mobile-header-logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        cursor: pointer;
        display: flex;
        align-items: center;
    }

    .mobile-pro-btn {
        background: transparent;
        border: 1px solid var(--border-color);
        border-radius: 9999px;
        padding: 4px 12px;
        font-size: 12px;
        font-weight: 700;
        color: var(--text-color);
        cursor: pointer;
    }

    .home-composer {
        display: none;
    }

    .mobile-fab {
        position: fixed;
        bottom: 70px;
        right: 20px;
        left: auto;
        width: 64px;
        height: 64px;
        border-radius: 50%;
        background: var(--primary-color);
        color: #ffffff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 30px;
        font-weight: 900;
        box-shadow: 0 4px 12px rgba(29, 155, 240, 0.4);
        z-index: 9999;
        cursor: pointer;
    }
}

/* Lightbox V2 */
.image-lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 2600;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-lightbox-close {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 2610;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.image-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.image-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2610;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.image-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.1);
}

.image-lightbox-prev {
    left: 20px;
}

.image-lightbox-next {
    right: 20px;
}

.image-lightbox-image-wrapper {
    flex: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.image-lightbox-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
}

.image-lightbox-interaction-bar {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 32px;
    padding: 12px 32px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 30px;
    backdrop-filter: blur(8px);
    z-index: 10;
}

.lightbox-action-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s, color 0.2s;
}

.lightbox-action-btn:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.lightbox-action-btn .fa-solid.fa-heart {
    color: #f91880;
}

/* Profile Info Alignment Fix */
/* --- 미나의 2차 정밀 보정 (X버튼, 창 크기, 비율 최적화) --- */

/* 1. 모달 본체: 가로 450px -> 500px로 살짝 넓히고 세로 길이는 팍! 줄임 */
.modal-content {
    max-width: 500px !important;
    /* 좌우를 조금 더 넓혔어요 사장님! */
    min-height: auto !important;
    /* 너무 긴 세로 길이를 내용에 맞게 자동 조절 */
    height: auto !important;
    max-height: 400px !important;
    /* 창이 너무 길어지지 않게 상한선 딱! */
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    position: relative !important;
    /* X 표시 위치를 잡기 위한 기준점 */
}

/* 2. X 표시(닫기 버튼) 위치: 아이콘이랑 안 겹치게 구석으로 유배 보냄 */
.close-modal-btn-twitter {
    position: absolute !important;
    top: 12px !important;
    left: 12px !important;
    margin: 0 !important;
    z-index: 2100 !important;
    color: var(--text-color) !important;
}

/* 3. 내부 글쓰기 영역: X 버튼이랑 아바타 공간 확보 */
.post-modal-content.twitter-style-modal {
    padding-top: 50px !important;
    /* 위쪽에 여백을 줘서 아이콘들이 안 겹치게! */
    min-height: auto !important;
    height: auto !important;
}

/* 4. 하단 도구함: 바닥에 딱! 붙이되 슬림하게 */
.home-composer-tools {
    margin-top: 20px !important;
    /* 글 쓰는 영역이랑 살짝 띄워주기 */
    padding: 10px 16px !important;
    border-top: 1px solid var(--border-color) !important;
}

/* 5. 텍스트 입력창: 너무 길어지지 않게 조절 */
.twitter-textarea {
    min-height: 100px !important;
    max-height: 150px !important;
}

/* Global Clipping Fix: Prevent cutting off long content or embeds */
.tweet,
.post-content {
    max-height: none !important;
    overflow: visible !important;
    max-width: 100% !important;
    text-align: left !important;
}

/* Text Container: Restore max-height for text only, but allow expansion */
.tweet-text-container {
    overflow: hidden;
    position: relative;
    max-width: 100% !important;
    display: block;
}

/* Mobile Text Truncation Force */
@media (max-width: 500px) {
    .tweet-text-container {
        overflow: hidden;
    }
}

/* Unified Embed System - Fixed Dimensions */
.unified-embed-card {
    overflow: hidden !important;
    position: relative;
    width: 100%;
    /* Ensure aspect ratio is maintained by padding-bottom in HTML, 
       but here we ensure no spillover */
}

.card-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-color: #000;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.unified-embed-card iframe,
.unified-embed-card .tiktok-embed {
    max-width: 100% !important;
    max-height: 100% !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Play Button Overlay - Hidden Globally Except TikTok */
.play-button-overlay,
.unified-embed-card .fa-play,
.unified-embed-card .play-icon {
    display: none !important;
}

/* TikTok & YouTube Play Button Exception - Enhanced Visibility */
.unified-embed-card[data-type="tiktok"] .play-button-overlay,
.unified-embed-card[data-type="youtube"] .play-button-overlay {
    display: flex !important;
}

.unified-embed-card[data-type="tiktok"] .play-button-overlay>div,
.unified-embed-card[data-type="youtube"] .play-button-overlay>div {
    width: 72px !important;
    height: 72px !important;
}

.unified-embed-card[data-type="tiktok"] .play-button-overlay i,
.unified-embed-card[data-type="youtube"] .play-button-overlay i {
    display: block !important;
    font-size: 32px !important;
    color: white !important;
}

/* TikTok Scrollbar Elimination & Black Gallery Mode */
.tiktok-embed,
.tiktok-embed iframe {
    height: 100% !important;
    max-height: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    border: none !important;
    overflow: hidden !important;
    display: block !important;
    margin: 0 !important;
}

.tiktok-embed-container {
    overflow: hidden !important;
    width: 100% !important;
    height: 100% !important;
    background: #000 !important;
    display: block !important;
}

/* Instagram Scaling & Centering (Black Gallery Mode) */
.unified-embed-card.loaded[data-type="instagram"] iframe,
.instagram-embed-iframe {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 100% !important;
    height: 100% !important;
    background: #000 !important;
    object-fit: contain !important;
    min-height: unset !important;
    display: block !important;
    margin: 0 !important;
}

/* Source Label */
.source-label {
    font-size: 13px;
    color: var(--secondary-text);
    margin-top: 4px;
    margin-bottom: 8px;
    margin-left: 2px;
}

/* If text container has an embed, allow it to overflow naturally? 
   No, we want text to be truncated but embeds to be fully visible.
   This is tricky if they are in the same container.
   Ideally, embeds should be OUTSIDE the text container or the text container should handle them.
   For now, we will rely on the JS 'See More' button for long text.
*/
/* .tweet-text-container.is-expanded removed */


/* Global Embed Wrapper Style */
.lite-embed-wrapper {
    width: 100%;
    margin: 10px 0;
    display: block;
}

/* TikTok Fix: Fit content naturally with aspect ratio to avoid gaps */
/* .tiktok-embed-container,
iframe[src*="tiktok"] {
    min-height: unset !important;
    aspect-ratio: 9 / 16 !important;
    height: auto !important;
} */

.tiktok-embed-container iframe,
.tiktok-embed-container blockquote {
    width: 100% !important;
    height: 100% !important;
    min-height: unset !important;
    max-width: 100% !important;
    border: none !important;
    display: block !important;
    margin: 0 !important;
}

/* Ensure container clips any overflow from bad iframes */
.tiktok-embed-container {
    overflow: hidden !important;
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0;
    left: 0;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* YouTube Fix: Force aspect ratio and fill parent */
.lite-embed-wrapper[data-type="youtube"]:not([data-shorts="true"]) {
    aspect-ratio: 16 / 9 !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    display: block;
}

/* YouTube Shorts Specific Logic - Stronger Specificity to override globals */
body .lite-embed-wrapper[data-shorts="true"],
body .lite-embed-wrapper[data-shorts="true"] iframe {
    aspect-ratio: 9 / 16 !important;
    max-width: 350px !important;
    margin: 10px auto !important;
    width: 100% !important;
    height: 100% !important;
    display: block !important;
}

/* Global Embed Sizing - Force 16:9 for standard videos */
iframe[src*="youtube"]:not([src*="shorts"]),
iframe[src*="facebook"],
.video-container iframe,
.lite-embed-wrapper[data-type="youtube"]:not([data-shorts="true"]) iframe {
    aspect-ratio: 16 / 9 !important;
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
}

/* Instagram Fallback Style */
.instagram-lite[data-no-thumb="true"] {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    position: relative;
}

/* Instagram Fix: Force full width and minimum height */
.instagram-lite,
.instagram-lite iframe {
    width: 100% !important;
    max-width: none !important;
    min-height: 600px !important;
    height: auto !important;
}

.instagram-lite[data-no-thumb="true"]::after {
    content: "View on Instagram";
    color: white;
    font-weight: bold;
    font-size: 18px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* 70% Slim Magazine Layout - Mobile Optimized */
@media (max-width: 768px) {

    /* (1) Video & Embeds: Slim 70% Width with Cinematic Shadow */
    .lite-embed-wrapper,
    .unified-embed-card,
    .video-container {
        width: 70% !important;
        margin: 12px auto !important;
        /* Centered with vertical spacing */
        border-radius: 12px !important;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
        /* Cinematic Depth */
        border: 1px solid rgba(255, 255, 255, 0.1);
        /* Subtle Border */
        overflow: hidden !important;
        display: block !important;
        position: relative;
    }

    /* Images: Full Width for Maximum Visibility (Requested by User) - SUPER FORCE FIX */
    /* Only apply to Post View Page (Assuming body has a specific class or we target specific container) */
    /* Since we don't have a body class for post_view, we target .main-post-container which is unique to post_view */

    .main-post-container .tweet-images {
        width: 100% !important;
        margin: 12px 0 !important;
        border-radius: 12px !important;
        box-shadow: none !important;
        /* Remove shadow to maximize space */
        border: none !important;
        overflow: visible !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
    }

    .main-post-container .tweet-image-item {
        width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        aspect-ratio: unset !important;
        border-radius: 12px !important;
        overflow: hidden !important;
        position: relative !important;
    }

    .main-post-container .tweet-image-item img {
        position: relative !important;
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        object-fit: contain !important;
        /* Show full image content */
        display: block !important;
    }

    /* Reset Index/Feed Images to Original Small Grid */
    .tweet:not(.main-post-container) .tweet-images {
        width: 70% !important;
        /* Original Slim Width */
        margin: 12px auto !important;
        border-radius: 12px !important;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
        border: 1px solid rgba(255, 255, 255, 0.1);
        overflow: hidden !important;
        display: grid !important;
        /* Restore Grid */
        /* Columns handled by specific classes .tweet-images-1 etc */
    }

    /* (2) Scroll Safety Zone: Ensure touch events pass through sides */
    .tweet-content {
        padding-left: 0 !important;
        padding-right: 0 !important;
        position: relative;
    }

    /* (3) Text Balance Options - Option A: Slim Text (Matching Video) */
    .tweet-text {
        width: 85% !important;
        /* Text slightly wider than video for readability */
        margin: 0 auto 12px auto !important;
        line-height: 1.6;
        font-size: 16px;
        text-align: left;
    }

    /* Header info stays full width for context */
    .tweet-header {
        padding: 0 16px;
        margin-bottom: 8px;
    }

    /* Action buttons centered and slim */
    .tweet-actions {
        width: 70% !important;
        margin: 12px auto !important;
        justify-content: space-between !important;
    }
}

/* Force Full Width and Original Ratio for Post Detail View (Requested by User) - Global */
.main-post-container {
    text-align: left !important;
}

.main-post-container .tweet-images-1 {
    display: block !important;
    border: none !important;
}

.main-post-container .tweet-images-1 .tweet-image-item {
    aspect-ratio: unset !important;
    height: auto !important;
    max-height: none !important;
    min-height: auto !important;
    overflow: visible !important;
}

.main-post-container .tweet-images-1 .tweet-image-item img {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 12px;
}

.main-post-container .tweet-text {
    width: 100% !important;
    margin: 0 0 12px 0 !important;
    text-align: left !important;
    display: block !important;
}

.main-post-container .tweet-header div,
.main-post-container .tweet-header a {
    text-align: left !important;
}

.main-post-container .lite-embed-wrapper,
.main-post-container .unified-embed-card,
.main-post-container .video-container {
    width: 100% !important;
    margin: 12px 0 !important;
}

/* Global Responsive Adjustments for Facebook to prevent overflow */
.video-container.facebook-video {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    border-radius: 12px;
    margin: 10px 0;
}

.video-container.facebook-video iframe {
    width: 100%;
    /* Default height/ratio for FB if not set inline */
    aspect-ratio: 16/9;
}

/* --- Unified Embed Card System --- */

/* Mobile Breakout for Unified Card */
@media (max-width: 500px) {
    .unified-embed-card {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        border-radius: 0.5rem !important;
        border-left: 1px solid hsl(210, 21%, 28%) !important;
        border-right: 1px solid hsl(210, 21%, 28%) !important;
    }
}

/* Active/Loaded State - Transition from Card to Player */
.unified-embed-card.loaded {
    /* Keep the card dimensions exactly the same! */
    /* padding-bottom: 0 !important; */
    /* height: auto !important; */
    /* Do NOT remove padding-bottom; this maintains the aspect ratio container */

    background: #000 !important;
    /* Black background for video */
    border: none !important;
    overflow: hidden !important;
    /* Ensure video doesn't spill */
}

/* YouTube Active */
.unified-embed-card.loaded[data-type="youtube"] iframe {
    position: absolute !important;
    /* Stick to the container */
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

/* Instagram Active - Standard Fit */
.unified-embed-card.loaded[data-type="instagram"] iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    width: 100% !important;
    height: 100% !important;
    background: #fff !important;
    /* Instagram embed usually has white bg */
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* TikTok Active - Black Gallery Mode */
.unified-embed-card.loaded[data-type="tiktok"] .tiktok-embed-container {
    display: block !important;
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    background: #000 !important;
    border-radius: 0.5rem;
}

.unified-embed-card.loaded[data-type="tiktok"] iframe {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 300px !important;
    /* Aggressively fixed width */
    max-width: 80% !important;
    /* Ensure it never touches the edges */
    height: 115% !important;
    /* Push bottom controls out of view */
    object-fit: cover !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
}

/* Global Scroll Layout */
html,
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
}

.app-layout {
    display: flex;
    justify-content: center;
    max-width: 1350px;
    margin: 0 auto;
}

/* Sidebars sticky, Main Feed flows naturally */
.left-sidebar,
.right-sidebar {
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    box-sizing: border-box;
}

.feed,
.main-feed {
    width: 600px;
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
    padding-bottom: 80px;
    min-height: 100vh;
}

.profile-more-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px 0;
    min-width: 150px;
    z-index: 1500;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    margin-top: 8px;
}

.profile-more-menu.show {
    display: block;
}

.profile-more-menu button {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: var(--text-color);
    text-align: left;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.profile-more-menu button:hover {
    background-color: var(--hover-color);
}

.profile-more-menu button.danger {
    color: #f4212e;
}

.profile-more-menu button i {
    width: 20px;
    margin-right: 12px;
}

@media (max-width: 1000px) {
    .app-layout {
        display: block;
        width: 100%;
        min-height: auto;
    }

    .feed,
    .main-feed {
        width: 100%;
        border-right: none;
        flex: none;
        padding-bottom: 80px;
    }

    .left-sidebar,
    .right-sidebar {
        display: none;
    }

    /* Prevent horizontal overflow */
    html,
    body {
        overflow-x: hidden;
        width: 100%;
    }
}

#sentinel {
    width: 100%;
    height: 50px;
    clear: both;
}

/* Read More Button Styles */
.read-more-container {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    margin-top: 10px;
    margin-bottom: 15px;
}

.read-more-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--primary-color);
    padding: 8px 20px;
    border-radius: 9999px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    border: 1px solid var(--primary-color);
    transition: all 0.2s;
    cursor: pointer;
}

.read-more-link:hover {
    background-color: rgba(29, 155, 240, 0.1);
}

@media (max-width: 500px) {
    .read-more-container {
        justify-content: center;
        /* Center on mobile for better look */
        padding-right: 10px;
        /* Offset for avatar space if needed, but centering is usually safer */
    }

    .read-more-link {
        width: 90%;
        /* Make it wider on mobile */
        justify-content: center;
        padding: 10px 0;
        font-size: 15px;
    }
}