:root {
    --bg-color: #000000;
    --text-color: #ffffff;
    --font-main: 'Inter', sans-serif;
    --font-code: 'JetBrains Mono', monospace;
    
    --ink: #f5f4f2;
    --ink-soft: rgba(245, 244, 242, 0.75);
    --paper: #000000;
    --paper-deep: #050505;
    --accent: #27d39f;
    --accent-bright: #ff6a3d;
    --accent-cool: #3bd1ff;
    --glass: rgba(18, 18, 26, 0.8);
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    --glow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 20px 50px rgba(0, 0, 0, 0.55);
    --card-border: rgba(255, 255, 255, 0.08);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* Remove blue tap highlight on mobile */
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: var(--font-main);
    color: var(--ink);
    background-color: var(--bg-color);
    overflow-x: hidden;
    overflow-y: auto; /* Allow body to scroll */
}

/* Background Canvas */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

body::before {
    content: none;
}

#app {
    position: relative;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: relative; /* Sit in flow */
    z-index: 50;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 5vw;
    backdrop-filter: blur(20px);
    background: rgba(0, 0, 0, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    height: 60px; /* Fixed compact height */
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-title {
    font-family: var(--font-main);
    text-transform: uppercase;
    font-size: 1.1rem; /* Slightly smaller */
    font-weight: 900;
    letter-spacing: 0.1em;
    color: #fff;
}

/* --- Search Overlay --- */
#searchOverlay {
    display: block !important;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    background: #000;
    padding: 0;
    opacity: 1;
    z-index: 100;
}

#searchOverlay:not(.hidden) {
    transform: translateX(0);
}

#searchOverlay.hidden {
    transform: translateX(100%);
    pointer-events: none;
}

.search-panel {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.search-top {
    padding: 14px 5vw;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.search-title,
.chat-title {
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-cool);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.search-body {
    flex: 1;
    padding: 20px 5vw;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
}

.search-form-overlay input {
    width: 100%;
    padding: 14px 20px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    font-family: var(--font-main);
    color: #fff;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.search-form-overlay input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    outline: none;
}

.search-results-list {
    flex: 1;
    overflow-y: auto;
    display: grid;
    gap: 8px;
    align-content: start;
}

.search-item {
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
    color: var(--ink);
    padding: 12px 16px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease;
}

.search-avatar,
.search-avatar-fallback {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.search-avatar {
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.search-avatar-fallback {
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
}

.search-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.search-item span {
    font-weight: 600;
    font-size: 1rem;
}

.feed {
    min-height: 100vh;
    padding: 0 0 60px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    justify-content: stretch;
    align-items: start;
}

.feed::after {
    content: '';
    display: block;
    height: 80px;
}

.feed-item {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    border: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: cardIn 0.6s ease both;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feed-item:hover {
    transform: none;
    box-shadow: none;
}

.feed-photo {
    width: 100%;
    height: auto;
    min-height: 200px; /* Reserve space */
    display: block;
    border-radius: 0;
    max-height: none;
    background-color: #111; /* Placeholder color */
}

.feed-body {
    padding: 14px 5vw 18px;
    display: grid;
    gap: 8px;
    background: transparent;
}

.feed-caption {
    font-size: 0.95rem;
    color: var(--ink-soft);
}

.feed-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(245, 244, 242, 0.35);
}

/* --- New Feed Actions & Options --- */
.feed-actions {
    display: flex;
    gap: 20px;
    align-items: center;
    padding-top: 4px;
}

.action-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    padding: 0;
    font-family: var(--font-main);
    font-size: 0.9rem;
    transition: transform 0.1s ease, color 0.2s ease;
}

.action-btn:hover {
    transform: scale(1.05);
}

.action-btn svg {
    stroke-width: 1.5px;
}

.like-btn.active {
    color: #ff4757;
}

.like-btn.active svg {
    fill: #ff4757;
    stroke: #ff4757;
}

/* --- Comments Bottom Sheet --- */
.sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sheet-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.sheet-container {
    background: #0f0f0f;
    width: 100%;
    height: 75vh;
    border-radius: 24px 24px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
}

.sheet-overlay.active .sheet-container {
    transform: translateY(0);
}

.sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    cursor: grab;
    touch-action: none; /* Prevent scrolling while dragging header */
}

.sheet-header:active {
    cursor: grabbing;
}

.sheet-handle {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.sheet-title {
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    flex-grow: 1;
}

.sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
}

.sheet-footer {
    padding: 16px 20px; /* More padding for mobile feel */
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 12px;
    align-items: center;
    background: #0f0f0f;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
}

#sheetCommentInput {
    flex: 1;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 10px 16px;
    color: #fff;
    font-size: 0.95rem;
}

#sheetCommentInput:focus {
    border-color: var(--accent);
    outline: none;
}

.small-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 20px;
}

.icon-only {
    padding: 8px;
    display: grid;
    place-items: center;
}

/* Comment Styles in Sheet */
.sheet-comment {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.sheet-comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
}

.sheet-comment-avatar-fallback {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
}

.sheet-comment-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sheet-comment-header {
    display: flex;
    gap: 8px;
    align-items: baseline;
}

.sheet-comment-user {
    font-weight: 600;
    font-size: 0.9rem;
}

.sheet-comment-time {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

.sheet-comment-text {
    font-size: 0.95rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
}

/* --- Feed Header --- */
.feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.feed-header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    text-decoration: none;
    border: none;
    background: transparent;
    padding: 0;
}

.header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
}

.header-avatar-fallback {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: grid;
    place-items: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
}

.header-username {
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
}

/* Post Options (Three Dots) */
.post-options {
    position: relative;
    top: auto;
    right: auto;
    z-index: 5;
}

.options-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    backdrop-filter: none;
    border: none;
    color: var(--text-color);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.options-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.options-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 6px;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    animation: fadeIn 0.2s ease;
}

.menu-item {
    background: transparent;
    border: none;
    color: #ff6b6b;
    padding: 10px 12px;
    text-align: left;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-item:hover {
    background: rgba(255, 107, 107, 0.1);
}

.menu-item svg {
    width: 16px;
    height: 16px;
}

.user-link {
    border: none;
    background: transparent;
    color: var(--accent-cool);
    font-family: var(--font-main);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 0;
}

/* --- Notifications Badge --- */
.icon-badge-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ff4757;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #000; /* border to separate from icon */
}

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none; /* Let clicks pass through */
}

.toast {
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 10px 24px;
    border-radius: 99px;
    font-size: 0.9rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Full Screen Slide Overlay (Chat) --- */
#chatOverlay {
    display: block !important; /* Override default hidden display */
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    background: #000;
    padding: 0;
    opacity: 1; /* Always opaque */
}

#chatOverlay:not(.hidden) {
    transform: translateX(0);
}

#chatOverlay.hidden {
    transform: translateX(100%);
    pointer-events: none; /* Prevent clicks when hidden */
}

#chatOverlay .chat-panel {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
    display: flex;
    flex-direction: column;
}

#chatOverlay .chat-top {
    padding: 14px 5vw;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

#chatOverlay .chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 5vw;
}

/* Hide original chat layout parts for the "Construction" view */
#chatList, #chatHeader, #chatForm {
    display: none; 
}

#chatMessages {
    background: transparent;
    border: none;
    padding: 0;
    flex: 1;
}

/* --- Bottom Navigation --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 50;
    padding-bottom: env(safe-area-inset-bottom);
}

body.overlay-open .bottom-nav {
    z-index: 240;
}

body.force-nav .bottom-nav {
    display: flex !important;
    opacity: 1;
    visibility: visible;
}

.fab-container {
    position: fixed;
    right: 16px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    z-index: 120;
}

.fab-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(12, 18, 24, 0.45);
    color: #fff;
    font-weight: 900;
    font-size: 1.1rem;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    backdrop-filter: blur(12px);
}

.fab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.fab-btn:active {
    transform: translateY(1px) scale(0.98);
}

.update-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: grid;
    place-items: center;
    z-index: 260;
    padding: 20px;
    backdrop-filter: blur(6px);
}

.update-card {
    width: min(520px, 92vw);
    padding: 22px 20px;
    border-radius: 18px;
    background: rgba(12, 18, 24, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: grid;
    gap: 10px;
    color: var(--ink);
}

.update-title {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.update-subtitle {
    font-size: 0.9rem;
    color: var(--ink-soft);
}

.update-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 6px;
    font-size: 0.95rem;
}

.update-btn {
    margin-top: 6px;
    justify-self: end;
}

.install-prompt {
    position: fixed;
    right: 16px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    z-index: 220;
    padding: 14px 14px;
    border-radius: 16px;
    background: rgba(12, 18, 24, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    width: min(320px, 80vw);
    display: grid;
    gap: 10px;
}

.install-title {
    font-size: 0.95rem;
    color: #fff;
    font-weight: 600;
}

.install-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.install-actions .ghost-btn {
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
}

.install-actions .primary-btn {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
}

.nav-item {
    background: transparent;
    border: none;
    padding: 10px;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, transform 0.1s ease;
}

.nav-item.active,
.nav-item:hover {
    color: #fff;
}

.nav-item.home-glow {
    color: rgba(255, 255, 255, 0.3);
}

.nav-item.home-glow svg {
    filter: none;
}

.nav-item:active {
    transform: scale(0.95);
}


.nav-add {
    color: #fff;
}

.add-circle {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #27d39f, #3bd1ff);
    border-radius: 12px;
    display: grid;
    place-items: center;
    box-shadow: 0 4px 12px rgba(39, 211, 159, 0.3);
    color: #000;
}

.nav-profile img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-avatar-fallback {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: grid;
    place-items: center;
}

/* Auth Mode: Hide controls */
body.auth-open .topbar,
body.auth-open .bottom-nav,
body.auth-open .fab-container {
    display: none !important;
}

body.auth-open #feed {
    display: none !important;
}

body.overlay-open .topbar {
    display: none !important;
}

body.overlay-open .fab-container {
    display: none !important;
}

.upload-panel {
    width: min(420px, 90vw);
    padding: 24px;
    border-radius: 20px;
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.upload-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.upload-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.file-drop-area {
    position: relative;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    transition: border-color 0.2s ease, background 0.2s ease;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
}

.file-drop-area:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.05);
}

.file-drop-area input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.drop-msg {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

.full-width {
    width: 100%;
    justify-content: center;
    padding: 14px;
}

.center-text {
    text-align: center;
}

#previewWrap {
    position: relative;
}

.preview-count {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    pointer-events: none;
    white-space: nowrap;
}

textarea,
input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(9, 9, 14, 0.85);
    font-family: var(--font-main);
    font-size: 0.95rem;
    color: var(--ink);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea::placeholder,
input::placeholder {
    color: rgba(245, 244, 242, 0.55);
}

textarea:focus,
input:focus {
    outline: none;
    border-color: rgba(41, 179, 143, 0.6);
    box-shadow: 0 0 0 2px rgba(41, 179, 143, 0.18);
}

.file-input {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
}

.file-input input[type="file"] {
    position: absolute;
    opacity: 0;
    inset: 0;
    cursor: pointer;
}

.file-input span {
    background: rgba(255, 255, 255, 0.12);
    padding: 8px 14px;
    border-radius: 999px;
}


.primary-btn,
.ghost-btn {
    border: none;
    cursor: pointer;
    font-family: var(--font-main);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.primary-btn {
    background: linear-gradient(135deg, #27d39f, #3bd1ff);
    color: #fff;
    padding: 12px 14px;
    border-radius: 12px;
    box-shadow: 0 12px 24px rgba(39, 211, 159, 0.25);
}

.ghost-btn {
    background: rgba(255, 255, 255, 0.08);
    padding: 8px 14px;
    border-radius: 999px;
    color: var(--ink);
}

.primary-btn:hover,
.ghost-btn:hover,
.comment-btn:hover,
.delete-btn:hover {
    transform: translateY(-1px);
}

.primary-btn:active,
.ghost-btn:active,
.comment-btn:active,
.delete-btn:active {
    transform: translateY(1px);
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 4, 8, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    z-index: 30;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.4s ease both;
    overflow-y: auto;
    padding: 40px 0;
}

/* --- Auth Hero Animation --- */
.hero-title {
    font-size: 15vw; /* Larger */
    font-weight: 900;
    margin: 0;
    line-height: 0.8;
    color: #fff;
    mix-blend-mode: normal;
    opacity: 0;
    filter: blur(20px);
    transform: scale(0.95);
    letter-spacing: 0; /* Reset global letter spacing for flex container */
    pointer-events: none;
    transition: all 2.5s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.5), 0 0 60px rgba(255, 255, 255, 0.3);
    will-change: opacity, filter, transform;
    
    /* Layout */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.hero-title.active {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
}

.hero-main {
    letter-spacing: 0.2em;
    margin-left: 0.2em; /* Optical center */
}

.hero-sub {
    font-size: 0.2em; /* Relative to hero-title font-size */
    font-weight: 300;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    margin-left: 0.5em; /* Optical center */
    opacity: 0.8;
}

/* Auth Mode: Hide controls, keep feed visible */
body.auth-open .topbar,
body.auth-open .fab-container {
    display: none !important;
}

#authOverlay {
    background: transparent;
    backdrop-filter: none;
}


.ban-notice {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 107, 107, 0.12);
    border: 1px solid rgba(255, 107, 107, 0.35);
    color: #ffd6d6;
    font-size: 0.85rem;
    text-align: center;
}

.ban-notice.hidden {
    display: none;
}

.auth-panel {
    z-index: 10;
    position: relative;
    width: min(420px, 90vw);
    padding: 32px 28px;
    border-radius: 24px;
    background: rgba(5, 5, 5, 0.65);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
    display: grid;
    gap: 20px;
}

.onboard-panel {
    position: relative;
    min-height: 220px;
}

.onboard-step {
    position: absolute;
    inset: 0;
    display: grid;
    gap: 14px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.7s ease, transform 0.7s ease;
    pointer-events: none;
}

.onboard-step.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.onboard-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}

.onboard-sub {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
}

.onboard-tagline {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.75);
    text-align: center;
}

.onboard-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: grid;
    place-items: center;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
}

.onboard-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.onboard-avatar-fallback {
    font-size: 1.5rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.7);
}

.onboard-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.admin-tools {
    display: grid;
    gap: 8px;
    width: 100%;
}

.admin-ban-info {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.admin-select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.admin-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.link-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    cursor: pointer;
}

.link-btn:hover {
    color: #fff;
}

.auth-tabs-panel.hidden {
    display: none;
}

/* ... existing styles ... */

/* --- Comments Bottom Sheet --- */
.sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sheet-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.sheet-container {
    background: #0f0f0f;
    width: 100%;
    height: 75vh;
    border-radius: 24px 24px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
    will-change: transform; /* Optimize animation */
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .hero-title {
        filter: none !important; /* Disable blur on mobile for performance */
        transition: opacity 1.5s ease, transform 1.5s ease; /* Simpler transition */
        font-size: 20vw; /* Slightly bigger on mobile */
    }
    
    .sheet-overlay {
        backdrop-filter: none !important; /* Disable backdrop blur */
        background: rgba(0, 0, 0, 0.8); /* Darker background to compensate */
    }
    
    .auth-panel {
        backdrop-filter: none !important; /* Reduce blur load */
        background: rgba(5, 5, 5, 0.9);
    }
    
    .topbar {
        backdrop-filter: none !important;
        background: rgba(0, 0, 0, 0.95);
    }
    
    .profile-top {
        backdrop-filter: none !important;
        background: #000;
    }
}

.profile-empty {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.auth-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px;
    border-radius: 12px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: none;
    background: transparent;
    font-family: var(--font-main);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.auth-form input[type="text"],
.auth-form input[type="password"] {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.auth-form input:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
}

.auth-form .primary-btn {
    background: #fff;
    color: #000;
    font-weight: 800;
    margin-top: 8px;
    padding: 16px;
    border-radius: 12px;
}

.auth-form .primary-btn:hover {
    background: #f0f0f0;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

/* --- Profile Panel (Restored Floating Card) --- */
/* ... (This comment is kept for context, but we are changing the implementation below) ... */

/* --- Full Screen Profile View Overrides --- */
#profileOverlay {
    background-color: #000000; /* Solid background hides feed */
    padding: 0;
    display: block; /* Standard flow layout */
    overflow-y: auto; /* Scroll within the overlay */
}

#profileOverlay .profile-panel {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    height: auto;
    max-height: none;
    padding: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    background: transparent;
    margin: 0;
    display: flex;
    flex-direction: column;
}

#profileOverlay .profile-top {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 5vw;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#profileInstall {
    background: linear-gradient(135deg, #27d39f, #3bd1ff);
    color: #000;
    border: none;
    font-weight: 700;
}

.profile-title {
    font-size: 1rem;
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

#profileOverlay .profile-content {
    width: 100%;
    max-width: 900px; /* Keep content centered on large screens */
    margin: 0 auto;
    padding: 0;
    overflow: visible; /* Let overlay handle scroll */
    flex: 1;
}

#profileOverlay .profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 20px 20px;
    background: radial-gradient(circle at center, rgba(39, 211, 159, 0.08) 0%, rgba(0,0,0,0) 70%); /* Subtle accent glow */
    border-bottom: none;
    gap: 16px;
    margin-bottom: 0;
    margin-top: 0; /* Reset margin */
}

#profileOverlay .avatar-wrap {
    width: 110px;
    height: 110px;
    border: 3px solid #000;
    outline: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin-bottom: 8px;
    overflow: visible; /* Allow badge to sit on edge */
}

#profileOverlay .avatar-wrap img,
#profileOverlay .avatar-wrap .avatar-fallback {
    border-radius: 50%; /* Apply radius to children since overflow is visible */
}

.avatar-wrap.is-editable.is-empty::after {
    top: -5px;
    right: -5px;
    bottom: auto;
    background-color: var(--accent-bright);
    border: 2px solid #fff;
    box-shadow: 0 0 10px var(--accent-bright);
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

#profileOverlay .profile-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
}

#profileOverlay .profile-name {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
    margin: 0;
}

/* Stats Row */
.profile-stats {
    display: flex;
    margin: 16px 0 10px;
}

.stat-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 4px 0;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
}
.stat-item:last-child { border-right: none; }

.stat-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
}

.stat-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.4);
}

/* Joined Badge */
.joined-badge {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.joined-badge svg {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

/* Tab Bar */
.profile-tab-bar {
    display: flex;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2px;
    position: sticky;
    top: 60px; /* Below sticky header */
    background: #000; /* Hide scrolling content behind */
    z-index: 55;
}

.profile-tab {
    padding: 14px 40px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #fff;
    border-bottom: 2px solid #fff; /* Active state */
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Profile Actions (Chat/Logout) */
.profile-actions {
    display: flex;
    gap: 7px;
    margin-top: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.profile-actions .ghost-btn {
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.02);
    padding: 7px 14px;
    font-size: 0.75rem;
    color: rgba(245, 244, 242, 0.75);
    border-radius: 999px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.profile-actions .ghost-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255,255,255,0.3);
}

/* Follow button — highlighted */
.profile-actions .follow-btn {
    background: var(--accent);
    border-color: var(--accent);
    color: #0a1628;
    font-weight: 700;
}

.profile-actions .follow-btn:hover {
    background: #20c090;
    border-color: #20c090;
}

.profile-actions .follow-btn.active {
    background: rgba(39, 211, 159, 0.12);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

/* General Avatar Styles (Fallback for other areas) */
.avatar-wrap {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    position: relative; /* Anchor for absolute img */
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.avatar-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: none; /* Controlled by JS */
}

.avatar-fallback {
    /* Fallback needs to be centered if img is hidden */
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-family: var(--font-main);
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    text-align: inherit;
}

.profile-name {
    font-family: var(--font-main);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
}

.profile-meta {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    font-family: var(--font-code);
}

/* Profile Feed Grid */
.profile-feed {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding-bottom: 0;
}

.profile-post {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    cursor: pointer;
    border-radius: 0;
}

.profile-post img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Multi-image indicator on profile grid thumbnail */
.profile-post-multi {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    background: rgba(0,0,0,0.55);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.profile-post-multi::before,
.profile-post-multi::after {
    content: '';
    position: absolute;
    border: 1.5px solid rgba(255,255,255,0.9);
    border-radius: 2px;
    width: 8px;
    height: 8px;
}
.profile-post-multi::before { top: 3px; left: 3px; }
.profile-post-multi::after  { top: 6px; left: 6px; background: rgba(0,0,0,0.3); }

/* =====================================================
   Feed Carousel (multi-image posts)
   ===================================================== */
.feed-carousel {
    position: relative;
}

/* Override base overflow so the inner track can scroll */
.feed-img-wrap.feed-carousel {
    overflow: visible;
}

.carousel-track {
    display: flex;
    overflow-x: scroll;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
}
.carousel-track::-webkit-scrollbar { display: none; }

.carousel-slide {
    flex: 0 0 100%;   /* exact viewport width of the track, never shrinks */
    min-width: 0;
    scroll-snap-align: start;
    overflow: hidden;
}

.carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 2;
    pointer-events: none;
}

.carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: background 0.2s, transform 0.2s;
}
.carousel-dot.active {
    background: #fff;
    transform: scale(1.3);
}

/* Top-right multi-image icon on feed */
.carousel-multi-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    display: flex;
    gap: 2px;
    opacity: 0.9;
    pointer-events: none;
}
.carousel-multi-badge span {
    display: block;
    width: 5px;
    height: 5px;
    background: #fff;
    border-radius: 1px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.3);
}

.chat-panel {
    width: min(900px, 94vw);
    height: 90vh;
    padding: 16px;
    border-radius: 20px;
    background: rgba(10, 12, 18, 0.98);
    box-shadow: var(--shadow);
    display: grid;
    gap: 14px;
    overflow: hidden;
}

.chat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}


.chat-body {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 14px;
    min-height: 0;
}

.chat-list {
    display: grid;
    gap: 10px;
    overflow-y: auto;
    padding-right: 6px;
}

.chat-item {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 10px 12px;
    display: grid;
    gap: 6px;
    cursor: pointer;
}

.chat-item strong {
    font-size: 0.85rem;
}

.chat-item span {
    font-size: 0.75rem;
    color: var(--ink-soft);
}

.chat-thread {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 10px;
    min-height: 0;
}

.chat-header {
    font-size: 0.85rem;
    color: var(--ink-soft);
}

.chat-messages {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 12px;
    overflow-y: auto;
    display: grid;
    gap: 8px;
    min-height: 0;
}

.chat-message {
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    max-width: 80%;
    word-break: break-word;
}

.chat-message.me {
    justify-self: end;
    background: rgba(39, 211, 159, 0.18);
    border: 1px solid rgba(39, 211, 159, 0.35);
}

.chat-message.them {
    justify-self: start;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.chat-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.chat-form input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(9, 9, 14, 0.85);
    color: var(--ink);
}

/* --- Post Full Screen View --- */
#postOverlay.overlay:not(.hidden) {
    background: #000 !important;
    display: block !important;
    padding: 0 !important;
    overflow-y: auto !important;
    place-items: unset !important;
}

#postOverlay .post-panel {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 100vh !important;
    height: auto !important;
    max-height: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: flex;
    flex-direction: column;
    overflow: visible !important;
}

.post-top {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 5vw;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.post-title {
    font-size: 1rem;
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

#postOverlay img {
    width: 100%;
    height: auto;
    max-height: none; /* Allow full scroll */
    object-fit: contain;
    border-radius: 0;
    background: transparent;
    margin: 0;
    display: block;
}

#postOverlay .post-info {
    padding: 20px 5vw;
    width: 100%;
    display: grid;
    gap: 12px;
}

#postOverlay .post-caption {
    font-size: 1.1rem;
    color: #fff;
    line-height: 1.5;
}

#postOverlay .post-meta {
    font-size: 0.75rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.35);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 12px;
}

.post-caption {
    font-size: 1rem;
    color: var(--ink);
}

.post-meta {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(245, 244, 242, 0.55);
}

.auth-tabs {
    display: flex;
    gap: 8px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: transparent;
    font-family: var(--font-main);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--ink);
}

.tab-btn.active {
    background: var(--accent-bright);
    color: #fff;
    border-color: transparent;
}

.auth-form {
    display: grid;
    gap: 10px;
}

.remember {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 0.85rem;
}

.status-text {
    font-size: 0.85rem;
    color: var(--accent-bright);
    min-height: 1.2em;
}

.auth-hint {
    font-size: 0.85rem;
    color: rgba(245, 244, 242, 0.65);
}

.preview {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(6, 6, 10, 0.45);
}

.preview img {
    display: block;
    width: 100%;
    max-height: 240px;
    object-fit: cover;
}

.delete-btn {
    border: none;
    background: rgba(255, 106, 61, 0.18);
    color: #ffd2c5;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
}

.comment-btn {
    border: none;
    background: rgba(59, 209, 255, 0.2);
    color: #bfeeff;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    justify-self: start;
}

.comments {
    margin-top: 10px;
    display: grid;
    gap: 10px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.comments-list {
    display: grid;
    gap: 8px;
}

.comment {
    display: grid;
    gap: 4px;
    font-size: 0.9rem;
    color: var(--ink-soft);
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(245, 244, 242, 0.5);
}

.comment strong {
    color: var(--ink);
    font-weight: 600;
}

.comment-hint {
    font-size: 0.85rem;
    color: rgba(245, 244, 242, 0.6);
}

.comments-form {
    display: grid;
    gap: 8px;
}

.feed::-webkit-scrollbar {
    width: 10px;
}

.feed::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
}

.feed::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
}

.feed::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.28);
}

.hidden {
    display: none !important;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes floatIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.composer-card,
.auth-panel {
    animation: floatIn 0.4s ease both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@media (max-width: 720px) {
    body {
        overflow: auto;
    }

    .composer {
        position: fixed;
        bottom: 12px;
        left: 0;
        right: 0;
        padding: 0 5vw;
        justify-content: flex-end;
    }

    .composer-card {
        width: 100%;
        padding: 16px;
        gap: 12px;
        border-radius: 16px;
    }

    .profile-fab {
        position: absolute;
        right: 5vw;
        bottom: 88px;
        width: 52px;
        height: 52px;
        border-radius: 16px;
    }

    .feed {
        height: auto;
        min-height: 100vh;
        grid-template-columns: 1fr;
        padding: 0 0 120px;
        gap: 14px;
    }

    .search {
        width: 100%;
        max-width: none;
    }

    .search-results {
        position: absolute; /* Revert to absolute */
        margin-top: 0;
    }

    .brand-title {
        font-size: 0.95rem;
    }

    .brand-sub {
        font-size: 0.75rem;
    }

    .auth-panel {
        width: min(92vw, 420px);
        padding: 20px;
        gap: 12px;
    }

    .tab-btn {
        padding: 12px 10px;
        font-size: 0.7rem;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    textarea {
        font-size: 1rem;
        padding: 12px 12px;
    }

    .primary-btn,
    .ghost-btn {
        padding: 12px 14px;
        font-size: 0.75rem;
    }

    .feed-item {
        border-radius: 16px;
    }

    /* .feed-photo removed to allow dynamic height from global rule */

    .feed-body {
        padding: 12px 14px 14px;
    }

    .delete-btn {
        padding: 8px 12px;
        font-size: 0.65rem;
    }

    .profile-panel {
        width: min(94vw, 640px);
        height: 90vh;
        padding: 16px;
    }

    .profile-card {
        grid-template-columns: auto 1fr;
    }

    .profile-feed {
        grid-template-columns: repeat(3, 1fr);
        gap: 2px;
    }

    .chat-panel {
        width: 94vw;
        height: 92vh;
        padding: 12px;
    }

    .chat-body {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .chat-list {
        grid-auto-flow: column;
        grid-auto-columns: minmax(180px, 1fr);
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 8px;
    }

    #chatOverlay.thread-active .chat-list {
        display: none;
    }

    #chatOverlay.thread-active .chat-body {
        grid-template-rows: 1fr;
    }

    .post-panel {
        width: 94vw;
        max-height: 92vh;
        padding: 12px;
    }

    .post-panel img {
        max-height: 70vh;
    }
}

/* ========================================
   GRUPO A: Nuevas funcionalidades
   ======================================== */

/* --- Feed image wrapper (doble tap, progresiva) --- */
.feed-img-wrap {
    position: relative;
    overflow: hidden;
    display: block;
    background: #111;
}

.feed-photo.img-loading {
    filter: blur(12px);
    opacity: 0.5;
    transform: scale(1.03);
    transition: filter 0.5s ease, opacity 0.5s ease, transform 0.5s ease;
}

.feed-photo:not(.img-loading) {
    transition: filter 0.5s ease, opacity 0.5s ease, transform 0.5s ease;
}

/* --- Tap heart (doble tap) --- */
.tap-heart {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
    z-index: 10;
    animation: tapHeartAnim 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    filter: drop-shadow(0 0 20px rgba(255,71,87,0.6));
}

@keyframes tapHeartAnim {
    0%   { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    40%  { transform: translate(-50%, -50%) scale(1.4); opacity: 1; }
    70%  { transform: translate(-50%, -60%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -80%) scale(1.0); opacity: 0; }
}

/* --- Like button pop animation --- */
@keyframes likePop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.45); }
    70%  { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.like-btn.like-pop svg {
    animation: likePop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Caption truncation --- */
.caption-ellipsis {
    color: rgba(245, 244, 242, 0.55);
}

.caption-more-btn {
    background: transparent;
    border: none;
    color: var(--accent);
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

/* --- Pull to Refresh --- */
.ptr-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    overflow: hidden;
    transition: opacity 0.2s ease;
}

.ptr-indicator.hidden {
    display: none;
}

.ptr-spinner {
    width: 26px;
    height: 26px;
    border: 2px solid rgba(39, 211, 159, 0.25);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: ptrSpin 0.75s linear infinite;
}

@keyframes ptrSpin {
    to { transform: rotate(360deg); }
}

/* --- Latido Home nav --- */
@keyframes navPulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.2); }
}

.nav-item.has-new-posts svg {
    animation: navPulse 1.4s ease-in-out infinite;
    color: var(--accent);
    filter: drop-shadow(0 0 6px rgba(39, 211, 159, 0.6));
}

/* --- Skeleton loading --- */
.skeleton-card {
    pointer-events: none;
}

.skeleton-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
}

.skeleton-body {
    padding: 14px 5vw 18px;
    display: grid;
    gap: 8px;
}

.skeleton-line {
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0.04) 0%,
        rgba(255,255,255,0.10) 50%,
        rgba(255,255,255,0.04) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.6s ease-in-out infinite;
    border-radius: 6px;
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-name {
    width: 110px;
    height: 14px;
}

.skeleton-image {
    width: 100%;
    height: 300px;
    border-radius: 0;
}

.skeleton-text {
    height: 12px;
}

.skeleton-text-short {
    width: 55%;
    height: 12px;
}

/* --- Draft banner --- */
.draft-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(39, 211, 159, 0.08);
    border: 1px solid rgba(39, 211, 159, 0.25);
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 4px;
}

.draft-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.draft-discard,
.draft-restore {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: var(--font-main);
}

.draft-discard {
    color: rgba(255, 255, 255, 0.45);
}

.draft-restore {
    color: var(--accent);
    font-weight: 700;
}

/* =====================================================
   GROUP B — UI Enriched
   ===================================================== */

/* --- Activity aura on avatars --- */
@property --aura-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes auraRotate {
    to { --aura-angle: 360deg; }
}

.header-avatar.aura-active,
.profile-grid-avatar.aura-active {
    animation: auraRotate 2.5s linear infinite;
    background: conic-gradient(
        from var(--aura-angle),
        #27d39f 0%, #3bd1ff 25%, #ff6a3d 50%, #ffd700 75%, #27d39f 100%
    );
    padding: 2px;
    border-radius: 50%;
}

/* Fallback for browsers without @property */
@supports not (background: conic-gradient(from 0deg, red, blue)) {
    .header-avatar.aura-active {
        outline: 2px solid var(--accent);
        outline-offset: 1px;
    }
}

/* --- Liked-by stacked avatars --- */
.liked-by-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0 6px;
}

.liked-by-stack {
    display: flex;
}

.liked-by-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--surface);
    object-fit: cover;
    margin-left: -8px;
}

.liked-by-stack .liked-by-avatar:first-child {
    margin-left: 0;
}

.liked-by-avatar.liked-by-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    background: rgba(39, 211, 159, 0.15);
    color: var(--accent);
}

.liked-by-label {
    font-size: 0.75rem;
    color: rgba(245, 244, 242, 0.55);
    line-height: 1;
}

/* --- Location chip --- */
.location-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.78rem;
    color: rgba(245, 244, 242, 0.55);
    padding: 2px 0;
}

/* --- Confetti pieces --- */
.confetti-piece {
    position: absolute;
    top: 0;
    border-radius: 2px;
    pointer-events: none;
    animation: confettiFall linear forwards;
    z-index: 9999;
}

@keyframes confettiFall {
    0%   { transform: translateY(-10px) rotate(0deg);   opacity: 1; }
    80%  { opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* --- Nostalgia mode --- */
.nostalgia-mode .profile-post img {
    filter: sepia(0.3) brightness(0.9);
    transition: filter 0.5s ease;
}

.nostalgia-btn.active {
    background: rgba(39, 211, 159, 0.12);
    border-color: var(--accent);
    color: var(--accent);
}

/* --- Location input in upload form --- */
#uploadForm input[name="location"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text);
    font-family: var(--font-main);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

#uploadForm input[name="location"]:focus {
    border-color: var(--accent);
}

#uploadForm input[name="location"]::placeholder {
    color: rgba(245, 244, 242, 0.35);
}

/* =====================================================
   GROUP C — Social features CSS
   ===================================================== */

/* --- Stories bar --- */
.stories-bar {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 14px 16px 10px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    background: transparent;
}

.stories-bar::-webkit-scrollbar { display: none; }

.stories-bar.hidden { display: none; }

@keyframes storyItemIn {
    from { opacity: 0; transform: translateY(10px) scale(0.82); }
    to   { opacity: 1; transform: none; }
}

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    animation: storyItemIn 0.28s ease both;
    transition: transform 0.12s ease;
}

.story-item:active { transform: scale(0.88); }

.story-ring {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    padding: 2px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-ring-active {
    background: conic-gradient(#27d39f 0%, #3bd1ff 33%, #ff6a3d 66%, #27d39f 100%);
    animation: auraRotate 3s linear infinite;
}

.story-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface);
    border: 2px solid var(--bg);
    display: block;
}

.story-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    background: rgba(39, 211, 159, 0.15);
}

.story-name {
    font-size: 0.7rem;
    color: rgba(245, 244, 242, 0.6);
    max-width: 58px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

/* Seen state — dimmed */
.story-item-seen .story-avatar,
.story-item-seen .story-avatar-fallback {
    opacity: 0.45;
}
.story-item-seen .story-name {
    opacity: 0.4;
}

/* =====================================================
   Story viewer (full-screen)
   ===================================================== */

.story-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: #000;
    display: flex;
    flex-direction: column;
    touch-action: pan-y;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.story-overlay.hidden { display: none; }

/* Animación de entrada y salida */
.story-overlay.story-entering,
.story-overlay.story-exiting {
    opacity: 0;
    transform: scale(0.96);
}

/* Progress bars */
.story-progress-wrap {
    display: flex;
    gap: 4px;
    padding: 12px 12px 6px;
    padding-top: max(12px, env(safe-area-inset-top));
    flex-shrink: 0;
}

.story-seg {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.25);
    overflow: hidden;
}
.story-seg-fill {
    height: 100%;
    width: 0%;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 2px;
}
.story-seg.seen .story-seg-fill { width: 100%; }
.story-seg.active .story-seg-fill {
    animation: segFill 5s linear forwards;
}
@keyframes segFill {
    from { width: 0% }
    to   { width: 100% }
}

/* Header */
.story-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px 10px;
    flex-shrink: 0;
}

.story-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    border-radius: 8px;
    padding: 4px 10px 4px 4px;
    margin: -4px -10px -4px -4px;
    transition: background 0.15s ease;
}

.story-user-info:active {
    background: rgba(255, 255, 255, 0.1);
}

.story-header-av-wrap {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.story-hd-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.story-hd-fb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
    background: rgba(39, 211, 159, 0.2);
    color: var(--accent);
}

.story-header-username {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
}

.story-header-time {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.55);
}

.story-close-btn {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}

/* Image */
.story-img-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 0;
}

.story-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    transition: opacity 0.25s ease;
}

/* Tap zones */
.story-tap {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 35%;
}
.story-tap-left  { left: 0; }
.story-tap-right { right: 0; }

/* Caption */
.story-caption {
    padding: 10px 16px 6px;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    flex-shrink: 0;
    line-height: 1.4;
    max-height: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Bottom actions */
.story-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px max(16px, env(safe-area-inset-bottom));
    flex-shrink: 0;
}

.story-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    color: #fff;
    padding: 8px 16px;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: var(--font-main);
    transition: background 0.15s ease;
}

.story-action-btn:active { background: rgba(255, 255, 255, 0.2); }

.story-action-btn.active svg {
    fill: #ff4757;
    stroke: #ff4757;
}

/* story-profile-btn removed — profile opens via header tap */

/* --- Wave button --- */
.wave-btn {
    font-size: 0.75rem;
}

/* --- Reacc button & popup --- */
.reacc-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    position: relative;
}

.reacc-btn .reacc-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.reacc-btn .reacc-label {
    color: rgba(245, 244, 242, 0.6);
    font-size: 0.78rem;
}

.reacc-btn.active .reacc-label {
    color: var(--accent);
}

.reacc-popup {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px;
    padding: 8px 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    z-index: 200;
    animation: popupIn 0.18s ease;
    white-space: nowrap;
}

@keyframes popupIn {
    from { opacity: 0; transform: translateX(-50%) scale(0.85) translateY(4px); }
    to   { opacity: 1; transform: translateX(-50%) scale(1) translateY(0); }
}

.reacc-emoji-btn {
    background: transparent;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: transform 0.15s ease;
    line-height: 1;
}

.reacc-emoji-btn:hover,
.reacc-emoji-btn:active {
    transform: scale(1.3);
}

/* --- Reacc counts row --- */
.reacc-counts {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 2px 0 4px;
}

.reacc-counts.hidden { display: none; }

.reacc-count-item {
    font-size: 0.8rem;
    color: rgba(245, 244, 242, 0.6);
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 2px 8px;
}

/* --- Eco button --- */
.eco-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: rgba(245, 244, 242, 0.5);
}

.eco-btn:hover { color: var(--accent-alt); }

/* --- Eco label on reshared posts --- */
.eco-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: rgba(245, 244, 242, 0.45);
    padding: 6px 16px 0;
}

/* --- Eco modal panel --- */
.eco-panel {
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    padding: 0 0 env(safe-area-inset-bottom, 16px);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    overflow: hidden;
}

.eco-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.eco-title {
    font-weight: 700;
    font-size: 1rem;
}

.eco-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

.eco-body textarea {
    background: rgba(255,255,255,0.05);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 12px 14px;
    color: var(--text);
    font-family: var(--font-main);
    font-size: 0.95rem;
    resize: none;
    outline: none;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.eco-body textarea:focus { border-color: var(--accent); }

.eco-original-preview {
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255,255,255,0.03);
}

.eco-preview-img {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    display: block;
}

.eco-preview-meta {
    padding: 8px 12px;
    font-size: 0.78rem;
    color: rgba(245, 244, 242, 0.5);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =====================================================
   Notifications panel
   ===================================================== */

/* Override overlay defaults for full-screen panel */
#notifOverlay {
    padding: 0;
    background: var(--bg);
    backdrop-filter: none;
    align-items: stretch;
    justify-content: flex-start;
}

.notif-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    animation: slideUpFade 0.22s ease;
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.notif-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
}

.notif-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

/* List */
.notif-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.notif-loading,
.notif-empty {
    padding: 48px 24px;
    text-align: center;
    color: rgba(245, 244, 242, 0.4);
    font-size: 0.9rem;
}

/* Row */
.notif-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.15s ease;
    position: relative;
}

.notif-row:active {
    background: rgba(255, 255, 255, 0.04);
}

/* New-notification highlight */
.notif-row.notif-new {
    background: rgba(39, 211, 159, 0.05);
}

.notif-row.notif-new::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
}

/* Avatar */
.notif-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.notif-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: rgba(255, 255, 255, 0.08);
}

.notif-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    background: rgba(39, 211, 159, 0.15);
}

/* Type badge */
.notif-type-icon {
    position: absolute;
    bottom: -2px;
    right: -4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    border: 2px solid var(--bg);
}

.notif-icon-like    { background: #ff4757; }
.notif-icon-comment { background: #3bd1ff; }
.notif-icon-wave    { background: #ffd700; }
.notif-icon-follow  { background: #27d39f; }

/* Text block */
.notif-body {
    flex: 1;
    min-width: 0;
}

.notif-text {
    font-size: 0.85rem;
    color: var(--text);
    line-height: 1.4;
    word-break: break-word;
}

.notif-text strong {
    font-weight: 700;
}

.notif-text em {
    color: rgba(245, 244, 242, 0.55);
    font-style: normal;
}

.notif-time {
    font-size: 0.72rem;
    color: rgba(245, 244, 242, 0.38);
    margin-top: 3px;
}

/* Post thumbnail */
.notif-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    opacity: 0.85;
}
