:root {
    --fo-bg: #f3f8ff;
    --fo-card: #ffffff;
    --fo-border: #d8e6f3;
    --fo-title: #123b63;
    --fo-text: #3f5d78;
    --fo-muted: #6a84a0;
    --fo-primary: #0b6cb6;
    --fo-primary-strong: #0a5ea0;
    --fo-primary-soft: #eaf4ff;
    --fo-success-soft: #ecf9f0;
    --fo-success-text: #1e7444;
    --fo-shadow: 0 10px 32px rgba(8,57,105,.08);
}

.fo-page {
    background: linear-gradient(180deg, var(--fo-bg) 0%, #f9fcff 45%, #ffffff 100%);
    min-height: calc(100vh - 84px);
    padding-bottom: 42px;
}

.fo-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 18px;
}

.fo-hero {
    background: linear-gradient(140deg, #0b5ea7 0%, #0e8fc1 55%, #1db8da 100%);
    color: #fff;
    padding: 52px 0 44px;
    margin-bottom: 22px;
}

.fo-hero h1 { margin: 0 0 12px; font-size: 2rem; }
.fo-hero p { margin: 0; max-width: 760px; opacity: .94; }

.fo-topbar {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fo-chip {
    border-radius: 999px;
    padding: 6px 11px;
    font-size: .82rem;
    font-weight: 600;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.25);
}

.fo-panel {
    background: var(--fo-card);
    border: 1px solid var(--fo-border);
    border-radius: 16px;
    box-shadow: var(--fo-shadow);
    padding: 14px;
    margin-bottom: 14px;
}

.fo-toolbar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
}

.fo-field { display: grid; gap: 6px; }
.fo-field label { font-size: .86rem; color: var(--fo-muted); font-weight: 600; }

.fo-input,.fo-select,.fo-textarea {
    width: 100%;
    border: 1px solid #c7d9eb;
    border-radius: 10px;
    padding: 10px 11px;
    font: inherit;
    color: #204464;
    background: #fff;
}
.fo-textarea { min-height: 130px; resize: vertical; }

.fo-input:focus,.fo-select:focus,.fo-textarea:focus {
    outline: none;
    border-color: #6faede;
    box-shadow: 0 0 0 3px rgba(27,126,202,.12);
}

.fo-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.fo-btn {
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.fo-btn.primary { background: linear-gradient(135deg, var(--fo-primary), #1684c9); color: #fff; }
.fo-btn.primary:hover { background: linear-gradient(135deg, var(--fo-primary-strong), #1278ba); }
.fo-btn.secondary { background: #edf5ff; border: 1px solid #d4e6f7; color: #1d5f95; }

.fo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.fo-card {
    background: #fff;
    border: 1px solid #dce8f5;
    border-radius: 14px;
    box-shadow: 0 6px 22px rgba(10,66,120,.06);
    padding: 13px;
    display: grid;
    gap: 8px;
}

.fo-card h3 { margin: 0; color: #0f2f4d; font-size: 1.02rem; }
.fo-card p { margin: 0; color: var(--fo-text); font-size: .9rem; line-height: 1.45; }

.fo-category-grid {
    gap: 14px;
}

.fo-category-card {
    padding: 16px;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 10px 26px rgba(10,66,120,.07);
}

.fo-category-card h3 {
    font-size: 1.08rem;
}

.fo-category-top {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
}

.fo-category-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--fo-primary-soft);
    color: var(--fo-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.fo-category-last {
    margin-top: 4px;
    color: var(--fo-muted);
    font-size: 0.82rem;
}

.fo-category-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.fo-category-links {
    display: grid;
    gap: 7px;
    padding: 10px 0 2px;
}

.fo-category-links a {
    color: var(--fo-primary);
    text-decoration: none;
    font-weight: 600;
    line-height: 1.35;
}

.fo-category-links a:hover {
    color: var(--fo-primary-strong);
}

.fo-home-grid {
    grid-template-columns: 1.2fr 0.8fr;
    gap: 14px;
    margin-bottom: 14px;
}

.fo-home-list {
    display: grid;
    gap: 10px;
}

.fo-home-item {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid #dce8f5;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.fo-home-item strong {
    color: var(--fo-title);
    font-size: 0.98rem;
}

.fo-home-item p {
    margin: 4px 0 0;
    color: var(--fo-muted);
    font-size: 0.88rem;
}

.fo-home-user {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 12px;
}

.fo-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.fo-badge {
    border-radius: 999px;
    padding: 4px 9px;
    font-size: .78rem;
    font-weight: 600;
    background: var(--fo-primary-soft);
    color: #1c598f;
}
.fo-badge.success { background: var(--fo-success-soft); color: var(--fo-success-text); }

.fo-empty {
    border: 1px dashed #bfd7eb;
    border-radius: 14px;
    padding: 24px;
    text-align: center;
    background: #f8fcff;
    color: #45647f;
}
.fo-empty h3 { margin: 0 0 8px; color: #123b63; }

.fo-empty p {
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.5;
}

.fo-empty-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    margin: 0 auto 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #edf5ff;
    color: var(--fo-primary);
    font-weight: 800;
    letter-spacing: 0.08em;
}

.fo-pagination { display: flex; gap: 8px; align-items: center; justify-content: center; }

.fo-image {
    max-width: 100%;
    border-radius: 10px;
    border: 1px solid #dbe8f5;
}

.fo-btn-sm {
    padding: 7px 10px;
    font-size: 0.82rem;
}

.fo-chat-panel {
    padding: 18px 16px;
}

.fo-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.fo-chat {
    display: grid;
    gap: 12px;
}

.fo-msg {
    display: grid;
    gap: 6px;
    transition: opacity .22s ease, transform .22s ease;
}

.fo-msg--me {
    justify-items: end;
}

.fo-msg--enter {
    animation: foMessageEnter .28s ease-out;
}

.fo-msg--removing {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
}

.fo-msg--skeleton {
    opacity: 0.94;
}

.fo-msg--skeleton .fo-avatar,
.fo-skeleton-line,
.fo-skeleton-pill {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, #edf4fb 0%, #ffffff 50%, #edf4fb 100%);
    background-size: 240px 100%;
    animation: foSkeletonPulse 1.2s linear infinite;
}

.fo-msg--skeleton .fo-avatar {
    color: transparent;
}

.fo-skeleton-line {
    display: block;
    border-radius: 999px;
    height: 10px;
}

.fo-skeleton-line--author {
    width: 96px;
}

.fo-skeleton-line--time {
    width: 74px;
}

.fo-skeleton-line--text {
    width: min(480px, 72vw);
    height: 11px;
    margin-bottom: 9px;
}

.fo-skeleton-line--text.short {
    width: min(290px, 48vw);
    margin-bottom: 0;
}

.fo-skeleton-pill {
    display: inline-block;
    width: 92px;
    height: 38px;
    border-radius: 999px;
}

.fo-msg-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--fo-muted);
    font-size: 0.86rem;
}

.fo-msg--me .fo-msg-head {
    flex-direction: row-reverse;
}

.fo-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--fo-primary-soft);
    color: var(--fo-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.fo-msg-meta {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.fo-msg-author {
    color: var(--fo-title);
    font-weight: 700;
}

.fo-msg-time {
    color: var(--fo-muted);
}

.fo-bubble {
    background: #f7fbff;
    border: 1px solid #d6e6f5;
    border-radius: 14px;
    padding: 10px 12px;
    max-width: 820px;
    width: fit-content;
    box-shadow: 0 6px 16px rgba(10,66,120,.06);
}

.fo-msg--me .fo-bubble {
    background: #e7f3ff;
    border-color: #bfdaf4;
}

.fo-bubble p {
    margin: 0;
    color: var(--fo-text);
    font-size: 0.92rem;
}

.fo-msg-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.fo-like-btn {
    border: 1px solid #d5e5f5;
    background: linear-gradient(180deg, #ffffff 0%, #eef6ff 100%);
    color: #164d7d;
    border-radius: 999px;
    padding: 7px 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
    box-shadow: 0 6px 14px rgba(10, 66, 120, 0.08);
}

.fo-like-btn:hover {
    background: linear-gradient(180deg, #ffffff 0%, #e7f2ff 100%);
    border-color: #b2d2ef;
    box-shadow: 0 8px 18px rgba(10, 66, 120, 0.14);
    transform: translateY(-1px);
}

.fo-like-btn.is-active {
    background: linear-gradient(180deg, #fff0bf 0%, #ffe398 100%);
    border-color: #efc556;
    color: #855300;
    box-shadow: 0 10px 20px rgba(150, 103, 0, 0.18);
}

.fo-like-btn--pulse {
    animation: foLikePulse .28s ease-out;
}

.fo-like-emoji {
    font-size: 1rem;
    line-height: 1;
}

.fo-like-count {
    font-size: 0.8rem;
    min-width: 1ch;
}

.fo-like-read {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #557790;
    font-size: 0.86rem;
}

.fo-msg-actions .fo-btn.secondary.fo-btn-sm {
    border: 1px solid #d5e6f7;
    background: linear-gradient(180deg, #ffffff 0%, #edf6ff 100%);
    color: #17598f;
    border-radius: 999px;
    padding: 7px 13px;
    font-weight: 700;
    min-height: 38px;
    transition: background .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.fo-msg-actions .fo-btn.secondary.fo-btn-sm:hover {
    background: #e0f0ff;
    border-color: #b4d3ef;
    box-shadow: 0 6px 14px rgba(10, 66, 120, 0.1);
    transform: translateY(-1px);
}

.fo-reply-btn {
    background: linear-gradient(135deg, #0c6db4, #1693c8) !important;
    border-color: #0b6cb6 !important;
    color: #fff !important;
    box-shadow: 0 10px 22px rgba(11, 108, 182, 0.2);
}

.fo-reply-btn:hover {
    background: linear-gradient(135deg, #0a619f, #127db4) !important;
}

.fo-delete-btn {
    background: linear-gradient(180deg, #ffffff 0%, #fff1f1 100%) !important;
    border-color: #f1d1d1 !important;
    color: #9f3737 !important;
    box-shadow: 0 8px 18px rgba(159, 55, 55, 0.08);
}

.fo-delete-btn:hover {
    background: linear-gradient(180deg, #ffffff 0%, #ffe6e6 100%) !important;
    border-color: #ebb7b7 !important;
}

.fo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(9, 23, 39, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
}

.fo-lightbox[hidden] {
    display: none !important;
}

.fo-lightbox-image {
    display: block;
    max-width: min(92vw, 1100px);
    max-height: 88vh;
    border-radius: 18px;
    box-shadow: 0 22px 42px rgba(0, 0, 0, 0.28);
    object-fit: contain;
    background: #fff;
}

.fo-lightbox-image[hidden] {
    display: none !important;
}

.fo-lightbox-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

.fo-collage {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 8px;
}

.fo-collage .fo-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.fo-image-single {
    margin-top: 8px;
    width: 100%;
    max-height: 340px;
    object-fit: cover;
}

.fo-chat-compose {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed #cddff0;
}

.fo-chat-compose h3 {
    margin: 0 0 10px;
    color: var(--fo-title);
}

.fo-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
}

.fo-preview-item {
    border: 1px solid #d7e6f4;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    position: relative;
}

.fo-preview-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.fo-preview-item::after {
    content: "Фото";
    position: absolute;
    left: 6px;
    bottom: 6px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
}

.fo-composer {
    position: sticky;
    bottom: 16px;
    z-index: 2;
    background: #ffffff;
    border: 1px solid #d8e6f3;
    box-shadow: 0 12px 30px rgba(10,66,120,.12);
}

.fo-new-msg-btn {
    position: fixed;
    right: 16px;
    bottom: 18px;
    border: none;
    border-radius: 999px;
    padding: 10px 14px;
    background: var(--fo-primary);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(10,66,120,.24);
    z-index: 25;
    transition: transform .15s ease, box-shadow .15s ease;
}

.fo-new-msg-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(10,66,120,.3);
}

@keyframes foMessageEnter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes foLikePulse {
    0% {
        transform: scale(1);
    }
    45% {
        transform: scale(1.06);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes foSkeletonPulse {
    0% {
        background-position: -240px 0;
    }
    100% {
        background-position: 240px 0;
    }
}

@media (max-width: 760px) {
    .fo-bubble {
        max-width: 100%;
    }

    .fo-msg-time {
        font-size: 0.8rem;
    }

    .fo-msg-actions {
        gap: 8px;
    }

    .fo-like-btn,
    .fo-msg-actions .fo-btn.secondary.fo-btn-sm {
        padding: 7px 11px;
    }
}

@media (max-width: 760px) {
    .fo-hero h1 { font-size: 1.6rem; }
    .fo-toolbar { grid-template-columns: 1fr; }
    .fo-home-grid { grid-template-columns: 1fr; }
}
