:root {
    --ko-primary: #6366f1;
    --ko-secondary: #ec4899;
    --ko-dark: #1f2937;
    --ko-light: #f9fafb;
    --ko-border: #e5e7eb;
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --touch-target: 44px;
    --border-radius: 8px;
}

html {
    scroll-behavior: smooth;
}

* {
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--ko-dark);
    font-size: clamp(14px, 2vw, 16px);
    line-height: 1.6;
}

/* Navbar Styling - Mobile First */
.ko-navbar {
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1050;
    min-height: 58px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
}

.ko-nav-shell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding: 0.5rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.ko-nav-left,
.ko-nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ko-brand {
    font-size: clamp(1rem, 2.5vw, 1.35rem);
    font-weight: 800;
    letter-spacing: 0.6px;
    color: #111827 !important;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.ko-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', 'Manrope', 'Segoe UI', sans-serif;
    font-weight: 800;
    letter-spacing: 0.12em;
    font-size: 0.9rem;
    padding: 4px 8px;
    border-radius: 8px;
    color: #ffffff;
    background: linear-gradient(
        90deg,
        #0b0b0b 0%,
        #0b0b0b 30%,
        #ffffff 30%,
        #ffffff 35%,
        #b91c1c 35%,
        #b91c1c 65%,
        #ffffff 65%,
        #ffffff 70%,
        #15803d 70%,
        #15803d 100%
    );
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
    text-transform: uppercase;
}

.ko-brand img {
    width: 28px;
    height: 28px;
    object-fit: cover;
    border-radius: 0;
    box-shadow: none;
}

/* Center navigation icons - Mobile */
.ko-nav-center {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 0;
    height: 100%;
    margin: 0;
    /* Facebook-style: center nav is centered in the header, independent of left/right widths */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: min(440px, calc(100vw - 360px));
    justify-content: space-evenly;
}

.ko-nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    width: auto;
    height: 100%;
    border-radius: 0;
    color: #111827;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.05rem;
    flex-shrink: 0;
    margin: 0;
    padding: 0.25rem 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.ko-nav-icon:hover,
.ko-nav-icon:focus {
    background: transparent !important;
    color: inherit;
    box-shadow: none;
    border-bottom-color: inherit;
    outline: none;
}

.ko-navbar .navbar-text {
    color: #111827;
    font-weight: 500;
    font-size: 0.95rem;
    margin: 0;
}

/* Right Side navbar buttons */
.ko-auth-actions {
    display: inline-flex;
    gap: 0.5rem;
}

.ko-auth-actions .btn {
    min-height: 38px;
    padding: 0.35rem 0.75rem;
    font-size: 0.9rem;
    border-radius: 999px;
}

.ko-auth-actions .btn-outline-light {
    color: #111827;
    border-color: #d1d5db;
}

.ko-auth-actions .btn-outline-light:hover {
    background: #111827;
    color: #ffffff;
    border-color: #111827;
}

.ko-auth-actions .btn-light {
    background: #111827;
    color: #ffffff;
    border-color: #111827;
}

.ko-auth-actions .btn-light:hover {
    background: #0b1220;
    border-color: #0b1220;
    color: #ffffff;
}

/* Navbar text visibility on mobile */
.navbar-text {
    font-size: 0.9rem;
}

@media (max-width: 991px) {
    .ko-navbar .navbar-text {
        display: none !important;
    }
    .ko-nav-shell {
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
    }
    .ko-nav-center {
        width: min(360px, calc(100vw - 280px));
    }
    .ko-nav-icon {
        min-width: 0;
        min-height: 40px;
        width: auto;
        height: 100%;
    }
}

@media (max-width: 640px) {
    .ko-nav-shell {
        justify-content: flex-start;
    }
    .ko-nav-center {
        /* On very small screens, avoid overlap by flowing normally */
        position: static;
        transform: none;
        width: auto;
        flex: 1;
    }
    .ko-auth-actions .btn {
        padding: 0.35rem 0.6rem;
    }
}

/* Notification Bell */
.nav-notifications {
    position: relative;
}

.notification-badge {
    animation: pulse 2s infinite;
}

.verified-badge {
    color: #1d9bf0;
    font-size: 0.82em;
    margin-left: 0.35rem;
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}


/* Old nav icon - now unused */
.nav-icon {
    display: none;
}

/* Main Content - Mobile First */
.ko-main {
    flex: 1;
    padding: clamp(0.25rem, 2vw, 1.5rem) clamp(0.25rem, 2vw, 0.5rem);
    width: 100%;
    overflow-x: hidden;
}

.ko-main .container {
    width: 100%;
    padding-left: clamp(0.25rem, 2vw, 0.5rem);
    padding-right: clamp(0.25rem, 2vw, 0.5rem);
    max-width: 100%;
}

/* Layout - Stack on mobile, flex on larger screens */
.ko-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    align-items: start;
}

/* For mobile: hide sidebars */
.ko-sidebar {
    display: none;
}

.ko-feed {
    width: 100%;
    min-width: 0;
}

.ko-layout-rails .ko-feed {
    min-width: 0;
}

.ko-suggest-card {
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    background: linear-gradient(180deg, #fff, #fcfcff);
    border: 1px solid var(--ko-border);
    margin-bottom: var(--spacing-sm);
    font-size: clamp(0.875rem, 2vw, 1rem);
}

.ko-rail-card {
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    border: 1px solid var(--ko-border);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
    margin-bottom: var(--spacing-md);
}

.ko-rail-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #0f172a;
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.ko-rail-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.6rem;
    border-radius: 10px;
    text-decoration: none;
    color: #0f172a;
    font-weight: 600;
    font-size: 0.92rem;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.ko-rail-link i {
    color: #0ea5a4;
    width: 20px;
    text-align: center;
}

.ko-rail-link:hover {
    background: rgba(14, 165, 164, 0.08);
    color: #0b7285;
    transform: translateX(2px);
}

.ko-rail-text {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: var(--spacing-sm);
}

.ko-rail-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    background: rgba(14, 165, 164, 0.12);
    color: #0b7285;
    font-size: 0.82rem;
    font-weight: 600;
    margin: 0.25rem 0.2rem 0 0;
}

.ko-rail-mini {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0;
}

.ko-rail-suggestion {
    justify-content: space-between;
    gap: 0.75rem;
}

.ko-rail-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.ko-rail-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0ea5a4, #f97316);
    color: #ffffff;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.ko-rail-avatar-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.ko-rail-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: #0f172a;
}

.ko-rail-subtext {
    font-size: 0.8rem;
    color: #64748b;
}

/* Post specifics - Mobile First */
.post-meta {
    display: flex;
    gap: clamp(0.5rem, 2vw, 0.75rem);
    align-items: center;
    flex-wrap: wrap;
}

.post-content {
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    color: #334155;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
}

.post-color-card {
    min-height: 180px;
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: clamp(1.05rem, 2.4vw, 1.35rem);
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: 0.2px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
}

.post-color-card * {
    white-space: inherit;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: inherit;
}

.post-color-card a {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.post-color-black {
    background: #0f172a;
    color: #f8fafc;
}

.post-color-green {
    background: #16a34a;
    color: #f8fafc;
}

.post-color-red {
    background: #dc2626;
    color: #fef2f2;
}

.post-color-white {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #e2e8f0;
}

.post-bg-picker {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.post-bg-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
}

.post-bg-options {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.post-bg-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-bg-option.is-black { background: #0f172a; border-color: #0f172a; }
.post-bg-option.is-green { background: #16a34a; border-color: #16a34a; }
.post-bg-option.is-red { background: #dc2626; border-color: #dc2626; }
.post-bg-option.is-white { background: #ffffff; border-color: #cbd5f5; }

.post-bg-option.is-selected::after {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 2px #111827;
}

.post-bg-option:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

.post-bg-option.is-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
}

.post-token-link {
    text-decoration: none;
    font-weight: 600;
}

.post-token-link.mention-link {
    color: #2563eb;
}

.post-token-link.hashtag-link {
    color: #0f766e;
}

.post-token-link:hover {
    text-decoration: underline;
}

/* Truncated Post Styles */
.post-content-wrapper {
    position: relative;
}

.post-content-preview {
    max-height: 10em;
    overflow: hidden;
    position: relative;
}

.post-content-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3em;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
    pointer-events: none;
}

.post-expand-btn {
    display: block;
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    color: var(--ko-primary);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.post-expand-btn:hover {
    color: var(--ko-secondary);
    transform: translateX(2px);
}

.post-media {
    margin-top: var(--spacing-md);
    border-radius: var(--border-radius);
    overflow: hidden;
    background: #f8fafc;
    min-height: 150px;
    max-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    width: 100%;
    object-fit: cover;
}

.post-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-actions .btn {
    font-weight: 700;
    min-height: var(--touch-target);
    padding: clamp(0.4rem, 1vw, 0.5rem) clamp(0.75rem, 2vw, 1rem);
    font-size: clamp(0.8rem, 2vw, 0.9rem);
}

/* Facebook-like post card specifics - Mobile First */
.fb-post {
    border-radius: var(--border-radius);
    border: 1px solid #e6e9ee;
    background: #fff;
    padding: 0;
    margin-bottom: clamp(0.5rem, 2vw, 1rem);
    overflow: hidden;
}

.fb-post .card-body {
    padding: clamp(0.5rem, 2vw, 1rem) clamp(0.75rem, 2vw, 1.5rem);
}

.fb-post .post-meta {
    gap: clamp(0.75rem, 2vw, 1rem);
}

.fb-post .user-avatar {
    width: clamp(36px, 8vw, 44px);
    height: clamp(36px, 8vw, 44px);
    font-size: clamp(0.9rem, 2vw, 1rem);
    flex-shrink: 0;
}

.fb-post .post-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.fb-post .post-header-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.fb-post .post-header-info h6 {
    font-size: clamp(0.9rem, 2vw, 1rem);
    margin: 0;
}

.fb-post .post-header-info small {
    color: #65676b;
    font-size: clamp(0.75rem, 1.5vw, 0.85rem);
}

.fb-post .post-content {
    margin-top: var(--spacing-sm);
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    color: #050505;
}

.fb-post .post-media {
    margin-top: var(--spacing-md);
    border-radius: var(--border-radius);
}

.fb-actions {
    display: flex;
    gap: clamp(0.25rem, 1vw, 0.5rem);
    border-top: 1px solid #eef0f3;
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-sm);
    flex-wrap: wrap;
    justify-content: space-between;
}

.fb-actions .fb-btn {
    flex: 1;
    min-height: var(--touch-target);
    display: inline-flex;
    gap: 0.35rem;
    align-items: center;
    justify-content: center;
    padding: 0.42rem 0.6rem;
    border-radius: 6px;
    color: #65676b;
    background: #f0f2f5;
    border: 1px solid #e4e6eb;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 0.9rem;
}

.fb-actions .fb-btn .action-count {
    font-weight: 700;
    font-size: 0.78em;
    opacity: 0.9;
    margin-left: 0.25rem;
}

.ko-action-count {
    font-size: 0.78em;
    font-weight: 600;
    color: #6b7280;
    margin-left: 0.25rem;
}

.profile-initial-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--ko-primary) 0%, var(--ko-secondary) 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 2rem;
    letter-spacing: 0.5px;
}

.profile-post-initial-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ko-primary) 0%, var(--ko-secondary) 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.notification-initial-avatar {
    width: 50px;
    height: 50px;
    font-size: 1.05rem;
    border: 2px solid rgba(99, 102, 241, 0.2);
    flex-shrink: 0;
}

.fb-actions .fb-btn i,
.ko-action-btn i,
.ko-whatsapp-btn i {
    font-size: 1rem;
    line-height: 1;
}

.fb-actions .fb-btn:hover {
    background: #e4e6eb;
    border-color: #d8dadf;
}

.fb-actions .like-btn {
    color: #65676b;
    min-height: var(--touch-target);
}

.fb-actions .like-btn:hover {
    background: #e4e6eb;
    color: #65676b;
}

.fb-actions .like-btn.liked {
    background: #f0f2f5;
    font-weight: 700;
    color: #65676b;
}

.fb-actions .like-btn.liked i {
    color: #f02849 !important;
}

.fb-actions .like-btn.liked:hover {
    background: #e4e6eb;
}

.fb-actions .like-btn.liked:hover i {
    color: #d91e3b;
}

/* Cards - Mobile First */
.ko-card {
    border: none;
    border-radius: var(--border-radius);
    background: white;
    transition: all 0.3s ease;
    overflow: hidden;
    margin-bottom: clamp(0.5rem, 2vw, 1rem);
}

.ko-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1) !important;
}

.ko-card .card-body {
    padding: clamp(0.75rem, 2vw, 1.5rem);
}

.ko-card .card-title {
    font-size: clamp(0.95rem, 3vw, 1.25rem);
}

/* User Avatar */
.user-avatar {
    width: clamp(36px, 8vw, 48px);
    height: clamp(36px, 8vw, 48px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: clamp(1rem, 2vw, 1.2rem);
    background: linear-gradient(135deg, var(--ko-primary) 0%, var(--ko-secondary) 100%);
    flex-shrink: 0;
}

.comment-avatar {
    width: clamp(32px, 6vw, 36px);
    height: clamp(32px, 6vw, 36px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    background: linear-gradient(135deg, var(--ko-primary) 0%, var(--ko-secondary) 100%);
    flex-shrink: 0;
}

/* Buttons - Touch Friendly */
.btn {
    min-height: clamp(40px, 10vw, 44px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: clamp(0.35rem, 1vw, 0.6rem) clamp(0.65rem, 2vw, 1.5rem);
    font-size: clamp(0.8rem, 1.5vw, 1rem);
    border-radius: var(--border-radius);
}

.btn:focus {
    outline: 2px solid var(--ko-primary);
    outline-offset: 2px;
}

.ko-btn {
    background: linear-gradient(135deg, var(--ko-primary) 0%, var(--ko-secondary) 100%);
    color: white;
    border: none;
    cursor: pointer;
}

.ko-btn:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #db2777 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.ko-btn:active {
    transform: translateY(0);
}

/* Action Buttons */
.ko-action-btn {
    color: #65676b;
    border: 1px solid #e4e6eb;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-height: var(--touch-target);
    background: #f0f2f5;
}

.ko-action-btn:hover {
    background-color: #e4e6eb;
    border-color: #d8dadf;
    color: #65676b;
}

.ko-action-btn.liked {
    color: #65676b;
    border-color: #e4e6eb;
    background-color: #f0f2f5;
}

/* WhatsApp Button */
.ko-whatsapp-btn {
    background-color: #f0f2f5;
    color: #65676b;
    border: 1px solid #e4e6eb;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-height: var(--touch-target);
}

.ko-whatsapp-btn:hover {
    background-color: #e4e6eb;
    color: #65676b;
    transform: none;
    box-shadow: none;
}

/* Form Controls - Touch Friendly */
.form-control,
.form-select {
    border: 1.5px solid var(--ko-border);
    border-radius: var(--border-radius);
    padding: clamp(0.5rem, 1vw, 0.75rem) clamp(0.65rem, 2vw, 1rem);
    transition: all 0.3s ease;
    min-height: clamp(40px, 10vw, 44px);
    font-size: clamp(0.85rem, 2vw, 1rem);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--ko-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-control::placeholder {
    color: #9ca3af;
}

.form-label {
    font-size: clamp(0.875rem, 2vw, 1rem);
    margin-bottom: clamp(0.3rem, 1vw, 0.5rem);
}

/* Comments Container - Responsive */
.comments-container {
    max-height: 60vh;
    max-height: clamp(240px, 60vh, 520px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-right: 0.2rem;
}

.comment-item {
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.comment-author {
    font-size: clamp(0.9rem, 1.6vw, 1rem);
    font-weight: 700;
    color: #0f172a;
}

.comment-text {
    font-size: clamp(0.9rem, 1.7vw, 1.02rem);
    color: #1f2937;
    word-break: break-word;
    flex: 1;
    line-height: 1.6;
}

/* Footer - Responsive */
.ko-footer {
    background: linear-gradient(135deg, var(--ko-dark), #374151);
    color: white;
    padding: clamp(1.5rem, 5vw, 3rem) 0 clamp(0.5rem, 1vw, 1rem);
    margin-top: auto;
}

.ko-footer h5 {
    font-weight: 700;
    margin-bottom: clamp(0.5rem, 1vw, 1rem);
    color: #fff;
    font-size: clamp(1rem, 2vw, 1.25rem);
}

.ko-footer p {
    margin: clamp(0.25rem, 0.5vw, 0.5rem) 0;
    opacity: 0.9;
    font-size: clamp(0.85rem, 1.5vw, 1rem);
}

/* Alerts - Responsive */
.alert {
    border-radius: var(--border-radius);
    border: none;
    padding: clamp(0.75rem, 2vw, 1rem) clamp(1rem, 2vw, 1.25rem);
    font-size: clamp(0.85rem, 1.5vw, 1rem);
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
}

.alert-success {
    background-color: #dcfce7;
    color: #166534;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

/* List Group - Responsive */
.list-group-item {
    padding: clamp(0.75rem, 2vw, 1rem) clamp(0.75rem, 2vw, 1rem);
    gap: var(--spacing-md);
}

.list-group-item > div {
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.list-group-item img {
    width: clamp(36px, 8vw, 44px);
    height: clamp(36px, 8vw, 44px);
    flex-shrink: 0;
}

/* Images - Responsive */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ko-card {
    animation: fadeIn 0.3s ease-out;
}

/* Scrollbar Styling */
.comments-container::-webkit-scrollbar {
    width: 6px;
}

.comments-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.comments-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.comments-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Dropdown Styling */
.dropdown-menu {
    border-radius: var(--border-radius);
    border: 1px solid var(--ko-border);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.dropdown-item {
    border-radius: 6px;
    margin: 0 0.25rem;
    font-size: clamp(0.875rem, 2vw, 1rem);
}

.dropdown-item:hover {
    background-color: #f3f4f6;
}

/* ================================================================ */
/* RESPONSIVE MEDIA QUERIES - Mobile First Approach */
/* ================================================================ */

/* ULTRA SMALL SCREENS - 320px to 375px */
@media (max-width: 375px) {
    :root {
        --spacing-md: 0.75rem;
        --spacing-lg: 1rem;
    }

    body {
        font-size: clamp(13px, 1.5vw, 15px);
    }

    .ko-navbar {
        max-height: 48px;
        min-height: 46px;
    }

    .ko-navbar .container-fluid {
        min-height: 46px;
    }

    .ko-navbar .px-3 {
        padding: 0.25rem !important;
    }

    .ko-brand {
        font-size: clamp(0.85rem, 2vw, 1.1rem);
        gap: 0.15rem;
    }

    .ko-brand img {
        height: clamp(20px, 5vw, 24px);
    }

    .ko-nav-center {
        gap: 0.4rem;
    }

    .ko-nav-icon {
        min-width: 0;
        min-height: 32px;
        width: auto;
        height: 100%;
        font-size: 0.85rem;
    }

    .ko-navbar .d-flex.gap-2 > .btn {
        min-height: 32px;
        min-width: 32px;
        padding: 0.25rem 0.4rem;
        font-size: 0.85rem;
    }

    .ko-main {
        padding: 0.15rem 0.15rem;
    }

    .ko-main .container {
        padding-left: 0.15rem;
        padding-right: 0.15rem;
    }

    .ko-card,
    .fb-post {
        margin-bottom: 0.5rem;
    }

    .fb-post .card-body {
        padding: 0.5rem 0.75rem;
    }

    .ko-card .card-body {
        padding: 0.5rem 0.75rem;
    }

    .post-media {
        min-height: 120px;
        max-height: 300px;
    }

    .user-avatar {
        width: clamp(28px, 6vw, 32px);
        height: clamp(28px, 6vw, 32px);
        font-size: clamp(0.7rem, 1.5vw, 0.8rem);
    }

    .comment-avatar {
        width: clamp(24px, 5vw, 28px);
        height: clamp(24px, 5vw, 28px);
        font-size: clamp(0.65rem, 1.2vw, 0.75rem);
    }

    .alert {
        padding: clamp(0.5rem, 1vw, 0.75rem) clamp(0.75rem, 1.5vw, 1rem);
        font-size: clamp(0.75rem, 1.2vw, 0.9rem);
    }

    .dropdown-item {
        font-size: clamp(0.75rem, 1.5vw, 0.9rem);
    }

    .form-label {
        font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    }

    .ko-footer {
        padding: clamp(0.75rem, 2vw, 1rem) 0 0.5rem;
    }

    .ko-footer h5 {
        font-size: clamp(0.9rem, 1.5vw, 1rem);
    }

    .ko-footer p {
        font-size: clamp(0.75rem, 1.2vw, 0.85rem);
    }
}

@media (min-width: 576px) {
    .ko-main {
        padding: clamp(1.5rem, 3vw, 2.5rem);
    }
    
    .ko-main .container {
        padding-left: var(--spacing-md);
        padding-right: var(--spacing-md);
    }
}

/* SMALL TABLET - 768px and up */
@media (min-width: 768px) {
    .ko-navbar {
        padding: 0.4rem 0;
        max-height: 52px;
        min-height: 50px;
    }

    .ko-brand {
        font-size: clamp(1.1rem, 3vw, 1.4rem);
    }

    .ko-nav-center {
        gap: 0.75rem;
    }

    .ko-nav-icon {
        width: auto;
        height: 100%;
        font-size: 1.05rem;
    }

    .navbar-text {
        display: inline !important;
    }

    .user-avatar {
        width: clamp(40px, 8vw, 48px);
        height: clamp(40px, 8vw, 48px);
    }

    .ko-card .card-body {
        padding: clamp(1rem, 2vw, 1.5rem);
    }

    /* Two-column layout starts here */
    .ko-layout {
        grid-template-columns: 1fr;
        gap: clamp(1rem, 2vw, 1.5rem);
    }

    /* Profile page 2-column */
    .row.mt-4 {
        gap: clamp(1rem, 2vw, 1.5rem);
    }

    .row.mt-4 > div {
        flex-basis: 100%;
    }
}

/* LARGE TABLET / SMALL LAPTOP - 992px and up */
@media (min-width: 992px) {
    /* Show sidebars on large screens when rails are enabled */
    .ko-layout-rails .ko-sidebar {
        display: block;
        background: linear-gradient(180deg, #ffffff, #fbfbfd);
        border-radius: var(--border-radius);
        border: 1px solid var(--ko-border);
        padding: var(--spacing-md);
        height: fit-content;
        position: sticky;
        top: 60px;
        max-width: 100%;
    }

    /* 3-column layout */
    .ko-layout-rails {
        grid-template-columns: minmax(220px, 1fr) minmax(0, 700px) minmax(220px, 1fr);
        gap: clamp(1.5rem, 3vw, 2rem);
    }

    .ko-layout-rails .ko-feed {
        grid-column: 2;
    }

    /* Profile page 2-column layout */
    .row.mt-4 > .col-md-4 {
        flex: 0 0 33.333%;
    }

    .row.mt-4 > .col-md-8 {
        flex: 0 0 66.667%;
    }

    /* Navbar adjustments */
    .ko-nav-center {
        gap: 2rem;
    }

    .ko-nav-icon {
        width: auto;
        height: 100%;
    }
}

/* DESKTOP - 1200px and up */
@media (min-width: 1200px) {
    .ko-main {
        padding: clamp(2rem, 4vw, 2.5rem);
    }

    .ko-main .container {
        max-width: 1200px;
    }

    .ko-layout {
        gap: 2rem;
    }

    .ko-sidebar {
        top: 60px;
    }

    /* Profile card centering */
    .row.mt-4 > .col-md-4 {
        display: flex;
        flex-direction: column;
    }
}

/* LARGE DESKTOP - 1400px and up */
@media (min-width: 1400px) {
    .ko-main .container {
        max-width: 1400px;
    }

    body {
        font-size: 16px;
    }
}

/* EXTRA LARGE - 1920px and up */
@media (min-width: 1920px) {
    .ko-layout {
        max-width: 1600px;
        margin: 0 auto;
    }
}

/* ================================================================ */
/* MOBILE OPTIMIZATION - Specific fixes for small screens */
/* ================================================================ */

/* Extra small screens - 320px to 575px */
@media (max-width: 575px) {
    .container-fluid {
        padding-left: clamp(0.25rem, 2vw, 0.5rem);
        padding-right: clamp(0.25rem, 2vw, 0.5rem);
    }

    /* Ensure full width on mobile */
    .ko-layout,
    .ko-feed,
    .ko-card,
    .fb-post {
        width: 100%;
        overflow-x: hidden;
    }

    /* Compact navbar on mobile */
    .ko-navbar {
        padding: clamp(0.2rem, 0.5vw, 0.35rem) 0;
        max-height: 50px;
        min-height: 48px;
    }

    .ko-brand {
        font-size: clamp(0.85rem, 2.5vw, 1.2rem);
        letter-spacing: 0.5px;
    }

    .ko-nav-center {
        gap: 0.5rem;
    }

    .ko-nav-icon {
        min-width: 0;
        min-height: 36px;
        width: auto;
        height: 100%;
    }

    /* Stack action buttons vertically if needed */
    .d-flex.gap-2 {
        gap: clamp(0.3rem, 1vw, 0.5rem) !important;
    }

    /* Reduce padding for small cards */
    .ko-card .card-body,
    .fb-post .card-body {
        padding: clamp(0.5rem, 2vw, 0.75rem);
    }

    /* Make buttons full width on very small screens */
    .btn.w-100 {
        width: 100%;
    }

    /* Improve list items on mobile */
    .list-group-item {
        flex-direction: column;
        align-items: flex-start;
        padding: clamp(0.5rem, 2vw, 0.75rem);
    }

    .list-group-item > div:first-child {
        width: 100%;
        margin-bottom: clamp(0.4rem, 1vw, 0.5rem);
    }

    .list-group-item > div:last-child {
        width: 100%;
        display: flex;
        gap: clamp(0.3rem, 1vw, 0.5rem);
    }

    /* Hide text on mobile, show only icons for nav */
    .ko-nav-center span {
        display: none;
    }

    /* Comments full viewport on mobile */
    .comments-container {
        max-height: 50vh;
    }

    /* Footer adjustments */
    .ko-footer {
        padding: clamp(0.75rem, 3vw, 1.5rem) 0 0.5rem;
    }

    .ko-footer .row {
        gap: clamp(0.5rem, 1.5vw, 1rem);
    }

    .ko-footer .text-end,
    .ko-footer .text-md-end {
        text-align: left !important;
    }

    /* Post meta and styling optimizations */
    .post-meta {
        gap: clamp(0.4rem, 1.5vw, 0.75rem);
    }

    .post-content {
        font-size: clamp(0.85rem, 2vw, 1rem);
    }

    .post-color-card {
        padding: 1rem;
        font-size: clamp(0.92rem, 4vw, 1.12rem);
        line-height: 1.45;
    }

    /* Form elements on mobile */
    .form-control,
    .form-select {
        padding: clamp(0.45rem, 1vw, 0.75rem) clamp(0.6rem, 1.5vw, 1rem);
        font-size: clamp(0.8rem, 1.5vw, 1rem);
    }

    /* Reduced gap for fb-actions on mobile */
    .fb-actions {
        gap: clamp(0.15rem, 0.75vw, 0.5rem);
    }

    .fb-actions .fb-btn {
        padding: 0.38rem 0.5rem;
        font-size: 0.82rem;
    }
}

/* ================================================================ */
/* LANDSCAPE ORIENTATION - Mobile Landscape */
/* ================================================================ */

@media (max-height: 600px) and (orientation: landscape) {
    .ko-main {
        padding: 1rem 0;
    }

    .ko-card .card-body,
    .fb-post .card-body {
        padding: 0.75rem;
    }

    .comments-container {
        max-height: 40vh;
    }
}
/* Action Buttons for Posts */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: #6b7280;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
}

.action-btn:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

.action-btn i {
    margin-right: 0.25rem;
}

.like-btn.liked i {
    color: #ef4444 !important;
}

/* Comments Section */
.comments-section {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
}

.comment-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-form {
    margin-top: 1rem;
}

.comment-input {
    font-size: 0.9rem;
}

.comment-bubble {
    width: 100%;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    position: relative;
}

.comment-item[data-depth]:not([data-depth="0"]) {
    padding-left: 0.75rem;
}

.comment-item[data-depth]:not([data-depth="0"])::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 0.6rem;
    bottom: 0.6rem;
    width: 2px;
    background: #e2e8f0;
    border-radius: 2px;
}

.comment-item[data-depth]:not([data-depth="0"])::after {
    content: "";
    position: absolute;
    left: -12px;
    top: 1.35rem;
    width: 16px;
    height: 2px;
    background: #e2e8f0;
    border-radius: 2px;
}

.comment-item[data-depth]:not([data-depth="0"]) .comment-bubble {
    margin-left: 0.15rem;
}

.comment-actions-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.comment-like-btn,
.comment-reply-toggle-btn {
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.comment-like-btn:hover,
.comment-reply-toggle-btn:hover {
    color: #0f172a;
}

.comment-like-btn.liked {
    color: #e11d48;
}

.comment-replies {
    border-left: 2px solid #e2e8f0;
    padding-left: 0.75rem;
    margin-left: 0.25rem;
}

.comment-view-replies-btn {
    border: none;
    background: transparent;
    color: #1d4ed8;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.comment-view-replies-btn:hover {
    color: #1e3a8a;
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Dark mode */
body.dark-mode {
    background: linear-gradient(135deg, #0b1220 0%, #111827 100%);
    color: #e5e7eb;
}

body.dark-mode .ko-navbar {
    background: #111827;
    border-bottom-color: #243041;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

body.dark-mode .ko-brand,
body.dark-mode .ko-navbar .navbar-text,
body.dark-mode .ko-nav-icon {
    color: #e5e7eb !important;
}

body.dark-mode .ko-nav-icon:hover,
body.dark-mode .ko-nav-icon:focus {
    background: transparent !important;
    color: inherit;
    box-shadow: none;
    border-bottom-color: inherit;
}

body.dark-mode .ko-card,
body.dark-mode .fb-post,
body.dark-mode .card,
body.dark-mode .ko-suggest-card {
    background: #111827;
    color: #e5e7eb;
    border-color: #243041;
}

body.dark-mode .card-header,
body.dark-mode .fb-actions {
    border-color: #243041;
}

body.dark-mode .post-content,
body.dark-mode .fb-post .post-content {
    color: #e5e7eb;
}

body.dark-mode .post-token-link.mention-link {
    color: #93c5fd;
}

body.dark-mode .post-token-link.hashtag-link {
    color: #5eead4;
}

body.dark-mode .text-muted {
    color: #9ca3af !important;
}

body.dark-mode .form-control,
body.dark-mode .form-select {
    background-color: #0f172a;
    border-color: #334155;
    color: #e5e7eb;
}

body.dark-mode .form-control::placeholder {
    color: #94a3b8;
}

body.dark-mode .dropdown-menu {
    background-color: #111827;
    border-color: #334155;
}

body.dark-mode .dropdown-item {
    color: #e5e7eb;
}

body.dark-mode .dropdown-item:hover {
    background-color: #1f2937;
}

body.dark-mode .list-group-item {
    background-color: #111827;
    border-color: #243041;
    color: #e5e7eb;
}

body.dark-mode .comment-item {
    background: #0f172a;
    border-color: #243041;
}

body.dark-mode .comment-author,
body.dark-mode .comment-text {
    color: #e2e8f0;
}

body.dark-mode .comment-bubble {
    background: #0f172a;
    border-color: #243041;
}

body.dark-mode .comment-item[data-depth]:not([data-depth="0"])::before,
body.dark-mode .comment-item[data-depth]:not([data-depth="0"])::after {
    background: rgba(148, 163, 184, 0.6);
}

body.dark-mode .comment-replies {
    border-left-color: #334155;
}

body.dark-mode .comment-like-btn,
body.dark-mode .comment-reply-toggle-btn {
    color: #94a3b8;
}

body.dark-mode .comment-like-btn:hover,
body.dark-mode .comment-reply-toggle-btn:hover {
    color: #e5e7eb;
}

body.dark-mode .comment-view-replies-btn {
    color: #93c5fd;
}

body.dark-mode .comment-view-replies-btn:hover {
    color: #dbeafe;
}

body.dark-mode .alert-info {
    background-color: rgba(37, 99, 235, 0.2);
    color: #bfdbfe;
}

body.dark-mode .alert-success {
    background-color: rgba(22, 163, 74, 0.2);
    color: #bbf7d0;
}

body.dark-mode .alert-danger {
    background-color: rgba(220, 38, 38, 0.2);
    color: #fecaca;
}

body.dark-mode .settings-container {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
}

body.dark-mode .ko-rail-card {
    background: #111827;
    border-color: #243041;
    box-shadow: 0 14px 24px rgba(2, 6, 23, 0.4);
}

body.dark-mode .ko-rail-title,
body.dark-mode .ko-rail-name {
    color: #e5e7eb;
}

body.dark-mode .ko-rail-text,
body.dark-mode .ko-rail-subtext {
    color: #9ca3af;
}

body.dark-mode .ko-rail-link {
    color: #e5e7eb;
}

body.dark-mode .ko-rail-link i {
    color: #5eead4;
}

body.dark-mode .ko-rail-link:hover {
    background: rgba(94, 234, 212, 0.1);
    color: #5eead4;
}

body.dark-mode .ko-rail-pill {
    background: rgba(94, 234, 212, 0.12);
    color: #5eead4;
}

/* ================================================================ */
/* FINAL UI POLISH LAYER */
/* ================================================================ */

:root {
    --ko-primary: #0ea5a4;
    --ko-secondary: #f97316;
    --ko-accent: #0f172a;
    --ko-bg-soft: #f4f7fb;
    --ko-ring: rgba(14, 165, 164, 0.35);
    --ko-card-radius: 14px;
    --ko-shadow-soft: 0 14px 30px rgba(15, 23, 42, 0.08);
    --ko-shadow-strong: 0 20px 45px rgba(15, 23, 42, 0.12);
}

body {
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    background:
        radial-gradient(circle at 10% 0%, rgba(14, 165, 164, 0.14), transparent 35%),
        radial-gradient(circle at 90% 8%, rgba(249, 115, 22, 0.14), transparent 32%),
        linear-gradient(180deg, #f8fbff 0%, #f1f5fb 100%);
}

h1, h2, h3, h4, h5, h6,
.navbar-brand,
.ko-brand {
    font-family: 'Space Grotesk', 'Manrope', sans-serif;
}

a {
    color: #0b7285;
}

a:hover {
    color: #0f766e;
}

.ko-navbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(8px);
}

.ko-brand img {
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.15);
}

.ko-nav-icon {
    border-bottom: 2px solid transparent;
}

.ko-nav-icon.is-active {
    color: #0b7285;
    border-bottom-color: #0b7285;
    background: rgba(14, 165, 164, 0.08);
}

.notification-badge {
    border: 2px solid #ffffff;
    font-size: 0.68rem;
}

.ko-card,
.fb-post,
.ko-suggest-card,
.ko-sidebar {
    border-radius: var(--ko-card-radius);
    box-shadow: var(--ko-shadow-soft);
}

.ko-card:hover,
.fb-post:hover {
    transform: translateY(-3px);
    box-shadow: var(--ko-shadow-strong) !important;
}

.ko-suggest-card {
    background: linear-gradient(165deg, #ffffff 0%, #f6fbff 100%);
}

.post-content {
    font-size: clamp(0.94rem, 1.6vw, 1.04rem);
    color: #1e293b;
}

.fb-actions {
    border-top: 1px solid #e8eef5;
}

.fb-actions .fb-btn {
    border-radius: 10px;
}

.ko-btn {
    background: linear-gradient(140deg, #0ea5a4 0%, #0b7285 45%, #f97316 100%);
    border: none;
}

.ko-btn:hover {
    background: linear-gradient(140deg, #0b948f 0%, #0a6678 45%, #ea6a11 100%);
    box-shadow: 0 10px 20px rgba(11, 114, 133, 0.25);
}

.form-control:focus,
.form-select:focus,
.btn:focus {
    box-shadow: 0 0 0 4px var(--ko-ring);
}

.ko-main .container > * {
    animation: fadeIn 0.36s ease-out;
}

body.dark-mode {
    background:
        radial-gradient(circle at 10% 0%, rgba(14, 165, 164, 0.12), transparent 34%),
        radial-gradient(circle at 92% 8%, rgba(249, 115, 22, 0.12), transparent 28%),
        linear-gradient(165deg, #060b14 0%, #0f172a 100%);
}

body.dark-mode .ko-navbar {
    background: rgba(17, 24, 39, 0.88);
}

body.dark-mode .ko-nav-icon.is-active {
    color: #5eead4 !important;
    border-bottom-color: #5eead4;
    background: rgba(94, 234, 212, 0.08);
}

body.dark-mode .ko-card,
body.dark-mode .fb-post,
body.dark-mode .ko-suggest-card,
body.dark-mode .ko-sidebar {
    box-shadow: 0 16px 32px rgba(2, 6, 23, 0.42);
}
