/* ==========================================================================
   OrbitOS social apps (4.4.1): Cirrus and Agora.
   Built from the Design v3 kit: banners in the app's color, colored tiles,
   lists on the theme's surface, and a floating navigation bar.
   ========================================================================== */

.sx-app {
    display: flex !important;
    flex-direction: column;
}

.sx-app .sx-head-actions {
    margin-left: auto;
    display: flex;
    gap: 6px;
}

.sx-app .sx-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 !important;
    overscroll-behavior: contain;
}

.sx-page {
    max-width: 640px;
    margin: 0 auto;
    padding: 14px 14px 28px;
    font-family: var(--font-main);
    color: var(--on-surface);
}

.sx-app.has-nav .sx-page { padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }

/* ---------- Floating navigation ---------- */

.sx-nav {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    z-index: 20;
    display: flex;
    justify-content: center;
    padding: 0 16px;
    pointer-events: none;
    transition: transform 0.3s var(--os-ease, ease), opacity 0.3s ease;
}

.sx-nav[hidden] { display: none; }
.sx-app.nav-hidden .sx-nav { transform: translateY(calc(100% + 24px)); opacity: 0; }

.sx-nav-inner {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px;
    border-radius: 999px;
    border: 1px solid var(--ok-line-strong);
    background: var(--surface-color, #0d1117);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.38), 0 2px 6px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
    /* Same width on every tab so the bar doesn't jump around */
    width: min(100%, 320px);
}

.sx-nav-btn {
    position: relative;
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    align-items: center;
    justify-content: center;
    gap: 0;
    height: 48px;
    padding: 0 10px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--ok-muted);
    font: 700 0.86rem var(--font-main);
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease, flex-grow 0.3s var(--os-ease, ease), gap 0.25s ease;
}

.sx-nav-btn span {
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    opacity: 0;
    transition: max-width 0.3s var(--os-ease, ease), opacity 0.2s ease;
}

.sx-nav-btn.is-on {
    flex-grow: 2.6;
    gap: 8px;
    background: var(--hue);
    color: #ffffff;
}

.sx-nav-btn.is-on span { max-width: 100px; opacity: 1; }
.sx-nav-btn:active svg { transform: scale(0.88); }
.sx-nav-btn svg { flex-shrink: 0; transition: transform 0.15s ease; }

.sx-badge {
    position: absolute;
    top: 5px;
    right: 6px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    border: 2px solid var(--surface-color, #0d1117);
    background: #ef4444;
    color: #ffffff;
    font: normal 800 0.62rem/17px var(--font-main);
    text-align: center;
    box-sizing: content-box;
}

.sx-nav-btn.is-on .sx-badge { border-color: var(--hue); }

/* ---------- Banners ---------- */

.sx-hero { margin-bottom: 4px; gap: 6px; }

.sx-hero-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.sx-hero .ok-hero-icon { margin: 0; }
.sx-hero .ok-hero-title { font-size: 1.55rem; }

.sx-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
    margin-top: 10px;
}

.sx-hero-stats .ok-hero-stat {
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: var(--font-main);
}

.sx-hero-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin-top: 10px;
}

.sx-stack { display: flex; }
.sx-stack .sx-avatar { border: 2px solid rgba(255, 255, 255, 0.85); }
.sx-stack .sx-avatar + .sx-avatar { margin-left: -10px; }

.sx-hero-avatar {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.2);
}

.sx-hero-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.sx-hero-search {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 50px;
    margin-top: 12px;
    padding: 0 16px;
    box-sizing: border-box;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    color: #4b5563 !important;
}

.sx-hero-search svg { color: #4b5563 !important; flex-shrink: 0; }

.sx-hero-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: none !important;
    background: none !important;
    color: #111318 !important;
    font: 600 1rem var(--font-main);
    outline: none;
    box-shadow: none !important;
}

.sx-hero-search input::placeholder { color: #6b7280 !important; font-weight: 500; }
.sx-hero-search input::-webkit-search-cancel-button { display: none; }

.sx-section {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 20px !important;
}

.sx-section svg { color: var(--hue); }

/* ---------- Trending strip ---------- */

.sx-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    margin: 0 -14px;
    padding: 2px 14px 4px;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 14px;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
}
.sx-strip > * { scroll-snap-align: start; }

.sx-strip::-webkit-scrollbar { display: none; }
.sx-strip.is-empty { display: none; }

.sx-trend-card {
    flex: 0 0 auto;
    width: 150px;
    min-width: 0;
    min-height: 96px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: 12px 14px;
    border-radius: 20px;
    border: 1px solid var(--ok-line);
    background: var(--ok-card);
    color: var(--on-surface);
    font-family: var(--font-main);
    text-align: left;
    cursor: pointer;
    scroll-snap-align: start;
    transition: transform 0.14s ease;
}

.sx-trend-card:active { transform: scale(0.96); }

.sx-trend-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin-bottom: 4px;
    border-radius: 9px;
    background: var(--hue);
    color: #ffffff;
    font: 800 0.8rem var(--font-main);
}

.sx-trend-card strong {
    width: 100%;
    font-size: 0.92rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: break-word;
}
/* A hashtag is one long word: cut it with "…" instead of breaking it in two */
.sx-trend-card.is-tag strong { display: block; white-space: nowrap; text-overflow: ellipsis; }

.sx-trend-card > span:last-child:not(.sx-trend-rank) {
    font-size: 0.74rem;
    color: var(--ok-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- Filters and chips ---------- */

.sx-filters {
    position: sticky;
    top: -14px;
    z-index: 5;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    margin: 8px -14px 10px;
    padding: 10px 14px;
    background: linear-gradient(var(--surface-color, #0d1117) 75%, transparent);
    scrollbar-width: none;
}

.sx-filters::-webkit-scrollbar { display: none; }

.sx-chip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--ok-line-strong);
    background: var(--surface-color, #0d1117);
    color: var(--on-surface);
    font: 600 0.85rem var(--font-main);
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
}

.sx-chip:active { transform: scale(0.95); }

.sx-chip.is-on {
    border-color: transparent;
    background: var(--hue);
    color: #ffffff;
}


.sx-seg { margin: 14px auto 4px; width: 100%; box-sizing: border-box; }
.sx-seg button { flex: 1; white-space: nowrap; }

.sx-mini {
    font-style: normal;
    font-size: 0.64rem;
    font-weight: 800;
    padding: 1px 6px;
    margin-left: 4px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--hue) 25%, transparent);
    color: var(--on-surface);
    vertical-align: 1px;
}

.sx-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 12px 4px 10px;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--ok-muted);
}

.sx-link-btn {
    flex-shrink: 0;
    border: none;
    background: none;
    color: var(--hue);
    font: 700 0.85rem var(--font-main);
    cursor: pointer;
    padding: 4px 2px;
}

.sx-center { display: flex; justify-content: center; margin-top: 16px; }
.sx-muted { color: var(--ok-muted); font-size: 0.86rem; }
.sx-foot { margin: 16px 6px 0; color: var(--ok-muted); font-size: 0.8rem; line-height: 1.55; }
.sx-more { display: flex; justify-content: center; padding: 20px 0; }

.sx-end {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px 0 4px;
    color: var(--ok-muted);
    font-size: 0.82rem;
    font-weight: 600;
}

/* ---------- Avatars ---------- */

.sx-avatar {
    position: relative;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--s);
    height: var(--s);
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg, color-mix(in srgb, var(--on-surface, #ffffff) 12%, transparent));
    color: #ffffff;
}

.sx-avatar b { font: 800 calc(var(--s) * 0.42) var(--font-main); }
.sx-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Posts ---------- */

.sx-list { display: flex; flex-direction: column; gap: 12px; }

.sx-post {
    position: relative;
    padding: 16px;
    border-radius: 24px;
    border: 1px solid var(--ok-line);
    background: var(--ok-card);
    animation: osRise 0.3s var(--os-ease, ease) both;
}

.sx-list > .sx-post:nth-child(2) { animation-delay: 0.04s; }
.sx-list > .sx-post:nth-child(3) { animation-delay: 0.08s; }
.sx-list > .sx-post:nth-child(n+6) { animation: none; }

.sx-post.is-focus {
    padding: 18px;
    border-color: color-mix(in srgb, var(--hue) 50%, var(--ok-line));
    background: color-mix(in srgb, var(--hue) 5%, var(--ok-card));
}

.sx-post.is-compact { padding: 13px; border-radius: 20px; }

.sx-kicker {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: -2px 0 10px 2px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--hue);
}

.sx-new {
    position: absolute;
    top: -8px;
    right: 18px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--hue);
    color: #ffffff;
    font: 800 0.66rem var(--font-main);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.sx-post-head { display: flex; align-items: center; gap: 10px; }

.sx-author {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0;
    border: none;
    background: none;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.sx-author-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }

.sx-author-text strong {
    font-size: 0.97rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sx-author-text span {
    font-size: 0.8rem;
    color: var(--ok-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sx-time {
    flex-shrink: 0;
    align-self: flex-start;
    padding: 3px 9px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--on-surface, #ffffff) 7%, transparent);
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--ok-muted);
}

.sx-post-body { margin-top: 12px; cursor: pointer; }

.sx-post-title { margin: 0 0 6px; font-size: 1.08rem; line-height: 1.35; }
.sx-post.is-focus .sx-post-title { font-size: 1.3rem; }

.sx-text { font-size: 0.96rem; line-height: 1.55; overflow-wrap: anywhere; }
.sx-post.is-focus .sx-text { font-size: 1.06rem; }

.sx-text.is-clamped {
    display: -webkit-box;
    -webkit-line-clamp: 8;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sx-text a,
.sx-profile-bio a { color: var(--hue); font-weight: 600; cursor: pointer; text-decoration: none; }

.sx-when {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--ok-line);
    font-size: 0.82rem;
    color: var(--ok-muted);
}

/* Media */
.sx-media {
    position: relative;
    display: grid;
    gap: 3px;
    margin-top: 12px;
    border-radius: 18px;
    overflow: hidden;
    background: color-mix(in srgb, var(--on-surface, #ffffff) 6%, transparent);
}

.sx-media--1 { aspect-ratio: var(--ratio, 1.5); width: 100%; }
.sx-media--2 { grid-template-columns: 1fr 1fr; aspect-ratio: 2; }
.sx-media--3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 1.5; }
.sx-media--3 .sx-media-item:first-child { grid-row: span 2; }
.sx-media--4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 1.3; }

.sx-media-item {
    position: relative;
    min-height: 0;
    padding: 0;
    border: none;
    background: none;
    cursor: zoom-in;
    overflow: hidden;
}

.sx-media-item.is-video { cursor: pointer; }
.sx-media-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s ease; }
.sx-media-item:active img { transform: scale(0.98); }

.sx-media-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--ok-muted);
}

.sx-play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #111318;
    transform: translate(-50%, -50%);
}

.sx-play svg { margin-left: 3px; fill: currentColor; }

.sx-media-tag {
    position: absolute;
    left: 10px;
    bottom: 10px;
    padding: 3px 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.65);
    color: #ffffff;
    font: 800 0.66rem var(--font-main);
    letter-spacing: 0.04em;
}

.sx-media.is-hidden .sx-media-item { filter: blur(28px) saturate(0.6); pointer-events: none; }

.sx-reveal {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: none;
    background: rgba(0, 0, 0, 0.3);
    color: #ffffff;
    font-family: var(--font-main);
    cursor: pointer;
}

.sx-reveal span {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    margin-bottom: 4px;
}

.sx-reveal strong { font-size: 0.95rem; }
.sx-reveal em { font-style: normal; font-size: 0.8rem; opacity: 0.8; }

/* Link cards */
.sx-link-card {
    display: flex;
    align-items: stretch;
    width: 100%;
    margin-top: 12px;
    padding: 0;
    border-radius: 18px;
    border: 1px solid var(--ok-line);
    background: color-mix(in srgb, var(--on-surface, #ffffff) 3%, transparent);
    color: var(--on-surface);
    text-align: left;
    overflow: hidden;
    cursor: pointer;
    font-family: var(--font-main);
}

.sx-link-card.is-big { flex-direction: column; }

.sx-link-thumb {
    flex-shrink: 0;
    width: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--hue) 15%, transparent);
    color: var(--hue);
}

.sx-link-card.is-big .sx-link-thumb { width: 100%; aspect-ratio: 1.91; }
.sx-link-card.is-big .sx-link-thumb.is-empty { aspect-ratio: auto; height: 0; }
.sx-link-card.is-big .sx-link-thumb.is-empty svg { display: none; }
.sx-link-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.sx-link-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 11px 13px;
}

.sx-link-host { font-size: 0.74rem; font-weight: 700; color: var(--hue); text-transform: lowercase; }
.sx-link-text strong { font-size: 0.93rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sx-link-text > span:last-child:not(.sx-link-host) { font-size: 0.82rem; color: var(--ok-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.sx-news { gap: 10px; }
.sx-news .sx-link-card { flex: 0 0 min(78%, 300px); margin-top: 0; scroll-snap-align: start; }

.sx-quote {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid var(--ok-line);
    background: color-mix(in srgb, var(--on-surface, #ffffff) 3%, transparent);
}

.sx-quote-head {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
}

.sx-quote-head span { color: var(--ok-muted); overflow: hidden; text-overflow: ellipsis; }
.sx-quote .sx-text { font-size: 0.9rem; }

/* Action pills */
.sx-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
}

.sx-act {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px;
    border: none;
    border-radius: 999px;
    background: color-mix(in srgb, var(--on-surface, #ffffff) 6%, transparent);
    color: var(--ok-muted);
    font: 700 0.8rem var(--font-main);
    font-variant-numeric: tabular-nums;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.sx-act.is-icon { width: 34px; padding: 0; justify-content: center; }
button.sx-act { cursor: pointer; }
button.sx-act:active { transform: scale(0.92); }
.sx-act.is-on { background: color-mix(in srgb, var(--hue) 22%, transparent); color: var(--hue); }
.sx-act.is-on svg { fill: currentColor; }
.sx-act-gap { flex: 1; }
.is-pop svg { animation: gamesBump 0.3s ease; }

/* ---------- Explore ---------- */

.sx-rank-list .ok-row { cursor: pointer; }

.sx-rank {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: color-mix(in srgb, var(--hue) 20%, transparent);
    color: var(--hue);
    font: 800 0.95rem var(--font-main);
}

.sx-rank-list .ok-row:nth-child(-n+3) .sx-rank { background: var(--hue); color: #ffffff; }

.sx-feed-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.sx-feed-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
    min-height: 140px;
    padding: 14px;
    border-radius: 22px;
    border: 1px solid var(--ok-line);
    background: var(--ok-card);
    color: var(--on-surface);
    font-family: var(--font-main);
    text-align: left;
    cursor: pointer;
    transition: transform 0.14s ease;
}

.sx-feed-card:active { transform: scale(0.97); }

.sx-feed-card strong {
    font-size: 0.93rem;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sx-feed-card > span:not(.sx-feed-avatar) {
    font-size: 0.78rem;
    color: var(--ok-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sx-feed-card em {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: auto;
    font-style: normal;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--ok-muted);
}

.sx-feed-avatar {
    width: 46px;
    height: 46px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    overflow: hidden;
    background: var(--tile, color-mix(in srgb, var(--on-surface, #ffffff) 10%, transparent));
    color: #ffffff;
    flex-shrink: 0;
}

.sx-feed-avatar.is-sm { width: 40px; height: 40px; margin: 0; border-radius: 13px; }
.sx-feed-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.sx-search-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 2px 2px 4px;
}

.sx-search-head > div { min-width: 0; display: flex; flex-direction: column; }
.sx-search-head strong { font-size: 1.3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sx-user { cursor: pointer; }
.sx-user-bio { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal !important; }

.sx-fav-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--ok-line-strong);
    background: none;
    color: var(--ok-muted);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sx-fav-btn.is-on { border-color: transparent; background: #f59e0b; color: #ffffff; }
.sx-fav-btn.is-on svg,
.sx-fav-big.ok-btn--outline svg,

/* ---------- Profile ---------- */

.sx-profile { margin: -14px -14px 0; }

.sx-banner {
    height: 150px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.sx-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 40%, color-mix(in srgb, var(--surface-color, #0d1117) 85%, transparent));
}

.sx-profile-card { padding: 0 16px; margin-top: -46px; position: relative; z-index: 1; }

.sx-profile-top { display: flex; align-items: flex-end; justify-content: space-between; }
.sx-profile-avatar { border: 4px solid var(--surface-color, #0d1117); box-sizing: content-box; }
.sx-profile-btns { display: flex; gap: 8px; transform: translateY(8px); }
.sx-profile-name { margin: 12px 0 0; font-size: 1.5rem; }
.sx-profile-handle { margin-top: 2px; color: var(--ok-muted); font-size: 0.9rem; overflow-wrap: anywhere; }
.sx-profile-bio { margin-top: 12px; font-size: 0.94rem; line-height: 1.55; overflow-wrap: anywhere; }
.sx-profile-stats { margin-top: 14px; }

/* ---------- Thread ---------- */

.sx-parents { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.sx-parents .sx-post { opacity: 0.8; }
.sx-thread { display: flex; flex-direction: column; gap: 10px; }
.sx-reply .sx-post { animation: none; }

.sx-replies {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px 0 0 16px;
    padding-left: 14px;
    border-left: 2px solid color-mix(in srgb, var(--hue) 40%, var(--ok-line));
}

.sx-more-replies {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0 0 16px;
    height: 32px;
    padding: 0 12px;
    border: none;
    border-radius: 999px;
    background: color-mix(in srgb, var(--hue) 16%, transparent);
    color: var(--on-surface);
    font: 700 0.8rem var(--font-main);
    cursor: pointer;
}

/* ---------- Following, library, empty states ---------- */

.sx-steps-card {
    margin-top: 14px;
    border-radius: 22px;
    border: 1px solid var(--ok-line);
    background: var(--ok-card);
    overflow: hidden;
}

.sx-steps-card .ok-row + .ok-row { border-top: 1px solid var(--ok-line); }

.sx-lib-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 14px 0 12px;
}

.sx-lib-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 12px;
    border-radius: 20px;
    border: 1px solid var(--ok-line);
    background: var(--ok-card);
    color: var(--on-surface);
    font-family: var(--font-main);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.sx-lib-card span {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    border-radius: 11px;
    background: var(--c);
    color: #ffffff;
}

.sx-lib-card strong { font-size: 1.3rem; }
.sx-lib-card em { font-style: normal; font-size: 0.76rem; font-weight: 700; color: var(--ok-muted); }
.sx-lib-card.is-on { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--ok-card)); }

.sx-hist { margin-bottom: 12px; }
.sx-hist-when { display: flex; align-items: center; gap: 5px; margin: 0 6px 6px; font-size: 0.76rem; font-weight: 600; color: var(--ok-muted); }

.sx-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 34px 20px;
    margin-top: 10px;
    border-radius: 24px;
    border: 1px dashed var(--ok-line-strong);
    text-align: center;
}

.sx-empty-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    border-radius: 22px;
    background: color-mix(in srgb, var(--hue) 18%, transparent);
    color: var(--hue);
}

.sx-empty strong { font-size: 1.05rem; }
.sx-empty > span:not(.sx-empty-icon) { max-width: 340px; font-size: 0.88rem; color: var(--ok-muted); line-height: 1.5; }
.sx-empty .ok-btn { margin-top: 10px; }

/* ---------- Skeletons ---------- */

.sx-skel { animation: none; }

.sx-skel .sx-avatar,
.sx-skel i,
.sx-skel-row .sx-avatar,
.sx-skel-row .sx-rank,
.sx-skel-row i,
.sx-skel-card {
    background: color-mix(in srgb, var(--on-surface, #ffffff) 8%, transparent) !important;
    border-color: transparent !important;
    animation: osBreathe 1.4s ease-in-out infinite;
}

.sx-skel-lines { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.sx-skel-lines i { display: block; height: 10px; border-radius: 5px; width: 45%; }
.sx-skel-lines i + i { width: 28%; }
.sx-skel-block { display: block; height: 70px; margin-top: 14px; border-radius: 14px; }
.sx-skel-acts { display: flex; gap: 6px; margin-top: 14px; }
.sx-skel-acts i { display: block; width: 56px; height: 30px; border-radius: 999px; }
.sx-strip .sx-skel-card { width: 150px; height: 96px; border-radius: 20px; flex-shrink: 0; }
.sx-feed-grid .sx-skel-card { height: 140px; border-radius: 22px; }
.sx-news .sx-skel-card { height: 220px; }

/* ---------- Setup ---------- */

.sx-setup { display: flex; flex-direction: column; gap: 14px; min-height: 100%; }

.sx-steps { display: flex; gap: 6px; justify-content: center; margin: 2px 0; }
.sx-steps i { width: 28px; height: 5px; border-radius: 3px; background: var(--ok-line-strong); transition: background-color 0.3s ease; }
.sx-steps i.is-on { background: var(--hue); }

.ok-app .sx-setup-hero { align-items: center; text-align: center; padding: 28px 20px 22px; }
.ok-app .sx-setup-hero .ok-hero-actions { justify-content: center; }

.sx-setup-mark {
    width: 84px;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.22);
}

.sx-setup-head { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 6px 2px 2px; }
.sx-setup-head .ok-tile { width: 44px; height: 44px; border-radius: 14px; }
.sx-setup-head h2 { margin: 6px 0 0; font-size: 1.5rem; }
.sx-setup-head p { margin: 0; color: var(--ok-muted); font-size: 0.92rem; line-height: 1.5; }
.sx-setup-err { margin: 0 4px; min-height: 1.2em; color: #ef4444; font-size: 0.85rem; }

.sx-pick-row { width: 100%; border: none; background: none; color: inherit; text-align: left; cursor: pointer; font-family: var(--font-main); }
.sx-pick-row.is-on { background: color-mix(in srgb, var(--hue) 12%, transparent); }

.sx-radio {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid var(--ok-line-strong);
    color: #ffffff;
    box-sizing: border-box;
}

.sx-pick-row.is-on .sx-radio { border-color: transparent; background: var(--hue); }

.sx-field {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 52px;
    padding: 0 6px 0 16px;
    border-radius: 999px;
    border: 1px solid var(--ok-line-strong);
    background: var(--ok-card);
    color: var(--ok-muted);
}

.sx-field input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: none !important;
    background: none !important;
    color: var(--on-surface) !important;
    font: 1rem var(--font-main);
    outline: none;
    box-shadow: none !important;
}

.sx-setup-nav {
    position: sticky;
    bottom: 0;
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: auto;
    padding: 14px 0 4px;
    background: linear-gradient(to bottom, transparent, var(--surface-color, #0d1117) 12px);
}

.sx-setup-next { flex: 1; height: 54px; font-size: 1rem; }
.sx-switch-row { cursor: pointer; }

/* ---------- Viewer: pictures and full-screen video ---------- */

.sx-viewer {
    position: fixed;
    inset: 0;
    z-index: 25000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;
    color: #ffffff;
    font-family: var(--font-main);
    touch-action: pan-y;
    animation: sxViewerIn 0.22s ease both;
}

.sx-viewer.is-leaving { animation: sxViewerOut 0.2s ease forwards; }

@keyframes sxViewerIn { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes sxViewerOut { to { opacity: 0; transform: scale(0.97); } }

.sx-viewer-top {
    position: absolute;
    top: calc(10px + env(safe-area-inset-top, 0px));
    left: 10px;
    right: 10px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sx-viewer-count { font-size: 0.9rem; font-weight: 700; }
.sx-viewer-tools { display: flex; gap: 8px; }

.sx-viewer-btn,
.sx-viewer-nav {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    cursor: pointer;
}

.sx-viewer-nav { position: absolute; top: 50%; z-index: 3; transform: translateY(-50%); }
.sx-viewer-nav.is-prev { left: 10px; }
.sx-viewer-nav.is-next { right: 10px; }
.sx-viewer-nav:disabled { opacity: 0.25; }

.sx-viewer-stage {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 66px 0;
    box-sizing: border-box;
}

.sx-viewer-stage > img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    animation: sxViewerIn 0.2s ease both;
}

.sx-video-box {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;
}

.sx-video-box video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000000;
}

.sx-video-state {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.sx-video-state[hidden] { display: none; }
.sx-video-state .ok-spinner { width: 34px; height: 34px; border-color: rgba(255, 255, 255, 0.25); border-top-color: #ffffff; }

.sx-video-err {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.7);
    pointer-events: auto;
}

/* OrbitOS video player */

.sx-video-box video { cursor: pointer; }
.sx-video-box video::-webkit-media-controls { display: none !important; }

.sx-vp-big {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 5px;
    border: none;
    border-radius: 50%;
    background: var(--hue);
    color: #ffffff;
    cursor: pointer;
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.25s var(--os-ease, ease);
}
.sx-vp-big svg { fill: currentColor; }
.sx-video-box.is-paused .sx-vp-big { opacity: 1; transform: translate(-50%, -50%); pointer-events: auto; }
.sx-vp-big:active { transform: translate(-50%, -50%) scale(0.92); }

.sx-vp-bar {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 4px;
    height: 52px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(18, 20, 26, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.25s var(--os-ease, ease);
}
.sx-video-box.ui-on .sx-vp-bar { opacity: 1; transform: none; pointer-events: auto; }
.sx-video-box.is-gif .sx-vp-bar,
.sx-video-box.is-gif .sx-vp-big { display: none; }

.sx-vp-btn {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
}
.sx-vp-btn[data-p="play"] svg { fill: currentColor; }
.sx-vp-btn:active { background: rgba(255, 255, 255, 0.14); }

.sx-vp-time {
    flex-shrink: 0;
    min-width: 34px;
    font: 700 0.78rem var(--font-main);
    font-variant-numeric: tabular-nums;
    text-align: center;
    opacity: 0.9;
}

.sx-vp-track {
    flex: 1;
    min-width: 0;
    height: 40px;
    display: flex;
    align-items: center;
    padding: 0 6px;
    cursor: pointer;
    touch-action: none;
}
.sx-vp-rail {
    position: relative;
    width: 100%;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    transition: height 0.15s ease;
}
.sx-vp-rail i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; }
.sx-vp-buf { background: rgba(255, 255, 255, 0.28); width: 0; }
.sx-vp-fill { background: var(--hue); width: 0; }
.sx-vp-fill::after {
    content: "";
    position: absolute;
    right: -7px;
    top: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    transform: translateY(-50%) scale(0.75);
    transition: transform 0.15s ease;
}
.sx-video-box.is-scrubbing .sx-vp-rail { height: 8px; }
.sx-video-box.is-scrubbing .sx-vp-fill::after { transform: translateY(-50%) scale(1.15); }

.sx-vp-skip {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(18, 20, 26, 0.8);
    font: 800 0.9rem var(--font-main);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%);
}
.sx-vp-skip.is-back { left: 14%; }
.sx-vp-skip.is-fwd { right: 14%; }
.sx-vp-skip.is-on { animation: sxSkip 0.6s ease; }
@keyframes sxSkip { 0% { opacity: 0; } 20%, 60% { opacity: 1; } 100% { opacity: 0; } }

/* Full screen: the player takes the whole screen, OrbitOS controls stay */
.sx-video-box:fullscreen { width: 100vw; height: 100vh; }
.sx-video-box:-webkit-full-screen { width: 100vw; height: 100vh; }
.sx-viewer.is-fs .sx-viewer-top,
.sx-viewer.is-fs .sx-viewer-alt,
.sx-viewer.is-fs .sx-viewer-nav { display: none; }
.sx-viewer.is-fs .sx-viewer-stage { padding: 0; }
.sx-viewer.is-fs { z-index: 30000; }

.sx-viewer-alt {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    max-height: 30vh;
    overflow-y: auto;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.88rem;
    line-height: 1.45;
}

.sx-viewer-alt b { margin-right: 6px; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.2); font-size: 0.7rem; }

/* ---------- Toast ---------- */

.sx-toast {
    position: absolute;
    left: 50%;
    bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    z-index: 30;
    width: max-content;
    max-width: calc(100% - 40px);
    padding: 11px 18px;
    border-radius: 999px;
    background: var(--ok-ink, #ffffff);
    color: var(--ok-on-ink, #000000);
    font: 700 0.88rem var(--font-main);
    text-align: center;
    opacity: 0;
    transform: translateX(-50%);
    pointer-events: none;
}

.sx-app:not(.has-nav) .sx-toast { bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
.sx-toast.is-on { animation: sxToast 2.2s ease forwards; }

@keyframes sxToast {
    0% { opacity: 0; transform: translate(-50%, 12px); }
    10%, 82% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, 0); }
}

.ok-spinner {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2.5px solid var(--ok-line-strong);
    border-top-color: var(--hue, var(--accent-primary));
    animation: sxSpin 0.8s linear infinite;
}

@keyframes sxSpin { to { transform: rotate(360deg); } }

/* ---------- AMOLED ---------- */

html.theme-amoled .sx-nav-inner,
html.theme-amoled .sx-post,
html.theme-amoled .sx-trend-card,
html.theme-amoled .sx-feed-card,
html.theme-amoled .sx-lib-card { background: #000000; }
html.theme-amoled .sx-vp-big { background: #ffffff; color: #000000; }
html.theme-amoled .sx-vp-fill { background: #ffffff; }
html.theme-amoled .sx-nav-btn.is-on,
html.theme-amoled .sx-chip.is-on,
html.theme-amoled .sx-trend-rank,
html.theme-amoled .sx-new { background: #ffffff; color: #000000; }
html.theme-amoled .sx-text a,
html.theme-amoled .sx-kicker,
html.theme-amoled .sx-section svg { color: #ffffff; }
html.theme-amoled .sx-filters { background: linear-gradient(#000000 75%, transparent); }

body.no-animations .sx-post,
body.no-animations .sx-viewer,
body.no-animations .sx-nav,
body.no-animations .sx-nav-btn,
body.no-animations .sx-nav-btn span { animation: none !important; transition: none !important; }
