.page-home,
.page-app {
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(12, 107, 88, 0.12), transparent 22%),
        radial-gradient(circle at bottom left, rgba(208, 159, 67, 0.1), transparent 24%),
        linear-gradient(180deg, #f8f3ea 0%, #efe5d7 100%);
}

.layout-home,
.layout-app {
    width: min(1320px, calc(100% - 32px));
    max-width: 1320px;
    padding: 20px 0 28px;
}

.app-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.app-main {
    min-width: 0;
}

.x-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
}

.x-sidebar,
.x-feed,
.x-aside {
    min-width: 0;
}

.x-sidebar,
.x-aside {
    position: sticky;
    top: 20px;
}

.x-brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding: 10px 4px;
    font-family: "Manrope", sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
}

.x-brand-mark,
.avatar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #9ed9b6 100%);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(12, 107, 88, 0.18);
}

.x-brand-mark {
    width: 46px;
    height: 46px;
}

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

.x-nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 12px 14px;
    border-radius: 18px;
    color: #352f27;
    font-size: 0.94rem;
    font-weight: 600;
    transition:
        background-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.x-nav-link:hover,
.x-nav-link.active {
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 10px 24px rgba(34, 28, 18, 0.06);
    transform: translateY(-1px);
}

.x-nav-icon {
    width: 24px;
    text-align: center;
    color: var(--accent-strong);
    line-height: 0;
}

.icon-svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    height: 1.15rem;
    flex: 0 0 auto;
}

.icon-svg svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-heart svg,
.icon-bookmark svg,
.icon-comment svg,
.icon-profile svg,
.icon-user svg,
.icon-home svg,
.icon-search svg,
.icon-explore svg,
.icon-settings svg {
    overflow: visible;
}

.x-post-button,
.x-publish,
.x-publish-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.x-post-button {
    width: 100%;
    margin: 18px 0 16px;
    padding: 15px 18px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
}

.x-profile-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(216, 200, 174, 0.9);
    box-shadow: 0 12px 28px rgba(34, 28, 18, 0.05);
}

.x-profile-mini strong,
.x-profile-mini span,
.follow-user strong,
.follow-user span {
    display: block;
}

.x-profile-mini span,
.follow-user span,
.trend-item span,
.trend-item small,
.x-post-head span,
.x-post-actions span {
    color: var(--muted);
}

.x-profile-mini strong {
    font-size: 0.95rem;
}

.x-profile-mini span {
    font-size: 0.82rem;
}

.avatar-badge {
    width: 44px;
    height: 44px;
}

.avatar-badge.small {
    width: 40px;
    height: 40px;
}

.avatar-badge.large {
    width: 54px;
    height: 54px;
    font-size: 1.1rem;
}

.x-feed {
    background: rgba(255, 252, 247, 0.86);
    border: 1px solid rgba(216, 200, 174, 0.9);
    border-radius: 30px;
    overflow: hidden;
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 48px rgba(34, 28, 18, 0.08);
}

.x-feed-header,
.x-tabs,
.x-composer,
.x-post {
    border-bottom: 1px solid rgba(216, 200, 174, 0.7);
}

.x-feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 16px;
    background: rgba(255, 250, 244, 0.82);
}

.x-feed-header h1,
.x-card-head h2 {
    margin: 0;
}

.x-feed-header h1 {
    font-size: 2rem;
}

.x-feed-header p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.x-filter-pill {
    border: 1px solid rgba(216, 200, 174, 0.95);
    border-radius: 999px;
    padding: 10px 14px;
    background: #fff;
    font: inherit;
    font-weight: 700;
    color: var(--accent-strong);
}

.x-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: rgba(255, 252, 247, 0.72);
}

.x-tabs button {
    border: 0;
    background: transparent;
    padding: 16px;
    font: inherit;
    font-weight: 700;
    color: var(--muted);
    cursor: pointer;
}

.x-tabs button.active {
    color: var(--text);
    box-shadow: inset 0 -3px 0 var(--accent);
}

.feed-notice {
    margin: 16px 24px 0;
}

.x-composer {
    display: flex;
    gap: 14px;
    padding: 18px 24px 14px;
}

.x-composer-body {
    flex: 1;
}

.x-composer textarea {
    width: 100%;
    min-height: 72px;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 2px 0 12px;
    font-size: 1.48rem;
    line-height: 1.55;
    resize: vertical;
}

.x-composer textarea::placeholder {
    color: #8f877a;
}

.x-composer-guest textarea {
    opacity: 0.85;
}

.x-composer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(216, 200, 174, 0.75);
}

.x-composer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.x-composer-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #1293ef;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.x-composer-icon:hover {
    background: rgba(18, 147, 239, 0.12);
}

.x-composer-icon input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.x-publish,
.x-publish-link {
    min-width: 92px;
    padding: 10px 22px;
    background: #111;
    box-shadow: none;
}

.x-post {
    display: flex;
    gap: 14px;
    padding: 20px 24px;
    transition: background-color 0.2s ease;
}

.x-post:hover {
    background: rgba(255, 255, 255, 0.38);
}

.x-post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
}

.x-post-avatar.launch {
    background: linear-gradient(135deg, #111 0%, #5f7b74 100%);
}

.x-post-avatar.system {
    background: linear-gradient(135deg, #0c6b58 0%, #85d0a6 100%);
}

.x-post-avatar.design {
    background: linear-gradient(135deg, #d09f43 0%, #f7d89a 100%);
}

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

.x-post-head {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    align-items: center;
}

.x-post-head strong {
    font-size: 1.02rem;
}

.x-post-content p {
    margin: 0 0 14px;
    line-height: 1.95;
    word-break: break-word;
}

.x-post-media {
    margin: 0 0 14px;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid rgba(216, 200, 174, 0.85);
    background: rgba(255, 255, 255, 0.56);
}

.x-post-media img {
    display: block;
    width: 100%;
    max-height: 460px;
    object-fit: cover;
}

.x-post-empty {
    justify-content: center;
}

.x-post-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.82rem;
    margin-top: 10px;
}

.x-post-meta-item,
.x-post-meta-item a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.x-post-actions a {
    color: var(--accent-strong);
    font-weight: 600;
}

.x-post-interactions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.x-reaction-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.x-action-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(12, 107, 88, 0.1);
    color: var(--accent-strong);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.x-action-button.active {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #fff;
}

.x-action-button-ghost {
    background: transparent;
    color: var(--muted);
    padding: 6px 8px;
}

.x-action-button-ghost:hover {
    background: rgba(12, 107, 88, 0.08);
    color: var(--accent-strong);
}

.x-action-button-ghost.active {
    background: rgba(12, 107, 88, 0.12);
    color: var(--accent-strong);
}

.x-action-count {
    min-width: 1ch;
    font-variant-numeric: tabular-nums;
}

.x-action-label {
    font-size: 0.78rem;
}

.x-post-profile-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 999px;
}

.x-post-profile-link:hover {
    background: rgba(12, 107, 88, 0.08);
}

.x-comment-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.x-comment-form input {
    flex: 1;
    min-width: 0;
    border-radius: 999px;
}

.x-comment-list {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.x-comment-item {
    padding: 12px 14px;
    border: 1px solid rgba(216, 200, 174, 0.72);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.6);
}

.x-comment-head {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.x-comment-head span {
    color: var(--muted);
}

.x-comment-item p {
    margin: 0;
    color: #3a332b;
    line-height: 1.8;
}

.thread-shell {
    width: min(900px, 100%);
}

.x-feed-thread {
    border-radius: 26px;
}

.x-feed-header-thread {
    align-items: flex-start;
}

.thread-panel {
    padding: 20px 24px 24px;
}

.thread-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.x-thread-list,
.x-thread-children {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.x-thread-comment {
    position: relative;
}

.x-thread-comment[data-depth="0"] > .x-comment-item-thread {
    border-color: rgba(216, 200, 174, 0.82);
}

.x-thread-comment[data-depth="1"] > .x-comment-item-thread {
    background: rgba(255, 255, 255, 0.76);
}

.x-thread-comment[data-depth="2"] > .x-comment-item-thread,
.x-thread-comment[data-depth="3"] > .x-comment-item-thread,
.x-thread-comment[data-depth="4"] > .x-comment-item-thread {
    background: rgba(251, 247, 239, 0.92);
}

.x-thread-children {
    margin-right: 26px;
    padding-right: 14px;
    border-right: 2px solid rgba(216, 200, 174, 0.72);
}

.x-comment-item-thread {
    background: rgba(255, 255, 255, 0.7);
}

.x-replying-to {
    margin: 0 0 8px;
    font-size: 0.84rem;
    color: var(--muted);
}

.x-replying-to span {
    color: #1293ef;
    font-weight: 700;
}

.x-inline-reply-toggle {
    margin-top: 10px;
    border: 0;
    background: transparent;
    color: var(--accent-strong);
    font: inherit;
    font-weight: 700;
    padding: 0;
    cursor: pointer;
}

.x-thread-root-form,
.x-thread-reply-form {
    margin-top: 10px;
}

.x-thread-reply-form {
    padding-top: 8px;
}

.x-aside {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.x-card {
    background: rgba(255, 250, 244, 0.84);
    border: 1px solid rgba(216, 200, 174, 0.92);
    border-radius: 24px;
    padding: 18px;
    box-shadow: 0 14px 32px rgba(34, 28, 18, 0.06);
}

.search-card input {
    background: #fff;
    border-radius: 999px;
}

.x-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.x-card-head a {
    color: var(--accent-strong);
    font-weight: 700;
}

.trend-list,
.follow-list {
    display: flex;
    flex-direction: column;
}

.trend-item,
.follow-item {
    padding: 14px 0;
}

.trend-item + .trend-item,
.follow-item + .follow-item {
    border-top: 1px solid rgba(216, 200, 174, 0.72);
}

.trend-item strong,
.trend-item span,
.trend-item small {
    display: block;
}

.trend-item strong {
    margin: 6px 0;
}

.follow-item,
.follow-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.follow-user {
    justify-content: flex-start;
}

.follow-item button {
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    background: #111;
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 1200px) {
    .x-shell,
    .app-shell {
        grid-template-columns: 88px minmax(0, 1fr) 300px;
    }

    .app-shell {
        grid-template-columns: 88px minmax(0, 1fr);
    }

    .x-brand-row span,
    .x-nav-link span:last-child,
    .x-profile-mini div {
        display: none;
    }

    .x-nav-link {
        justify-content: center;
        width: 58px;
        padding: 14px;
    }

    .x-post-button {
        padding: 14px;
        font-size: 0;
    }

    .x-post-button::before {
        content: '+';
        font-size: 1.8rem;
        line-height: 1;
    }
}

@media (max-width: 960px) {
    .layout-home,
    .layout-app {
        width: min(860px, calc(100% - 24px));
    }

    .x-shell,
    .app-shell {
        grid-template-columns: 1fr;
    }

    .x-sidebar,
    .x-aside {
        position: static;
    }

    .x-nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 14px 16px;
    }

    .x-brand-row span,
    .x-nav-link span:last-child,
    .x-profile-mini div {
        display: block;
    }

    .x-post-button {
        font-size: 1rem;
    }

    .x-post-button::before {
        content: none;
    }
}

@media (max-width: 720px) {
    .layout-home,
    .layout-app {
        width: calc(100% - 16px);
    }

    .x-feed-header,
    .x-composer,
    .x-post,
    .follow-item,
    .x-card-head,
    .x-composer-toolbar,
    .x-post-actions,
    .x-comment-form {
        flex-direction: column;
        align-items: stretch;
    }

    .x-feed-header h1 {
        font-size: 1.65rem;
    }

    .x-tabs {
        grid-template-columns: 1fr;
    }
}
