:root {
    --fm-ink: #122332;
    --fm-muted: #5f7283;
    --fm-accent: #e45f2b;
    --fm-surface: #ffffff;
    --fm-bg: #eef2f6;
    --fm-line: #d8e0e8;
    --fm-dark: #0f1d2a;
}

body {
    font-family: "Trebuchet MS", "Gill Sans", "Verdana", sans-serif;
    color: var(--fm-ink);
    background:
        radial-gradient(1200px 300px at 15% -5%, rgba(27, 71, 111, 0.14), transparent 60%),
        radial-gradient(900px 220px at 85% -3%, rgba(228, 95, 43, 0.16), transparent 60%),
        var(--fm-bg);
}

.navbar {
    backdrop-filter: blur(8px);
}

.navbar-brand {
    letter-spacing: 0.02em;
}

.btn-dark {
    color: #fff;
    background: var(--fm-dark);
    border-color: var(--fm-dark);
}

.btn-outline-dark {
    color: var(--fm-dark);
    border-color: var(--fm-dark);
}

.btn-outline-dark:hover {
    color: #fff;
    background: var(--fm-dark);
}

.shadow-sm {
    box-shadow: 0 0.2rem 0.5rem rgba(16, 35, 53, 0.12) !important;
}

.border-0 {
    border: 0 !important;
}

.hero-shell {
    position: relative;
}

.hero-inner {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(247, 250, 253, 0.94)),
        linear-gradient(70deg, #153551 0%, #0d1f31 100%);
    border: 1px solid var(--fm-line);
    box-shadow: 0 18px 40px rgba(10, 27, 44, 0.14);
}

.hero-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--fm-accent);
    font-size: 0.75rem;
}

.lead {
    color: var(--fm-muted);
}

.hero-search {
    border-radius: 0.85rem;
    background: #ffffff;
}

.find-next-section {
    background: #fff;
    border: 1px solid var(--fm-line);
    border-radius: 0.85rem;
    padding: 1rem;
    box-shadow: 0 8px 20px rgba(20, 35, 48, 0.08);
}

.find-next-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.8rem;
}

.find-next-card {
    border: 1px solid #d7e1ea;
    background: #fbfdff;
    border-radius: 0.7rem;
    padding: 0.75rem;
}

.find-next-parent {
    display: inline-block;
    font-weight: 700;
    color: #153551;
    text-decoration: none;
    margin-bottom: 0.45rem;
}

.find-next-parent:hover {
    color: #0b5ed7;
    text-decoration: underline;
}

.find-next-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.find-next-link {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.58rem;
    border: 1px solid #c8d6e3;
    border-radius: 999px;
    color: #1b3954;
    background: #f4f9ff;
    text-decoration: none;
    font-size: 0.82rem;
    line-height: 1.2;
}

.find-next-link:hover {
    border-color: #9fb8cf;
    color: #0b5ed7;
    background: #ecf4ff;
}

.feature-card {
    border: 1px solid var(--fm-line);
    box-shadow: 0 6px 18px rgba(14, 34, 52, 0.08);
}

.step-block {
    background: #f7fafc;
    border: 1px solid var(--fm-line);
    border-radius: 0.75rem;
    padding: 0.75rem;
    height: 100%;
}

.step-block span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 999px;
    background: var(--fm-dark);
    color: #fff;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.step-block p {
    margin: 0;
    color: var(--fm-muted);
    font-size: 0.92rem;
}

.listing-card {
    border: 1px solid var(--fm-line);
    box-shadow: 0 8px 20px rgba(20, 35, 48, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.listing-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 26px rgba(20, 35, 48, 0.14);
}

.listing-thumb {
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: #f1f3f5;
}

.stats-chip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.55rem;
}

.stats-chip-grid-compact {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.stat-chip {
    background: #fff;
    border: 1px solid var(--fm-line);
    border-radius: 0.55rem;
    padding: 0.48rem 0.62rem;
    min-height: 64px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
}

.stat-chip-inline {
    min-height: 50px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.stat-chip-label {
    color: var(--fm-muted);
    font-size: 0.82rem;
    line-height: 1.2;
}

.stat-chip-value {
    color: var(--fm-ink);
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1;
}

.stat-chip-value-inline {
    font-size: 0.98rem;
    text-transform: capitalize;
}

.feed-stack {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.feed-card {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 0.85rem;
    border: 1px solid var(--fm-line);
    border-radius: 0.65rem;
    background: #fff;
    overflow: hidden;
}

.feed-thumb-link {
    display: block;
    background: #e8edf2;
}

.feed-thumb {
    width: 100%;
    height: 100%;
    min-height: 120px;
    max-height: 150px;
    object-fit: cover;
    display: block;
}

.feed-content {
    padding: 0.7rem 0.85rem 0.7rem 0;
    color: var(--fm-ink);
}

.feed-card-no-thumb {
    grid-template-columns: 1fr;
}

.feed-card-no-thumb .feed-content {
    padding: 0.75rem 0.85rem;
}

.feed-meta-top {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.45rem;
}

.feed-kind-badge {
    background: #153551;
    border: 1px solid #153551;
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.feed-content h3,
.feed-content p,
.feed-content .small {
    color: var(--fm-ink);
}

.feed-content .text-muted {
    color: #5b6d7d !important;
}

.feed-content .text-secondary {
    color: #4f6172 !important;
}

.feed-content a {
    color: #0b5ed7;
}

.feed-content a:hover {
    color: #0849a8;
}

.cookie-notice {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 1080;
    background: rgba(15, 29, 42, 0.96);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 0.6rem;
    box-shadow: 0 10px 24px rgba(12, 23, 34, 0.28);
    padding: 0.7rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cookie-notice-text {
    font-size: 0.86rem;
    line-height: 1.35;
}

.cookie-notice-btn {
    flex-shrink: 0;
}

.content-archive-thumb {
    width: 180px;
    height: 120px;
    max-width: 100%;
    object-fit: cover;
    background: #f1f3f5;
    display: block;
}

@media (max-width: 575.98px) {
    .cookie-notice {
        flex-direction: column;
        align-items: stretch;
        gap: 0.55rem;
    }

    .cookie-notice-btn {
        width: 100%;
    }

    .content-archive-thumb {
        width: 120px;
        height: 84px;
    }

    .feed-card {
        grid-template-columns: 1fr;
    }

    .feed-thumb {
        max-height: 180px;
    }

    .feed-content {
        padding: 0 0.75rem 0.75rem;
    }

    .stat-chip {
        min-height: 58px;
    }

    .stat-chip-value {
        font-size: 1.25rem;
    }
}

.content-body {
    line-height: 1.65;
    color: #1d2f3e;
}

.content-body h2,
.content-body h3,
.content-body h4 {
    margin-top: 1.2rem;
}

.content-body a {
    color: #0e5da8;
    text-decoration: underline;
}

.content-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0.8rem 0;
    border-radius: 0.35rem;
}

.wysiwyg {
    border: 1px solid #c7d2de;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #fff;
}

.wysiwyg-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.6rem;
    border-bottom: 1px solid #d7e0e8;
    background: #f8fbfe;
}

.wysiwyg-toolbar .form-select {
    width: auto;
}

.wysiwyg-editor {
    min-height: 420px;
    border: 0;
    border-radius: 0;
    padding: 0.85rem;
    font-family: "Trebuchet MS", "Gill Sans", "Verdana", sans-serif;
    line-height: 1.55;
}

.wysiwyg-editor:focus {
    outline: 2px solid rgba(13, 110, 253, 0.28);
    outline-offset: -2px;
}

.chat-messages {
    min-height: 360px;
    max-height: 62vh;
    overflow-y: auto;
    background: #f7fafc;
    border-radius: 0.5rem;
    padding: 0.9rem;
}

.chat-row {
    display: flex;
    margin-bottom: 0.75rem;
}

.chat-row-own {
    justify-content: flex-end;
}

.chat-row-other {
    justify-content: flex-start;
}

.chat-bubble {
    max-width: 84%;
    border-radius: 0.75rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid #d7e0e8;
    background: #fff;
    box-shadow: 0 2px 8px rgba(16, 28, 41, 0.06);
}

.chat-bubble-own {
    background: #e9f2ff;
    border-color: #bdd7ff;
}

.chat-bubble-other {
    background: #fff;
}

.chat-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    font-size: 0.76rem;
    color: #5f7283;
    margin-bottom: 0.35rem;
}

.chat-body {
    white-space: normal;
    word-break: break-word;
}

.chat-deleted {
    font-style: italic;
    color: #7c8b98;
}

.chat-actions {
    margin-top: 0.45rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
}

.chat-actions form {
    margin: 0;
}

code {
    word-break: break-word;
}

/* Admin mobile compatibility only */
@media (max-width: 991.98px) {
    .layout-admin aside {
        border-right: 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    }

    .layout-admin aside .nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem 0.75rem !important;
    }

    .layout-admin aside .nav-link {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .layout-admin main {
        padding: 1rem !important;
    }
}

@media (max-width: 768px) {
    .hero-inner {
        padding: 1.2rem;
    }

    .wysiwyg-editor {
        min-height: 300px;
    }
}

@media (max-width: 575.98px) {
    .layout-admin aside .nav {
        grid-template-columns: 1fr;
    }

    .layout-admin .btn {
        width: 100%;
    }
}
