/* ═══════════════════════════════════════════════════════════════════
   Socialify — app layer (loaded by blog/templates/app/head.html)
   Phones & tablets (< 1200px): native-style app — rainbow app bar + rainbow tab bar
   (same .bg-steel / .navbar-bottom gradients as the website, equal heights), card
   feed, and the "All of Socialify" sheet.
   Desktop & laptops (>= 1200px): the existing website, with responsive fixes only.
   ═══════════════════════════════════════════════════════════════════ */

:root {
    --sf-bar-h: 58px;
    --sf-safe-top: env(safe-area-inset-top, 0px);
    --sf-safe-bottom: env(safe-area-inset-bottom, 0px);
    --sf-font: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --sf-ink: #1c1f2b;
    --sf-ink-soft: #667085;
    --sf-bg: #eef1f7;
    --sf-card: #ffffff;
    --sf-rainbow: linear-gradient(90deg, #ff0000, #ff9a00, #d0de21, #4fdc4a, #3fdad8, #2fc9e2, #1c7fee, #5f15f2, #ba0cf8, #fb07d9);
}

/* Never scroll sideways, on any screen */
html, body { overflow-x: clip; max-width: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; }
@view-transition { navigation: auto; }

/* The app layer is hidden on desktop */
.sf-appbar, .sf-tabbar, .sf-sheet, .sf-sheet-backdrop { display: none; }

.sf-ico {
    width: 24px; height: 24px; flex: none;
    fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ═════════════════════════ Desktop & laptops ═════════════════════════ */
@media (min-width: 1200px) {
    /* The top menu has ~20 links: keep them on one line instead of wrapping under the bar */
    .site-header .navbar-nav { flex-wrap: nowrap; }
    .site-header .navbar-nav .nav-link { white-space: nowrap; }
    .site-header .navbar > .container { max-width: 100%; }
}
/* Top and bottom rainbow bars: same 60px height, icon-over-label items so the ~22 links fit on one row
   (they used 38px icons beside the text, which pushed Post/Edit/Logout/profile off the right edge).
   Only sizes change here — the rainbow backgrounds are the site's own .bg-steel / .navbar-bottom. */
@media (min-width: 1200px) {
    .site-header .navbar.bg-steel { height: 60px; min-height: 60px; padding-top: 0 !important; padding-bottom: 0 !important; }
    .site-header .navbar-brand { font-size: 22px; font-weight: 900; margin-right: 10px !important; }
    .site-header .navbar .nav-link:has(> i), .site-header .dropbtn {
        display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
        padding: 4px 6px !important; font-size: 11.5px !important; line-height: 1.1; white-space: nowrap;
        background: none; border: 0; color: #fff; font-weight: 800; text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
    }
    .site-header .navbar .nav-link > i, .site-header .dropbtn > i {
        font-size: 22px !important; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .3));
    }
    .site-header .navbar .nav-link:has(> i):hover { background: rgba(255, 255, 255, .16); border-radius: 12px; }
    .site-header #p-link { width: 34px; height: 34px; box-shadow: 0 0 0 2px #fff; }

    .site-header .navbar-bottom { display: block !important; height: 60px; padding: 0 !important; margin-bottom: 0 !important; }
    .site-header .navbar-bottom .navbar-nav { display: flex; flex-direction: row; align-items: center; height: 60px; }
    .site-header .navbar-bottom a:has(> i), .site-header .navbar-bottom .dropbtn {
        display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
        padding: 4px 12px !important; font-size: 12px !important; line-height: 1.1; font-weight: 800; text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
    }
    .site-header .navbar-bottom a > i { font-size: 22px !important; }
}
@media (min-width: 1200px) and (max-width: 1439.98px) {
    .site-header .navbar .nav-link:has(> i), .site-header .dropbtn { padding: 4px 4px !important; font-size: 10.5px !important; }
    .site-header .navbar .nav-link > i, .site-header .dropbtn > i { font-size: 20px !important; }
}
/* Pages on the text-only menu (blog/socialify.html) */
@media (min-width: 1200px) and (max-width: 1599.98px) {
    .site-header .navbar-nav .nav-link:not(:has(> i)) { padding-left: .42rem !important; padding-right: .42rem !important; font-size: 14px; }
}
/* Media inside posts never overflow their card */
main img, main video, main iframe { max-width: 100%; }

/* ═════════════════════════ Phones & tablets ═════════════════════════ */
@media (max-width: 1199.98px) {

    /* The website's own bars are replaced by the app bars below */
    .site-header { display: none !important; }

    body {
        margin-top: 0 !important;
        padding-top: calc(var(--sf-bar-h) + var(--sf-safe-top));
        padding-bottom: calc(var(--sf-bar-h) + var(--sf-safe-bottom) + 12px);
        background: var(--sf-bg) !important;
        font-family: var(--sf-font);
        color: var(--sf-ink);
    }

    /* ── Top app bar: the site's .bg-steel rainbow, unchanged ── */
    .sf-appbar {
        display: flex; align-items: center; gap: 8px;
        position: fixed; top: 0; left: 0; right: 0; z-index: 1040;
        height: calc(var(--sf-bar-h) + var(--sf-safe-top));
        padding: var(--sf-safe-top) max(10px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
        box-shadow: 0 2px 16px rgba(20, 10, 60, .22);
        font-family: var(--sf-font);
        transition: transform .28s cubic-bezier(.32, .72, 0, 1);
    }
    body.sf-bar-hidden .sf-appbar { transform: translateY(-100%); }
    .sf-brand { display: flex; align-items: center; text-decoration: none !important; }
    .sf-brand-name {
        color: #fff; font-size: 27px; font-weight: 900; letter-spacing: -.6px; line-height: 1;
        text-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 0 14px rgba(0, 0, 0, .12);
    }
    .sf-appbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
    .sf-icon-btn {
        display: inline-flex; align-items: center; justify-content: center;
        width: 40px; height: 40px; border-radius: 50%;
        background: rgba(255, 255, 255, .22); color: #fff !important;
        -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
        filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .3));
        transition: transform .12s ease, background .12s ease;
    }
    .sf-icon-btn .sf-ico { width: 21px; height: 21px; stroke-width: 2.3; }
    .sf-icon-btn:active { transform: scale(.9); background: rgba(255, 255, 255, .35); }
    .sf-pill-btn {
        padding: 9px 18px; border-radius: 999px; background: #fff; color: #1c1f2b !important;
        font-weight: 800; font-size: 14px; text-decoration: none !important; box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
    }

    /* ── Bottom tab bar: the site's .navbar-bottom rainbow, unchanged, same height as the top bar ── */
    .sf-tabbar.navbar-bottom {
        display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
        position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 1040;
        width: auto; height: calc(var(--sf-bar-h) + var(--sf-safe-bottom));
        margin: 0; padding: 0 env(safe-area-inset-right) var(--sf-safe-bottom) env(safe-area-inset-left);
        overflow: visible;
        box-shadow: 0 -2px 16px rgba(20, 10, 60, .22);
        font-family: var(--sf-font);
    }
    .sf-tabbar.navbar-bottom .sf-tab {
        float: none; position: relative;
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
        padding: 0; border: 0; background: none; cursor: pointer;
        color: #fff !important; font: 800 10.5px/1.1 var(--sf-font); letter-spacing: .2px;
        text-decoration: none !important; text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
        -webkit-user-select: none; user-select: none;
    }
    .sf-tab .sf-ico { width: 23px; height: 23px; stroke-width: 2.2; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .4)); position: relative; z-index: 1; }
    .sf-tab > span { position: relative; z-index: 1; opacity: .92; }
    .sf-tab:active .sf-ico, .sf-tab:active .sf-tab-avatar { transform: scale(.86); }
    .sf-tab .sf-ico, .sf-tab-avatar { transition: transform .12s ease; }
    /* Active tab: a frosted pill behind the icon (Material-style indicator) */
    .sf-tab.active::before {
        content: ''; position: absolute; top: 6px; left: 50%; width: 58px; height: 30px; margin-left: -29px;
        border-radius: 999px; background: rgba(255, 255, 255, .3); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
    }
    .sf-tab.active > span { opacity: 1; font-weight: 900; }
    .sf-tab-avatar {
        width: 26px; height: 26px; border-radius: 50%; object-fit: cover; position: relative; z-index: 1;
        box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(0, 0, 0, .35); background: #fff;
    }

    /* ── Page content: centred column of cards ── */
    main[role="main"], main.container {
        width: 100% !important; min-width: 0 !important;
        margin-top: 12px !important; max-width: 680px !important;
        padding-left: max(10px, env(safe-area-inset-left)) !important; padding-right: max(10px, env(safe-area-inset-right)) !important;
    }
    main[role="main"] > .row { margin-left: 0; margin-right: 0; }
    /* Bootstrap rows pull 15px outside their parent; on pages without a padded container that overflows the screen */
    .row { margin-left: 0 !important; margin-right: 0 !important; }
    /* Friend cards (friendship.css) are fixed at 500px + a 75px left margin */
    #fb, #fb-top { width: 100% !important; max-width: 100%; margin-left: 0 !important; left: 0 !important; }
    #fb { display: block; height: auto; min-height: 150px; border-radius: 18px !important; overflow: hidden; background: #fff; margin-bottom: 12px; }
    /* Sidebars (search, greetings, radio, calendar…) live in the app's menu on phones */
    main[role="main"] > .row > .col-md-2 { display: none !important; }
    main[role="main"] > .row > .col-md-8 { flex: 0 0 100%; max-width: 100%; padding-left: 0; padding-right: 0; }

    .content-section, main .card {
        border: 0 !important; border-radius: 20px !important; margin-left: 0 !important; margin-right: 0 !important;
        background: var(--sf-card); box-shadow: 0 1px 2px rgba(20, 30, 60, .06), 0 6px 20px rgba(20, 30, 60, .07);
        padding: 14px 14px 12px; margin-bottom: 14px;
    }
    main .card-header { background: transparent; border-bottom: 1px solid #eef0f4; }
    .article-title { color: var(--sf-ink) !important; font-weight: 800; }
    .article-metadata a, .article-content { word-break: break-word; }

    /* Photos and videos in posts: full card width, natural shape (no stretching) */
    main img.my-imgs, main .my-imgs, main video, main .w-100 {
        width: 100% !important; max-width: 100% !important; height: auto !important;
        object-fit: contain !important; margin: 8px 0 0 !important; border-radius: 14px;
    }
    main iframe { width: 100% !important; height: auto !important; aspect-ratio: 16 / 9; margin: 8px 0 0 !important; border: 0; border-radius: 14px; }
    /* Full-screen rooms (Meet, Air) fill their frame instead of being a 16:9 video embed */
    main .meet-frame iframe, main .air-room iframe { height: 100% !important; aspect-ratio: auto; margin: 0 !important; border-radius: 0; }
    main .img-fluid { max-width: 100% !important; }
    main .rounded-circle { object-fit: cover; }

    /* Forms feel native: 16px text stops iOS zooming, big touch targets */
    input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]),
    select, textarea { font-size: 16px !important; }
    main .form-control { border-radius: 14px; min-height: 46px; border-color: #dfe3eb; }
    main .btn { border-radius: 14px; min-height: 44px; font-weight: 800; }
    main .alert { border-radius: 14px; border: 0; }

    h1, h2, h3 { overflow-wrap: break-word; }
    .sf-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }

    /* ── "All of Socialify" sheet ── */
    .sf-sheet-backdrop {
        display: block; position: fixed; inset: 0; z-index: 1060;
        background: rgba(12, 10, 30, .45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
        opacity: 0; pointer-events: none; transition: opacity .25s ease;
    }
    .sf-sheet {
        display: flex; flex-direction: column;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1061;
        max-height: 88vh; max-height: 88dvh; max-width: 680px; margin: 0 auto;
        background: #f6f7fb; border-radius: 26px 26px 0 0;
        box-shadow: 0 -12px 40px rgba(12, 10, 30, .25);
        transform: translateY(105%); transition: transform .32s cubic-bezier(.32, .72, 0, 1);
        font-family: var(--sf-font); color: var(--sf-ink);
    }
    body.sf-sheet-open .sf-sheet { transform: none; }
    body.sf-sheet-open .sf-sheet-backdrop { opacity: 1; pointer-events: auto; }
    body.sf-sheet-open { overflow: hidden; }
    .sf-sheet::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; border-radius: 26px 26px 0 0; background: var(--sf-rainbow); }
    .sf-sheet-grabber { width: 44px; height: 5px; border-radius: 3px; background: #c9cdd8; margin: 10px auto 2px; flex: none; }
    .sf-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 18px 6px; flex: none; }
    .sf-sheet-head h2 {
        margin: 0; font-size: 26px; font-weight: 900; letter-spacing: -.5px;
        background: var(--sf-rainbow); -webkit-background-clip: text; background-clip: text; color: transparent;
    }
    .sf-sheet-close {
        width: 36px; height: 36px; border: 0; border-radius: 50%; background: #e7e9f0; color: #444a5a;
        display: inline-flex; align-items: center; justify-content: center;
    }
    .sf-sheet-close .sf-ico { width: 18px; height: 18px; }
    .sf-sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px calc(18px + var(--sf-safe-bottom)); }

    .sf-me {
        display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px;
        background: #fff; box-shadow: 0 1px 2px rgba(20, 30, 60, .06); color: var(--sf-ink) !important; text-decoration: none !important;
    }
    .sf-me img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px #fff, 0 0 0 5px transparent; background: var(--sf-rainbow); padding: 2px; }
    .sf-me span { display: flex; flex-direction: column; min-width: 0; }
    .sf-me strong { font-size: 17px; font-weight: 900; }
    .sf-me small { color: var(--sf-ink-soft); font-size: 13px; font-weight: 700; }

    .sf-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
    .sf-quick a {
        display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px;
        border-radius: 16px; background: #fff; color: var(--sf-ink) !important; font-weight: 800; font-size: 12.5px;
        text-decoration: none !important; box-shadow: 0 1px 2px rgba(20, 30, 60, .06);
    }
    .sf-quick a span { font-size: 22px; line-height: 1; }

    .sf-sheet-title { margin: 18px 4px 8px; font-size: 13px; font-weight: 900; letter-spacing: 1.2px; text-transform: uppercase; color: #8a90a2; }
    .sf-apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 6px; }
    .sf-apps a {
        display: flex; flex-direction: column; align-items: center; gap: 6px;
        color: #2a2f3d !important; font-weight: 800; font-size: 12px; text-align: center; text-decoration: none !important;
    }
    .sf-apps a span {
        display: flex; align-items: center; justify-content: center; width: 58px; height: 58px; border-radius: 18px;
        font-size: 28px; line-height: 1; box-shadow: 0 4px 12px rgba(20, 30, 60, .1), inset 0 -2px 0 rgba(0, 0, 0, .04);
        transition: transform .12s ease;
    }
    .sf-apps a:active span, .sf-quick a:active, .sf-me:active { transform: scale(.93); }
    /* Soft rainbow of tile colours, cycling through the brand hues */
    .sf-apps a:nth-child(8n+1) span { background: linear-gradient(145deg, #ffe1e1, #ffc9c9); }
    .sf-apps a:nth-child(8n+2) span { background: linear-gradient(145deg, #ffecd6, #ffd8a8); }
    .sf-apps a:nth-child(8n+3) span { background: linear-gradient(145deg, #f6f9d0, #e9f09a); }
    .sf-apps a:nth-child(8n+4) span { background: linear-gradient(145deg, #dcf8dc, #b9efb7); }
    .sf-apps a:nth-child(8n+5) span { background: linear-gradient(145deg, #d8f7f6, #aeeeec); }
    .sf-apps a:nth-child(8n+6) span { background: linear-gradient(145deg, #dbeafe, #b6d4fb); }
    .sf-apps a:nth-child(8n+7) span { background: linear-gradient(145deg, #e8ddff, #d0bcfd); }
    .sf-apps a:nth-child(8n+8) span { background: linear-gradient(145deg, #fde0f7, #f9bdee); }

    .sf-list { background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 1px 2px rgba(20, 30, 60, .06); }
    .sf-list a, .sf-list button {
        display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: 0; background: none; text-align: left;
        color: var(--sf-ink) !important; font: 800 15px var(--sf-font); text-decoration: none !important;
    }
    .sf-list a + a, .sf-list a + button, .sf-list button + a { border-top: 1px solid #eef0f4; }
    .sf-list a:active, .sf-list button:active { background: #f2f4f8; }
    .sf-list .sf-ico { width: 20px; height: 20px; color: #5b6275; }
    .sf-list [hidden] { display: none; }
    .sf-list .sf-danger, .sf-list .sf-danger .sf-ico { color: #e5364d !important; }
    .sf-sheet-foot { margin: 16px 0 4px; text-align: center; color: #9aa0b1; font-size: 12px; font-weight: 700; }
    .sf-sheet-foot a { color: #7a8196 !important; }
}

/* ─── Install prompt (phones only, once, not when already installed) ─── */
.app-install {
    position: fixed; left: 12px; right: 12px; z-index: 1070;
    bottom: calc(var(--sf-bar-h) + var(--sf-safe-bottom) + 12px);
    display: flex; align-items: center; gap: 12px; padding: 12px 14px;
    border-radius: 20px; background: #fff; box-shadow: 0 18px 40px rgba(12, 10, 30, .25);
    font-family: var(--sf-font); color: var(--sf-ink); animation: sf-slide-up .25s ease;
}
.app-install img { width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0; }
.app-install .app-install-text { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; line-height: 1.35; color: #4a5064; }
.app-install .app-install-text strong { display: block; font-size: 15px; font-weight: 900; color: var(--sf-ink); }
.app-install button { border: 0; border-radius: 12px; font: 800 13px var(--sf-font); cursor: pointer; min-height: 40px; }
.app-install .app-install-go { padding: 0 16px; color: #fff; background: linear-gradient(90deg, #ff4d4d, #ff9a00, #1c7fee, #ba0cf8); }
.app-install .app-install-close { width: 36px; background: #eef0f5; color: #555c70; font-size: 18px; }
@keyframes sf-slide-up { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (display-mode: standalone) {
    .app-install { display: none !important; }
    .sf-appbar, .sf-tabbar { -webkit-user-select: none; user-select: none; }
}

/* ── Desktop /home three columns (blog/base.html .sf-3col): fluid grid instead of fixed Bootstrap cols,
   so the sidebars never spill off the right edge when the window is resized ── */
/* left and right columns are always the same width, growing with the window (220px on a 1280 laptop, 290px max) */
.sf-3col { --sf-side: clamp(200px, 17vw, 290px); display: grid !important; grid-template-columns: var(--sf-side) minmax(0, 1fr) var(--sf-side);
    gap: clamp(14px, 1.4vw, 24px); margin: 0 !important; align-items: start; }
.sf-3col > [class*="col-"] { max-width: none !important; width: auto !important; flex: none !important; padding: 0 !important; min-width: 0; }
.sf-3col > [class*="col-"] > .content-section { max-width: 100%; overflow-wrap: anywhere; }
.sf-3col .sidebar { width: auto !important; margin-left: 0 !important; }
.sf-3col .calendar-widget { margin-left: 0 !important; max-width: 100%; padding: 12px 10px !important; }
.sf-3col img, .sf-3col video, .sf-3col iframe, .sf-3col select, .sf-3col table, .sf-3col input, .sf-3col textarea, .sf-3col embed, .sf-3col object { max-width: 100% !important; }
.sf-3col video, .sf-3col img { height: auto; }
.sf-3col .content-section h2 { font-size: clamp(18px, 1.6vw, 26px); overflow-wrap: anywhere; }
/* below 1200px the app layout takes over (app bars, centred feed, sidebars hidden): one column */
@media (max-width: 1199.98px) {
    .sf-3col { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

/* ── Desktop /home status box (home.html #configname): avatar and input centred on one line ── */
#configname { display: flex !important; align-items: center; gap: 12px; margin: 12px 0; padding: 12px 14px; border-radius: 18px; background: #fff;
    box-shadow: 0 1px 2px rgba(20, 30, 60, .05), 0 6px 20px rgba(20, 30, 60, .06); }
#configname > img { flex: none; width: 52px !important; height: 52px !important; margin: 0 !important; border-radius: 50%; object-fit: cover; }
#configname > input { flex: 1; min-width: 0; height: 52px; margin: 0 !important; padding: 0 20px !important; border: 0; border-radius: 999px;
    background: #f0f2f6; font: 700 16px var(--sf-font, sans-serif); color: #1c1f2b; cursor: pointer; outline: none; transition: background .15s; }
#configname > input:hover { background: #e7eaf0; }
#configname > br { display: none; }
#configname > .sf-ini { width: 52px; height: 52px; margin: 0 !important; }

/* ── Initials avatar ({% avatar_html %} in blog/templatetags/app_extras.py; app.js swaps in the same for broken photos).
   Fills whatever avatar box it sits in; the letters scale with the box (container units). ── */
.sf-ini { container-type: inline-size; display: grid; place-items: center; border-radius: 50%; overflow: hidden; flex: none;
    background: linear-gradient(135deg, hsl(var(--h, 260) 85% 62%), hsl(calc(var(--h, 260) + 50) 85% 55%)); }
:where(.sf-ini) { width: 100%; height: 100%; aspect-ratio: 1; }   /* zero specificity: any context size below wins */
.sf-ini b { color: #fff; font-family: var(--sf-font, 'Nunito', system-ui, sans-serif); font-weight: 900; font-size: 38cqi; line-height: 1; letter-spacing: .02em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.pp-ring .sf-ini { border: 3px solid #fff; }

/* initials circle in each avatar spot (same size and frame the photo would have) */
.ft-me .sf-ini, .pf-compose .sf-ini { width: 44px; height: 44px; }
.ft-ring .sf-ini, .st-ring .sf-ini { border: 3px solid #fff; }
.pc-avatar .sf-ini { border: 2px solid #fff; }
.st-who .sf-ini { width: 38px; height: 38px; box-shadow: 0 0 0 2px #fff; }
.ms-av-big .sf-ini { border: 3px solid #fff; }
.pf-friends .sf-ini { width: 100%; height: auto; aspect-ratio: 1; border-radius: 16px; }
.sf-me .sf-ini { width: 52px; height: 52px; box-shadow: 0 0 0 3px #fff; }
.sf-ini.pc-cav b { font-size: 36cqi; }

/* /home on laptops & desktops only: content sits just under the top bar (10px gap) instead of ~47px.
   Other pages keep their spacing; the marker lives in blog/templates/blog/home.html. */
@media (min-width: 1200px) {
    body:has(.sf-home-page) { margin-top: 0 !important; }
    body:has(.sf-home-page) main[role="main"] { margin-top: 70px !important; }   /* 60px bar + 10px */
}

/* "People you may know" sidebars on the laptop home (blog/my_row.html, blog/base.html): initials fill the 100px circle */
.sf-ini.posteds-img { width: 100px; height: 100px; margin: 12px auto 0; }

/* ── Top & bottom bars: the site's vivid rainbow, one full rainbow across every bar, always flowing ──
   The old .bg-steel / .navbar-bottom background (static/blog/main.css) packs ~1,090 colour stops into a 17000%-wide
   strip, so at times 5-6 random, muddy shades crowd a bar. Here every bar always shows a bright, HealthTeky-style rainbow
   (coral, tangerine, sunflower, HealthTeky green, aqua, HealthTeky sky, royal blue, violet, orchid, pink) spread evenly across its width, gliding sideways
   at a calm steady pace. The strip is two identical rainbows (200% wide) moved by exactly one width per cycle, so it
   loops seamlessly. static/app/bars.js sets --sf-rainbow-delay from the clock so the top and bottom bars match and a
   new page carries on where the last one was. */
@keyframes sf-rainbow-flow { from { background-position: 100% 0; } to { background-position: 0% 0; } }
.bg-steel, .navbar-bottom, .sf-appbar, .sf-tabbar, .sfm-head, .sf-rainbow-text {
    background: linear-gradient(90deg, #ff4f5e 0.00%, #ff8a1f 5.00%, #ffc21a 10.00%, #64dd17 15.00%, #1fd1b0 20.00%, #00a8ff 25.00%, #4f7cff 30.00%, #8f5cff 35.00%, #d052f5 40.00%, #ff4fae 45.00%, #ff4f5e 50.00%, #ff8a1f 55.00%, #ffc21a 60.00%, #64dd17 65.00%, #1fd1b0 70.00%, #00a8ff 75.00%, #4f7cff 80.00%, #8f5cff 85.00%, #d052f5 90.00%, #ff4fae 95.00%, #ff4f5e 100.00%) !important;
    background-size: 200% 100% !important;
    animation: sf-rainbow-flow 30s linear infinite !important;
    animation-delay: var(--sf-rainbow-delay, 0s) !important;
}
@media (prefers-reduced-motion: reduce) {
    .bg-steel, .navbar-bottom, .sf-appbar, .sf-tabbar, .sfm-head, .sf-rainbow-text { animation-duration: 180s !important; }
}
/* a soft shadow keeps white labels and icons readable on the light bands (yellow, cyan) */
.bg-steel, .navbar-bottom, .sf-appbar, .sf-tabbar { text-shadow: 0 1px 2px rgba(0, 0, 0, .38), 0 0 8px rgba(0, 0, 0, .12); }
.sf-appbar svg, .sf-tabbar svg { filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .38)); }

/* Desktop top bar: Post · Edit · Logout · your name · your photo float to the right edge. The template marks the main
   menu .mr-auto (Bootstrap 4), but Bootstrap 5 is also loaded and renamed that utility, so it computed to 0 and the
   right-hand group sat straight after "More". */
@media (min-width: 1200px) {
    .site-header nav.fixed-top.bg-steel .navbar-collapse > .navbar-nav:last-child { margin-left: auto !important; }   /* top bar only (the bottom bar is .bg-steel too) */
}

/* ── "More" mega menu (blog/templates/app/mega_menu.html, static/app/mega.js): laptops & desktops ──
   Opens downward from the top bar's More and upward from the bottom bar's More. The old plain dropdown lists are
   switched off at these widths (phones & tablets use the app's "All of Socialify" sheet instead). */
.sfm { display: none; }
@media (min-width: 1200px) {
    .site-header .dropdown-content, .site-header .dropdown-content-dow { display: none !important; }
    .site-header .dropdown .dropbtn { cursor: pointer; }
    .site-header .dropdown .dropbtn[aria-expanded="true"] { background: rgba(255, 255, 255, .22) !important; border-radius: 12px; }

    .sfm { position: fixed; left: 50%; z-index: 6000; width: min(1180px, calc(100vw - 32px)); border-radius: 26px; overflow: hidden;
        background: rgba(255, 255, 255, .97); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
        box-shadow: 0 2px 6px rgba(20, 20, 60, .08), 0 30px 80px rgba(30, 20, 80, .30); font-family: var(--sf-font, 'Nunito', system-ui, sans-serif);
        transform: translateX(-50%); }
    .sfm.open { display: flex; flex-direction: column; }
    .sfm.down { top: 70px; max-height: calc(100vh - 150px); animation: sfm-down .26s cubic-bezier(.2, .8, .2, 1); }
    .sfm.up { bottom: 70px; max-height: calc(100vh - 150px); flex-direction: column-reverse; animation: sfm-up .26s cubic-bezier(.2, .8, .2, 1); }
    @keyframes sfm-down { from { opacity: 0; transform: translate(-50%, -14px) scale(.98); } to { opacity: 1; transform: translate(-50%, 0); } }
    @keyframes sfm-up { from { opacity: 0; transform: translate(-50%, 14px) scale(.98); } to { opacity: 1; transform: translate(-50%, 0); } }

    .sfm-head { flex: none; display: flex; align-items: center; gap: 14px; padding: 18px 22px; color: #fff; }
    .sfm-head > div { display: flex; flex-direction: column; margin-right: auto; }
    .sfm-head b { font-size: 24px; font-weight: 900; letter-spacing: -.4px; }
    .sfm-head small { font-size: 14px; font-weight: 800; opacity: .95; }
    .sfm-cta { display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border-radius: 999px; background: rgba(255, 255, 255, .95);
        color: #3b1f8f !important; text-decoration: none !important; font-weight: 900; font-size: 14.5px; text-shadow: none;
        box-shadow: 0 6px 16px rgba(0, 0, 0, .15); transition: transform .12s; }
    .sfm-cta:hover { transform: translateY(-1px); }
    .sfm-x { width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .25); color: #fff; font-size: 16px; font-weight: 900; cursor: pointer; }
    .sfm-x:hover { background: rgba(255, 255, 255, .4); }

    .sfm-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 6px 18px; padding: 18px 20px 20px; overflow-y: auto; min-height: 0; }
    .sfm-col { --t1: #ff4f5e; --t2: #ff4fae; --tint: #fff0f3; min-width: 0; }
    .sfm-c2 { --t1: #ff8a1f; --t2: #ffc21a; --tint: #fff6e8; }
    .sfm-c3 { --t1: #1fd1b0; --t2: #64dd17; --tint: #eafbf3; }
    .sfm-c4 { --t1: #4f7cff; --t2: #8f5cff; --tint: #f0efff; }
    .sfm-col h3 { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; font-size: 16px; font-weight: 900; color: #1c1f2b; letter-spacing: .2px; }
    .sfm-col h3 span { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-size: 18px;
        background: linear-gradient(135deg, var(--t1), var(--t2)); box-shadow: 0 6px 14px color-mix(in srgb, var(--t1) 35%, transparent); }
    .sfm-col a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 14px; color: #1c1f2b !important; text-decoration: none !important;
        transition: background .15s, transform .15s; }
    .sfm-col a:hover, .sfm-col a:focus-visible { background: var(--tint); transform: translateX(3px); outline: none; }
    .sfm-col a i { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-style: normal; font-size: 20px;
        background: var(--tint); transition: background .15s; }
    .sfm-col a:hover i { background: linear-gradient(135deg, var(--t1), var(--t2)); }
    .sfm-col a span { display: flex; flex-direction: column; min-width: 0; }
    .sfm-col a b { font-size: 15px; font-weight: 900; line-height: 1.2; }
    .sfm-col a small { font-size: 12.5px; font-weight: 700; color: #7a8196; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* Rainbow wordmark (e.g. "Socialify" above the search bar on /search/): the bars' flowing rainbow, clipped to the letters.
   A faint drop shadow gives the light bands (sunflower, aqua) definition on a white page. */
.sf-rainbow-text {
    display: inline-block; padding: 0 .04em .06em;
    -webkit-background-clip: text !important; background-clip: text !important;
    color: transparent !important; -webkit-text-fill-color: transparent;
    font-family: var(--sf-font, 'Nunito', system-ui, sans-serif); font-weight: 900; letter-spacing: -.02em; line-height: 1.05;
    filter: drop-shadow(0 2px 4px rgba(40, 20, 90, .14));
}
.sf-search-logo { margin: 24px 0 18px !important; text-align: center; }
.sf-search-logo a { text-decoration: none !important; }
.sf-search-logo .sf-rainbow-text { font-size: clamp(56px, 9vw, 104px); }
