:root {
    color-scheme: light;
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --surface-solid: #ffffff;
    --surface-raised: rgba(255, 255, 255, .96);
    --surface-muted: #f8fafc;
    --surface-hover: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --btn-bg-primary: #06b6d4;
    --btn-text-primary: #ffffff;
    --btn-bg-secondary: #f1f5f9;
    --btn-text-secondary: #334155;
    --border-color: #e2e8f0;
    --input-bg: #ffffff;
    --text-on-accent: #ffffff;
    --text-on-media: #ffffff;
    --text-on-warning: #111827;
    --surface-inverse: #000000;
    --control-knob: #ffffff;
    --bg: var(--bg-primary);
    --panel: var(--surface-raised);
    --text: var(--text-primary);
    --muted: var(--text-secondary);
    --line: var(--border-color);
    --bg-card: var(--panel);
    --media-bg: #eef2f7;
    --brand: #06b6d4;
    --brand2: #22d3ee;
    --accent-cyan: #06b6d4;
    --accent-purple: #9333ea;
    --dark: var(--text-primary);
    --radius: 16px;
    --premium-glass: rgba(255,255,255,.9);
    --premium-glow: 0 24px 90px rgba(14, 165, 233, .12);
    --shadow-sm: 0 8px 24px rgba(15, 23, 42, .06);
    --shadow-card: 0 16px 44px rgba(15, 23, 42, .08);
    --shadow-floating: 0 20px 60px rgba(15, 23, 42, .16);
    --body-gradient-start: #ffffff;
    --body-glow-a: rgba(139, 92, 246, .055);
    --body-glow-b: rgba(34, 211, 238, .075);
    --ease-premium: cubic-bezier(0.4, 0, 0.2, 1);
}
:root[data-theme="light"],
body.light-mode {
    color-scheme: light;
}
:root.dark-mode-preload,
:root[data-theme="dark"],
body.dark-mode {
    color-scheme: dark;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --surface-solid: #111c31;
    --surface-raised: rgba(17, 28, 49, .94);
    --surface-muted: #172033;
    --surface-hover: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --btn-bg-primary: #0891b2;
    --btn-text-primary: #ffffff;
    --btn-bg-secondary: #334155;
    --btn-text-secondary: #f1f5f9;
    --border-color: #334155;
    --input-bg: #1e293b;
    --text-on-accent: #ffffff;
    --text-on-media: #ffffff;
    --text-on-warning: #111827;
    --surface-inverse: #000000;
    --control-knob: #ffffff;
    --bg: var(--bg-primary);
    --panel: var(--surface-raised);
    --text: var(--text-primary);
    --muted: var(--text-secondary);
    --line: rgba(203,213,225,.14);
    --bg-card: var(--panel);
    --media-bg: #020617;
    --accent-cyan: #22d3ee;
    --accent-purple: #a855f7;
    --dark: var(--text-primary);
    --premium-glass: rgba(30,41,59,.72);
    --premium-glow: 0 24px 90px rgba(124, 58, 237, 0.22);
    --shadow-sm: 0 8px 24px rgba(0, 0, 0, .2);
    --shadow-card: 0 18px 48px rgba(0, 0, 0, .28);
    --shadow-floating: 0 24px 70px rgba(0, 0, 0, .46);
    --body-gradient-start: #020617;
    --body-glow-a: rgba(128,0,128,.22);
    --body-glow-b: rgba(0,162,255,.14);
}

* { box-sizing: border-box; }
html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}
[hidden] { display: none !important; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 14% 0%, var(--body-glow-a), transparent 31%),
        radial-gradient(circle at 92% 16%, var(--body-glow-b), transparent 27%),
        linear-gradient(180deg, var(--body-gradient-start), var(--bg-primary));
    color: var(--text-primary);
    line-height: 1.45;
    font-synthesis-weight: none;
    text-rendering: optimizeLegibility;
}
body, .topbar, .sidebar, .bottom-nav, .panel, .post-card, .inbox-panel, .auth-card,
button, input, textarea, select, a, img, video {
    transition: all 0.3s var(--ease-premium);
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button {
    cursor: pointer;
    color: var(--btn-text-primary);
    background-color: var(--btn-bg-primary);
}
input,
textarea,
select {
    color: var(--text-primary);
    background-color: var(--input-bg);
    border-color: var(--border-color);
}
input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}
body :where(h1, h2, h3, h4, strong, label, li) {
    color: var(--text-primary);
}
body :where(p, small, span) {
    color: inherit;
}
.btn,
.primary-btn,
.login-pill,
button[data-state="active"],
button.active {
    background-color: var(--btn-bg-primary);
    color: var(--btn-text-primary);
}
.btn-secondary,
.secondary-btn,
.mini-btn,
button.secondary {
    background-color: var(--btn-bg-secondary);
    color: var(--btn-text-secondary);
    border-color: var(--border-color);
}
img, video {
    content-visibility: auto;
}

.kinetic-target,
[data-haptic],
.bottom-nav a[data-nav-key],
[data-action="like"],
[data-follow-user],
[data-gift-user],
.comment-gift-btn,
[data-gift-id],
[data-gift-amount] {
    transform-origin: center;
    touch-action: manipulation;
    will-change: transform;
    transition: transform .25s cubic-bezier(.175, .885, .32, 1.275), box-shadow .18s ease, filter .18s ease;
}
.is-kinetic-press {
    transform: scale(.92) !important;
}
@media (prefers-reduced-motion: reduce) {
    .kinetic-target,
    [data-haptic],
    .bottom-nav a[data-nav-key],
    [data-action="like"],
    [data-follow-user],
    [data-gift-user],
    .comment-gift-btn,
    [data-gift-id],
    [data-gift-amount] {
        transition: none !important;
    }
    .album-art-disc img {
        animation: none !important;
    }
}

.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 220px;
    padding: 24px 16px;
    border-right: 1px solid var(--line);
    background: var(--panel);
    backdrop-filter: blur(18px);
}
.brand {
    display: block;
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 28px;
}
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav a {
    position: relative;
    padding: 12px;
    border-radius: var(--radius);
    font-weight: 700;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}
.sidebar nav a:hover,
.sidebar nav a.active {
    background: var(--line);
    color: var(--brand);
}
.sidebar nav a:hover {
    transform: translateX(2px);
}
.content {
    margin-left: 220px;
    min-height: 100vh;
    padding: 18px 18px 90px;
}
.is-guest .content {
    margin-left: 0;
}
.is-guest .topbar {
    max-width: 720px;
}
.topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    max-width: 980px;
    margin: 0 auto 16px;
}
.topbar-admin-link {
    margin-left: auto;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255,255,255,.06);
    color: var(--text);
    font-size: 12px;
    font-weight: 900;
}
.topbar-admin-link:hover {
    color: var(--brand);
    border-color: rgba(192,132,252,.42);
}
.mobile-brand { display: none; margin: 0; }
.avatar-link img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}
.login-pill, .primary-btn {
    border: 0;
    border-radius: var(--radius);
    background: var(--btn-bg-primary);
    color: var(--btn-text-primary);
    padding: 11px 16px;
    font-weight: 800;
}
.screen {
    width: min(100%, 980px);
    margin: 0 auto;
}
.feed {
    display: grid;
    gap: 18px;
    justify-items: center;
}
.explore-feed {
    display: grid;
    gap: 14px;
}
.explore-feed > input {
    width: min(100%, 560px);
    justify-self: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 14px;
    background: var(--panel);
    color: var(--text);
}
.explore-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: minmax(110px, 14vw);
    grid-auto-flow: dense;
    gap: 4px;
}
.explore-tile {
    position: relative;
    overflow: hidden;
    background: var(--media-bg);
    border-radius: 3px;
}
.explore-tile.is-featured {
    grid-column: span 2;
    grid-row: span 2;
}
.explore-tile img,
.explore-tile video,
.explore-text-post {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: cover;
}
.explore-text-post {
    min-height: 0;
    place-items: start;
    padding: 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: clamp(15px, 3.8vw, 22px);
    line-height: 1.4;
    text-align: start;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.grid-item-overlay,
.explore-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    background: rgba(0, 0, 0, 0.6);
    color: var(--text-on-accent);
    font-weight: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity .16s ease, transform .16s ease;
}
.grid-item-overlay b {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-on-accent);
    font-size: 15px;
    line-height: 1;
    text-shadow: 0 1px 8px rgba(0, 0, 0, .35);
}
.grid-item-overlay span {
    color: var(--text-on-accent);
}
.explore-tile:hover .grid-item-overlay,
.explore-tile:focus-visible .grid-item-overlay,
.explore-tile:active .grid-item-overlay,
.explore-tile:hover .explore-overlay,
.grid-card:hover .grid-item-overlay,
.grid-card:focus-visible .grid-item-overlay,
.grid-card:active .grid-item-overlay {
    opacity: 1;
}
.post-card {
    width: min(100%, 560px);
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 14px 40px rgba(0,0,0,.16);
}
.post-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
}
.post-options {
    margin-left: auto;
    flex: 0 0 34px;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 900;
    width: 34px;
    height: 34px;
    border-radius: 50%;
}
.post-options:hover {
    background: var(--bg);
}
.post-avatar-link {
    display: block;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
}
.post-avatar-link img,
.post-head img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}
.post-user-link {
    display: grid;
    gap: 1px;
    min-width: 0;
    flex: 1 1 auto;
}
.post-user-link b,
.post-user-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.post-head b {
    display: block;
    color: var(--text-primary);
    font-size: 14px;
}
.post-head span {
    color: var(--text-secondary);
    font-size: 12px;
}
.feed-follow-btn {
    border: 1px solid rgba(128,0,128,.48);
    border-radius: 999px;
    padding: 7px 13px;
    background: linear-gradient(135deg, var(--btn-bg-primary), #ff315a);
    color: var(--btn-text-primary);
    font-size: 12px;
    font-weight: 950;
    white-space: nowrap;
}
.feed-follow-btn.is-followed {
    background: var(--btn-bg-secondary);
    color: var(--btn-text-secondary);
    border-color: var(--border-color);
}
.post-sound-link {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 14px 12px;
    padding: 9px 11px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 900;
}
.post-sound-link span {
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
}
.post-sound-link b {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.post-card.is-sponsored {
    border-color: rgba(255, 204, 92, .48);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .2), inset 3px 0 0 rgba(255, 204, 92, .82);
}
.native-sponsored-label {
    margin-left: auto;
    padding: 4px 7px;
    border: 1px solid rgba(255, 204, 92, .5);
    border-radius: 999px;
    background: rgba(255, 204, 92, .12);
    color: #ffd76b !important;
    font-size: 10px !important;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.post-card.is-sponsored .post-options {
    margin-left: 0;
}
.post-media {
    position: relative;
    width: 100%;
    min-height: 0;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.post-media img,
.post-media video {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    display: block;
}
.post-media img {
    height: auto;
    background: var(--bg-card);
}
.video-shell {
    position: relative;
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    background: var(--media-bg);
    aspect-ratio: 4 / 5;
}
.chaabi-custom-player {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    background: var(--media-bg);
    display: block;
    touch-action: pan-y;
}
.slider-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    width: 100%;
    scrollbar-width: none;
}
.slider-track::-webkit-scrollbar {
    display: none;
}
.slider-shell {
    position: relative;
    width: 100%;
}
.slider-track > * {
    min-width: 100%;
    scroll-snap-align: center;
}
.slider-nav {
    position: absolute;
    top: 50%;
    z-index: 6;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(0,0,0,.42);
    color: var(--text-on-accent);
    font-size: 24px;
    display: grid;
    place-items: center;
}
.slider-nav.prev { left: 10px; }
.slider-nav.next { right: 10px; }
.text-post {
    min-height: 330px;
    padding: 30px;
    display: grid;
    place-items: center;
    text-align: center;
    font-size: clamp(24px, 6vw, 44px);
    font-weight: 900;
    color: inherit;
}
.post-body {
    padding: 0 14px 14px;
    color: var(--text-primary);
}
.text-only-post-body {
    padding-top: 2px;
    padding-bottom: 16px;
}
.post-card.is-text-post .post-media,
.shared-post.is-text-post .shared-post-frame {
    display: none;
}
.post-card.is-text-post {
    background: var(--bg-card);
}
.text-only-post-body .description,
.shared-post-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.text-only-post-body .description {
    font-size: 16px;
    line-height: 1.55;
}
.description {
    margin: 0;
    line-height: 1.45;
    font-size: 14px;
    overflow-wrap: anywhere;
}
.description.is-collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-body .description a {
    font-weight: 900;
}
.more-btn {
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 800;
    padding: 0;
}
.inline-more {
    display: inline;
    vertical-align: baseline;
}
.post-actions,
.actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px 6px;
}
.action-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.icon-btn {
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 23px;
    padding: 4px;
}
.metric-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 28px;
    min-height: 30px;
    color: var(--text-primary);
    font-weight: 900;
}
.metric-action span {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    line-height: 1;
}
.ig-action-icon {
    width: 24px;
    height: 24px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition:
        transform .22s cubic-bezier(.175,.885,.32,1.275),
        fill .18s ease,
        stroke .18s ease;
}
.metric-action:hover .ig-action-icon,
.loopz-actions button:hover .ig-action-icon {
    transform: scale(1.08);
}
.metric-action em {
    font-style: normal;
    font-size: 13px;
    letter-spacing: 0;
}
.icon-btn.active,
.metric-action.active {
    color: var(--brand);
}
.metric-action[data-action="like"].active,
.loopz-actions button[data-action="like"].active {
    color: #ed4956;
}
.metric-action[data-action="save"].active {
    color: var(--text-primary);
}
.loopz-actions button[data-action="save"].active {
    color: var(--text-on-accent);
}
.metric-action[data-action="like"].active .ig-like-icon,
.loopz-actions button[data-action="like"].active .ig-like-icon {
    fill: #ed4956;
    stroke: #ed4956;
    transform: scale(1.12);
}
.metric-action[data-action="save"].active .ig-save-icon,
.loopz-actions button[data-action="save"].active .ig-save-icon {
    fill: currentColor;
}
.liked-by {
    padding: 0 14px 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 800;
}
.muter {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 0;
    background: rgba(0,0,0,.55);
    color: var(--text-on-accent);
    z-index: 5;
}
.loopz-cinema {
    min-height: 100svh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 20% 10%, rgba(128, 0, 128, .22), transparent 30%),
        radial-gradient(circle at 82% 88%, rgba(255, 49, 90, .16), transparent 34%),
        #06070a;
    overflow: hidden;
}
body[data-page="loopz"] .content {
    padding: 0;
    margin-left: 0;
}
body[data-page="loopz"] .topbar {
    display: none;
}
body[data-page="loopz"] .sidebar,
body[data-page="loopz"] .bottom-nav {
    display: none !important;
}
.loopz-view {
    width: min(100%, calc(100svh * 9 / 16));
    height: 100svh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    overscroll-behavior-y: contain;
    background: var(--surface-inverse);
    box-shadow: 0 28px 90px rgba(0,0,0,.55);
}
.loopz-item {
    position: relative;
    height: 100svh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: grid;
    place-items: center;
    color: var(--text-on-accent);
    overflow: hidden;
    background: var(--surface-inverse);
}
.loopz-end-card {
    padding: 32px;
    text-align: center;
    background:
        radial-gradient(circle at 50% 32%, rgba(124, 58, 237, .34), transparent 34%),
        linear-gradient(180deg, #090511, #020204);
}
.loopz-end-card::after {
    display: none;
}
.loopz-end-card > div {
    position: relative;
    z-index: 3;
    width: min(100%, 360px);
    display: grid;
    justify-items: center;
    gap: 14px;
}
.loopz-end-card h2,
.loopz-end-card p {
    margin: 0;
    color: #fff;
}
.loopz-end-card p {
    color: rgba(255,255,255,.68);
}
.loopz-item::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 42%;
    background: linear-gradient(transparent, rgba(0,0,0,.72));
    pointer-events: none;
}
.loopz-item video, .loopz-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--surface-inverse);
    position: relative;
    z-index: 1;
    opacity: 1;
    visibility: visible;
}
.loopz-video-shell {
    width: 100%;
    height: 100%;
}
.loopz-video-shell .chaabi-custom-player {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: cover;
}

/* ===== Loopz photo mode (single image + swipeable multi-image slider) =====
   Photo Loopz posts share the full-bleed vertical canvas with videos. Single
   images already inherit .loopz-item img (object-fit: contain). These rules
   make a multi-image slider fill the vertical viewport, stay horizontally
   swipeable (native scroll-snap), and float its dots above the meta gradient. */
.loopz-item .slider-shell {
    width: 100%;
    height: 100%;
}
.loopz-item .slider-track {
    height: 100%;
    align-items: stretch;
}
.loopz-item .slider-track > * {
    min-width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
}
.loopz-item .slider-track img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.loopz-item .slider-dots {
    bottom: 104px;
    z-index: 7;
}
/* On the touch-first cinema, swipe + dots drive navigation; the side arrows
   stay hidden until a pointer hovers (desktop affordance). */
.loopz-item .slider-nav {
    opacity: 0;
    transition: opacity .15s var(--ease-premium);
}
.loopz-item .slider-shell:hover .slider-nav {
    opacity: 1;
}
@media (hover: none) {
    .loopz-item .slider-nav { display: none; }
}
.loopz-back {
    position: fixed;
    top: 16px;
    left: calc(220px + 24px);
    z-index: 20;
    border: 0;
    border-radius: 50%;
    background: rgba(0,0,0,.55);
    color: var(--text-on-accent);
    width: 42px;
    height: 42px;
    font-size: 20px;
}
.loopz-tabs {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    gap: 8px;
}
.loopz-tabs button {
    border: 0;
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(255,255,255,.15);
    color: var(--text-on-accent);
    font-weight: 800;
}
.loopz-tabs button.active {
    background: rgba(255,255,255,.92);
    color: var(--text-on-warning);
}
.loopz-meta {
    position: absolute;
    left: 18px;
    right: 92px;
    bottom: 28px;
    z-index: 5;
    display: grid;
    gap: 7px;
    text-shadow: 0 2px 12px rgba(0,0,0,.6);
}
.sound-marquee {
    overflow: hidden;
    white-space: nowrap;
    color: var(--text-on-accent);
    opacity: .9;
}
.sound-marquee span {
    display: inline-block;
    animation: marquee 9s linear infinite;
}
@keyframes marquee {
    from { transform: translateX(100%); }
    to { transform: translateX(-100%); }
}
.loopz-actions {
    position: absolute;
    right: 13px;
    bottom: 28px;
    display: grid;
    gap: 13px;
    z-index: 6;
    justify-items: center;
}
.loopz-actions button,
.audio-disc {
    width: 49px;
    height: 49px;
    border-radius: 50%;
    border: 0;
    background: rgba(255,255,255,.17);
    backdrop-filter: blur(14px);
    color: var(--text-on-accent);
    display: grid;
    place-items: center;
    text-align: center;
    box-shadow: 0 10px 26px rgba(0,0,0,.22);
}
.loopz-creator-avatar {
    width: 51px;
    height: 51px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    padding: 2px;
}
.loopz-creator-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: var(--media-bg);
}
.quick-follow-btn {
    width: 24px !important;
    height: 24px !important;
    min-height: 24px !important;
    margin-top: -22px;
    margin-bottom: 2px;
    border: 2px solid var(--text-on-accent) !important;
    background: var(--brand) !important;
    font-size: 17px !important;
    font-weight: 900;
    z-index: 2;
    line-height: 1;
}
.quick-follow-btn.is-followed {
    background: #16a34a !important;
}
.loopz-actions button span {
    display: grid;
    place-items: center;
    min-height: 24px;
    line-height: 1;
}
.loopz-actions button em {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    font-style: normal;
    font-weight: 900;
    line-height: 1;
}
.loopz-actions button.active {
    background: rgba(255,255,255,.22);
}
.loopz-actions button[data-action="like"].active {
    color: #ed4956;
}
.loopz-actions button[data-action="save"].active {
    color: var(--text-on-accent);
}
.loopz-actions .post-options {
    margin-left: 0;
}
.loopz-options-overlay {
    position: fixed;
    inset: 0;
    z-index: 1700;
    display: grid;
    align-items: end;
    justify-items: center;
    pointer-events: none;
}
.loopz-options-open {
    overflow: hidden;
}
.loopz-options-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.54);
    opacity: 0;
    transition: opacity .24s ease;
    pointer-events: auto;
}
.loopz-options-sheet {
    position: relative;
    width: min(100%, 540px);
    max-height: min(82svh, 680px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
    padding: 10px 14px max(18px, env(safe-area-inset-bottom));
    border: 1px solid rgba(255,255,255,.1);
    border-bottom: 0;
    border-radius: 24px 24px 0 0;
    background: #111318;
    color: #f8fafc;
    box-shadow: 0 -24px 80px rgba(0,0,0,.55);
    transform: translateY(105%);
    transition: transform .28s cubic-bezier(.22, .61, .36, 1);
    pointer-events: auto;
    touch-action: pan-y;
}
.loopz-options-overlay.is-open .loopz-options-backdrop {
    opacity: 1;
}
.loopz-options-overlay.is-open .loopz-options-sheet {
    transform: translateY(0);
}
.loopz-options-overlay.is-closing .loopz-options-backdrop {
    opacity: 0;
}
.loopz-options-overlay.is-closing .loopz-options-sheet {
    transform: translateY(105%);
}
.loopz-options-overlay.is-dragging .loopz-options-sheet {
    transition: none;
}
.loopz-options-handle {
    width: 46px;
    height: 5px;
    min-height: 5px;
    display: block;
    margin: 2px auto 14px;
    border: 0;
    border-radius: 999px;
    background: rgba(248,250,252,.42);
    cursor: grab;
}
.loopz-options-top-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.loopz-sheet-action-card {
    min-height: 84px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 8px;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 18px;
    background: rgba(255,255,255,.075);
    color: #f8fafc;
    font-weight: 900;
    transition: transform .18s var(--ease-premium), background .18s ease, border-color .18s ease;
}
.loopz-sheet-action-card span {
    min-height: 28px;
    display: grid;
    place-items: center;
    font-size: 20px;
}
.loopz-sheet-action-card b {
    color: inherit;
    font-size: 13px;
}
.loopz-sheet-action-card.is-active {
    border-color: rgba(168,85,247,.72);
    background: linear-gradient(135deg, rgba(124,58,237,.72), rgba(236,72,153,.68));
}
.loopz-sheet-action-card.is-muted {
    opacity: .48;
}
.loopz-sheet-action-card:active,
.loopz-sheet-list-item:active {
    transform: scale(.97);
}
.loopz-options-list {
    display: grid;
    padding: 10px 0 2px;
}
.loopz-sheet-list-item {
    width: 100%;
    min-height: 48px;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: #f8fafc;
    text-align: left;
    font-weight: 850;
}
.loopz-sheet-list-item:hover {
    background: rgba(255,255,255,.07);
}
.loopz-sheet-list-item span {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255,255,255,.09);
    color: inherit;
    font-weight: 950;
}
.loopz-sheet-list-item b {
    color: inherit;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.loopz-sheet-list-item.is-danger,
.loopz-sheet-list-item.is-danger-soft {
    color: #ff5a70;
}
.loopz-sheet-list-item.is-loading,
.loopz-sheet-action-card.is-loading {
    opacity: .62;
    cursor: wait;
}
.loopz-options-footnote {
    margin: 6px 2px 0;
    color: rgba(248,250,252,.58);
    font-size: 12px;
    font-weight: 800;
}
@media (min-width: 760px) {
    .loopz-options-overlay {
        align-items: end;
        padding-bottom: 18px;
    }
    .loopz-options-sheet {
        border-radius: 24px;
        border-bottom: 1px solid rgba(255,255,255,.1);
    }
}
.audio-disc {
    overflow: hidden;
    border: 2px solid rgba(255,255,255,.75);
    background: var(--media-bg);
    pointer-events: none;
}
.audio-disc img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: spinVinyl 6s linear infinite;
    animation-play-state: paused;
    will-change: transform;
}
.album-art-disc {
    position: relative;
    isolation: isolate;
}
.album-art-disc::after {
    content: "";
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.96), rgba(255,255,255,.25));
    box-shadow: 0 0 0 4px rgba(0,0,0,.22);
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}
.loopz-item.is-playing .album-art-disc img {
    animation-play-state: running;
}
.loopz-item.is-paused .album-art-disc img {
    animation-play-state: paused;
}
@keyframes spinVinyl {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== Clickable Loopz audio area (disc + marquee title) =====
   The base .audio-disc keeps pointer-events: none for decorative uses,
   but when rendered as a link (.audio-disc-link) it must be tappable.
   Declared after the base rule so the cascade re-enables clicks. */
.audio-disc-link {
    pointer-events: auto;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform .15s ease, border-color .15s ease;
}
.audio-disc-link:hover,
.audio-disc-link:focus-visible {
    transform: scale(1.08);
    border-color: rgba(255, 255, 255, .95);
}
.sound-marquee {
    cursor: pointer;
    text-decoration: none;
}
.sound-marquee:hover,
.sound-marquee:focus-visible {
    opacity: 1;
}
.sound-marquee:hover span,
.sound-marquee:focus-visible span {
    text-decoration: underline;
}
.comment-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    align-items: end;
    background: rgba(0,0,0,.38);
}
.comment-modal.open {
    display: flex;
}
.comment-drawer {
    width: min(100%, 620px);
    max-height: min(78vh, 620px);
    margin: 0 auto;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 10px;
    padding: 16px;
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 16px 16px 0 0;
}
.comment-close {
    justify-self: end;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: var(--bg);
    color: var(--text);
    font-size: 24px;
}
.comment-list {
    overflow-y: auto;
    display: grid;
    align-content: start;
    gap: 10px;
}
.comment-row {
    position: relative;
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text-primary);
    background: var(--panel);
}
.comment-row img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}
.comment-avatar-link {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: block;
}
.comment-user-link {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    color: inherit;
    text-decoration: none;
}
.comment-user-link:hover b {
    color: var(--accent-purple);
}
.comment-row b {
    color: var(--text-secondary);
}
.comment-row p {
    margin: 4px 0 0;
    color: var(--text-primary);
}
.comment-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}
.comment-form input {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    background: var(--panel);
    color: var(--text);
}
.post-comments-panel {
    width: min(100%, 640px);
    margin: 14px auto 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--text-primary);
}
.post-comments-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}
.post-comments-head h2 {
    margin: 0;
    font-size: 18px;
}
.post-comments-head span {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 900;
}
.post-comment-list {
    max-height: min(480px, 56vh);
    overflow-y: auto;
    padding: 10px 0;
    display: grid;
    gap: 8px;
}
.post-comment-form {
    position: sticky;
    bottom: 0;
    padding-top: 10px;
    background: var(--panel);
}
.inline-zoom-host {
    overflow: hidden;
    touch-action: pan-y;
}
.inline-zoom-host.is-zooming {
    touch-action: none;
    cursor: grab;
    z-index: 12;
}
.inline-zoom-media {
    transform-origin: center center;
    transition: transform .12s var(--ease-premium);
    will-change: transform;
    cursor: zoom-in;
    user-select: none;
    -webkit-user-drag: none;
}
.inline-zoom-media.is-zoomed {
    cursor: grab;
    transition: transform .04s linear;
}
.post-options-overlay {
    position: fixed;
    inset: 0;
    z-index: 2700;
    display: grid;
    align-items: end;
    justify-items: center;
    pointer-events: none;
}
.post-options-open {
    overflow: hidden;
}
.post-options-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(0,0,0,.58);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity .24s ease;
    pointer-events: auto;
}
.post-options-sheet {
    position: relative;
    width: min(100%, 560px);
    max-height: min(84svh, 720px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 14px max(18px, env(safe-area-inset-bottom));
    border: 1px solid rgba(255,255,255,.1);
    border-bottom: 0;
    border-radius: 25px 25px 0 0;
    background: #111318;
    color: #f8fafc;
    box-shadow: 0 -28px 90px rgba(0,0,0,.56);
    transform: translateY(105%);
    transition: transform .28s cubic-bezier(.22,.61,.36,1);
    pointer-events: auto;
}
.post-options-overlay.is-open .post-options-backdrop {
    opacity: 1;
}
.post-options-overlay.is-open .post-options-sheet {
    transform: translateY(0);
}
.post-options-overlay.is-closing .post-options-backdrop {
    opacity: 0;
}
.post-options-overlay.is-closing .post-options-sheet {
    transform: translateY(105%);
}
.post-options-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: 38px minmax(0,1fr) 38px;
    align-items: center;
    min-height: 64px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: #111318;
    text-align: center;
}
.post-options-head div {
    display: grid;
    gap: 2px;
}
.post-options-head b {
    color: #f8fafc;
    font-size: 15px;
}
.post-options-head small {
    color: rgba(248,250,252,.58);
    font-size: 11px;
}
.post-options-head button {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.09);
    color: #f8fafc;
    font-size: 22px;
}
.post-options-list {
    display: grid;
    padding-top: 8px;
}
.post-sheet-item {
    width: 100%;
    min-height: 54px;
    display: grid;
    grid-template-columns: 38px minmax(0,1fr) 20px;
    align-items: center;
    gap: 11px;
    border: 0;
    border-radius: 15px;
    background: transparent;
    color: #f8fafc;
    text-align: start;
}
.post-sheet-item:hover,
.post-sheet-item:focus-visible {
    background: rgba(255,255,255,.075);
}
.post-sheet-item > span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255,255,255,.09);
    color: inherit;
    font-size: 17px;
    font-weight: 950;
}
.post-sheet-item > b {
    color: inherit;
    font-size: 14px;
}
.post-sheet-item > i {
    color: rgba(248,250,252,.42);
    font-size: 20px;
    font-style: normal;
}
.post-sheet-item.is-active {
    color: #c4b5fd;
}
.post-sheet-item.is-danger,
.post-sheet-item.is-danger-soft {
    color: #ff637b;
}
.post-sheet-item.is-loading {
    opacity: .58;
    cursor: wait;
}
@media (min-width: 760px) {
    .post-options-overlay {
        padding-bottom: 18px;
    }
    .post-options-sheet {
        border-bottom: 1px solid rgba(255,255,255,.1);
        border-radius: 25px;
    }
}
.share-drawer-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: none;
    align-items: end;
    justify-content: center;
    background: rgba(0,0,0,.34);
    backdrop-filter: blur(8px);
}
.share-drawer-modal.open {
    display: flex;
}
.share-drawer {
    width: min(100%, 620px);
    max-height: min(86vh, 720px);
    display: grid;
    gap: 16px;
    padding: 9px 16px 18px;
    border-radius: 26px 26px 0 0;
    background: var(--panel);
    color: var(--text-primary);
    box-shadow: 0 -24px 70px rgba(0,0,0,.26);
    animation: drawer-up .18s ease-out;
}
@keyframes drawer-up {
    from { transform: translateY(30px); opacity: .5; }
    to { transform: translateY(0); opacity: 1; }
}
.share-handle {
    width: 44px;
    height: 5px;
    justify-self: center;
    border: 0;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-primary) 22%, transparent);
}
.share-search-row {
    display: grid;
    grid-template-columns: 1fr 42px;
    gap: 10px;
    align-items: center;
}
.share-search-row input {
    height: 42px;
    border: 0;
    border-radius: 14px;
    padding: 0 15px;
    background: var(--bg);
    color: var(--text-primary);
    font-weight: 700;
}
.share-group-btn {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: var(--bg);
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 900;
}
.share-contacts {
    display: grid;
    grid-template-columns: repeat(4, minmax(72px, 1fr));
    gap: 14px 10px;
    max-height: 250px;
    overflow-y: auto;
}
.share-contact {
    border: 0;
    background: transparent;
    color: var(--text-primary);
    display: grid;
    justify-items: center;
    gap: 7px;
    min-width: 0;
}
.share-contact img {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 2px var(--line);
}
.share-contact span {
    max-width: 78px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}
.share-actions {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-top: 4px;
    scrollbar-width: none;
}
.share-actions button {
    min-width: 76px;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    display: grid;
    justify-items: center;
    gap: 7px;
    font-weight: 900;
}
.share-actions button > span {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--bg);
    font-size: 23px;
}
.share-actions b {
    font-size: 12px;
    line-height: 1.1;
}
/* Repost entry inside the paper-plane drawer. The glyph reuses the action-bar
   repost line-art; the active (already-reposted) state fills with the brand. */
.share-action-repost .ig-share-glyph .ig-action-icon {
    width: 26px;
    height: 26px;
}
.share-action-repost.is-active > span {
    background: var(--btn-bg-primary);
    color: var(--btn-text-primary);
}
.share-action-repost.is-active b {
    color: var(--btn-bg-primary);
}
.dashed-plus {
    border: 2px dashed currentColor;
    background: transparent !important;
}
.toast {
    position: fixed;
    left: 50%;
    bottom: 86px;
    z-index: 120;
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
    pointer-events: none;
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--text);
    color: var(--panel);
    font-weight: 900;
    transition: opacity .16s ease, transform .16s ease;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.repost-badge {
    position: absolute;
    left: 6px;
    top: 6px;
    z-index: 3;
    border-radius: 999px;
    padding: 4px 7px;
    background: rgba(0,0,0,.62);
    color: var(--text-on-accent);
    font-size: 11px;
    font-weight: 900;
}
.skeleton-card {
    width: min(100%, 560px);
    height: 520px;
    border-radius: var(--radius);
    background: linear-gradient(90deg, var(--panel), var(--bg), var(--panel));
    background-size: 240% 100%;
    animation: skeleton 1.1s linear infinite;
}
@keyframes skeleton {
    from { background-position: 100% 0; }
    to { background-position: -100% 0; }
}

/* ===== Reusable skeleton loaders (4-tab profile, grids, lists) ===== */
.skeleton-block,
.skeleton-tile,
.skeleton-line,
.skeleton-circle,
.skeleton-tab {
    background: linear-gradient(90deg, var(--panel), var(--bg), var(--panel));
    background-size: 240% 100%;
    animation: skeleton 1.1s linear infinite;
}
.profile-skeleton { display: grid; gap: 14px; padding: 16px; justify-items: center; }
.skeleton-circle { width: 88px; height: 88px; border-radius: 50%; }
.skeleton-line { height: 12px; border-radius: 6px; width: 100%; }
.skeleton-line.short { width: 38%; }
.skeleton-line.med { width: 64%; }
.skeleton-tabs { display: flex; gap: 8px; width: min(100%, 520px); }
.skeleton-tabs .skeleton-tab { flex: 1; height: 36px; border-radius: 10px; }
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
    width: 100%;
}
.skeleton-grid .skeleton-tile { aspect-ratio: 1 / 1; border-radius: 4px; }
@media (max-width: 540px) {
    .skeleton-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ===== Admin emergency killswitch button ===== */
.system-admin-killswitch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-inline-start: auto;
    padding: 7px 13px;
    border: 1px solid rgba(224, 36, 94, .55);
    border-radius: 999px;
    background: transparent;
    color: #e0245e;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: background .15s var(--ease-premium), box-shadow .15s var(--ease-premium);
}
.system-admin-killswitch span { font-size: 14px; line-height: 1; }
.system-admin-killswitch:hover { background: rgba(224, 36, 94, .12); }
.system-admin-killswitch.is-active {
    background: #e0245e;
    border-color: #e0245e;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(224, 36, 94, .25);
}
.system-admin-secure { margin-inline-start: 8px; }
.composer-screen {
    display: grid;
    gap: 14px;
}
.composer-hero,
.admin-hero {
    padding: 22px;
    border-radius: 18px;
    color: var(--text-on-accent);
    background: linear-gradient(135deg, #111216, #7c3aed 55%, #ff315a);
}
.composer-hero h1,
.admin-hero h1 {
    margin: 0;
    font-size: clamp(28px, 6vw, 48px);
}
.composer-hero p,
.admin-hero p {
    margin: 6px 0 0;
    color: rgba(255,255,255,.82);
}
.composer-form {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
}
.composer-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
    gap: 14px;
    align-items: start;
}
.composer-panel {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: var(--bg-secondary);
}
.composer-panel .section-head h2 {
    margin: 0;
    font-size: 18px;
}
.composer-details-panel {
    margin-top: 14px;
}
.composer-tabs button.active {
    background: linear-gradient(135deg, var(--brand), var(--brand2));
}
.drop-zone {
    display: grid;
    place-items: center;
    gap: 6px;
    min-height: 150px;
    border: 2px dashed color-mix(in srgb, var(--brand) 55%, var(--line));
    border-radius: 18px;
    background: color-mix(in srgb, var(--panel) 80%, var(--bg));
    text-align: center;
    cursor: pointer;
}
.drop-zone.is-dragging {
    border-color: var(--brand);
    background: color-mix(in srgb, var(--brand) 12%, var(--panel));
    transform: translateY(-1px);
}
.drop-zone input {
    display: none;
}
.drop-zone span {
    color: var(--muted);
    font-size: 13px;
}
.upload-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
    gap: 8px;
}
.creator-preview.is-colored-preview {
    min-height: 300px;
    display: grid;
    place-items: center;
    padding: 24px;
    border-radius: 20px;
    font-size: clamp(24px, 4.4vw, 42px);
    font-weight: 950;
    text-align: center;
    overflow-wrap: anywhere;
}
.locked-audio-card {
    display: grid;
    grid-template-columns: 54px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--line));
    border-radius: 18px;
    background: color-mix(in srgb, var(--brand) 8%, var(--panel));
}
.locked-audio-card img {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
}
.locked-audio-card b,
.locked-audio-card span {
    display: block;
}
.locked-audio-card span {
    color: var(--muted);
    font-size: 13px;
}
.locked-audio-card a {
    font-weight: 900;
    color: var(--brand);
}
.category-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.upload-thumb {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--bg);
    cursor: pointer;
    box-shadow: 0 0 0 1px transparent;
}
.upload-thumb.active {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--btn-bg-primary) 70%, transparent);
}
.upload-thumb img,
.upload-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.upload-thumb span,
.upload-thumb button {
    position: absolute;
    top: 6px;
    border: 0;
    border-radius: 999px;
    background: rgba(0,0,0,.58);
    color: var(--text-on-accent);
    font-weight: 900;
}
.upload-thumb span { left: 6px; padding: 3px 7px; }
.upload-thumb button { right: 6px; width: 24px; height: 24px; }
.color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.color-swatches button {
    width: 34px;
    height: 34px;
    border: 2px solid var(--panel);
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--line);
}
.color-swatches button.active {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--btn-bg-primary) 65%, transparent);
}
.color-swatches .swatch-bg-night { background: var(--media-bg); }
.color-swatches .swatch-bg-sunset { background: linear-gradient(135deg, var(--brand), #ff8a00); }
.color-swatches .swatch-bg-sky { background: linear-gradient(135deg, var(--brand2), var(--btn-bg-primary)); }
.color-swatches .swatch-bg-green { background: linear-gradient(135deg, #10b981, #84cc16); }
.color-swatches .swatch-bg-purple { background: linear-gradient(135deg, var(--btn-bg-primary), #ec4899); }
.premium-metrics b {
    color: var(--text-on-accent);
    border: 0;
    box-shadow: 0 14px 34px rgba(0,0,0,.18);
}
.premium-metrics i {
    font-style: normal;
    font-size: 24px;
}
.metric-blue { background: linear-gradient(135deg, #2563eb, #38bdf8) !important; }
.metric-green { background: linear-gradient(135deg, #059669, #34d399) !important; }
.metric-red { background: linear-gradient(135deg, #be123c, #fb7185) !important; }
.metric-purple { background: linear-gradient(135deg, #6d28d9, #c084fc) !important; }
.premium-metrics span {
    color: rgba(255,255,255,.82);
}
.admin-activity-table {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: color-mix(in srgb, var(--panel) 82%, transparent);
    backdrop-filter: blur(16px);
}
.admin-activity-table h2 {
    margin: 0 0 4px;
}
.admin-activity-table > div {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border-radius: var(--radius);
}
.admin-activity-table > div:hover {
    background: var(--bg);
}
.admin-user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}
.admin-user-card {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg);
}
.admin-user-card label {
    display: grid;
    gap: 5px;
    font-size: 12px;
    font-weight: 900;
    color: var(--muted);
}
.category-admin-list {
    display: grid;
    gap: 8px;
}
.category-admin-row {
    grid-template-columns: minmax(160px, 1fr) auto auto auto;
}
.category-admin-row input {
    min-width: 0;
}
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}
.grid-card {
    position: relative;
    aspect-ratio: 1;
    background: var(--media-bg);
    overflow: hidden;
    color: var(--text-on-accent);
}
.grid-card img, .grid-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
}
.form-grid { display: grid; gap: 12px; }
.form-grid input, .form-grid textarea, .form-grid select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    background: var(--panel);
    color: var(--text);
}
.creator-preview {
    position: relative;
    min-height: 360px;
    border-radius: var(--radius);
    background: var(--media-bg);
    overflow: hidden;
    display: grid;
    place-items: center;
    color: var(--text-on-accent);
    touch-action: none;
}
.creator-preview img,
.creator-preview video {
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    display: block;
}
.overlay-chip {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(0,0,0,.22);
    color: var(--text-on-accent);
    font-weight: 900;
    font-size: 22px;
    cursor: grab;
    user-select: none;
    max-width: 86%;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0,0,0,.45);
}
.overlay-chip:active { cursor: grabbing; }
.overlay-render {
    z-index: 3;
    pointer-events: none;
    cursor: default;
}
.creator-tools {
    display: grid;
    grid-template-columns: 1fr 56px auto;
    gap: 8px;
}
.creator-tools input {
    min-width: 0;
}
.mode-row, .tab-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
}
.mode-row button, .tab-row button {
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    border-radius: 999px;
    padding: 9px 12px;
    font-weight: 800;
    white-space: nowrap;
}
.mode-row button.active, .tab-row button.active {
    background: var(--text);
    color: var(--bg);
}
.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 18px;
}
.pro-auth-body {
    background:
        radial-gradient(circle at 18% 16%, rgba(128,0,128,.24), transparent 34%),
        radial-gradient(circle at 82% 84%, rgba(0,162,255,.18), transparent 34%),
        linear-gradient(135deg, #05060a, #101114);
    color: var(--text-on-accent);
}
.pro-auth-shell {
    width: min(1120px, calc(100vw - 28px));
    display: grid;
    grid-template-columns: 1fr minmax(330px, 430px);
    gap: 28px;
    align-items: center;
}
.pro-auth-copy {
    display: grid;
    gap: 14px;
}
.pro-auth-copy b,
.auth-kicker {
    color: #c084fc;
    text-transform: uppercase;
    letter-spacing: 0;
    font-size: 12px;
    font-weight: 900;
}
.pro-auth-copy h1 {
    margin: 0;
    max-width: 720px;
    font-size: clamp(42px, 8vw, 76px);
    line-height: .95;
}
.pro-auth-copy p {
    max-width: 560px;
    color: rgba(255,255,255,.72);
    font-size: 18px;
    line-height: 1.55;
}
.pro-auth-card {
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.18);
    color: var(--text-on-accent);
    backdrop-filter: blur(22px);
    box-shadow: 0 30px 90px rgba(0,0,0,.38);
}
.pro-auth-card p,
.pro-auth-card .auth-link {
    color: rgba(255,255,255,.68);
}
.pro-auth-card input {
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.16);
    color: var(--text-on-accent);
}
.pro-auth-card input:focus {
    outline: none;
    border: 1px solid var(--accent-purple);
    box-shadow: 0 0 0 4px rgba(128,0,128,.2);
}
.pro-auth-card input::placeholder {
    color: rgba(255,255,255,.5);
}
.auth-submit {
    background: linear-gradient(135deg, #800080, #ff315a);
    color: var(--text-on-accent);
}
.auth-card {
    width: min(100%, 390px);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
}
.auth-form { display: grid; gap: 12px; }
.auth-form input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
}
.password-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}
.password-row button {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--text);
    padding: 0 12px;
}
.bottom-nav { display: none; }
.nav-badge {
    position: absolute;
    right: 18%;
    top: 3px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e0245e;
    color: #ffffff;
    display: inline-grid;
    place-items: center;
    font-size: 11px;
    line-height: 1;
    font-weight: 800;
    box-shadow: 0 0 0 2px var(--panel), 0 2px 8px rgba(224, 36, 94, .5);
    animation: navBadgePop .2s var(--ease-premium);
}
@keyframes navBadgePop {
    from { transform: scale(.4); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.install-banner {
    position: fixed;
    left: 50%;
    bottom: 76px;
    z-index: 80;
    width: min(94vw, 520px);
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 18px 44px rgba(0,0,0,.22);
}
.install-banner b,
.install-banner span {
    display: block;
}
.install-banner span {
    color: var(--muted);
    font-size: 12px;
}
.install-banner button {
    border: 0;
    border-radius: 999px;
    padding: 9px 12px;
    font-weight: 900;
}
.install-banner [data-install-app] {
    background: var(--text);
    color: var(--panel);
}
.maintenance-body {
    min-height: 100vh;
    background: var(--bg-primary);
    color: var(--text-on-accent);
}
.maintenance-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}
.maintenance-card {
    width: min(100%, 520px);
    display: grid;
    gap: 12px;
    padding: 26px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--panel);
    text-align: center;
}
.maintenance-card b {
    color: var(--brand);
    font-size: 18px;
}
.maintenance-card h1 {
    margin: 0;
    font-size: clamp(28px, 8vw, 48px);
    line-height: 1.05;
}
.maintenance-card p {
    margin: 0;
    font-size: 24px;
    font-weight: 900;
}
.maintenance-card small {
    color: var(--text-secondary);
    line-height: 1.5;
}
.maintenance-card .primary-btn {
    justify-self: center;
    background: var(--control-knob);
    color: var(--text-on-warning);
}
.bottom-nav a {
    position: relative;
}
.empty {
    color: var(--muted);
    text-align: center;
    padding: 40px 12px;
}
.small-empty {
    padding: 18px 10px;
    font-size: 14px;
}
.inbox-screen {
    display: grid;
    gap: 14px;
}
.stories-rail {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 2px 10px;
    scrollbar-width: none;
}
.stories-rail::-webkit-scrollbar { display: none; }
.mobile-explore-link {
    display: none;
    align-items: center;
    gap: 10px;
    margin: 0 12px 10px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--text-primary);
    font-weight: 900;
    box-shadow: 0 10px 28px rgba(0,0,0,.08);
}
.mobile-explore-link span {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--bg);
    color: var(--accent-purple);
    font-size: 18px;
}
.story-card {
    border: 0;
    background: transparent;
    color: var(--text-primary);
    display: grid;
    justify-items: center;
    gap: 5px;
    min-width: 76px;
}
.story-card img,
.story-add span {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--panel);
}
.story-add span {
    display: grid;
    place-items: center;
    font-size: 24px;
    font-weight: 900;
}
.story-card b,
.story-card small {
    max-width: 72px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 11px;
}
.story-card small {
    color: var(--muted);
}
.story-ring {
    --story-ring-gradient: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    display: grid;
    place-items: center;
    aspect-ratio: 1 / 1;
    padding: 3px;
    border: 0;
    border-radius: 50%;
    background: var(--story-ring-gradient);
    overflow: visible;
}
.story-ring-blue,
.story-ring-red,
.story-ring-purple {
    background: var(--story-ring-gradient);
}
.story-card.story-ring {
    width: 72px;
    min-width: 72px;
    grid-template-rows: 66px auto auto;
}
.story-card.story-ring img,
.story-card.story-ring > span,
.loopz-creator-avatar.story-ring img,
.profile-photo-frame.story-ring .profile-photo,
.profile-photo-trigger.story-ring .profile-photo {
    width: 100%;
    height: 100%;
    border: 2px solid var(--panel);
    border-radius: 50%;
    box-shadow: none;
    object-fit: cover;
    background: var(--panel);
}
.story-card.story-ring img,
.story-card.story-ring > span {
    width: 66px;
    height: 66px;
}
.story-card.story-add.story-ring > span {
    display: grid;
    place-items: center;
    background: var(--btn-bg-primary);
    color: var(--btn-text-primary);
}
.loopz-creator-avatar.story-ring {
    width: 56px;
    height: 56px;
    padding: 3px;
}
.profile-photo-trigger.story-ring {
    width: 126px;
    height: 126px;
    padding: 3px;
}
.profile-photo-frame {
    display: inline-grid;
    place-items: center;
    width: 104px;
    height: 104px;
    margin-inline: auto;
    border-radius: 50%;
}
.profile-photo-frame.story-ring {
    width: 126px;
    height: 126px;
    padding: 3px;
}
.profile-photo-trigger.story-ring span {
    box-shadow: none;
}
.profile-photo-trigger {
    position: relative;
    display: inline-grid;
    place-items: center;
    justify-self: center;
    width: 104px;
    height: 104px;
    border-radius: 50%;
    cursor: pointer;
}
.profile-photo-trigger span {
    position: absolute;
    right: -2px;
    bottom: 5px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--brand);
    color: var(--text-on-accent);
    font-weight: 900;
    border: 2px solid var(--panel);
}
.profile-website {
    color: var(--accent-purple, #800080);
    font-weight: 900;
    word-break: break-all;
}
.story-viewer-modal {
    position: fixed;
    inset: 0;
    z-index: 125;
    display: none;
    place-items: center;
    padding: 18px;
    background: rgba(0,0,0,.88);
    backdrop-filter: blur(22px);
}
.story-viewer-modal.open {
    display: grid;
}
.story-viewer {
    width: min(100%, 440px);
    height: min(92svh, 782px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 10px;
    color: var(--text-on-accent);
}
.story-media-frame {
    position: relative;
    aspect-ratio: 9 / 16;
    height: 100%;
    min-height: 0;
    border-radius: 22px;
    overflow: hidden;
    background: var(--surface-inverse);
    box-shadow: 0 28px 80px rgba(0,0,0,.45);
}
.story-media-frame img,
.story-media-frame video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.story-text-canvas {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 28px;
    color: #111827;
}
.story-text-canvas p,
.story-caption-chip {
    max-width: 86%;
    margin: 0;
    color: inherit;
    text-align: center;
    font-size: clamp(26px, 5vw, 44px);
    font-weight: 950;
    line-height: 1.05;
    overflow-wrap: anywhere;
}
.story-caption-chip {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 96px;
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--text-on-accent);
    background: rgba(0,0,0,.42);
    backdrop-filter: blur(14px);
    font-size: 15px;
}
.story-text-sticker {
    position: absolute;
    transform: translate(-50%, -50%);
    padding: 6px 10px;
    border-radius: 12px;
    background: rgba(0,0,0,.24);
    color: var(--text-on-accent);
    font-weight: 950;
    text-align: center;
    max-width: 80%;
    overflow-wrap: anywhere;
    text-shadow: 0 2px 10px rgba(0,0,0,.35);
    touch-action: none;
}
.story-link-sticker,
.story-mention-sticker {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 950;
    color: var(--text-on-accent);
    background: rgba(17,24,39,.72);
    backdrop-filter: blur(16px);
}
.story-link-sticker { bottom: 74px; }
.story-mention-sticker { top: 56px; }
.story-poll-widget {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 116px;
    z-index: 5;
    display: grid;
    gap: 8px;
    padding: 14px;
    border-radius: 18px;
    color: #111827;
    background: rgba(255,255,255,.9);
    box-shadow: 0 18px 46px rgba(0,0,0,.25);
}
.story-poll-widget b {
    color: #111827;
    text-align: center;
}
.story-poll-widget button {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(17,24,39,.1);
    border-radius: 999px;
    padding: 9px 12px;
    color: #111827;
    background: #fff;
    font-weight: 900;
}
.story-poll-widget button.is-voted {
    background: #111827;
    color: #fff;
}
.story-edge {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 3;
    width: 34%;
    border: 0;
    background: transparent;
}
.story-edge-left { left: 0; }
.story-edge-right { right: 0; }
.story-viewer-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.story-viewer-meta button {
    border: 0;
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(255,255,255,.16);
    color: var(--text-on-accent);
    font-weight: 900;
}
.story-viewers-list {
    max-height: 180px;
    overflow-y: auto;
}
.story-progress {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18px, 1fr));
    gap: 4px;
}
.story-progress span {
    overflow: hidden;
    height: 3px;
    border-radius: 999px;
    background: rgba(255,255,255,.28);
}
.story-progress span.active {
    background: var(--control-knob);
}
.story-progress span i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #fff;
}
.story-progress span.is-current i {
    animation: storyProgressFill 6s linear forwards;
}
@keyframes storyProgressFill {
    from { width: 0; }
    to { width: 100%; }
}
.story-embedded-post {
    position: absolute;
    left: 14px;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border-radius: 16px;
    background: rgba(0,0,0,.62);
    color: var(--text-on-accent);
    backdrop-filter: blur(14px);
    box-shadow: 0 14px 34px rgba(0,0,0,.28);
}
.story-embedded-post img {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    object-fit: cover;
}
.story-embedded-post b,
.story-embedded-post span {
    display: block;
}
.story-embedded-post span {
    color: rgba(255,255,255,.72);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.story-card {
    min-width: 78px;
    display: grid;
    justify-items: center;
    gap: 6px;
    color: var(--text);
    border: 0;
    background: transparent;
    padding: 0;
}
.story-card img,
.story-card span {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    border: 3px solid var(--brand);
    object-fit: cover;
}
.story-card span {
    display: grid;
    place-items: center;
    background: var(--text);
    color: var(--text-on-accent);
    font-size: 32px;
    font-weight: 900;
}
.story-card b {
    width: 78px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    font-size: 12px;
}
.story-card.story-ring img,
.story-card.story-ring > span {
    border: 2px solid var(--panel);
    box-shadow: none;
    object-fit: cover;
}
.story-card.story-ring > span {
    color: var(--btn-text-primary);
    background: var(--btn-bg-primary);
}
.story-creator-modal {
    position: fixed;
    inset: 0;
    z-index: 130;
    display: none;
    place-items: center;
    padding: 18px;
    background: rgba(0,0,0,.78);
    backdrop-filter: blur(20px);
}
.story-creator-modal.open { display: grid; }
.story-creator-shell {
    width: min(100%, 980px);
    max-height: 94svh;
    overflow: auto;
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 24px;
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: 0 26px 80px rgba(0,0,0,.42);
}
.story-creator-phone {
    display: grid;
    place-items: center;
}
.story-creator-canvas {
    position: relative;
    width: min(100%, 330px);
    aspect-ratio: 9 / 16;
    overflow: hidden;
    border-radius: 26px;
    background: #fff;
    box-shadow: 0 20px 54px rgba(0,0,0,.28);
}
.story-creator-base,
.story-creator-overlays {
    position: absolute;
    inset: 0;
}
.story-creator-base {
    display: grid;
    place-items: center;
    padding: 24px;
    text-align: center;
    color: #111827;
}
.story-creator-base img,
.story-creator-base video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.story-creator-base p {
    margin: 0;
    font-size: clamp(24px, 4vw, 40px);
    font-weight: 950;
    overflow-wrap: anywhere;
}
.story-creator-form {
    display: grid;
    gap: 12px;
}
.story-creator-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.story-creator-tabs button,
.story-bg-picker button {
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    background: var(--bg-secondary);
}
.story-creator-tabs button.active {
    color: var(--btn-text-primary);
    background: var(--btn-bg-primary);
}
.story-media-picker,
.story-sticker-grid label {
    display: grid;
    gap: 7px;
}
.story-bg-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.story-bg-picker button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
}
.story-bg-picker button.active {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--btn-bg-primary) 70%, transparent);
}
.story-sticker-grid {
    display: grid;
    gap: 10px;
}
.inline-field {
    display: flex;
    gap: 8px;
    align-items: center;
}
.inline-field input {
    min-width: 0;
}
.is-guest .app-shell {
    grid-template-columns: 1fr;
}
.is-guest .content {
    margin-left: 0;
}
.inbox-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
}
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
.section-head h2 {
    margin: 0;
    font-size: 18px;
}
.requests-head {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}
.inbox-tabs {
    padding-bottom: 10px;
}
.inbox-mobile-switcher {
    display: none;
}
.notice-row,
.person-row {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}
.notice-row:first-child,
.person-row:first-child {
    border-top: 0;
}
.notice-row > span {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--bg-secondary);
    color: var(--text-on-accent);
    font-weight: 900;
}
.person-row img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
}
.notice-row b,
.person-row b {
    display: block;
    font-size: 14px;
}
.notice-row small,
.person-row small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mini-btn {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--text);
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 800;
}
.profile-hero {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    text-align: center;
}
.profile-photo {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--panel);
    box-shadow: 0 12px 28px rgba(0,0,0,.16);
}
.profile-photo-frame.story-ring .profile-photo,
.profile-photo-trigger.story-ring .profile-photo {
    box-shadow: none;
}
.profile-hero h1 { margin: 10px 0 0; }
.profile-hero p { color: var(--muted); margin: 4px 0; }
.profile-bio {
    max-width: 560px;
    margin: 10px auto !important;
    color: var(--text) !important;
}
.profile-stats,
.metric-row,
.wallet-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 16px;
}
.profile-stats b,
.metric-row b,
.wallet-cards b {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--panel) 88%, var(--bg));
}
.profile-stats span,
.metric-row span,
.wallet-cards span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}
/* 4-up profile stats with clickable Followers/Following */
.profile-stats { grid-template-columns: repeat(4, 1fr); }
.profile-stat-btn {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--panel) 88%, var(--bg));
    color: var(--text);
    font: inherit;
    cursor: pointer;
    text-align: center;
    transition: border-color .15s var(--ease-premium);
}
.profile-stat-btn:hover { border-color: var(--btn-bg-primary); }
.profile-stat-btn b {
    display: block;
    border: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
}
@media (max-width: 540px) {
    .profile-stats { gap: 6px; }
    .profile-stats b, .profile-stat-btn { padding: 8px; font-size: 14px; }
}
/* Instagram-style profile tab row + saved sub-tabs */
.ig-profile-tabs button { flex: 1; }
.profile-saved-subtabs { margin-top: 6px; }
.profile-saved-subtabs button { flex: 1; font-size: 13px; }

/* Followers / Following modal */
.follow-list-modal {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(8, 10, 14, .55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.follow-list-sheet {
    width: min(420px, 100%);
    max-height: 72vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--premium-glow);
}
.follow-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    font-size: 16px;
}
.follow-list-close {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}
.follow-list-body { overflow-y: auto; padding: 8px; }
.follow-list-row { text-decoration: none; color: var(--text); }

/* Public-profile options (⋯) context menu */
.public-profile-options { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 5; }
.public-profile-options-btn {
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 8px;
}
.public-profile-options-btn:hover { background: var(--bg-secondary); }
.public-profile-menu {
    position: absolute;
    inset-inline-end: 0;
    top: 38px;
    min-width: 180px;
    display: grid;
    background: var(--bg-primary);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--premium-glow);
}
.public-profile-menu button {
    border: 0;
    background: transparent;
    color: var(--text);
    text-align: start;
    padding: 11px 14px;
    font: inherit;
    cursor: pointer;
}
.public-profile-menu button:hover { background: var(--bg-secondary); }
.public-profile-hero .profile-stats { width: 100%; max-width: 460px; }

/* ===== Loopz → GIF creator + saved GIFs ===== */
.loopz-gif-icon { font-size: 12px; font-weight: 800; letter-spacing: .5px; }
.gif-crop-modal {
    position: fixed;
    inset: 0;
    z-index: 1820;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(8, 10, 14, .6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.gif-crop-sheet {
    width: min(440px, 100%);
    display: grid;
    gap: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--premium-glow);
}
.gif-crop-head { display: flex; align-items: center; justify-content: space-between; }
.gif-crop-close { border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.gif-crop-video { width: 100%; max-height: 300px; border-radius: 12px; background: var(--media-bg); object-fit: contain; }
.gif-crop-field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.gif-crop-field input[type="range"] { width: 100%; }
.gif-crop-result { display: grid; gap: 8px; justify-items: center; }
.gif-crop-result img { max-width: 100%; border-radius: 12px; }
.gif-saved-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gif-saved-tile img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; background: var(--media-bg); }
/* GIFs inside comments + the comment GIF picker */
.comment-gif { max-width: 180px; border-radius: 10px; margin-top: 4px; display: block; }
.comment-gif-trigger {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--accent-purple);
    font-weight: 800;
    font-size: 11px;
    border-radius: 8px;
    padding: 6px 9px;
    cursor: pointer;
}
.comment-gif-picker {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
    padding: 8px;
    border-top: 1px solid var(--line);
}
.comment-gif-pick { border: 0; padding: 0; background: transparent; cursor: pointer; }
.comment-gif-pick img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; }

/* ===== Global home search + multi-tab results ===== */
.home-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 12px;
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--input-bg);
}
.home-search-icon { color: var(--muted); font-size: 16px; }
.home-search input {
    flex: 1;
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    outline: none;
}
.home-search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 40;
    display: grid;
    background: var(--bg-primary);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--premium-glow);
    max-height: 360px;
    overflow-y: auto;
}
.home-search-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    text-decoration: none;
    color: var(--text);
}
.home-search-result:hover { background: var(--bg-secondary); }
.home-search-result img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.home-search-result span { display: grid; line-height: 1.2; }
.home-search-result small { color: var(--muted); font-size: 12px; }
.home-search-all {
    border: 0;
    border-top: 1px solid var(--line);
    background: transparent;
    color: var(--btn-bg-primary);
    font: inherit;
    font-weight: 700;
    padding: 11px 12px;
    text-align: start;
    cursor: pointer;
}
.home-search-all:hover { background: var(--bg-secondary); }
.search-tabs { margin-bottom: 10px; }
.search-tabs button { flex: 1; }
.search-list { display: grid; gap: 8px; }
.search-row { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); padding: 8px; border-radius: 12px; }
.search-row:hover { background: var(--bg-secondary); }
.search-row img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.search-row small { color: var(--muted); font-size: 12px; }
.search-audio-icon {
    width: 44px; height: 44px;
    display: grid; place-items: center;
    border-radius: 12px;
    background: var(--bg-secondary);
    font-size: 20px;
    color: var(--accent-purple);
}
.search-tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.search-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
}
.search-tag-chip span { color: var(--muted); font-size: 12px; font-weight: 600; }
.search-tag-chip:hover { border-color: var(--btn-bg-primary); }
.hamburger {
    position: absolute;
    right: 14px;
    top: 14px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: color-mix(in srgb, var(--panel) 80%, var(--text));
    display: grid;
    place-items: center;
    gap: 3px;
    padding: 10px;
}
.hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
}
.profile-menu {
    position: absolute;
    right: 14px;
    top: 60px;
    z-index: 20;
    display: none;
    min-width: 190px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 18px 40px rgba(0,0,0,.18);
    overflow: hidden;
    text-align: left;
}
.profile-menu.open { display: block; }
.profile-menu a,
.profile-menu button {
    display: block;
    width: 100%;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    border-left: 0;
    border-right: 0;
    border-top: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text-primary);
    font-weight: 800;
    font: inherit;
    text-align: left;
    text-decoration: none;
    box-shadow: none;
    cursor: pointer;
}
.profile-menu a:hover,
.profile-menu button:hover {
    background: var(--bg-secondary);
}
.profile-menu a:last-child,
.profile-menu button:last-child {
    border-bottom: 0;
}
.profile-sort-tabs,
.profile-tabs,
.profile-saved-subtabs {
    width: 100%;
    max-width: 980px;
    margin: 14px auto;
    gap: 10px;
    padding: 0;
    scrollbar-width: none;
}
.profile-sort-tabs::-webkit-scrollbar,
.profile-tabs::-webkit-scrollbar,
.profile-saved-subtabs::-webkit-scrollbar { display: none; }
.profile-sort-tabs button,
.ig-profile-tabs button,
.profile-saved-subtabs button {
    min-height: 44px;
    flex: 1 1 132px;
    border: 1px solid color-mix(in srgb, var(--border-color) 78%, transparent);
    background: linear-gradient(180deg, color-mix(in srgb, var(--bg-secondary) 92%, transparent), color-mix(in srgb, var(--bg-primary) 82%, transparent));
    color: var(--text-primary);
    border-radius: 999px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 10px 26px rgba(0,0,0,.10);
    transition: transform .18s var(--ease-premium), border-color .18s var(--ease-premium), background .18s var(--ease-premium), box-shadow .18s var(--ease-premium);
}
.ig-profile-tabs button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}
.profile-tab-icon,
.profile-tab-icon .ig-action-icon {
    width: 18px;
    height: 18px;
    display: inline-grid;
    place-items: center;
}
.profile-tab-icon .ig-action-icon {
    stroke: currentColor;
    fill: none;
}
.profile-sort-tabs button:hover,
.ig-profile-tabs button:hover,
.profile-saved-subtabs button:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--btn-bg-primary) 58%, var(--border-color));
}
.profile-sort-tabs button.active,
.ig-profile-tabs button.active,
.profile-saved-subtabs button.active {
    background: linear-gradient(135deg, var(--btn-bg-primary), var(--brand));
    color: var(--btn-text-primary);
    border-color: transparent;
    box-shadow: 0 12px 32px color-mix(in srgb, var(--btn-bg-primary) 34%, transparent);
}
.profile-grid .grid-card { position: relative; }
.text-grid {
    display: grid;
    place-items: center;
    padding: 12px;
    font-weight: 900;
    text-align: center;
}
.grid-badge {
    position: absolute;
    right: 8px;
    top: 8px;
    color: var(--text-on-accent);
    text-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.studio-screen {
    display: grid;
    gap: 14px;
}
.studio-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.studio-head h1 { margin: 0; }
.studio-head p { color: var(--muted); margin: 4px 0 0; }
.studio-verification-card .admin-form {
    margin-top: 12px;
    display: grid;
    gap: 10px;
}
.studio-verification-card input[type="file"],
.studio-verification-card select,
.studio-verification-card textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--text);
    padding: 10px 12px;
}
.line-chart {
    width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-top: 12px;
    background: var(--panel);
}
.traffic-row {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 12px 0 18px;
    border-top: 1px solid var(--line);
}
.traffic-row:first-child { border-top: 0; }
.traffic-row i {
    position: absolute;
    left: 0;
    bottom: 8px;
    height: 5px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand), var(--brand2));
}
.suggestion-list {
    display: grid;
    gap: 8px;
}
.suggestion-list p {
    margin: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.wallet-cards { grid-template-columns: repeat(2, 1fr); }
.wallet-actions {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    margin: 12px 0;
}
.wallet-actions input {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--text);
    padding: 10px;
}
.reward-box {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 12px;
}
.switch-line {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
}
.admin-screen {
    display: grid;
    gap: 14px;
}
.admin-screen > * {
    animation: admin-rise .42s var(--ease-premium) both;
}
.admin-screen > *:nth-child(2) { animation-delay: .04s; }
.admin-screen > *:nth-child(3) { animation-delay: .08s; }
.admin-screen > *:nth-child(4) { animation-delay: .12s; }
.admin-screen > *:nth-child(5) { animation-delay: .16s; }
.launch-card {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 14px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.launch-card b,
.launch-card span,
.launch-card small {
    display: block;
}
.launch-card span,
.launch-card small {
    color: var(--muted);
    font-size: 12px;
}
.admin-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.admin-metrics b {
    display: grid;
    gap: 4px;
    padding: 14px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: transform .18s var(--ease-premium), box-shadow .18s var(--ease-premium), filter .18s ease;
}
.admin-metrics b:hover {
    transform: translateY(-3px);
    filter: saturate(1.08);
    box-shadow: 0 18px 40px rgba(0,0,0,.24);
}
.admin-metrics span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: capitalize;
}
.admin-row {
    display: grid;
    grid-template-columns: 48px 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}
.admin-row:first-of-type { border-top: 0; }
.admin-row img {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    object-fit: cover;
    background: var(--media-bg);
}
.admin-row > div:first-child {
    grid-column: 1 / 3;
}
.admin-row b,
.admin-row small {
    display: block;
}
.admin-row small {
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-form {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 10px;
}
.admin-control-grid,
.site-map-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
}
.admin-control-card,
.site-map-card {
    min-width: 0;
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--text);
    text-align: left;
    transition: transform .18s var(--ease-premium), border-color .18s ease, background .18s ease;
}
.admin-control-card:hover,
.site-map-card:hover {
    transform: translateY(-2px);
    border-color: rgba(192,132,252,.42);
    background: rgba(255,255,255,.07);
}
.admin-control-card span,
.site-map-card small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}
.admin-control-card b,
.site-map-card b {
    overflow-wrap: anywhere;
}
.admin-control-card small {
    color: var(--muted);
}
.admin-subtitle {
    margin: 16px 0 0;
    font-size: 14px;
}
.admin-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.diagnostic-grid,
.runtime-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 12px 0;
}
.diagnostic-card,
.runtime-grid b {
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
}
.diagnostic-card span {
    width: max-content;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 900;
}
.diagnostic-card.ok span {
    background: #d9fbe7;
    color: #096b35;
}
.diagnostic-card.fail span {
    background: #ffe1e1;
    color: #a60000;
}
.diagnostic-card.fail {
    border-color: color-mix(in srgb, #ff315a 58%, var(--line));
}
.diagnostic-card small,
.runtime-grid span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}
.log-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    margin-top: 12px;
}
.log-toolbar div {
    display: grid;
    gap: 2px;
    margin-right: auto;
}
.log-toolbar span {
    color: var(--muted);
    font-size: 12px;
}
.mini-btn.danger {
    border-color: #ff315a;
    color: #ff315a;
}
.danger-btn {
    background: #ff315a;
    color: var(--text-on-accent);
}
.log-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}
.log-entry {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--muted);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--panel) 92%, var(--bg));
}
.log-entry.fatal,
.log-entry.error {
    border-left-color: #ff315a;
}
.log-entry.warning {
    border-left-color: #d48b00;
}
.log-entry.notice {
    border-left-color: var(--brand2);
}
.log-entry div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.log-entry p {
    margin: 0;
    overflow-wrap: anywhere;
    line-height: 1.45;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
}
.log-entry time,
.log-entry small {
    color: var(--muted);
    font-size: 12px;
}
.production-controls {
    display: grid;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}
.production-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.production-actions a {
    text-align: center;
}
.operation-log {
    min-height: 44px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--panel) 88%, var(--bg));
    color: var(--muted);
    font-size: 13px;
}
.operation-log b {
    display: block;
    color: var(--text);
    margin-bottom: 4px;
}
.operation-log p {
    margin: 6px 0 0;
    overflow-wrap: anywhere;
}
.operation-log p.ok {
    color: #0a7a3b;
}
.operation-log p.fail {
    color: #d10b2f;
}
.backup-list {
    display: grid;
    gap: 8px;
}
.backup-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}
.backup-row:first-child {
    border-top: 0;
}
.backup-row b,
.backup-row small {
    display: block;
}
.backup-row small {
    color: var(--muted);
    font-size: 12px;
}
.shared-post {
    width: min(100%, 640px);
    margin: 0 auto;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.shared-post-head {
    display: grid;
    grid-template-columns: 42px 54px minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
}
.post-back-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--btn-bg-secondary);
    color: var(--btn-text-secondary);
    font-size: 28px;
    font-weight: 900;
    line-height: 1;
}
.shared-author-avatar,
.shared-post-head img {
    width: 54px;
    height: 54px;
    border-radius: 50%;
}
.shared-author-avatar {
    display: block;
    overflow: hidden;
}
.shared-post-head img {
    object-fit: cover;
}
.shared-post-head h1 {
    margin: 0;
    font-size: 20px;
    line-height: 1.25;
}
.shared-post-head p {
    margin: 4px 0 0;
    color: var(--muted);
}
.shared-post-head p a,
.shared-post-head time {
    color: var(--text-secondary);
}
.shared-follow-btn {
    justify-self: end;
}
.shared-post-frame {
    background: var(--bg-card);
}
.shared-post-text {
    padding: 8px 18px 18px;
    color: var(--text-primary);
    font-size: 18px;
    line-height: 1.6;
}
.shared-media-slider {
    position: relative;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    min-height: min(420px, 62vh);
}
.shared-media-item {
    min-width: 100%;
    display: grid;
    place-items: center;
    scroll-snap-align: center;
}
.shared-media-item img,
.shared-media-item video {
    width: 100%;
    max-height: min(560px, 72vh);
    object-fit: contain;
    display: block;
    background: var(--bg-card);
}
.shared-post-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 14px 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}
.shared-post-desc {
    padding: 12px 14px;
    margin: 0;
    line-height: 1.5;
}
.shared-sound {
    display: block;
    margin: 0 14px 14px;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: var(--bg-secondary);
}
.small-copy {
    color: var(--muted);
    line-height: 1.5;
}
.sound-page {
    display: grid;
    gap: 14px;
}
.sound-hero,
.gif-hero {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 16px;
    align-items: center;
    padding: 18px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.sound-hero img,
.gif-hero img {
    width: 110px;
    height: 110px;
    border-radius: 16px;
    object-fit: cover;
}
.sound-hero h1,
.gif-hero h1 { margin: 0; }
.sound-hero p,
.gif-hero p { color: var(--muted); }
.sound-hero audio { width: 100%; }
.gif-page {
    width: min(100%, 900px);
    margin: 0 auto;
}
.gif-hero {
    grid-template-columns: minmax(180px, 360px) minmax(0, 1fr);
}
.gif-hero img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
}
.use-audio-btn {
    display: inline-grid;
    width: fit-content;
    margin-top: 10px;
}
.request-row {
    background: var(--line);
    margin: 0 -4px;
    padding-left: 4px;
    padding-right: 4px;
    border-radius: var(--radius);
}
.dismiss-notification-btn {
    border: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg);
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 900;
}
.notice-row.is-dismissing,
.activity-row.is-dismissing {
    opacity: 0;
    transform: translateX(12px);
    transition: opacity .16s ease, transform .16s ease;
}

.activity-row {
    position: relative;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto 28px;
    align-items: center;
    gap: 11px;
    min-height: 72px;
    padding: 10px 4px;
    border-bottom: 1px solid var(--line);
    color: var(--text-primary);
    cursor: pointer;
    transition: background .16s ease, transform .16s ease, opacity .16s ease;
}
.activity-row:last-child {
    border-bottom: 0;
}
.activity-row:hover,
.activity-row:focus-visible {
    border-radius: 14px;
    outline: 0;
    background: var(--bg-secondary);
}
.activity-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-secondary);
}
.activity-copy {
    min-width: 0;
}
.activity-copy p {
    margin: 0;
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.35;
}
.activity-copy b {
    color: inherit;
    font-size: inherit;
}
.activity-copy time {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 750;
}
.activity-post-thumb {
    width: 48px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    object-fit: cover;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 950;
}
.activity-post-thumb.is-placeholder {
    border: 1px solid var(--line);
}
.activity-follow-btn {
    min-width: 76px;
    min-height: 34px;
    border: 0;
    border-radius: 8px;
    padding: 0 12px;
    background: var(--brand);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
}
.activity-follow-btn.is-followed {
    border: 1px solid var(--line);
    background: var(--bg-secondary);
    color: var(--text-primary);
}
.activity-row-arrow {
    color: var(--text-muted);
    font-size: 24px;
}
.activity-dismiss {
    width: 26px;
    height: 26px;
    background: transparent;
    color: var(--text-muted);
    font-size: 18px;
}
@media (max-width: 520px) {
    .activity-row {
        grid-template-columns: 44px minmax(0, 1fr) auto 24px;
        gap: 9px;
    }
    .activity-avatar {
        width: 44px;
        height: 44px;
    }
    .activity-post-thumb {
        width: 44px;
        height: 54px;
    }
    .activity-follow-btn {
        min-width: 68px;
        padding-inline: 9px;
    }
}
.ring-picker {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.ring-picker label {
    display: grid;
    place-items: center;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-weight: 900;
}

body[data-page="loopz"] .loopz-view,
body[data-page="loopz"] .loopz-item {
    background: radial-gradient(circle at 50% 12%, #1f2028, #050506 58%);
}
body[data-page="loopz"] .loopz-item video,
body[data-page="loopz"] .loopz-item img,
body[data-page="loopz"] .loopz-video-shell {
    background: transparent !important;
    content-visibility: visible;
}
body[data-page="loopz"] .loopz-video-shell .chaabi-custom-player {
    object-fit: contain;
}
body[data-page="loopz"] .loopz-actions,
body[data-page="loopz"] .loopz-meta {
    bottom: 28px;
}
.gift-modal {
    position: fixed;
    inset: 0;
    z-index: 132;
    display: none;
    place-items: end center;
    padding: 18px;
    background: rgba(0, 0, 0, .56);
}
.gift-modal.open {
    display: grid;
}
.gift-card {
    position: relative;
    width: min(100%, 430px);
    display: grid;
    gap: 12px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 22px;
    background: var(--panel);
    background: color-mix(in srgb, var(--panel) 92%, transparent);
    color: var(--text-primary);
    box-shadow: 0 28px 90px rgba(0,0,0,.36);
    backdrop-filter: blur(18px);
}
.gift-card h2,
.gift-card p {
    margin: 0;
}
.gift-card p {
    color: var(--text-secondary);
    line-height: 1.45;
}
.gift-card label {
    display: grid;
    gap: 7px;
    color: var(--text-secondary);
    font-weight: 800;
}
.gift-card input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 12px 14px;
    background: var(--bg-card);
    color: var(--text-primary);
}
.gift-quick-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.gift-quick-row button {
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 10px 12px;
    background: var(--bg);
    color: var(--text-primary);
    font-weight: 900;
}
.gift-success-overlay {
    position: fixed;
    left: 50%;
    top: 20px;
    z-index: 140;
    transform: translateX(-50%) translateY(-16px);
    opacity: 0;
    pointer-events: none;
    width: min(92vw, 420px);
    transition: opacity .18s ease, transform .18s ease;
}
.gift-success-overlay.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.gift-success-overlay div {
    display: grid;
    gap: 3px;
    padding: 14px 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, #16a34a, #800080);
    color: var(--text-on-accent);
    box-shadow: 0 22px 70px rgba(0,0,0,.28);
}
.gift-success-overlay b {
    font-size: 18px;
}
.rank-row {
    display: grid;
    grid-template-columns: 54px 54px minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
    color: var(--text-primary);
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.rank-row:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--accent-purple) 40%, var(--line));
    box-shadow: 0 18px 44px rgba(0,0,0,.14);
}
.rank-row strong {
    font-size: 18px;
}
.rank-row img {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
}
.rank-row b,
.rank-row small,
.rank-row em {
    display: block;
}
.rank-row small {
    color: var(--text-secondary);
}
.rank-row em {
    font-style: normal;
    font-weight: 900;
}
.rank-badge {
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}
.rank-diamond .rank-badge {
    background: linear-gradient(135deg, #7dd3fc, #a78bfa);
    color: var(--text-on-warning);
}
.rank-gold .rank-badge {
    background: linear-gradient(135deg, #facc15, #f97316);
    color: var(--text-on-warning);
}
.rank-standard .rank-badge {
    background: var(--bg);
    color: var(--text-primary);
}
.studio-leaderboard-panel {
    display: grid;
    gap: 14px;
    overflow: hidden;
}
.studio-rank-me {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}
.studio-rank-badge {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}
.studio-rank-badge span {
    display: grid;
    grid-row: span 2;
    min-width: 58px;
    height: 58px;
    place-items: center;
    border-radius: 50%;
    background: var(--btn-bg-primary);
    color: var(--btn-text-primary);
    font-size: 20px;
    font-weight: 900;
}
.studio-rank-badge b,
.studio-rank-badge small {
    min-width: 0;
}
.studio-rank-badge small {
    color: var(--text-secondary);
}
.studio-rank-badge.is-muted span {
    background: var(--btn-bg-secondary);
    color: var(--btn-text-secondary);
}
.studio-rank-list {
    display: grid;
    gap: 10px;
}
.studio-rank-row em small {
    color: var(--text-secondary);
    font-weight: 700;
}
.verified-mark {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-purple);
    color: var(--text-on-accent);
    font-size: 12px;
}
.auth-card.pro-auth-card {
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.18);
    color: var(--text-on-accent);
    backdrop-filter: blur(22px);
    box-shadow: 0 30px 90px rgba(0,0,0,.38);
}
.auth-card.pro-auth-card input {
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.16);
    color: var(--text-on-accent);
}
.auth-card.pro-auth-card input:focus {
    outline: none;
    border: 1px solid var(--accent-purple);
    box-shadow: 0 0 0 4px rgba(128,0,128,.2);
}
.auth-card.pro-auth-card .auth-link,
.auth-card.pro-auth-card p {
    color: rgba(255,255,255,.72);
}

/* Premium SaaS-tier surface system */
.panel,
.post-card,
.inbox-panel,
.profile-hero,
.composer-form,
.composer-hero,
.studio-screen > section,
.sound-hero,
.shared-post,
.admin-hero,
.admin-activity-table,
.admin-row,
.admin-user-card,
.category-admin-row,
.notice-row,
.person-row,
.rank-row,
.settings-card,
.settings-pro-hero,
.platform-settings-card,
.bi-chart-card {
    background: var(--premium-glass);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 16px;
    color: var(--text-primary);
    backdrop-filter: blur(16px);
    box-shadow: 0 18px 54px rgba(0,0,0,.22);
}
.sidebar nav a:hover,
.sidebar nav a:focus-visible,
.bottom-nav a:hover,
.post-card:hover,
.panel:hover,
.inbox-panel:hover,
.rank-row:hover,
.admin-row:hover,
.person-row:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,.075);
    border-color: rgba(128,0,128,.42);
    box-shadow: var(--premium-glow);
}
button:hover,
.primary-btn:hover,
.mini-btn:hover,
.icon-btn:hover,
.login-pill:hover {
    transform: translateY(-1px) scale(1.015);
    box-shadow: 0 16px 38px rgba(128,0,128,.26);
}
input,
textarea,
select {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--input-bg);
    color: var(--text-primary);
    outline: none;
}
input:focus,
textarea:focus,
select:focus {
    border-color: rgba(168,85,247,.72);
    box-shadow: 0 0 0 4px rgba(128,0,128,.18);
    background: var(--input-bg);
}
.primary-btn,
.login-pill {
    background: linear-gradient(135deg, var(--btn-bg-primary), #ff315a);
    color: var(--btn-text-primary);
}
.mini-btn {
    border: 1px solid var(--border-color);
    background: var(--btn-bg-secondary);
    color: var(--btn-text-secondary);
}
.settings-pro-screen {
    display: grid;
    gap: 18px;
}
body[data-page="admin"] .screen {
    width: min(100%, 1320px);
}
body[data-page="settings"] .screen {
    width: min(100%, 1120px);
}
.settings-pro-hero,
.intelligence-hero {
    position: relative;
    overflow: hidden;
    padding: 26px;
    background:
        radial-gradient(circle at 12% 10%, rgba(128,0,128,.24), transparent 30%),
        radial-gradient(circle at 90% 20%, rgba(34,211,238,.14), transparent 30%),
        rgba(31,40,51,.65);
}
.settings-pro-hero::after,
.intelligence-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(115deg, transparent 0%, rgba(255,255,255,.08) 45%, transparent 62%);
    transform: translateX(-120%);
    animation: surface-sheen 7s ease-in-out infinite;
}
.settings-pro-hero span,
.intelligence-hero span {
    color: #c084fc;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.settings-pro-hero h1,
.intelligence-hero h1 {
    margin: 6px 0;
    font-size: clamp(34px, 7vw, 64px);
    line-height: .95;
}
.settings-pro-hero p,
.intelligence-hero p {
    max-width: 760px;
    margin: 0;
    color: var(--text-secondary);
}
.settings-pro-form {
    display: grid;
    gap: 14px;
}
.settings-segment-shell {
    display: grid;
    grid-template-columns: minmax(190px, 250px) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}
.settings-segment-sidebar {
    position: sticky;
    top: 86px;
}
.settings-segment-sidebar .settings-tabbar {
    display: grid;
}
.settings-segment-panels {
    display: grid;
    gap: 14px;
    min-width: 0;
}
.settings-tabbar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 6px;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 18px;
    background: rgba(255,255,255,.045);
    backdrop-filter: blur(14px);
}
.settings-tabbar button {
    border: 0;
    border-radius: 13px;
    padding: 11px 14px;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 900;
    white-space: nowrap;
}
.settings-tabbar button.active {
    background: linear-gradient(135deg, rgba(128,0,128,.86), rgba(0,162,255,.38));
    color: var(--text-on-accent);
}
.settings-segment-sidebar .settings-tabbar button {
    text-align: left;
}
.settings-panel {
    display: none;
    gap: 14px;
}
.settings-panel.active {
    display: grid;
}
.settings-card {
    display: grid;
    gap: 12px;
    padding: 18px;
}
.settings-card h2 {
    margin: 0 0 2px;
}
.two-col-settings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.ios-switch-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 16px;
    background: rgba(255,255,255,.04);
}
.ios-switch-row span {
    display: grid;
    gap: 3px;
}
.ios-switch-row small {
    color: var(--text-secondary);
}
.ios-switch-row input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.ios-switch-row i {
    position: relative;
    width: 52px;
    height: 30px;
    border-radius: 999px;
    background: rgba(255,255,255,.16);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.ios-switch-row i::after {
    content: "";
    position: absolute;
    width: 24px;
    height: 24px;
    left: 3px;
    top: 3px;
    border-radius: 50%;
    background: var(--control-knob);
    box-shadow: 0 8px 20px rgba(0,0,0,.3);
    transition: all .3s var(--ease-premium);
}
.ios-switch-row input:checked + i {
    background: linear-gradient(135deg, #800080, #00a2ff);
}
.ios-switch-row input:checked + i::after {
    transform: translateX(22px);
}
.premium-ring-picker label {
    background: rgba(255,255,255,.045);
}
.wallet-config-card textarea {
    min-height: 98px;
}
.session-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}
.session-card {
    display: grid;
    gap: 4px;
    padding: 13px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 14px;
    background: rgba(255,255,255,.045);
}
.session-card.current {
    border-color: rgba(34,211,238,.45);
    box-shadow: 0 0 0 1px rgba(34,211,238,.16);
}
.session-card span,
.session-card small {
    color: var(--text-secondary);
}
.settings-save-bar {
    position: sticky;
    bottom: 12px;
    z-index: 8;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: var(--panel);
    backdrop-filter: blur(18px);
}
.admin-bi-console {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr);
    gap: 14px;
}
.bi-chart-card,
.platform-settings-card {
    padding: 18px;
}
.bi-chart-card canvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 14px;
    background: rgba(255,255,255,.025);
}
.range-control {
    display: grid;
    gap: 12px;
}
.range-control span {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-weight: 900;
}
.range-control input[type="range"] {
    width: 100%;
    accent-color: #c084fc;
}
.category-audit-deck {
    display: grid;
    gap: 10px;
    padding: 18px;
}
.category-audit-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255,255,255,.045);
}
.category-audit-row span {
    font-weight: 900;
}
.category-audit-row b {
    color: var(--text-secondary);
}
.moderation-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 12px 0;
}
.moderation-stat-grid b {
    display: grid;
    gap: 4px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 22px;
}
.moderation-stat-grid span {
    color: var(--text-secondary);
    font-size: 12px;
}
.moderation-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.moderation-grid section,
.moderation-log {
    display: grid;
    gap: 10px;
}
.moderation-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
}
.moderation-row small {
    color: var(--text-secondary);
}
.content-moderation-table {
    display: grid;
    gap: 8px;
}
.content-moderation-row {
    display: grid;
    grid-template-columns: 72px minmax(110px, .7fr) minmax(0, 1.4fr) minmax(130px, .7fr) auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}
.content-moderation-row.is-head {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    background: var(--input-bg);
}
.content-moderation-row.is-removed {
    opacity: .68;
}
.content-moderation-row strong,
.content-moderation-row small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.content-moderation-row small,
.content-moderation-row time {
    color: var(--text-secondary);
    font-size: 12px;
}
.compact-form-title {
    margin: 6px 0 4px;
    color: var(--text-primary);
    font-size: 14px;
    letter-spacing: 0;
}
.compact-form-title.is-spaced {
    margin-top: 14px;
}
.compact-form-title.is-muted {
    color: var(--text-secondary);
    font-size: 13px;
}
.admin-stack-fieldset {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--text-primary);
}
.delete-post-btn {
    box-shadow: 0 10px 28px rgba(255,49,90,.18);
}
.media-library-admin-card {
    display: grid;
    gap: 16px;
}
.media-library-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}
.media-library-list {
    display: grid;
    gap: 10px;
    margin: 10px 0 18px;
}
.media-library-explorer {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: var(--bg-secondary);
}
.media-library-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
}
.media-library-tabs button {
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 9px 14px;
    background: var(--btn-bg-secondary);
    color: var(--btn-text-secondary);
    font-weight: 950;
}
.media-library-tabs button.active {
    background: linear-gradient(135deg, var(--btn-bg-primary), #ff315a);
    color: var(--btn-text-primary);
}
.media-library-panel {
    display: none;
    gap: 10px;
}
.media-library-panel.active {
    display: grid;
}
.media-explorer-row {
    display: grid;
    grid-template-columns: 64px minmax(160px, 1fr) minmax(190px, .8fr) minmax(260px, 1.3fr);
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--input-bg);
    color: var(--text-primary);
}
.media-explorer-row img {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    object-fit: cover;
    background: var(--media-bg);
}
.media-explorer-row small {
    display: block;
    color: var(--text-secondary);
}
.media-explorer-row form,
.media-assign-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.media-explorer-row select {
    min-width: 132px;
}
.media-library-row {
    display: grid;
    grid-template-columns: 58px minmax(180px, 1fr) minmax(150px, .8fr) auto auto;
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}
.media-library-row img {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    object-fit: cover;
    background: var(--media-bg);
}
.media-library-row label {
    display: grid;
    gap: 5px;
}
.media-library-row label span {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}
@media (max-width: 760px) {
    .media-explorer-row {
        grid-template-columns: 54px minmax(0, 1fr);
    }
    .media-explorer-row form,
    .media-explorer-row > a,
    .media-assign-controls {
        grid-column: 1 / -1;
    }
    .media-library-row {
        grid-template-columns: 50px minmax(0, 1fr);
    }
    .media-library-row a,
    .media-library-row button,
    .media-library-row label:nth-of-type(2) {
        grid-column: 1 / -1;
    }
}

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

@keyframes surface-sheen {
    0%, 45% { transform: translateX(-120%); }
    70%, 100% { transform: translateX(120%); }
}

@media (prefers-reduced-motion: reduce) {
    .admin-screen > *,
    .settings-pro-hero::after,
    .intelligence-hero::after,
    #app-root.spa-enter {
        animation: none !important;
    }
    .admin-metrics b,
    .admin-control-card,
    .site-map-card,
    .sidebar nav a {
        transition: none !important;
    }
}

@media (max-width: 760px) {
    .composer-workspace,
    .story-creator-shell {
        grid-template-columns: 1fr;
    }
    .composer-form,
    .composer-panel {
        border-left: 0;
        border-right: 0;
        border-radius: 0;
    }
    .story-viewer-modal {
        padding: 0;
        align-items: stretch;
    }
    .story-viewer {
        width: 100%;
        height: 100svh;
        padding: 8px;
    }
    .story-media-frame {
        border-radius: 0;
    }
    .story-creator-modal {
        padding: 0;
    }
    .story-creator-shell {
        max-height: 100svh;
        min-height: 100svh;
        border-radius: 0;
    }
    .story-creator-canvas {
        width: min(78vw, 330px);
    }
    .inline-field {
        flex-wrap: wrap;
    }
    .pro-auth-shell {
        grid-template-columns: 1fr;
    }
    .pro-auth-copy {
        display: none;
    }
    .category-tools,
    .ring-picker {
        grid-template-columns: 1fr;
    }
    .two-col-settings,
    .admin-bi-console,
    .moderation-grid,
    .moderation-stat-grid {
        grid-template-columns: 1fr;
    }
    .settings-pro-hero,
    .settings-card,
    .bi-chart-card,
    .platform-settings-card {
        border-left: 0;
        border-right: 0;
        border-radius: 0;
    }
    .settings-tabbar {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }
    .settings-segment-shell {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .settings-segment-sidebar {
        position: sticky;
        top: 62px;
        z-index: 12;
        margin: 0 -8px;
    }
    .settings-segment-sidebar .settings-tabbar {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .settings-segment-sidebar .settings-tabbar button {
        text-align: center;
        flex: 0 0 auto;
    }
    .category-audit-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
    .moderation-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
    .content-moderation-row,
    .content-moderation-row.is-head {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
    .sidebar { display: none; }
    .content {
        margin-left: 0;
        padding: 8px 0 78px;
    }
    .topbar {
        position: sticky;
        top: 0;
        z-index: 30;
        justify-content: space-between;
        padding: 10px 14px;
        background: var(--panel);
        backdrop-filter: blur(14px);
        margin-bottom: 4px;
    }
    .mobile-brand { display: block; font-size: 22px; }
    .screen { width: 100%; }
    .mobile-explore-link {
        display: flex;
    }
    .inbox-mobile-switcher {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        padding: 8px;
        margin: 0 8px;
        border: 1px solid rgba(255,255,255,.08);
        border-radius: 16px;
        background: rgba(255,255,255,.055);
        backdrop-filter: blur(16px);
    }
    .inbox-mobile-switcher button {
        min-width: 0;
        border: 0;
        border-radius: 12px;
        padding: 10px 8px;
        background: transparent;
        color: var(--text-secondary);
        font-size: 12px;
        font-weight: 900;
    }
    .inbox-mobile-switcher button.active {
        background: linear-gradient(135deg, rgba(128,0,128,.88), rgba(0,162,255,.42));
        color: var(--text-on-accent);
    }
    .inbox-panel[data-inbox-mobile-panel] {
        display: none;
    }
    .inbox-panel[data-inbox-mobile-panel].is-mobile-active {
        display: grid;
    }
    .inbox-tabs {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }
    .post-card {
        border-left: 0;
        border-right: 0;
        border-radius: 0;
        max-width: none;
    }
    /* No forced min-height: it created a large empty dark area around
       small images. Media now sizes to its own aspect ratio. */
    .post-media { min-height: 0; }
    .loopz-view, .loopz-item {
        height: 100svh;
        border-radius: 0;
    }
    .loopz-cinema {
        display: block;
        min-height: 100svh;
    }
    .loopz-view {
        width: 100%;
        box-shadow: none;
    }
    .loopz-back {
        left: 12px;
        top: 12px;
    }
    .loopz-tabs {
        top: 12px;
    }
    .loopz-actions {
        bottom: 86px;
    }
    .loopz-meta {
        bottom: 86px;
    }
    .bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 40;
        height: 70px;
        background: var(--panel);
        border-top: 1px solid var(--line);
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        align-items: center;
        text-align: center;
        font-size: 11px;
        font-weight: 800;
        padding: 5px 8px calc(5px + env(safe-area-inset-bottom));
        backdrop-filter: blur(16px);
    }
    .bottom-nav a {
        min-width: 0;
        position: relative;
        display: grid;
        justify-items: center;
        gap: 2px;
        color: var(--text);
    }
    .bottom-nav a > span:first-child {
        font-size: 20px;
        line-height: 1;
    }
    .bottom-nav b {
        font-size: 9px;
        line-height: 1;
    }
    .create-fab {
        width: 58px;
        height: 46px;
        border-radius: 17px;
        background: linear-gradient(135deg, #111216, #800080);
        color: var(--text-on-accent);
        display: grid;
        place-items: center;
        justify-self: center;
        box-shadow: 0 12px 28px rgba(128,0,128,.32);
    }
    .create-fab span {
        font-size: 27px !important;
        margin-top: -3px;
    }
    .create-fab b {
        color: var(--text-on-accent);
    }
    .grid { gap: 2px; }
    .explore-grid {
        grid-auto-rows: 32vw;
        gap: 2px;
    }
    .explore-tile {
        border-radius: 0;
    }
    .explore-overlay {
        display: none;
    }
    .panel { border-radius: 0; border-left: 0; border-right: 0; }
    .profile-hero {
        border-left: 0;
        border-right: 0;
        border-radius: 0;
    }
    .studio-screen { padding: 0 0 8px; }
    .studio-head { padding: 0 14px; }
    .profile-stats, .metric-row { gap: 6px; }
    .wallet-actions { grid-template-columns: 1fr; }
    .admin-metrics { grid-template-columns: repeat(2, 1fr); padding: 0 12px; }
    .admin-tabs { padding: 0 12px; }
    .admin-row { grid-template-columns: 42px 1fr auto; }
    .launch-controls {
        padding: 0 12px;
    }
    .launch-card {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
    .diagnostic-grid,
    .runtime-grid {
        grid-template-columns: 1fr;
    }
    .log-toolbar {
        align-items: stretch;
        flex-wrap: wrap;
    }
    .production-actions,
    .backup-row {
        grid-template-columns: 1fr;
    }
    .shared-post {
        border-left: 0;
        border-right: 0;
        border-radius: 0;
    }
    .shared-media-slider {
        min-height: 360px;
    }
    .shared-post-head {
        grid-template-columns: 38px 46px minmax(0, 1fr);
    }
    .shared-follow-btn,
    .shared-post-head .post-options {
        grid-column: auto;
    }
    .sound-hero,
    .gif-hero {
        grid-template-columns: 82px 1fr;
        border-left: 0;
        border-right: 0;
        border-radius: 0;
    }
    .sound-hero img,
    .gif-hero img {
        width: 82px;
        height: 82px;
    }
    .inbox-screen { gap: 10px; }
    .stories-rail { padding: 8px 12px 12px; }
    .inbox-panel {
        border-left: 0;
        border-right: 0;
        border-radius: 0;
    }
    .rank-row {
        grid-template-columns: 42px 48px minmax(0, 1fr);
    }
    .rank-row img {
        width: 48px;
        height: 48px;
    }
    .rank-row .rank-badge,
    .rank-row em {
        grid-column: 3;
        justify-self: start;
    }
    .gift-modal {
        padding: 0;
        place-items: end stretch;
    }
    .gift-card {
        width: 100%;
        border-radius: 22px 22px 0 0;
    }
}

/* ===== Batch 1: Monetization & Analytics ===== */
.comment-gift-bar {
    margin: 4px 0 10px;
}
.comment-gift-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    border: 0;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--brand), #ff8a00);
    color: var(--text-on-accent);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: transform .15s var(--ease-premium);
}
.comment-gift-btn span {
    font-size: 18px;
}
.comment-gift-btn:active {
    transform: scale(.98);
}

.gift-picker-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(0, 0, 0, .62);
    backdrop-filter: blur(6px);
}
.gift-picker-card {
    position: relative;
    width: 100%;
    max-width: 460px;
    max-height: 86vh;
    overflow-y: auto;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 24px 18px 18px;
    backdrop-filter: blur(22px);
}
.gift-picker-card h2 {
    margin: 6px 0 4px;
    font-size: 20px;
}
.gift-picker-card p {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 13px;
}
.gift-picker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.gift-pick-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .04);
    color: var(--text);
    cursor: pointer;
    transition: transform .15s var(--ease-premium), border-color .15s;
}
.gift-pick-card img {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    object-fit: cover;
}
.gift-pick-card b {
    font-size: 13px;
}
.gift-pick-card span {
    font-size: 12px;
    color: var(--brand2);
    font-weight: 700;
}
.gift-pick-card:hover {
    border-color: var(--brand);
    transform: translateY(-2px);
}
.gift-pick-card:disabled {
    opacity: .5;
    cursor: progress;
}
.gift-pick-card.is-sending {
    border-color: var(--brand);
}

.wallet-earnings {
    margin: 14px 0 4px;
}
.wallet-earnings .section-head.sub-head {
    margin-bottom: 4px;
}
.wallet-earnings .sub-head h3 {
    margin: 0;
    font-size: 16px;
}
.earn-range-tabs {
    margin: 8px 0;
}
.earn-total {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
}
#wallet-earnings-chart {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
}
.studio-range-custom {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0;
}
.studio-range-custom input[type="date"] {
    flex: 1 1 130px;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .04);
    color: var(--text);
    font-size: 13px;
}
.studio-range-custom .mini-btn {
    flex: 1 1 100%;
}

@media (min-width: 720px) {
    .gift-picker-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .studio-range-custom .mini-btn {
        flex: 0 0 auto;
    }
}

/* ===== Batch 2: Settings Completion ===== */
.settings-tabbar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.settings-tabbar::-webkit-scrollbar {
    display: none;
}
.settings-hint {
    display: block;
    margin: -2px 0 6px;
    font-size: 12px;
    color: var(--muted);
}
.section-head.sub-head {
    margin: 14px 0 4px;
}
.sub-head h3 {
    margin: 0;
    font-size: 15px;
}

.account-switch-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 8px 0 12px;
}
.account-switch-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .04);
}
.account-switch-row.is-current {
    border-color: var(--brand2);
}
.account-switch-row img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
}
.account-switch-row > div {
    flex: 1 1 auto;
    min-width: 0;
}
.account-switch-row b {
    display: block;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.account-switch-row small {
    color: var(--muted);
    font-size: 12px;
}
.account-tag {
    font-size: 11px;
    font-weight: 700;
    color: var(--brand2);
    padding: 4px 10px;
    border: 1px solid var(--brand2);
    border-radius: 999px;
}
.account-switch-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}
.faq-item {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .04);
    overflow: hidden;
}
.faq-item summary {
    cursor: pointer;
    padding: 12px 14px;
    font-weight: 600;
    font-size: 14px;
    list-style: none;
}
.faq-item summary::-webkit-details-marker {
    display: none;
}
.faq-item summary::after {
    content: '+';
    float: right;
    color: var(--muted);
    font-weight: 700;
}
.faq-item[open] summary::after {
    content: '\2212';
}
.faq-item p {
    margin: 0;
    padding: 0 14px 14px;
    color: var(--muted);
    font-size: 13px;
}

.support-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 8px 0 4px;
}
.support-ticket-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.support-ticket {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .04);
}
.support-ticket-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.support-ticket-head b {
    font-size: 14px;
}
.support-ticket small {
    display: block;
    margin: 4px 0 6px;
    color: var(--muted);
    font-size: 12px;
}
.support-ticket p {
    margin: 0;
    font-size: 13px;
}
.support-status {
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: var(--muted);
}
.support-status.status-open {
    color: #00a2ff;
}
.support-status.status-in_progress {
    color: #ff8a00;
}
.support-status.status-resolved,
.support-status.status-closed {
    color: #16a34a;
}
.support-reply {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(0, 162, 255, .1);
}
.support-reply b {
    display: block;
    font-size: 12px;
    color: var(--brand2);
    margin-bottom: 2px;
}
.support-reply p {
    margin: 0;
    font-size: 13px;
}

/* ===== Batch 3: Post Edit & Privacy ===== */
.slider-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 10px;
    display: flex;
    justify-content: center;
    gap: 6px;
    pointer-events: none;
    z-index: 3;
}
.slider-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .45);
    box-shadow: 0 0 4px rgba(0, 0, 0, .5);
    pointer-events: auto;
    cursor: pointer;
    transition: transform .15s var(--ease-premium), background .15s;
}
.slider-dot.active {
    background: var(--control-knob);
    transform: scale(1.35);
}

.post-edit-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(0, 0, 0, .62);
    backdrop-filter: blur(6px);
}
.post-edit-card {
    position: relative;
    width: 100%;
    max-width: 460px;
    max-height: 88vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 24px 18px 18px;
    backdrop-filter: blur(22px);
}
.post-edit-card h2 {
    margin: 4px 0 2px;
    font-size: 20px;
}
.post-edit-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}
.post-edit-card textarea,
.post-edit-card select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .04);
    color: var(--text);
    font: inherit;
    font-size: 14px;
}
.post-edit-card textarea {
    resize: vertical;
    min-height: 90px;
}
.post-edit-card .primary-btn {
    margin-top: 6px;
}

@media (min-width: 720px) {
    .post-edit-card {
        border-radius: 22px;
    }
}

/* ===== Batch 4: Loopz & UI Polish ===== */
body[data-page="loopz"] .topbar {
    display: none !important;
}
body[data-page="loopz"] .content {
    padding: 0 !important;
}
body[data-page="loopz"] .loopz-item,
body[data-page="loopz"] .loopz-video-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--surface-inverse);
}
body[data-page="loopz"] .loopz-item video,
body[data-page="loopz"] .loopz-item img,
body[data-page="loopz"] .loopz-video-shell .chaabi-custom-player {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain !important;
    background: var(--surface-inverse);
}

.inbox-system-banner {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(255, 49, 90, .95), rgba(255, 138, 0, .95));
    box-shadow: 0 14px 34px rgba(255, 49, 90, .26);
}
.inbox-system-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--text-on-accent);
}
.inbox-system-head span {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .26);
    font-weight: 800;
    font-size: 13px;
}
.inbox-system-head b {
    font-size: 14px;
    letter-spacing: .2px;
}
.inbox-system-banner #system-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.inbox-system-banner .notice-row {
    background: rgba(255, 255, 255, .16);
    border-color: rgba(255, 255, 255, .22);
}
.inbox-system-banner .notice-row b,
.inbox-system-banner .notice-row small,
.inbox-system-banner .notice-row span {
    color: var(--text-on-accent);
}
.inbox-system-banner .dismiss-notification-btn {
    color: var(--text-on-accent);
}

/* ===== Hybrid SPA navigation ===== */
.bottom-nav a.active {
    color: var(--brand);
}
.bottom-nav a.active.create-fab {
    color: var(--text-on-accent);
}
#app-root.spa-enter {
    animation: spa-fade-in .22s var(--ease-premium);
}
.spa-view[hidden] {
    display: none !important;
}
.spa-view.is-active.spa-enter {
    animation: spa-fade-in .22s var(--ease-premium);
}
@keyframes spa-fade-in {
    from { opacity: .35; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Loopz tap-to-pause indicator ===== */
.loopz-item.is-paused::before {
    content: '\25B6';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 6;
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    padding-left: 6px;
    font-size: 30px;
    color: var(--text-on-accent);
    background: rgba(0, 0, 0, .5);
    border-radius: 50%;
    pointer-events: none;
    animation: spa-fade-in .15s var(--ease-premium);
}

/* ===== Admin user override matrix ===== */
.admin-user-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.admin-user-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .04);
}
.admin-user-row img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
}
.admin-user-row > div {
    flex: 1 1 auto;
    min-width: 0;
}
.admin-user-row b {
    display: block;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.admin-user-row small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    text-transform: capitalize;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.admin-user-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(0, 0, 0, .62);
    backdrop-filter: blur(6px);
}
.admin-user-form-card {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 88vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 24px 18px 18px;
    backdrop-filter: blur(22px);
}
.admin-user-form-card h2 {
    margin: 4px 0 2px;
    font-size: 19px;
}
.admin-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.admin-field > span {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}
.admin-field input,
.admin-field select,
.admin-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .04);
    color: var(--text);
    font: inherit;
    font-size: 14px;
}
.admin-field textarea {
    resize: vertical;
    min-height: 64px;
}
.admin-field-row {
    display: flex;
    gap: 10px;
}
.admin-field-row .admin-field {
    flex: 1 1 0;
    min-width: 0;
}
.admin-user-form-card .primary-btn {
    margin-top: 6px;
}
.admin-profile-edit-btn {
    justify-self: center;
    margin-top: 12px;
    border: 1px solid rgba(168, 85, 247, .45);
    border-radius: 999px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #7c3aed, #db2777);
    color: var(--text-on-accent);
    font-weight: 900;
    box-shadow: 0 12px 28px rgba(124, 58, 237, .22);
}
.admin-profile-modal {
    position: fixed;
    inset: 0;
    z-index: 1800;
    display: none;
    place-items: center;
    padding: 16px;
    background: rgba(0, 0, 0, .62);
    backdrop-filter: blur(8px);
}
.admin-profile-modal.open {
    display: grid;
}
.admin-profile-card {
    width: min(100%, 760px);
    max-height: 90vh;
    overflow-y: auto;
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--panel);
    color: var(--text-primary);
    box-shadow: 0 28px 90px rgba(0, 0, 0, .36);
}
.admin-profile-head,
.admin-profile-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.admin-profile-head h2 {
    margin: 0;
}
.admin-profile-head small {
    color: var(--text-secondary);
    font-weight: 900;
    text-transform: uppercase;
}
.admin-account-type {
    width: fit-content;
    max-width: 100%;
    padding: 7px 10px;
    border: 1px solid rgba(34, 197, 94, .38);
    border-radius: 999px;
    background: rgba(34, 197, 94, .12);
    color: #22c55e;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .02em;
}
.admin-account-type.is-bot {
    border-color: rgba(168, 85, 247, .45);
    background: rgba(168, 85, 247, .14);
    color: #c084fc;
}
.admin-profile-form {
    display: grid;
    gap: 14px;
}
.admin-avatar-manager {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
}
.admin-avatar-manager img,
.settings-avatar-preview img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    background: var(--panel);
}
.admin-profile-grid,
.bot-toggle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}
.admin-profile-form label {
    display: grid;
    gap: 5px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 800;
}
.admin-profile-form input,
.admin-profile-form select {
    min-width: 0;
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--input-bg);
    color: var(--text-primary);
    font: inherit;
}
.bot-automation-panel {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(168, 85, 247, .28);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(168, 85, 247, .12), transparent 55%), var(--bg-secondary);
}
.avatar-management-card {
    gap: 14px;
}
.settings-avatar-preview {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
}
.settings-avatar-preview h2 {
    margin: 0 0 4px;
}
.avatar-management-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.avatar-management-actions input[type="file"] {
    flex: 1 1 220px;
    min-width: 0;
}

/* ===== In-browser video editor ===== */
.video-editor {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.video-editor[hidden] {
    display: none;
}
.video-editor .ve-head {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.video-editor .ve-head strong {
    font-size: 15px;
}
.video-editor .ve-status {
    font-size: 12px;
    color: var(--muted);
}
.video-editor .ve-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}
.video-editor .ve-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .03);
}
.video-editor .ve-block > label {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.video-editor .ve-range-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.video-editor .ve-range-row input[type="range"] {
    flex: 1 1 120px;
    accent-color: var(--brand, #ff315a);
    min-width: 0;
}
.video-editor .ve-time {
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    color: var(--muted);
    min-width: 38px;
    text-align: center;
}
.video-editor .ve-trim-info {
    font-size: 12px;
    color: var(--muted);
}
.video-editor .ve-crop-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.video-editor .ve-crop-btn {
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.video-editor .ve-crop-btn.is-active {
    background: var(--brand, #ff315a);
    border-color: var(--brand, #ff315a);
    color: var(--text-on-accent);
}
.video-editor .ve-audio-block {
    grid-column: 1 / -1;
}
.video-editor .ve-audio-picker {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}
.video-editor .ve-audio-chip {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 92px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 11px;
    cursor: pointer;
    text-align: center;
    transition: border-color .12s ease, background .12s ease;
}
.video-editor .ve-audio-chip img {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    background: rgba(255, 255, 255, .06);
}
.video-editor .ve-audio-chip > span {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}
.video-editor .ve-audio-chip.is-active {
    border-color: var(--brand, #ff315a);
    background: rgba(255, 49, 90, .08);
}
.video-editor .ve-audio-chip[data-audio-id=""] {
    width: auto;
    min-width: 92px;
    justify-content: center;
}
.video-editor .ve-locked-note {
    font-size: 12px;
    color: var(--muted);
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .04);
    border: 1px dashed var(--line);
    line-height: 1.4;
}
.video-editor .ve-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}
.video-editor .ve-actions .ghost-btn,
.video-editor .ve-actions .primary-btn {
    flex: 0 1 auto;
}
@media (min-width: 760px) {
    .video-editor .ve-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ===== Inbox glassmorphic drawer overlay =====
   Mobile-first: slides up from the bottom on phones, slides in from the
   right on desktop. Sits above #app-root so the Home/Loopz scroll
   position underneath is preserved. */
.inbox-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 1400;
    pointer-events: none;
    opacity: 0;
    transition: opacity .24s ease;
}
.inbox-drawer-overlay.is-open {
    pointer-events: auto;
    opacity: 1;
}
.inbox-drawer-overlay .inbox-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 10, 14, .55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.inbox-drawer-overlay .inbox-drawer-panel {
    position: absolute;
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--line);
    box-shadow: 0 -18px 60px rgba(0, 0, 0, .35);
    /* Phone-first: slide-up tray that covers most of the screen. */
    left: 0;
    right: 0;
    bottom: 0;
    height: 92vh;
    max-height: 92vh;
    border-radius: 22px 22px 0 0;
    transform: translateY(100%);
    transition: transform .28s cubic-bezier(.22, .61, .36, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.inbox-drawer-overlay.is-open .inbox-drawer-panel {
    transform: translateY(0);
}
.inbox-drawer-overlay .inbox-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}
.inbox-drawer-overlay .inbox-drawer-head h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
}
.inbox-drawer-overlay .inbox-drawer-close {
    appearance: none;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .12s ease;
}
.inbox-drawer-overlay .inbox-drawer-close:hover {
    background: rgba(255, 255, 255, .06);
}
.inbox-drawer-overlay .inbox-drawer-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px 12px 24px;
    -webkit-overflow-scrolling: touch;
}
.inbox-drawer-overlay .inbox-drawer-body .inbox-panel {
    margin-top: 14px;
}
/* Prevent body scroll behind the open drawer without losing scrollTop. */
body.inbox-drawer-active {
    overflow: hidden;
    touch-action: auto;
}
/* Desktop: side drawer rather than bottom sheet. */
@media (min-width: 900px) {
    .inbox-drawer-overlay .inbox-drawer-panel {
        left: auto;
        top: 0;
        right: 0;
        bottom: 0;
        width: 440px;
        max-width: 90vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 22px 0 0 22px;
        transform: translateX(100%);
    }
    .inbox-drawer-overlay.is-open .inbox-drawer-panel {
        transform: translateX(0);
    }
}

/* ===== Creator notification bell =====
   Sits inside the public-profile hero. Toggles between subscribed and
   unsubscribed states with distinct colors. */
.creator-alert-bell {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 14px;
    transition: background .14s ease, border-color .14s ease, transform .14s ease, color .14s ease;
}
.creator-alert-bell:hover {
    background: rgba(255, 255, 255, .04);
    transform: translateY(-1px);
}
.creator-alert-bell:disabled {
    opacity: .65;
    cursor: progress;
    transform: none;
}
.creator-alert-bell.is-active {
    background: var(--brand, #ff315a);
    border-color: var(--brand, #ff315a);
    color: var(--text-on-accent);
}
.creator-alert-bell.is-active:hover {
    background: var(--brand, #ff315a);
    filter: brightness(1.05);
}
.creator-alert-bell span {
    font-size: 17px;
    line-height: 1;
}
.creator-alert-bell em {
    font-style: normal;
}
.public-profile-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
}

/* ===== Public-profile action controls (Follow / Message) ===== */
.profile-action-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 360px;
    margin: 14px auto 0;
}
.profile-follow-btn,
.profile-message-btn {
    appearance: none;
    flex: 1 1 140px;
    min-width: 130px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 16px;
    border-radius: 999px;
    border: 1px solid transparent;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s var(--ease-premium), border-color .15s var(--ease-premium), transform .15s var(--ease-premium), color .15s var(--ease-premium), filter .15s var(--ease-premium);
}
.profile-follow-btn {
    background: var(--btn-bg-primary);
    color: var(--btn-text-primary);
}
.profile-follow-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.profile-follow-btn:disabled { opacity: .65; cursor: progress; transform: none; }
.profile-follow-btn.is-following {
    background: transparent;
    color: var(--text);
    border-color: var(--line);
}
.profile-follow-btn.is-following:hover {
    background: var(--brand, #ff315a);
    border-color: var(--brand, #ff315a);
    color: var(--text-on-accent);
    filter: none;
}
/* Swap the label to "Unfollow" on hover when already following. */
.profile-follow-btn.is-following { position: relative; }
.profile-follow-btn.is-following:hover .pf-label { visibility: hidden; }
.profile-follow-btn.is-following:hover::after {
    content: "Unfollow";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.profile-message-btn {
    background: var(--btn-bg-secondary);
    color: var(--btn-text-secondary);
    border-color: var(--line);
}
.profile-message-btn:hover { transform: translateY(-1px); filter: brightness(1.03); }
.profile-message-btn span[aria-hidden] { font-size: 16px; line-height: 1; }

/* ===== Smart Notification Gateway modal ===== */
.cg-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1600;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(8, 10, 14, .55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity .18s var(--ease-premium);
}
.cg-modal-overlay.is-open { opacity: 1; }
.cg-modal {
    position: relative;
    width: min(420px, 100%);
    background: var(--bg-primary);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 24px 22px;
    text-align: center;
    box-shadow: var(--premium-glow);
    transform: translateY(12px) scale(.98);
    transition: transform .18s var(--ease-premium);
}
.cg-modal-overlay.is-open .cg-modal { transform: translateY(0) scale(1); }
.cg-modal-close {
    position: absolute;
    top: 10px;
    inset-inline-end: 12px;
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
}
.cg-modal-icon { font-size: 38px; line-height: 1; }
.cg-modal-title { margin: 12px 0 6px; font-size: 19px; font-weight: 800; }
.cg-modal-body { margin: 0 auto 20px; color: var(--muted); max-width: 320px; font-size: 14px; line-height: 1.45; }
.cg-modal-body b { color: var(--text); }
.cg-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}
.cg-btn {
    appearance: none;
    flex: 1 1 140px;
    min-width: 130px;
    padding: 12px 16px;
    border-radius: 999px;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition: filter .15s var(--ease-premium), transform .15s var(--ease-premium), background .15s var(--ease-premium);
}
.cg-btn:hover { transform: translateY(-1px); }
.cg-btn-primary { background: var(--btn-bg-primary); color: var(--btn-text-primary); }
.cg-btn-primary:hover { filter: brightness(1.05); }
.cg-btn-ghost { background: var(--btn-bg-secondary); color: var(--btn-text-secondary); border-color: var(--line); }
@media (max-width: 380px) {
    .cg-btn, .profile-follow-btn, .profile-message-btn { flex-basis: 100%; }
}

/* ===== Onboarding overlay =====
   Welcoming overlay for new accounts — skippable, not blocking.
   Phone-first layout that grows comfortably on tablets / desktops. */
.onboarding-overlay {
    position: fixed;
    inset: 0;
    z-index: 1500;
    background: rgba(8, 10, 14, .82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: grid;
    place-items: center;
    padding: 16px;
    overflow-y: auto;
}
body.onboarding-active {
    overflow: hidden;
}
.onboarding-overlay .onboarding-card {
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 22px 18px 18px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, .35);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.onboarding-overlay h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
    text-align: center;
}
.onboarding-overlay .onboarding-lede {
    margin: 0;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}
.onboarding-overlay .onboarding-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 6px 0;
}
.onboarding-overlay .onboarding-chip {
    appearance: none;
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: background .12s ease, border-color .12s ease, color .12s ease, transform .12s ease;
}
.onboarding-overlay .onboarding-chip:hover {
    background: rgba(255, 255, 255, .04);
    transform: translateY(-1px);
}
.onboarding-overlay .onboarding-chip.is-active {
    background: var(--brand, #ff315a);
    border-color: var(--brand, #ff315a);
    color: var(--text-on-accent);
}
.onboarding-overlay .onboarding-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .03);
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
}
.onboarding-overlay .onboarding-consent input[type="checkbox"] {
    margin-top: 2px;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    accent-color: var(--brand, #ff315a);
}
.onboarding-overlay .onboarding-counter {
    margin: 0;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}
.onboarding-overlay .primary-btn {
    width: 100%;
    margin-top: 4px;
}
.onboarding-overlay .primary-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}
.onboarding-overlay .onboarding-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}
.onboarding-overlay .secondary-btn {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
}
.onboarding-overlay .secondary-btn:hover {
    background: rgba(255, 255, 255, .04);
    color: var(--text);
}
.onboarding-overlay .onboarding-footnote {
    display: block;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}

/* ===== Onboarding wizard steps (categories -> profile photo) =====
   Direction-agnostic flex/grid layout, so RTL (Arabic) renders correctly
   without overrides; colors come from theme variables for light/night. */
.onboarding-overlay .onboarding-step {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.onboarding-overlay .onboarding-step[hidden] {
    display: none;
}
.onboarding-overlay .onboarding-progress {
    display: flex;
    justify-content: center;
    gap: 8px;
}
.onboarding-overlay .onboarding-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--line);
    transition: background .15s ease, transform .15s ease;
}
.onboarding-overlay .onboarding-dot.is-active {
    background: var(--brand, #ff315a);
    transform: scale(1.15);
}
.onboarding-overlay .onboarding-avatar-preview {
    display: grid;
    place-items: center;
    padding: 6px 0 2px;
}
.onboarding-overlay .onboarding-avatar-preview img {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--line);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
    background: var(--panel);
}
.onboarding-overlay .onboarding-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
}

/* ===== Loopz native ads (honest "Sponsored" disclosure) =====
   The "Sponsored" badge is enforced by CSS even if the renderer is
   bypassed — using absolute positioning and !important ensures it
   stays visible. */
.loopz-ad-item {
    position: relative;
}
.loopz-sponsored-item {
    position: relative;
}
.loopz-sponsored-item::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(255, 215, 107, .34);
}
.loopz-ad-badge {
    position: absolute !important;
    top: 12px;
    left: 12px;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, .68);
    color: var(--text-on-accent);
    border-radius: 999px;
    font-size: 11px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, .18);
}
.loopz-ad-badge span {
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
    color: #ffd76b;
    font-size: 10px;
}
.loopz-ad-badge b {
    font-size: 12px;
}
.loopz-ad-meta {
    padding: 14px;
}
.loopz-ad-meta .loopz-ad-body {
    margin: 6px 0 10px;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.4;
}
.loopz-ad-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    text-decoration: none;
}

/* Sponsor link for Store-account organic Loopz posts. Always shows the
   "Sponsored by @user" disclosure so viewers can distinguish from
   non-paid content. */
.loopz-sponsor-link {
    position: absolute;
    bottom: 110px;
    left: 12px;
    right: 90px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, .58);
    color: var(--text-on-accent);
    border-radius: 12px;
    text-decoration: none;
    font-size: 12px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.loopz-sponsor-link span {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #ffd76b;
    font-weight: 700;
}
.loopz-sponsor-link b {
    font-size: 13px;
    font-weight: 700;
}

/* ===== Account type switcher (Personal / Store) =====
   Lives in Settings; renders as a two-card row with a cooldown countdown
   when applicable. */
.account-type-switcher {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .03);
}
.account-type-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: border-color .12s ease, background .12s ease, transform .12s ease;
    color: var(--text);
    font: inherit;
}
.account-type-card.is-active {
    background: rgba(255, 49, 90, .12);
    border-color: var(--brand, #ff315a);
}
.account-type-card[disabled] {
    opacity: .65;
    cursor: not-allowed;
}
.account-type-card b {
    font-size: 14px;
}
.account-type-card small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}
.account-type-cooldown {
    font-size: 12px;
    color: #ffd76b;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(255, 215, 107, .08);
}
@media (min-width: 600px) {
    .account-type-switcher {
        grid-template-columns: 1fr 1fr;
    }
}

/* ===== Nabdex AI floating button + chat modal ===== */
.nabdex-fab {
    position: fixed;
    right: 16px;
    bottom: 96px;
    z-index: 1300;
    display: none;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    color: var(--text-on-accent);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 36px rgba(124, 58, 237, .35);
    transition: transform .14s ease, box-shadow .14s ease;
}
body[data-page="inbox"] .nabdex-fab:not([hidden]),
body.nabdex-inbox-enabled .nabdex-fab:not([hidden]) {
    display: inline-flex;
}
.nabdex-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(124, 58, 237, .45);
}
.nabdex-fab span {
    font-size: 16px;
}
@media (min-width: 900px) {
    .nabdex-fab {
        right: 28px;
        bottom: 32px;
    }
}
.nabdex-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1450;
    background: rgba(8, 10, 14, .65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: grid;
    place-items: end center;
    padding: 8px;
}
body.nabdex-modal-active {
    overflow: hidden;
}
.nabdex-modal {
    width: 100%;
    max-width: 480px;
    max-height: 86vh;
    margin-bottom: env(safe-area-inset-bottom, 0px);
    display: flex;
    flex-direction: column;
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 22px 22px 16px 16px;
    box-shadow: 0 -18px 60px rgba(0, 0, 0, .4);
    overflow: hidden;
}
.nabdex-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(135deg, rgba(124, 58, 237, .12), rgba(236, 72, 153, .06));
}
.nabdex-modal-head b {
    font-size: 15px;
}
.nabdex-modal-close {
    appearance: none;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    color: var(--text);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}
.nabdex-modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
}
.nabdex-bubble {
    max-width: 86%;
    padding: 8px 12px;
    border-radius: 14px;
    border: 1px solid var(--line);
    font-size: 13px;
    line-height: 1.45;
}
.nabdex-bubble b {
    display: block;
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 3px;
}
.nabdex-bubble p {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}
.nabdex-user {
    align-self: flex-end;
    background: rgba(124, 58, 237, .12);
    border-color: rgba(124, 58, 237, .25);
}
.nabdex-bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, .04);
}
.nabdex-bot.is-offline {
    border-style: dashed;
    opacity: .85;
}
.nabdex-escalate {
    margin-top: 6px;
    appearance: none;
    border: none;
    background: none;
    color: var(--brand, #ff315a);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}
.nabdex-escalate.is-done {
    color: #8be3a8;
    text-decoration: none;
    cursor: default;
}
.nabdex-form {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--line);
    background: var(--panel);
}
.nabdex-form input {
    flex: 1 1 auto;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .04);
    color: var(--text);
    font: inherit;
    font-size: 14px;
}
.nabdex-form .primary-btn {
    padding: 10px 14px;
    font-size: 13px;
}

/* Tag chip used in admin rows (boost queue, etc.). */
.tag-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 215, 107, .12);
    color: #ffd76b;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-top: 4px;
}

/* ===== Creator Studio AI assist button =====
   Sits below the composer textarea. Calls Nabdex with composer context
   and pastes the suggestion back into the title field. */
.creator-ai-assist {
    appearance: none;
    align-self: flex-start;
    margin-top: -2px;
    padding: 9px 14px;
    border: 1px dashed rgba(124, 58, 237, .55);
    border-radius: 999px;
    background: rgba(124, 58, 237, .08);
    color: var(--text);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background .14s ease, transform .14s ease;
}
.creator-ai-assist:hover {
    background: rgba(124, 58, 237, .14);
    transform: translateY(-1px);
}
.creator-ai-assist:disabled {
    opacity: .65;
    cursor: progress;
    transform: none;
}
.creator-ai-assist span {
    color: #ec4899;
    font-size: 15px;
}

/* ===== Google sign-in button (auth pages) ===== */
.google-signin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 14px;
    margin-top: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .04);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background .14s ease, border-color .14s ease;
}
.google-signin-btn:hover {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .22);
}
.google-signin-btn span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4285f4 0%, #ea4335 30%, #fbbc04 60%, #34a853 100%);
    color: var(--text-on-accent);
    font-weight: 800;
    font-size: 13px;
}

/* ===== Report picker (3-dot menu reason flow) ===== */
.report-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 1550;
    display: grid;
    place-items: end center;
}
.report-picker-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 10, 14, .58);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.report-picker-card {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 22px 22px 0 0;
    padding: 16px;
    box-shadow: 0 -18px 60px rgba(0, 0, 0, .4);
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: report-slide .26s cubic-bezier(.22, .61, .36, 1);
}
@keyframes report-slide {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.report-picker-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.report-picker-head b {
    font-size: 15px;
}
.report-picker-close {
    appearance: none;
    border: 1px solid var(--line);
    background: transparent;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
}
.report-picker-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.report-picker-reason {
    appearance: none;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: background .12s ease, border-color .12s ease;
}
.report-picker-reason:hover {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 49, 90, .35);
}
.report-picker-reason.is-sending {
    opacity: .65;
    cursor: progress;
}
.report-picker-detail {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
    color: var(--muted);
}
.report-picker-detail textarea {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, .04);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    resize: vertical;
}
@media (min-width: 760px) {
    .report-picker-overlay {
        place-items: center;
    }
    .report-picker-card {
        border-radius: 18px;
        max-width: 460px;
    }
}

/* ===== Multi-badge display ===== */
.verify-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin: 4px 0;
}
.verify-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    font-size: 11px;
    line-height: 1;
}
.verify-badge i {
    font-style: normal;
    font-size: 13px;
    line-height: 1;
}
.verify-admin {
    background: rgba(0, 162, 255, .14);
    color: #00a2ff;
    border-color: rgba(0, 162, 255, .35);
}
.verify-pro {
    background: rgba(255, 215, 107, .14);
    color: #ffd76b;
    border-color: rgba(255, 215, 107, .35);
}
.verify-id {
    background: rgba(139, 227, 168, .14);
    color: #8be3a8;
    border-color: rgba(139, 227, 168, .35);
}
.verify-company {
    background: rgba(124, 58, 237, .14);
    color: #b794f6;
    border-color: rgba(124, 58, 237, .35);
}

/* ===== Pinned comment + comment row actions ===== */
.pinned-comment,
.is-pinned-comment {
    position: relative;
    background:
        linear-gradient(90deg, rgba(255, 215, 107, .10), transparent 42%),
        color-mix(in srgb, var(--panel) 92%, rgba(255, 215, 107, .10));
    border-left: 3px solid rgba(255, 215, 107, .82);
    box-shadow: inset 9px 0 18px rgba(255, 215, 107, .06);
    padding-left: 10px;
}
.pinned-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    padding: 2px 7px;
    border: 1px solid rgba(255, 215, 107, .28);
    border-radius: 999px;
    background: rgba(255, 215, 107, .12);
    color: #ffd76b;
    font-size: 10px;
    font-weight: 900;
    line-height: 1.2;
    vertical-align: middle;
}
.pinned-label i {
    font-size: 9px;
}
.comment-row-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}
.comment-action {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 11px;
    cursor: pointer;
    padding: 0;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.comment-action:hover {
    color: var(--brand, #ff315a);
}

/* ===== Anti-spam disabled link rendering ===== */
.link-disabled {
    color: var(--text);
    text-decoration: line-through dotted var(--muted);
    text-decoration-thickness: 1px;
    cursor: not-allowed;
    word-break: break-all;
}
.comment-row.is-shadow-boxed {
    border-color: rgba(255, 193, 7, .45);
    background: color-mix(in srgb, var(--panel) 88%, rgba(255, 193, 7, .12));
}
.comment-shadow-badge {
    position: absolute;
    right: 12px;
    top: 8px;
    padding: 3px 8px;
    border: 1px solid rgba(255, 193, 7, .42);
    border-radius: 999px;
    color: #ffd76b;
    font-size: 11px;
    font-weight: 800;
}

.loopz-prebuffer-host {
    position: fixed;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    left: -10px;
    top: -10px;
}
.loopz-prebuffer-host video {
    width: 1px;
    height: 1px;
}

@supports (view-transition-name: root) {
    ::view-transition-old(root) {
        animation: chaabi-route-out .2s var(--ease-premium);
    }
    ::view-transition-new(root) {
        animation: chaabi-route-in .26s var(--ease-premium);
    }
}
@keyframes chaabi-route-out {
    from { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
    to { opacity: .35; transform: translateY(8px) scale(.992); filter: blur(4px); }
}
@keyframes chaabi-route-in {
    from { opacity: .2; transform: translateY(10px) scale(.992); filter: blur(5px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* ===== Video 2x speed indicator (long-press right side) ===== */
.chaabi-custom-player.is-speed-2x {
    outline: 2px solid rgba(255, 215, 107, .8);
    outline-offset: -2px;
}
.video-shell.is-speed-2x::after {
    content: "2x";
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 4;
    padding: 4px 10px;
    background: rgba(255, 215, 107, .92);
    color: var(--text-on-warning);
    font-weight: 900;
    border-radius: 999px;
    font-size: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,.28);
}
.chart-tooltip {
    position: fixed;
    z-index: 90;
    width: 178px;
    display: grid;
    gap: 2px;
    padding: 9px 11px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text-primary);
    box-shadow: 0 14px 34px rgba(0,0,0,.32);
    pointer-events: none;
    font-size: 12px;
    backdrop-filter: blur(12px);
}
.chart-tooltip span,
.chart-tooltip small {
    color: var(--text-secondary);
}

/* ===== Admin-overridden action icon images =====
   Sized to match the emoji glyph metrics so a swap stays pixel-aligned
   inside .metric-action / .icon-btn. */
.action-icon-custom {
    width: 1.05em;
    height: 1.05em;
    vertical-align: -0.18em;
    object-fit: contain;
    display: inline-block;
    transition: transform .12s ease, filter .12s ease;
}
.metric-action.active .action-icon-custom,
.icon-btn.active .action-icon-custom {
    /* Slight visual lift on active state so the toggle remains obvious
       even with a custom icon. */
    filter: drop-shadow(0 0 4px rgba(255, 49, 90, .55));
    transform: scale(1.08);
}

/* ===== Verification queue row tweaks ===== */
.verification-row .mini-input {
    flex: 0 0 auto;
    width: 180px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .04);
    color: var(--text);
    font: inherit;
    font-size: 12px;
}

/* ===== View As feed preview ===== */
.view-as-target {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 10px;
    border: 1px dashed var(--line);
    border-radius: 12px;
}
.view-as-target img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}
.view-as-feed {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}
.chaabi-custom-player.is-speed-2x::after {
    content: "2x";
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    background: rgba(255, 215, 107, .9);
    color: var(--text-on-warning);
    font-weight: 700;
    border-radius: 999px;
    font-size: 12px;
}


/* ===== Engagement prompt overlay (decay / acquisition) ===== */
.engagement-prompt {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 92px;
    z-index: 1350;
    display: flex;
    justify-content: center;
    pointer-events: none;
}
.engagement-prompt-card {
    width: 100%;
    max-width: 420px;
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px 16px 14px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, .35);
    position: relative;
    pointer-events: auto;
    animation: engagement-slide .26s cubic-bezier(.22, .61, .36, 1);
}
@keyframes engagement-slide {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.engagement-prompt-card h3 {
    margin: 0 0 6px;
    font-size: 16px;
}
.engagement-prompt-card h3 em {
    font-style: normal;
    color: var(--brand, #ff315a);
}
.engagement-prompt-card p {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}
.engagement-prompt-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.engagement-prompt-actions .ghost-btn,
.engagement-prompt-actions .primary-btn {
    padding: 8px 14px;
    font-size: 13px;
}
.engagement-prompt-close {
    position: absolute;
    top: 8px;
    right: 8px;
    appearance: none;
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 18px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
}
.engagement-prompt-close:hover {
    background: rgba(255, 255, 255, .06);
    color: var(--text);
}
@media (min-width: 900px) {
    .engagement-prompt {
        left: auto;
        right: 28px;
        bottom: 28px;
        justify-content: flex-end;
    }
}

/* ===== Local Radar newbie matchmaking ===== */
.local-radar-overlay {
    position: fixed;
    inset: 0;
    z-index: 1380;
    display: grid;
    align-items: end;
    justify-items: center;
    padding: 16px;
    background: linear-gradient(180deg, rgba(4, 6, 12, .08), rgba(4, 6, 12, .62));
}
.local-radar-card {
    width: min(100%, 460px);
    max-height: min(78vh, 620px);
    overflow: auto;
    position: relative;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 18px;
    background: rgba(12, 15, 24, .86);
    color: var(--text-on-accent);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .46);
    backdrop-filter: blur(18px);
    padding: 18px;
    animation: engagement-slide .26s cubic-bezier(.22, .61, .36, 1);
}
.local-radar-card > span {
    display: inline-flex;
    margin-bottom: 8px;
    color: #22d3ee;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.local-radar-card h3 {
    margin: 0 30px 14px 0;
    font-size: 18px;
    line-height: 1.25;
}
.local-radar-card > small {
    display: block;
    margin-top: 12px;
    color: rgba(255, 255, 255, .62);
}
.local-radar-people {
    display: grid;
    gap: 8px;
}
.local-radar-person {
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .06);
    border-radius: 14px;
}
.local-radar-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: var(--text-on-accent);
    font-size: 18px;
    cursor: pointer;
}
.ai-knowledge-form {
    display: grid;
    gap: 10px;
    width: 100%;
}
.ip-radar-panel {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 14px;
    background: rgba(255, 255, 255, .04);
}
.ip-radar-list {
    display: grid;
    gap: 8px;
    max-height: 260px;
    overflow: auto;
}
.ip-radar-row.is-target {
    border-color: rgba(128, 0, 128, .5);
}
.ip-radar-actions {
    justify-content: flex-end;
}
@media (min-width: 900px) {
    .local-radar-overlay {
        align-items: center;
        justify-items: end;
        padding-right: 32px;
    }
}

/* ===== Offline banner =====
   Briefly appears when api() serves cached content because the network
   call failed. */
.offline-banner,
.offline-badge {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1600;
    padding: 10px 16px;
    background: rgba(8, 10, 14, .82);
    color: var(--text-on-accent);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    font-size: 13px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
    animation: offline-fade .3s ease;
}
@keyframes offline-fade {
    from { opacity: 0; transform: translate(-50%, -8px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ===== Realtime chat micro-states ===== */
.typing-indicator {
    display: block;
    margin-top: 3px;
    color: var(--accent-purple, #a855f7);
    font-size: 12px;
    font-weight: 700;
}
.typing-indicator[hidden] {
    display: none;
}
.active-chat-typing {
    padding: 6px 10px;
    animation: realtime-typing-pulse 1.1s ease-in-out infinite;
}
.realtime-message {
    animation: realtime-message-enter .2s ease-out;
}
.assistant-suggestion-hint {
    display: grid;
    gap: 4px;
    margin: 10px 8px;
    padding: 10px 12px;
    border-left: 3px solid var(--accent-purple, #a855f7);
    border-radius: 8px;
    background: rgba(128, 0, 128, .09);
    color: var(--text);
    animation: realtime-message-enter .2s ease-out;
}
.assistant-suggestion-hint b {
    color: var(--accent-purple, #a855f7);
    font-size: 12px;
}
.assistant-suggestion-hint span {
    font-size: 13px;
    line-height: 1.45;
}
@keyframes realtime-message-enter {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes realtime-typing-pulse {
    0%, 100% { opacity: .56; }
    50% { opacity: 1; }
}

/* ===== Marketplace escrow tracker ===== */
.escrow-widget {
    display: grid;
    gap: 10px;
}
.escrow-widget .section-head small {
    color: var(--muted);
    font-size: 12px;
}
.escrow-list {
    display: grid;
    gap: 8px;
}
.escrow-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px 12px;
    padding: 11px 12px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-left: 3px solid rgba(148, 163, 184, .72);
    border-radius: 8px;
    background: rgba(255, 255, 255, .035);
}
.escrow-row b,
.escrow-row small {
    display: block;
}
.escrow-row small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}
.escrow-row strong {
    color: var(--text);
    white-space: nowrap;
}
.escrow-status {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}
.escrow-actions {
    display: flex;
    grid-column: 1 / -1;
    justify-content: flex-end;
    gap: 7px;
}
.escrow-held {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, .055);
}
.escrow-held .escrow-status,
.escrow-disputed .escrow-status {
    color: #fbbf24;
}
.escrow-released {
    border-left-color: #22c55e;
    background: rgba(34, 197, 94, .055);
}
.escrow-released .escrow-status {
    color: #4ade80;
}
.escrow-disputed {
    border-left-color: #f97316;
    background: rgba(249, 115, 22, .075);
}
.escrow-refunded {
    border-left-color: #38bdf8;
    background: rgba(56, 189, 248, .055);
}
.escrow-refunded .escrow-status {
    color: #7dd3fc;
}
@media (max-width: 520px) {
    .escrow-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }
    .escrow-status {
        grid-column: 1 / -1;
    }
}

/* ===== Unified administration workspace ===== */
.system-admin-loading {
    display: grid;
    place-items: center;
    min-height: 55vh;
    color: var(--muted);
}
.system-admin-shell {
    display: grid;
    position: relative;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: calc(100vh - 68px);
    background: var(--bg-secondary);
    color: var(--text-primary);
}
.system-admin-scrim {
    display: none;
}
.system-admin-side {
    position: sticky;
    top: 0;
    height: calc(100vh - 68px);
    overflow-y: auto;
    padding: 20px 14px;
    border-right: 1px solid rgba(148, 163, 184, .14);
    background: var(--panel);
    color: var(--text-primary);
    z-index: 20;
}
.system-admin-brand {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 8px 20px;
}
.system-admin-side-close,
.system-admin-menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--btn-bg-secondary);
    color: var(--btn-text-secondary);
    font-size: 20px;
    font-weight: 900;
    cursor: pointer;
}
.system-admin-brand small,
.system-admin-head small,
.system-admin-section-head small {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}
.system-admin-brand b {
    font-size: 18px;
}
.system-admin-side nav {
    display: grid;
    gap: 4px;
}
.system-admin-nav-group {
    margin: 14px 10px 3px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.system-admin-nav-group:first-child {
    margin-top: 0;
}
.system-admin-side button {
    padding: 11px 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.system-admin-side button:hover,
.system-admin-side button.active {
    border-color: rgba(168, 85, 247, .3);
    background: rgba(128, 0, 128, .15);
    color: var(--text-primary);
}
.system-admin-main {
    min-width: 0;
    padding: 20px clamp(14px, 3vw, 30px) 36px;
}
.system-admin-head,
.system-admin-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.system-admin-head {
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(148, 163, 184, .14);
    color: var(--text-primary);
}
.system-admin-head h1,
.system-admin-section-head h2,
.system-admin-form h3 {
    margin: 4px 0 0;
    letter-spacing: 0;
}
.system-admin-head h1 {
    font-size: clamp(22px, 3vw, 30px);
}
.system-admin-section-head h2 {
    font-size: 20px;
}
.system-admin-secure {
    padding: 6px 9px;
    border: 1px solid rgba(34, 197, 94, .34);
    border-radius: 999px;
    background: rgba(34, 197, 94, .08);
    color: #86efac;
    font-size: 12px;
    font-weight: 800;
}
.system-admin-panel {
    padding: 20px 0;
}
.system-admin-panel[hidden] {
    display: none;
}

/* ===== Real-time DM chat shell ===== */
.chat-shell-overlay {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: flex;
    justify-content: flex-end;
    background: rgba(8, 10, 14, .45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity .18s var(--ease-premium);
}
.chat-shell-overlay.open { opacity: 1; }
.chat-shell {
    display: flex;
    flex-direction: column;
    width: min(440px, 100%);
    height: 100%;
    background: var(--bg-primary);
    border-inline-start: 1px solid var(--line);
    box-shadow: -18px 0 60px rgba(0, 0, 0, .28);
    transform: translateX(24px);
    transition: transform .2s var(--ease-premium);
}
.chat-shell-overlay.open .chat-shell { transform: translateX(0); }
.chat-shell-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}
.chat-shell-back {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 0 6px;
}
.chat-shell-peer {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    min-width: 0;
}
.chat-shell-peer img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}
.chat-shell-peer b { display: block; font-size: 15px; }
.chat-shell-peer small { color: var(--muted); font-size: 12px; }
.active-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-secondary);
}
.active-chat-messages .chat-message b { display: none; }
.chat-message {
    max-width: 78%;
    padding: 9px 13px;
    border-radius: 16px;
    background: var(--panel);
    border: 1px solid var(--line);
    color: var(--text);
    align-self: flex-start;
}
.chat-message p { margin: 0; word-wrap: break-word; overflow-wrap: anywhere; }
.chat-message small {
    display: block;
    margin-top: 3px;
    font-size: 10px;
    color: var(--muted);
    text-align: end;
}
.chat-message.is-me {
    align-self: flex-end;
    background: var(--btn-bg-primary);
    border-color: var(--btn-bg-primary);
    color: var(--btn-text-primary);
}
.chat-message.is-me small { color: rgba(255, 255, 255, .8); }
.chat-empty { margin: auto; }
.active-chat-typing,
.assistant-suggestion-hint {
    align-self: flex-start;
    font-size: 12px;
    color: var(--muted);
    padding: 4px 8px;
}
.assistant-suggestion-hint {
    background: var(--panel);
    border: 1px dashed var(--line);
    border-radius: 12px;
    color: var(--text);
}
.assistant-suggestion-hint b { display: block; font-size: 11px; color: var(--accent-purple); }
.chat-compose {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--line);
    background: var(--panel);
}
.chat-compose textarea {
    flex: 1;
    resize: none;
    max-height: 120px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--input-bg);
    color: var(--text);
    font: inherit;
    line-height: 1.35;
}
.chat-compose textarea:focus { outline: none; border-color: var(--btn-bg-primary); }
.chat-send-btn {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: var(--btn-bg-primary);
    color: var(--btn-text-primary);
    font-size: 17px;
    cursor: pointer;
    transition: filter .15s var(--ease-premium), transform .15s var(--ease-premium);
}
.chat-send-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.chat-attach-btn {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background .15s var(--ease-premium), color .15s var(--ease-premium);
}
.chat-attach-btn:hover { background: var(--bg-secondary); color: var(--text); }
/* Media attachments inside chat bubbles */
.chat-message.has-media { padding: 5px; }
.chat-message.has-media p { padding: 4px 8px 0; }
.chat-media-link { display: block; }
.chat-media {
    display: block;
    max-width: 100%;
    width: auto;
    max-height: 320px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--media-bg);
}
.chat-message.is-uploading { opacity: .65; }
.chat-message.is-uploading small::after {
    content: " ⏳";
}
.chat-media[data-lightbox], .chat-media-video { cursor: zoom-in; }
/* Inline video bubble with a play badge (tap opens the lightbox) */
.chat-media-video { position: relative; display: inline-block; line-height: 0; }
.chat-video-play {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 18px;
    pointer-events: none;
}
/* Document chip */
.chat-doc {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
    max-width: 260px;
    padding: 9px 11px;
    border-radius: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--line);
    text-decoration: none;
    color: var(--text);
}
.chat-message.is-me .chat-doc {
    background: rgba(255, 255, 255, .16);
    border-color: rgba(255, 255, 255, .25);
    color: var(--btn-text-primary);
}
.chat-doc-ext {
    flex: 0 0 auto;
    width: 38px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: var(--btn-bg-primary);
    color: var(--btn-text-primary);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .3px;
}
.chat-doc-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
}
.chat-doc-dl { flex: 0 0 auto; font-size: 16px; opacity: .8; }

/* ===== Media lightbox ===== */
.media-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1700;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .92);
    opacity: 0;
    transition: opacity .2s var(--ease-premium);
    overscroll-behavior: contain;
}
.media-lightbox.open { opacity: 1; }
.lightbox-stage {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 24px;
}
.lightbox-media {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: center center;
    transition: transform .04s linear;
    cursor: zoom-in;
    will-change: transform;
    user-select: none;
    -webkit-user-drag: none;
}
.lightbox-media.is-zoomed { cursor: grab; }
.lightbox-close {
    position: absolute;
    top: 14px;
    inset-inline-end: 16px;
    z-index: 2;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s var(--ease-premium);
}
.lightbox-close:hover { background: rgba(255, 255, 255, .26); }
body.lightbox-active { overflow: hidden; }

/* ===== DM gallery grid (multi-attachment) ===== */
.chat-gallery {
    display: grid;
    gap: 3px;
    max-width: 280px;
    border-radius: 12px;
    overflow: hidden;
}
.chat-gallery.is-single {
    display: block;
    max-width: none;
    overflow: visible;
}
.chat-gallery-2, .chat-gallery-3, .chat-gallery-4 { grid-template-columns: 1fr 1fr; }
.chat-gallery-3 .chat-gallery-tile:first-child { grid-column: 1 / -1; }
.chat-gallery-tile {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    cursor: zoom-in;
    background: var(--media-bg);
}
.chat-gallery-tile .chat-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    max-height: none;
}
.chat-gallery.is-single .chat-gallery-tile {
    aspect-ratio: auto;
    background: transparent;
}
.chat-gallery.is-single .chat-gallery-tile .chat-media {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 320px;
    object-fit: contain;
    border-radius: 12px;
}
/* +N overflow tile */
.chat-gallery .chat-gallery-tile.has-more::after {
    content: attr(data-more);
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 22px;
    font-weight: 800;
}
.chat-gallery.has-overflow .chat-gallery-tile:nth-child(n+5) { display: none; }
.chat-doc-list { display: grid; gap: 6px; margin-top: 3px; }
.chat-doc-list .chat-doc { max-width: none; }

/* ===== Lightbox gallery navigation ===== */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s var(--ease-premium);
}
.lightbox-nav:hover { background: rgba(255, 255, 255, .26); }
.lightbox-prev { inset-inline-start: 14px; }
.lightbox-next { inset-inline-end: 14px; }
.lightbox-counter {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    background: rgba(0, 0, 0, .45);
    padding: 4px 12px;
    border-radius: 999px;
}
@media (max-width: 540px) {
    .chat-gallery { max-width: 220px; }
    .lightbox-nav { width: 40px; height: 40px; font-size: 24px; }
}
@media (max-width: 540px) {
    .chat-shell { width: 100%; border-inline-start: 0; }
    .chat-message { max-width: 86%; }
    .chat-media { max-height: 260px; }
}

/* ===== Admin inline search rows (user directory, moderation) ===== */
.admin-search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 10px 0 14px;
}
.admin-search-row input[type="search"] {
    flex: 1 1 240px;
    min-width: 180px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--input-bg);
    color: var(--text);
    font: inherit;
}
.admin-search-row input[type="search"]:focus {
    outline: none;
    border-color: var(--btn-bg-primary);
}

/* ===== Ops & Safety desk ===== */
.ops-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}
@media (min-width: 900px) {
    .ops-grid { grid-template-columns: 1fr 1fr; }
    .ops-grid > .ops-card:last-child { grid-column: 1 / -1; }
}
.ops-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    padding: 16px;
}
.ops-metric-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 9px;
    padding: 10px 0 14px;
}
.ops-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 10px;
}
.ops-inline-field {
    display: grid;
    gap: 4px;
    font-size: 12px;
    color: var(--muted);
}
.ops-inline-field input {
    width: 110px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--text);
}
.ops-escrow-list {
    display: grid;
    gap: 12px;
}
.ops-escrow-row {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg-secondary);
}
.ops-escrow-main b { display: block; }
.ops-escrow-main small { display: block; color: var(--muted); }
.ops-dispute-reason { font-style: italic; }
.ops-escrow-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.ops-escrow-reason {
    flex: 1 1 200px;
    min-width: 160px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--text);
}
.ops-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}
.ops-badge-held { background: rgba(245, 158, 11, .18); color: #b45309; }
.ops-badge-disputed { background: rgba(239, 68, 68, .18); color: #b91c1c; }
.ops-audit-list {
    display: grid;
    gap: 8px;
    max-height: 340px;
    overflow-y: auto;
}
.ops-audit-row {
    display: grid;
    gap: 2px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg-secondary);
}
.ops-audit-row b { font-size: 13px; }
.ops-audit-row small { color: var(--muted); font-size: 12px; }
.ops-audit-detail { color: var(--text) !important; }
.ops-audit-time { opacity: .75; }
.mini-btn.is-positive { color: #16a34a; border-color: rgba(22, 163, 74, .4); }
.mini-btn.is-danger { color: #dc2626; border-color: rgba(220, 38, 38, .4); }
.ops-error { color: #dc2626; font-size: 13px; }
.system-admin-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 9px;
    padding-top: 15px;
}
.system-admin-group-title {
    margin: 20px 0 0;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .3px;
    color: var(--muted);
    text-transform: uppercase;
}
/* ===== Analytics Hub: granular range explorer ===== */
.analytics-explorer { margin-bottom: 18px; }
.analytics-explorer-form select {
    flex: 0 0 auto;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--input-bg);
    color: var(--text);
    font: inherit;
}
.analytics-explorer-form select:focus {
    outline: none;
    border-color: var(--btn-bg-primary);
}
.analytics-explorer-results { margin-top: 12px; }
.analytics-explorer-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 12px;
}
.analytics-explorer-summary b {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
}
.analytics-explorer-summary span {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
    color: var(--muted);
}
/* ===== System Settings: 8-group sub-tab nav ===== */
.settings-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}
.settings-subtab {
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--muted);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.settings-subtab:hover { color: var(--text); }
.settings-subtab.active {
    background: var(--btn-bg-primary);
    border-color: var(--btn-bg-primary);
    color: #fff;
}
.settings-group-form[hidden] { display: none; }
.settings-group-form .settings-hint { margin-bottom: 14px; }
/* ===== User Management directory + workspace ===== */
.people-online-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
}
.people-table {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}
.people-row {
    display: grid;
    grid-template-columns: 40px minmax(140px, 1.4fr) minmax(160px, 1.6fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.people-row:hover { border-color: var(--btn-bg-primary); }
.people-row.active { border-color: var(--btn-bg-primary); background: var(--input-bg); }
.people-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--input-bg);
}
.people-avatar.lg { width: 64px; height: 64px; }
.people-id { display: flex; flex-direction: column; min-width: 0; }
.people-id b, .people-meta small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people-id small, .people-meta small { color: var(--muted); font-size: 12px; }
.people-meta { display: flex; flex-direction: column; min-width: 0; }
.people-flags { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.people-chip {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--input-bg);
    color: var(--muted);
}
.people-chip.is-verified { background: rgba(59, 130, 246, .15); color: #3b82f6; }
.people-chip.is-2fa { background: rgba(139, 92, 246, .15); color: #8b5cf6; }
.people-chip.is-frozen { background: rgba(239, 68, 68, .15); color: #ef4444; }
.people-chip.is-online { background: rgba(34, 197, 94, .15); color: #22c55e; }
.people-detail {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
}
.people-detail[hidden] { display: none; }
.people-detail-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}
.people-detail-head h3 { margin: 0; }
.people-detail-head h3 small { color: var(--muted); font-weight: 500; }
.people-detail-head p { margin: 4px 0 6px; color: var(--muted); font-size: 13px; }
.people-detail-head > button { margin-left: auto; align-self: flex-start; }
.people-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}
.people-detail-tabs { margin-top: 0; }
.people-subpanel[hidden] { display: none; }
.people-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.people-data-table th, .people-data-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
}
.people-data-table th { color: var(--muted); font-weight: 700; }
.people-data-table td.is-neg { color: #ef4444; }
.people-data-table td.is-pos { color: #22c55e; }
@media (max-width: 640px) {
    .people-row { grid-template-columns: 36px 1fr auto; }
    .people-row .people-meta { display: none; }
}
/* ===== Synthetic bot manager ===== */
.bot-roster { margin-top: 10px; }
.bot-roster .people-row { grid-template-columns: 40px 1fr auto; }
.bot-editor-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}
@media (min-width: 900px) {
    .bot-editor-grid { grid-template-columns: 1fr 1fr; }
    .bot-editor-grid > form[data-bot-form="profile"] { grid-column: 1 / -1; }
}
.bot-editor-grid h4 {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 800;
}
.people-mode-nav { margin-bottom: 16px; }
/* ===== Verification review desk ===== */
.verify-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.verify-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.6fr) auto auto;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
}
.verify-acct { display: flex; align-items: center; gap: 12px; min-width: 0; }
.verify-doc {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--input-bg);
    color: var(--muted);
    font-weight: 800;
    text-decoration: none;
}
.verify-doc img { width: 100%; height: 100%; object-fit: cover; }
.verify-doc img.is-broken { display: none; }
.verify-doc span {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2px 0;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    color: #fff;
    background: rgba(0, 0, 0, .55);
}
.verify-doc-pdf { flex-direction: column; gap: 2px; color: var(--text); }
.verify-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: flex-end; }
.verify-row-actions small { color: var(--muted); font-size: 12px; max-width: 220px; }
.verify-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, .5);
}
.verify-modal[hidden] { display: none; }
.verify-modal-card {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    border-radius: 16px;
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.verify-modal-card h3 { margin: 0 0 6px; }
.verify-modal-card textarea {
    width: 100%;
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--text);
    font: inherit;
    resize: vertical;
}
.verify-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.primary-btn.is-danger { background: #ef4444; border-color: #ef4444; }
@media (max-width: 640px) {
    .verify-row { grid-template-columns: 1fr auto; }
    .verify-row .verify-row-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
.system-admin-metric {
    display: grid;
    gap: 8px;
    min-height: 90px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-left: 3px solid #64748b;
    border-radius: 7px;
    background: var(--panel);
    color: var(--text-primary);
}
.system-admin-metric small {
    color: var(--text-secondary);
    font-size: 12px;
}
.system-admin-metric b {
    align-self: end;
    color: var(--text-primary);
    font-size: 21px;
}
.system-admin-metric.is-green { border-left-color: #22c55e; }
.system-admin-metric.is-purple { border-left-color: #a855f7; }
.system-admin-metric.is-blue { border-left-color: #38bdf8; }
.system-admin-metric.is-amber { border-left-color: #f59e0b; }
.system-admin-stack {
    display: grid;
    gap: 8px;
    padding-top: 15px;
}
.system-admin-record {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 7px;
    background: var(--panel);
    color: var(--text-primary);
}
.system-admin-record img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}
.system-admin-record b,
.system-admin-record small {
    display: block;
}
.system-admin-record small {
    margin-top: 3px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
}
.system-admin-record.is-disputed {
    grid-template-columns: auto minmax(0, 1fr) auto;
    border-color: rgba(245, 158, 11, .3);
    background: rgba(245, 158, 11, .05);
}
.system-admin-warning {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    background: rgba(245, 158, 11, .17);
    color: #fbbf24;
    font-weight: 900;
    animation: system-admin-alert 1.5s ease-in-out infinite;
}
.system-admin-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}
.system-admin-actions .is-positive {
    border-color: rgba(34, 197, 94, .35);
    color: #86efac;
}
.system-admin-actions .is-danger {
    border-color: rgba(248, 113, 113, .35);
    color: #fca5a5;
}
.system-admin-form {
    display: grid;
    gap: 14px;
    max-width: none;
    padding-top: 16px;
}
.system-admin-ip-form {
    margin-top: 20px;
    padding: 16px;
    border: 1px solid rgba(245, 158, 11, .26);
    border-radius: 7px;
    background: rgba(245, 158, 11, .045);
}
.system-admin-form p {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}
.system-admin-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.system-admin-form label {
    display: grid;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
}
.system-admin-form input,
.system-admin-form select,
.system-admin-form textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-primary);
}
.system-admin-form input,
.system-admin-form select {
    min-height: 42px;
    padding: 9px 10px;
}
.system-admin-form textarea {
    padding: 10px;
    resize: vertical;
}
.system-admin-form input:focus,
.system-admin-form select:focus,
.system-admin-form textarea:focus {
    border-color: rgba(168, 85, 247, .7);
    outline: 2px solid rgba(168, 85, 247, .14);
}
.system-admin-check {
    display: flex !important;
    align-items: center;
    gap: 8px !important;
}
.system-admin-check input {
    width: 18px;
    min-height: 18px;
}
.system-admin-form .primary-btn {
    width: max-content;
}
.system-admin-note {
    padding-left: 9px;
    border-left: 2px solid rgba(168, 85, 247, .54);
}
.system-admin-vault {
    display: grid;
    gap: 10px;
    margin-top: 15px;
    padding: 13px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-left: 3px solid #f59e0b;
    border-radius: 7px;
    background: rgba(245, 158, 11, .045);
}
.system-admin-vault.is-ready {
    border-left-color: #22c55e;
    background: rgba(34, 197, 94, .045);
}
.system-admin-vault b,
.system-admin-vault small {
    display: block;
}
.system-admin-vault small,
.system-admin-vault p {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
}
.system-admin-diagnostics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.system-admin-diagnostics span {
    padding: 5px 7px;
    border: 1px solid rgba(245, 158, 11, .26);
    border-radius: 5px;
    color: #fbbf24;
    font-size: 11px;
    font-weight: 800;
}
.system-admin-diagnostics .is-ready {
    border-color: rgba(34, 197, 94, .28);
    color: #86efac;
}
.system-admin-users {
    display: grid;
    gap: 8px;
    max-height: 650px;
    margin-top: 14px;
    overflow: auto;
}
.system-admin-user {
    display: grid;
    grid-template-columns: auto minmax(180px, 1fr) minmax(110px, auto) minmax(260px, auto);
    align-items: center;
    gap: 10px;
    padding: 11px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 7px;
    background: var(--panel);
    color: var(--text-primary);
}
.system-admin-user img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}
.system-admin-user-main small,
.system-admin-user label span {
    display: block;
    margin-top: 3px;
    color: var(--text-secondary);
    font-size: 11px;
}
.system-admin-user select {
    max-width: 120px;
    min-height: 34px;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 5px;
    background: var(--input-bg);
    color: var(--text-primary);
}
.system-admin-control-map {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
    padding-top: 15px;
}
.system-admin-control-link {
    display: grid;
    gap: 7px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 7px;
    background: var(--panel);
    color: var(--text-primary);
    text-decoration: none;
    transition: border-color .18s ease, background .18s ease;
}
.system-admin-control-link:hover {
    border-color: rgba(168, 85, 247, .48);
    background: rgba(128, 0, 128, .12);
}
.system-admin-control-link small {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
}
.system-admin-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.rank-admin-actions {
    justify-content: flex-start;
    margin-top: 12px;
}
.rank-admin-table,
.ai-knowledge-grid {
    display: grid;
    gap: 8px;
    min-width: 760px;
}
.rank-admin-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(130px, .7fr) minmax(160px, .8fr) minmax(130px, .7fr) auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}
.rank-admin-row.is-head {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}
.rank-admin-row small {
    display: block;
    color: var(--text-secondary);
}
.ai-knowledge-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.2fr) minmax(120px, .5fr) auto;
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}
.ai-knowledge-row textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    background: var(--input-bg);
    color: var(--text-primary);
}
.system-admin-money-grid,
.system-admin-bot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    align-items: start;
}
.system-admin-card {
    display: grid;
    gap: 14px;
    margin-top: 15px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text-primary);
}
.algorithm-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}
.algorithm-stat-card {
    display: grid;
    gap: 5px;
    padding: 13px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
}
.algorithm-stat-card b {
    color: var(--muted);
    font-size: 12px;
}
.algorithm-stat-card span {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 800;
}
.algorithm-settings-list,
.algorithm-user-profile {
    display: grid;
    gap: 10px;
}
.algorithm-setting-row {
    grid-template-columns: minmax(0, 1fr) minmax(90px, 140px) auto;
    align-items: center;
}
.algorithm-control-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: clamp(18px, 3vw, 30px);
    border: 1px solid rgba(168, 85, 247, .24);
    border-radius: 18px;
    background:
        radial-gradient(circle at 88% 12%, rgba(124, 58, 237, .22), transparent 34%),
        color-mix(in srgb, var(--panel) 92%, transparent);
}
.algorithm-control-hero h2,
.algorithm-control-hero p {
    margin: 0;
}
.algorithm-control-hero h2 {
    margin-top: 4px;
    font-size: clamp(24px, 4vw, 38px);
}
.algorithm-control-hero p {
    max-width: 720px;
    margin-top: 8px;
    color: var(--text-secondary);
}
.algorithm-control-hero > div > small {
    color: #a855f7;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.algorithm-live-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid rgba(34, 197, 94, .28);
    border-radius: 999px;
    background: rgba(34, 197, 94, .08);
    color: #22c55e;
    font-size: 12px;
    font-weight: 900;
}
.algorithm-live-badge i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 5px rgba(34, 197, 94, .12);
}
.algorithm-health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 10px;
    margin-top: 14px;
}
.algorithm-health-card {
    display: grid;
    gap: 4px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
}
.algorithm-health-card small,
.algorithm-health-card span {
    color: var(--text-secondary);
}
.algorithm-health-card b {
    font-size: 22px;
}
.algorithm-health-card span {
    font-size: 11px;
}
.algorithm-explainer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0;
    padding: 12px 14px;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--panel);
    white-space: nowrap;
}
.algorithm-explainer b {
    margin-right: auto;
}
.algorithm-explainer span {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 800;
}
.algorithm-explainer i {
    width: 24px;
    height: 1px;
    background: linear-gradient(90deg, #7c3aed, #22d3ee);
}
.algorithm-sticky-actions {
    position: sticky;
    top: 72px;
    z-index: 12;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 14px 0;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: color-mix(in srgb, var(--panel) 94%, transparent);
    box-shadow: 0 12px 34px rgba(2, 6, 23, .18);
    backdrop-filter: blur(16px);
}
.algorithm-sticky-actions span {
    color: var(--text-secondary);
    font-size: 12px;
}
.algorithm-sticky-actions #algorithm-blend-status {
    margin-left: auto;
}
.algorithm-sticky-actions #algorithm-blend-status.is-warning {
    color: #f59e0b;
    font-weight: 900;
}
.algorithm-controls {
    display: grid;
    gap: 12px;
}
.algorithm-control-group {
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--panel);
}
.algorithm-control-group summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 16px;
    cursor: pointer;
    list-style: none;
}
.algorithm-control-group summary::-webkit-details-marker {
    display: none;
}
.algorithm-control-group summary span {
    display: grid;
    gap: 2px;
}
.algorithm-control-group summary small {
    color: var(--text-secondary);
}
.algorithm-control-group summary i {
    font-style: normal;
    font-size: 20px;
    transition: transform .18s ease;
}
.algorithm-control-group[open] summary i {
    transform: rotate(45deg);
}
.algorithm-control-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 10px;
    padding: 0 12px 12px;
}
.algorithm-control-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 13px;
    border: 1px solid var(--border-color);
    border-radius: 11px;
    background: var(--bg-secondary);
    transition: border-color .18s ease, box-shadow .18s ease;
}
.algorithm-control-card.is-dirty {
    border-color: rgba(168, 85, 247, .65);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .08);
}
.algorithm-control-copy {
    min-width: 0;
    display: grid;
    gap: 4px;
}
.algorithm-control-copy small {
    color: var(--text-secondary);
    line-height: 1.35;
}
.algorithm-control-value output {
    color: #a855f7;
    font-size: 18px;
    font-weight: 900;
}
.algorithm-range {
    grid-column: 1 / -1;
    width: 100%;
    accent-color: #7c3aed;
}
.algorithm-control-input {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}
.algorithm-control-input input {
    width: 100%;
}
.algorithm-workbench {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}
.algorithm-category-list {
    display: grid;
}
.algorithm-category-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) repeat(2, minmax(100px, .45fr));
    gap: 12px;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid var(--border-color);
}
.algorithm-category-row:last-child {
    border-bottom: 0;
}
.algorithm-category-row span {
    min-width: 0;
    display: grid;
    gap: 2px;
}
.algorithm-category-row small {
    color: var(--text-secondary);
}
.algorithm-inspector-result {
    margin-top: 14px;
}
.system-admin-bot-health p {
    margin: 7px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
}
.system-admin-two-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    align-items: start;
}
.system-admin-pulse-card canvas {
    width: 100%;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
}
.system-admin-ledger,
.system-admin-earners,
.system-admin-bot-status,
.system-admin-bot-summary section {
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: var(--panel);
}
.system-admin-earners {
    grid-column: 1 / -1;
}
.system-admin-budget-bar {
    position: relative;
    height: 14px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 999px;
    background: var(--bg-secondary);
}
.system-admin-budget-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22c55e, #a855f7);
}
.system-admin-budget-bar span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 10px;
    color: var(--text-primary);
}
.system-admin-earner-row,
.system-admin-ledger-row,
.system-admin-bot-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    align-items: end;
    padding: 10px 0;
    border-bottom: 1px solid rgba(148, 163, 184, .1);
}
.system-admin-ledger-row {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    align-items: center;
}
.system-admin-bot-row {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
}
.system-admin-bot-row img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(168, 85, 247, .5);
}
.system-admin-earner-row:last-child,
.system-admin-ledger-row:last-child,
.system-admin-bot-row:last-child {
    border-bottom: 0;
}
.system-admin-earner-row label,
.system-admin-ledger-row small,
.system-admin-bot-row small {
    min-width: 0;
}
.system-admin-earner-row input {
    width: 100%;
}
.system-admin-bot-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    grid-column: 1 / -1;
}
.system-admin-bot-status {
    grid-column: 1 / -1;
}
.system-admin-bot-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.system-admin-broadcast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    align-items: start;
}
.system-admin-broadcast-grid > .system-admin-metrics,
.system-admin-geo-list {
    grid-column: 1 / -1;
}
.wilaya-matrix {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    max-height: 280px;
    overflow: auto;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: var(--bg-secondary);
}
.wilaya-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 7px;
    background: var(--input-bg);
    color: var(--text-secondary);
    font-size: 12px;
}
.push-permission-banner {
    position: fixed;
    left: max(14px, env(safe-area-inset-left));
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(82px + env(safe-area-inset-bottom));
    z-index: 1200;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    max-width: 760px;
    margin: 0 auto;
    padding: 12px;
    border: 1px solid rgba(168, 85, 247, .32);
    border-radius: 10px;
    background: var(--panel);
    color: var(--text-primary);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .38);
    backdrop-filter: blur(18px);
}
.push-permission-banner b {
    display: block;
    font-size: 14px;
}
.push-permission-banner small {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.35;
}
.video-shell {
    position: relative;
}
.video-runtime-overlay {
    pointer-events: none;
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    z-index: 4;
}
.video-runtime-overlay > * {
    pointer-events: auto;
}
.video-loading-spinner {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .25);
    border-top-color: var(--text-on-accent);
    animation: chaabi-video-spin .78s linear infinite;
}
.video-retry-badge {
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 999px;
    padding: 10px 16px;
    background: rgba(15, 23, 42, .82);
    color: var(--text-on-accent);
    font-weight: 800;
    backdrop-filter: blur(12px);
}
.video-like-burst {
    color: var(--text-on-accent);
    font-size: 72px;
    text-shadow: 0 14px 36px rgba(0, 0, 0, .45);
    transform: scale(.68);
    opacity: 0;
}
.video-like-burst.is-active {
    animation: chaabi-like-burst .62s cubic-bezier(.175, .885, .32, 1.275);
}
@keyframes chaabi-video-spin {
    to { transform: rotate(360deg); }
}
@keyframes chaabi-like-burst {
    0% { opacity: 0; transform: scale(.55); }
    35% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 0; transform: scale(1.28); }
}
@keyframes system-admin-alert {
    0%, 100% { opacity: .72; transform: scale(.94); }
    50% { opacity: 1; transform: scale(1); }
}

/* ===== TikTok-style Create camera ===== */
body.camera-create-active {
    overflow: hidden;
    background: #000;
}
body.camera-create-active .sidebar,
body.camera-create-active .topbar,
body.camera-create-active .mobile-nav,
body.camera-create-active .bottom-nav,
body.camera-create-active .mobile-dock,
body.camera-create-active .nabdex-fab {
    display: none !important;
}
body.camera-create-active .content {
    margin: 0;
    padding: 0;
}
body.camera-create-active #app-root {
    min-height: 100vh;
}
.camera-create-screen {
    position: fixed;
    inset: 0;
    z-index: 2200;
    min-height: 100dvh;
    overflow: hidden;
    background: #000;
    color: #fff;
    touch-action: none;
    overscroll-behavior: none;
    user-select: none;
}
.camera-live-preview,
.camera-preview-layer,
.camera-text-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #05070d;
}
.camera-live-preview {
    object-fit: cover;
    object-position: center;
    transform: none;
    transition: opacity .18s ease;
}
.camera-live-preview.is-front-camera {
    transform: scaleX(-1);
}
.camera-preview-layer {
    overflow: hidden;
    isolation: isolate;
}
.camera-preview-backdrop {
    position: absolute;
    z-index: 0;
    inset: -9%;
    background-position: center;
    background-size: cover;
    filter: blur(30px) saturate(1.12);
    opacity: .72;
    transform: scale(1.1);
}
.camera-preview-backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.28);
}
.camera-preview-media {
    position: absolute;
    z-index: 1;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    animation: camera-preview-in .2s ease-out;
}
@keyframes camera-preview-in {
    from { opacity: 0; transform: scale(1.015); }
}
.camera-preview-layer[data-media-shape="landscape"] .camera-preview-media {
    object-fit: contain;
}
.camera-preview-play {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    min-width: 68px;
    min-height: 48px;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 999px;
    background: rgba(0,0,0,.58);
    color: #fff;
    font-weight: 900;
    transform: translate(-50%, -50%);
    backdrop-filter: blur(12px);
}
.camera-preview-play[hidden] {
    display: none;
}
.camera-preview-layer[data-crop="keep"] .camera-preview-media {
    width: 100%;
    height: 100%;
    object-position: center;
}
.camera-preview-layer[data-crop="portrait"] .camera-preview-media {
    aspect-ratio: 9 / 16;
    width: auto;
    max-width: 100%;
    object-fit: cover;
}
.camera-preview-layer[data-crop="square"] .camera-preview-media {
    aspect-ratio: 1 / 1;
    height: min(100dvh, 100vw);
    object-fit: cover;
}
.camera-preview-layer[data-crop="landscape"] .camera-preview-media {
    aspect-ratio: 16 / 9;
    height: auto;
    max-height: 100%;
    object-fit: contain;
}
.camera-create-screen.is-editing .camera-bottom,
.camera-create-screen.is-editing .camera-tools-rail {
    display: none;
}
.camera-text-preview {
    display: grid;
    place-items: center;
    padding: 28px;
    text-align: center;
    font-size: clamp(28px, 8vw, 58px);
    font-weight: 900;
    line-height: 1.1;
}
.camera-create-top,
.camera-bottom,
.camera-tools-rail,
.camera-after-sheet,
.camera-final-sheet,
.camera-audio-sheet,
.camera-gif-sheet,
.camera-text-sheet,
.camera-timer-sheet,
.camera-permission-card {
    position: absolute;
    z-index: 4;
}
.camera-countdown {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: clamp(84px, 24vw, 190px);
    font-weight: 950;
    text-shadow: 0 18px 60px rgba(0,0,0,.55);
    pointer-events: none;
}
.camera-record-status {
    position: absolute;
    z-index: 7;
    top: max(72px, calc(env(safe-area-inset-top) + 58px));
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 74px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(0,0,0,.56);
    color: #fff;
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    font-weight: 900;
    backdrop-filter: blur(12px);
}
.camera-record-status i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff315a;
    animation: camera-record-pulse 1s infinite;
}
.camera-record-status[hidden] {
    display: none;
}
@keyframes camera-record-pulse {
    50% { opacity: .35; }
}
.camera-create-top {
    top: max(14px, env(safe-area-inset-top));
    left: 14px;
    right: 14px;
    display: grid;
    grid-template-columns: 48px 1fr 48px;
    align-items: center;
    gap: 10px;
}
.camera-icon-btn,
.camera-tools-rail button,
.camera-library-btn,
.camera-next-btn,
.camera-glass-btn {
    border: 1px solid rgba(255,255,255,.18);
    background: rgba(15,23,42,.42);
    color: #fff;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.camera-icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-weight: 900;
}
.camera-sound-pill {
    justify-self: center;
    max-width: min(280px, 70vw);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 999px;
    padding: 10px 18px;
    background: rgba(15,23,42,.48);
    color: #fff;
    font-weight: 900;
    backdrop-filter: blur(18px);
}
.camera-tools-rail {
    top: max(106px, calc(env(safe-area-inset-top) + 96px));
    right: 10px;
    display: grid;
    gap: 8px;
}
.camera-edit-tools {
    position: absolute;
    z-index: 5;
    right: 12px;
    top: max(76px, calc(env(safe-area-inset-top) + 72px));
    display: grid;
    gap: 8px;
}
.camera-tools-rail button {
    width: 50px;
    min-height: 50px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    gap: 0;
    font-weight: 900;
}
.camera-edit-tools button {
    width: 52px;
    min-height: 52px;
    display: grid;
    place-items: center;
    gap: 0;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 20px;
    background: rgba(15,23,42,.48);
    color: #fff;
    font-weight: 950;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.camera-edit-tools span {
    font-size: 20px;
    color: #fff;
}
.camera-tools-rail button b,
.camera-library-btn b,
.camera-next-btn b,
.camera-edit-tools b {
    font-size: 10px;
    color: inherit;
}
.camera-overlay-layer {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}
.camera-edit-overlay-chip {
    position: absolute;
    transform: translate(-50%, -50%);
    max-width: 82vw;
    border: 0;
    border-radius: 14px;
    padding: 9px 12px;
    background: rgba(0,0,0,.24);
    color: #fff;
    font-size: clamp(22px, 7vw, 54px);
    font-weight: 950;
    line-height: 1.05;
    text-align: center;
    text-shadow: 0 4px 18px rgba(0,0,0,.6);
    cursor: grab;
    user-select: none;
    touch-action: none;
    pointer-events: auto;
}
.camera-edit-overlay-chip.is-dragging {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.04);
}
.camera-remove-zone {
    position: absolute;
    z-index: 6;
    left: 50%;
    bottom: max(116px, calc(env(safe-area-inset-bottom) + 104px));
    transform: translateX(-50%);
    width: min(84vw, 360px);
    padding: 12px 16px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;
    background: rgba(239,68,68,.74);
    color: #fff;
    text-align: center;
    font-weight: 950;
    box-shadow: 0 18px 50px rgba(0,0,0,.35);
    backdrop-filter: blur(16px);
    pointer-events: none;
}
.camera-remove-zone.is-hot {
    background: #ef4444;
    transform: translateX(-50%) scale(1.04);
}
.camera-bottom {
    left: 0;
    right: 0;
    bottom: max(16px, env(safe-area-inset-bottom));
    display: grid;
    gap: 10px;
    padding: 0 14px;
}
.camera-shot-mode-row {
    justify-self: center;
    display: flex;
    gap: 8px;
    max-width: 100%;
    overflow-x: auto;
    padding: 4px;
    border-radius: 999px;
    background: rgba(15,23,42,.32);
    backdrop-filter: blur(14px);
}
.camera-shot-mode-row button {
    border: 0;
    border-radius: 999px;
    padding: 7px 14px;
    background: transparent;
    color: rgba(255,255,255,.74);
    font-size: 12px;
    font-weight: 900;
}
.camera-shot-mode-row button.active {
    background: #fff;
    color: #05070d;
}
.camera-capture-row {
    display: grid;
    grid-template-columns: minmax(60px, 76px) 1fr minmax(60px, 76px);
    align-items: center;
    gap: 10px;
}
.camera-library-btn,
.camera-next-btn {
    min-height: 54px;
    border-radius: 17px;
    display: grid;
    place-items: center;
    font-weight: 900;
}
.camera-next-btn:disabled {
    opacity: .45;
}
.camera-record-btn {
    justify-self: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 6px solid rgba(255,255,255,.9);
    background: #ff315a;
    box-shadow: 0 0 0 7px rgba(255,255,255,.16), 0 18px 50px rgba(0,0,0,.45);
    position: relative;
}
.camera-create-screen[data-capture-mode="photo"] .camera-record-btn {
    background: #fff;
    box-shadow: 0 0 0 7px rgba(255,255,255,.2), 0 18px 50px rgba(0,0,0,.45);
}
.camera-record-btn i {
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    background: conic-gradient(#ff315a var(--record-progress, 0%), rgba(255,255,255,.16) 0);
    z-index: -1;
}
.camera-record-btn.is-recording {
    border-radius: 24px;
    transform: scale(.92);
}
.camera-create-screen.is-recording .camera-tools-rail,
.camera-create-screen.is-recording .camera-shot-mode-row,
.camera-create-screen.is-recording .camera-library-btn,
.camera-create-screen.is-recording .camera-next-btn,
.camera-create-screen.is-recording .camera-entry-row {
    opacity: .42;
    pointer-events: none;
}
.camera-entry-row {
    justify-self: center;
    display: grid;
    grid-template-columns: repeat(3, minmax(76px, 1fr));
    width: min(100%, 360px);
    padding: 4px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 18px;
    background: rgba(4,8,18,.5);
    backdrop-filter: blur(18px);
}
.camera-entry-row button {
    min-height: 44px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: rgba(255,255,255,.72);
    font-size: 12px;
    font-weight: 900;
}
.camera-entry-row button.active {
    background: rgba(255,255,255,.16);
    color: #fff;
}
.camera-after-sheet,
.camera-final-sheet,
.camera-audio-sheet,
.camera-text-sheet,
.camera-timer-sheet,
.camera-permission-card {
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 24px;
    padding: 16px;
    background: rgba(15,23,42,.84);
    color: #fff;
    backdrop-filter: blur(22px);
    box-shadow: 0 24px 80px rgba(0,0,0,.42);
}
.camera-after-sheet {
    bottom: max(14px, env(safe-area-inset-bottom));
    max-width: 720px;
    margin-inline: auto;
}
.camera-after-sheet p {
    margin: 4px 0 12px;
    color: rgba(255,255,255,.72);
}
.camera-after-sheet div,
.camera-audio-tabs,
.camera-text-swatches {
    display: flex;
    gap: 8px;
    overflow-x: auto;
}
.camera-after-actions {
    flex-wrap: wrap;
}
.camera-after-actions button {
    flex: 1 1 auto;
}
.camera-permission-card {
    top: 50%;
    bottom: auto;
    display: grid;
    gap: 8px;
    text-align: center;
    transform: translateY(-50%);
}
.camera-permission-card[hidden] {
    display: none;
}
.camera-permission-card span {
    color: rgba(255,255,255,.72);
}
.camera-permission-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
}
.camera-permission-actions button {
    min-height: 44px;
    border-radius: 999px;
    padding: 10px 14px;
    font-weight: 900;
}
.camera-after-sheet button,
.camera-audio-tabs button,
.camera-text-sheet button,
.camera-final-sheet button {
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.16);
    padding: 10px 13px;
    font-weight: 900;
}
.camera-final-sheet,
.camera-audio-sheet,
.camera-gif-sheet,
.camera-text-sheet,
.camera-timer-sheet {
    max-width: 620px;
    margin-inline: auto;
    max-height: 82dvh;
    overflow-y: auto;
}
.camera-create-screen.is-final-open .camera-final-sheet {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: none;
    max-height: none;
    border-radius: 0;
    padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
}
.camera-final-sheet form,
.camera-text-sheet {
    display: grid;
    gap: 12px;
}
.camera-text-sheet {
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: none;
    max-height: none;
    border-radius: 0;
    padding: max(16px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
    background:
        radial-gradient(circle at top left, rgba(255,49,90,.22), transparent 38%),
        linear-gradient(180deg, rgba(2,6,23,.98), rgba(15,23,42,.96));
}
.camera-text-head {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 10px;
}
.camera-text-head button {
    min-height: 42px;
}
.camera-text-templates {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.camera-text-templates button {
    min-height: 64px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.16);
    background: rgba(255,255,255,.08);
    color: #fff;
    font-weight: 900;
}
.camera-final-sheet textarea,
.camera-final-sheet input,
.camera-final-sheet select,
.camera-text-sheet textarea,
.camera-audio-search input {
    width: 100%;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.16);
    background: rgba(2,6,23,.62);
    color: #fff;
    padding: 12px;
    font-size: 16px;
}
.camera-final-sheet,
.camera-audio-sheet,
.camera-gif-sheet,
.camera-text-sheet,
.camera-timer-sheet {
    touch-action: pan-y;
    overscroll-behavior: contain;
}
.camera-text-sheet textarea {
    min-height: 32dvh;
    resize: vertical;
    font-size: clamp(22px, 6vw, 42px);
    font-weight: 850;
    line-height: 1.12;
}
.camera-volume-grid {
    display: grid;
    gap: 10px;
}
.camera-volume-grid label {
    display: grid;
    gap: 6px;
}
.camera-audio-row {
    display: grid;
    grid-template-columns: 48px 1fr auto auto;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,.10);
}
.camera-audio-row img {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    object-fit: cover;
}
.camera-audio-row b,
.camera-audio-row span {
    display: block;
}
.camera-audio-row span {
    color: rgba(255,255,255,.68);
    font-size: 12px;
}
.camera-gif-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 10px;
}
.camera-gif-pick {
    display: grid;
    gap: 6px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 16px;
    padding: 8px;
    background: rgba(255,255,255,.08);
    color: #fff;
    font-weight: 900;
}
.camera-gif-pick img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    object-fit: cover;
}
.camera-edit-overlay-chip.is-gif {
    padding: 0;
    background: transparent;
    box-shadow: none;
}
.camera-edit-overlay-chip.is-gif img {
    width: clamp(90px, 26vw, 190px);
    height: auto;
    display: block;
    border-radius: 12px;
}
.overlay-gif-render {
    width: clamp(72px, 18vw, 150px);
    height: auto;
    padding: 0;
    background: transparent;
    border-radius: 12px;
}
.camera-text-swatches button {
    width: 66px;
    height: 66px;
    border-radius: 16px;
    padding: 0;
    border: 2px solid rgba(255,255,255,.18);
}
.camera-text-swatches button.active {
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(255,255,255,.18);
}
.camera-text-preview-card {
    min-height: 180px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    padding: 18px;
    color: #fff;
    text-align: center;
    font-size: clamp(24px, 7vw, 48px);
    font-weight: 900;
    line-height: 1.08;
}
.camera-timer-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.camera-timer-options button {
    min-height: 52px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.16);
    background: rgba(255,255,255,.08);
    color: #fff;
    font-weight: 900;
}
.camera-timer-options button.active {
    background: #fff;
    color: #05070d;
}
.camera-media-count {
    position: absolute;
    left: 18px;
    bottom: 170px;
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(15,23,42,.68);
    color: #fff;
    font-weight: 900;
}
@media (max-width: 360px), (max-height: 680px) {
    .camera-create-top {
        left: 10px;
        right: 10px;
        grid-template-columns: 44px 1fr 44px;
    }
    .camera-sound-pill {
        max-width: 54vw;
        padding: 9px 12px;
    }
    .camera-tools-rail {
        top: max(92px, calc(env(safe-area-inset-top) + 80px));
        gap: 6px;
    }
    .camera-tools-rail button {
        width: 46px;
        min-height: 46px;
    }
    .camera-bottom {
        gap: 7px;
        padding-inline: 10px;
    }
    .camera-capture-row {
        grid-template-columns: 60px 1fr 60px;
        gap: 7px;
    }
    .camera-library-btn,
    .camera-next-btn {
        min-height: 48px;
    }
    .camera-record-btn {
        width: 70px;
        height: 70px;
    }
    .camera-entry-row {
        grid-template-columns: repeat(3, minmax(68px, 1fr));
    }
}
@media (orientation: landscape) and (max-height: 520px) {
    .camera-tools-rail {
        top: max(68px, calc(env(safe-area-inset-top) + 58px));
    }
    .camera-tools-rail button b,
    .camera-edit-tools b {
        display: none;
    }
    .camera-bottom {
        left: max(8px, env(safe-area-inset-left));
        right: auto;
        width: min(300px, 46vw);
        bottom: max(8px, env(safe-area-inset-bottom));
    }
    .camera-capture-row {
        grid-template-columns: 56px 1fr 56px;
    }
    .camera-record-btn {
        width: 64px;
        height: 64px;
    }
    .camera-entry-row button {
        min-height: 38px;
    }
}
.loopz-create-top {
    position: absolute;
    top: max(16px, env(safe-area-inset-top));
    right: 18px;
    z-index: 12;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.22);
    background: rgba(15,23,42,.46);
    color: #fff;
    font-size: 26px;
    font-weight: 900;
    text-decoration: none;
    backdrop-filter: blur(16px);
}
.loopz-seekbar {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 6px;
    width: calc(100% - 20px);
    height: 18px;
    z-index: 8;
    accent-color: #fff;
    background: linear-gradient(90deg, #fff var(--seek-progress, 0%), rgba(255,255,255,.24) 0);
    border-radius: 999px;
    opacity: .72;
}
.loopz-seekbar::-webkit-slider-runnable-track {
    height: 3px;
    border-radius: 999px;
    background: transparent;
}
.loopz-seekbar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 13px;
    height: 13px;
    margin-top: -5px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,.35);
}
.loopz-seekbar::-moz-range-track {
    height: 3px;
    background: transparent;
}
.loopz-seekbar::-moz-range-thumb {
    width: 13px;
    height: 13px;
    border: 0;
    border-radius: 50%;
    background: #fff;
}

/* ===== Theme contrast hardening layer =====
   This late layer keeps historical components readable in both light and
   dark mode without removing purposeful media overlays or brand accents. */
.screen,
.app-shell,
.panel,
.post-card,
.inbox-panel,
.settings-pro-screen,
.admin-screen,
.system-admin-shell,
.system-admin-main,
.modal,
.inbox-drawer-panel,
.gift-picker-card,
.support-ticket,
.content-moderation-row,
.settings-segment-shell,
.settings-segment-sidebar,
.settings-segment-panels,
.settings-card,
.admin-row,
.category-admin-row,
.moderation-stat-grid b,
.system-admin-card,
.admin-profile-card,
.avatar-management-card,
.settings-avatar-preview,
.studio-rank-badge,
.studio-rank-row,
.rank-admin-row,
.ai-knowledge-row {
    color: var(--text-primary);
}
.screen :where(h1, h2, h3, h4, h5, h6, b, strong, label, li),
.modal :where(h1, h2, h3, h4, h5, h6, b, strong, label, li),
.inbox-drawer-panel :where(h1, h2, h3, h4, h5, h6, b, strong, label, li),
.system-admin-shell :where(h1, h2, h3, h4, h5, h6, b, strong, label, li),
.settings-segment-shell :where(h1, h2, h3, h4, h5, h6, b, strong, label, li),
.admin-screen :where(h1, h2, h3, h4, h5, h6, b, strong, label, li),
.admin-profile-modal :where(h1, h2, h3, h4, h5, h6, b, strong, label, li),
.studio-leaderboard-panel :where(h1, h2, h3, h4, h5, h6, b, strong, label, li) {
    color: var(--text-primary);
}
.screen :where(p, small, .settings-hint, .empty, .text-muted),
.modal :where(p, small, .settings-hint, .empty, .text-muted),
.inbox-drawer-panel :where(p, small, .settings-hint, .empty, .text-muted),
.system-admin-shell :where(p, small, .settings-hint, .empty, .text-muted),
.settings-segment-shell :where(p, small, .settings-hint, .empty, .text-muted),
.admin-screen :where(p, small, .settings-hint, .empty, .text-muted),
.admin-profile-modal :where(p, small, .settings-hint, .empty, .text-muted),
.content-moderation-row :where(small, time),
.studio-leaderboard-panel :where(p, small, .settings-hint, .empty, .text-muted) {
    color: var(--text-secondary);
}
.theme-inline-sanitized {
    color: var(--text-primary);
    background-color: transparent;
}
:where(button, .btn, .primary-btn, .login-pill) {
    color: var(--btn-text-primary);
}
:where(.mini-btn, .btn-secondary, .secondary-btn, button.secondary),
:where(.tab-row button, .settings-tabbar button, .system-admin-side button):not(.active) {
    color: var(--btn-text-secondary);
    background-color: var(--btn-bg-secondary);
    border-color: var(--border-color);
}
:where(.tab-row button.active, .settings-tabbar button.active, .system-admin-side button.active, button.active) {
    color: var(--btn-text-primary);
    background-color: var(--btn-bg-primary);
}
:where(input, textarea, select, .admin-field input, .admin-field select, .admin-field textarea, .system-admin-form input, .system-admin-form select, .system-admin-form textarea) {
    color: var(--text-primary);
    background-color: var(--input-bg);
    border-color: var(--border-color);
}
.settings-segment-shell :where(input, textarea, select),
.admin-screen :where(input, textarea, select),
.admin-profile-modal :where(input, textarea, select),
.inbox-drawer-panel :where(input, textarea, select),
.category-admin-row :where(input, textarea, select),
.ai-knowledge-row :where(input, textarea, select),
.content-moderation-row,
.content-moderation-row.is-head {
    color: var(--text-primary);
    background-color: var(--input-bg);
    border-color: var(--border-color);
}
.content-moderation-row.is-head {
    color: var(--text-secondary);
}
.settings-tabbar,
.settings-card,
.settings-segment-panels,
.inbox-drawer-overlay .inbox-drawer-panel,
.inbox-drawer-overlay .inbox-drawer-head,
.inbox-drawer-overlay .inbox-drawer-close {
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}
.system-admin-card,
.system-admin-metric,
.system-admin-record,
.system-admin-user,
.admin-profile-card,
.admin-avatar-manager,
.avatar-management-card,
.admin-row,
.category-admin-row,
.moderation-stat-grid b,
.content-moderation-row,
.inbox-drawer-overlay .inbox-drawer-body .inbox-panel,
.studio-rank-badge,
.studio-rank-row,
.rank-admin-row,
.ai-knowledge-row {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}
.settings-tabbar button:not(.active),
.inbox-drawer-overlay .inbox-drawer-close {
    color: var(--btn-text-secondary);
    background-color: var(--btn-bg-secondary);
}
.inbox-drawer-overlay .inbox-drawer-close:hover {
    background-color: var(--bg-secondary);
}
:where(input, textarea)::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

/* ===== TikTok-style profile editor ===== */
.edit-profile-screen {
    position: fixed;
    inset: 0;
    z-index: 1900;
    display: none;
    overflow-y: auto;
    background: #000;
    color: #fff;
    -webkit-overflow-scrolling: touch;
}
.edit-profile-screen.open {
    display: block;
}
.edit-profile-shell {
    width: min(100%, 620px);
    min-height: 100svh;
    margin: 0 auto;
    padding: max(16px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom));
}
.edit-profile-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: 52px 1fr 64px;
    align-items: center;
    gap: 8px;
    padding: 8px 0 18px;
    background: linear-gradient(180deg, #000 72%, rgba(0,0,0,0));
}
.edit-profile-header h1 {
    margin: 0;
    text-align: center;
    color: #fff;
    font-size: clamp(26px, 4vw, 34px);
    line-height: 1;
}
.edit-profile-back,
.edit-profile-save {
    border: 0;
    background: transparent;
    color: #fff;
    box-shadow: none;
}
.edit-profile-back {
    width: 48px;
    height: 48px;
    font-size: 56px;
    line-height: .7;
    padding: 0;
}
.edit-profile-save {
    justify-self: end;
    font-weight: 900;
    color: #67e8f9;
}
.edit-profile-form {
    display: grid;
    gap: 20px;
}
.edit-profile-avatar {
    display: grid;
    justify-items: center;
    gap: 12px;
}
.edit-profile-avatar label {
    display: grid;
    justify-items: center;
    gap: 14px;
    cursor: pointer;
}
.edit-profile-avatar span {
    position: relative;
    width: clamp(136px, 24vw, 178px);
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #21152f;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 20px 70px rgba(124,58,237,.24);
}
.edit-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.edit-profile-avatar i {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(0,0,0,.26);
    color: #fff;
    font-size: clamp(48px, 8vw, 66px);
    font-style: normal;
    font-weight: 900;
}
.edit-profile-avatar b {
    color: #67e8f9;
    font-size: clamp(22px, 4vw, 28px);
}
.edit-profile-card {
    display: grid;
    overflow: hidden;
    border-radius: 20px;
    background: #1f1f1f;
}
.edit-profile-row {
    min-height: 64px;
    display: grid;
    grid-template-columns: minmax(100px, 210px) minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,.06);
    background: transparent;
    color: #fff;
    box-shadow: none;
    text-align: left;
}
.edit-profile-row:last-child {
    border-bottom: 0;
}
.edit-profile-row span {
    color: rgba(255,255,255,.78);
    font-size: clamp(17px, 2.4vw, 22px);
}
.edit-profile-row input,
.edit-profile-row textarea {
    width: 100%;
    border: 0;
    border-radius: 0;
    padding: 4px 0;
    background: transparent;
    color: #fff;
    font-size: clamp(17px, 2.4vw, 21px);
    font-weight: 800;
    box-shadow: none;
    resize: vertical;
}
.edit-profile-row textarea {
    min-height: 82px;
    line-height: 1.28;
}
.edit-profile-row i {
    color: rgba(255,255,255,.56);
    font-style: normal;
    font-size: 30px;
}
.edit-profile-row.is-link b {
    overflow: hidden;
    color: #fff;
    font-size: clamp(16px, 2.2vw, 19px);
    text-overflow: ellipsis;
    white-space: nowrap;
}
.edit-profile-section-title {
    margin: 8px 32px -10px;
    color: rgba(255,255,255,.36);
    font-size: clamp(18px, 3vw, 22px);
}
.edit-profile-remove-photo {
    justify-self: center;
    border: 1px solid rgba(248,113,113,.32);
    border-radius: 999px;
    background: rgba(127,29,29,.22);
    color: #fecaca;
    padding: 12px 18px;
    box-shadow: none;
}

@media (max-width: 767px) {
    body[data-page="settings"] .content {
        padding-inline: 0;
    }
    .settings-pro-screen {
        gap: 10px;
    }
    .settings-pro-hero {
        padding: 18px 16px;
    }
    .settings-pro-hero h1 {
        font-size: clamp(30px, 11vw, 44px);
    }
    .settings-segment-shell {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .settings-segment-sidebar {
        position: sticky;
        top: 58px;
        z-index: 22;
        margin: 0;
        padding: 0 8px;
        background: var(--bg-primary);
    }
    .settings-segment-sidebar .settings-tabbar {
        display: flex;
        overflow-x: auto;
        border-radius: 16px;
        -webkit-overflow-scrolling: touch;
    }
    .settings-segment-sidebar .settings-tabbar button {
        flex: 0 0 auto;
        max-width: 82vw;
        text-align: center;
    }
    .settings-card {
        margin: 0 8px;
        padding: 14px;
        border-radius: 16px;
    }
    .settings-panel {
        gap: 10px;
    }
    .settings-save-bar {
        bottom: 78px;
        margin: 0 8px;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .settings-save-bar > * {
        width: 100%;
        justify-content: center;
    }
    .ios-switch-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }
    .ios-switch-row i {
        grid-column: 2;
    }
    .edit-profile-shell {
        padding-inline: 24px;
    }
    .edit-profile-row {
        grid-template-columns: minmax(92px, 30%) minmax(0, 1fr) auto;
        padding: 14px 18px;
    }
    .edit-profile-row span,
    .edit-profile-row input,
    .edit-profile-row textarea {
        font-size: 20px;
    }
    .edit-profile-avatar b {
        font-size: 27px;
    }
    .shared-post {
        width: 100%;
        border-left: 0;
        border-right: 0;
        border-radius: 0;
    }
    .post-comments-panel {
        width: 100%;
        margin-top: 8px;
        border-left: 0;
        border-right: 0;
        border-radius: 0;
    }
    .shared-post-head {
        grid-template-columns: 34px 44px minmax(0, 1fr) 34px;
        gap: 9px;
        padding: 10px;
    }
    .shared-post-head .post-back-btn {
        grid-column: 1;
        grid-row: 1;
        width: 34px;
        height: 34px;
    }
    .shared-post-head .shared-author-avatar {
        grid-column: 2;
        grid-row: 1;
    }
    .shared-post-head > div {
        grid-column: 3;
        grid-row: 1;
        min-width: 0;
    }
    .shared-post-head .shared-follow-btn {
        grid-column: 3 / 5;
        grid-row: 2;
        justify-self: start;
    }
    .shared-post-head .post-options {
        grid-column: 4;
        grid-row: 1;
        width: 34px;
    }
    .shared-post-head h1 {
        font-size: 16px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .shared-author-avatar,
    .shared-post-head img {
        width: 44px;
        height: 44px;
    }
    .shared-post-text {
        padding: 8px 14px 16px;
        font-size: 17px;
    }
    .shared-media-slider {
        min-height: min(390px, 58vh);
    }
    .shared-media-item img,
    .shared-media-item video {
        max-height: min(520px, 64vh);
    }
    .system-admin-shell {
        grid-template-columns: 1fr;
    }
    .system-admin-side {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(86vw, 320px);
        height: 100vh;
        padding: 18px 14px;
        border-right: 1px solid var(--border-color);
        border-bottom: 0;
        transform: translateX(-105%);
        transition: transform .24s cubic-bezier(.175, .885, .32, 1.12);
        box-shadow: 22px 0 55px rgba(0, 0, 0, .22);
        z-index: 1600;
    }
    .system-admin-shell.is-menu-open .system-admin-side {
        transform: translateX(0);
    }
    .system-admin-shell.is-menu-open .system-admin-scrim {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1500;
        background: rgba(15, 23, 42, .5);
        backdrop-filter: blur(4px);
    }
    .system-admin-menu-toggle,
    .system-admin-side-close {
        display: grid;
    }
    .system-admin-brand {
        padding: 2px 2px 18px;
    }
    .system-admin-side nav {
        display: grid;
        gap: 8px;
        overflow: visible;
        padding-bottom: 0;
    }
    .system-admin-side button {
        width: 100%;
        white-space: normal;
    }
    .system-admin-head {
        justify-content: flex-start;
    }
    .system-admin-secure {
        margin-left: auto;
    }
}
@media (max-width: 640px) {
    .system-admin-main {
        padding-inline: 12px;
    }
    .system-admin-metrics,
    .algorithm-stats-grid,
    .system-admin-form-grid,
    .system-admin-two-col {
        grid-template-columns: 1fr;
    }
    .algorithm-setting-row {
        grid-template-columns: 1fr;
    }
    .algorithm-control-hero,
    .algorithm-sticky-actions {
        align-items: stretch;
        flex-direction: column;
    }
    .algorithm-live-badge {
        align-self: flex-start;
    }
    .algorithm-sticky-actions #algorithm-blend-status {
        margin-left: 0;
    }
    .algorithm-workbench,
    .algorithm-control-grid {
        grid-template-columns: 1fr;
    }
    .algorithm-category-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }
    .algorithm-category-row > :nth-child(3) {
        grid-column: 1 / -1;
    }
    .system-admin-money-grid,
    .system-admin-bot-grid,
    .system-admin-broadcast-grid,
    .system-admin-bot-summary {
        grid-template-columns: 1fr;
    }
    .push-permission-banner {
        grid-template-columns: 1fr auto;
    }
    .push-permission-banner .mini-btn {
        grid-column: 1 / -1;
    }
    .system-admin-earner-row,
    .system-admin-ledger-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
    .system-admin-record,
    .system-admin-record.is-disputed,
    .system-admin-user {
        grid-template-columns: auto minmax(0, 1fr);
    }
    .system-admin-user label {
        grid-column: 1 / -1;
    }
    .system-admin-control-map {
        grid-template-columns: 1fr;
    }
    .system-admin-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
    .admin-profile-card {
        padding: 14px;
        border-radius: 12px;
    }
    .admin-avatar-manager,
    .settings-avatar-preview {
        grid-template-columns: 1fr;
        justify-items: start;
    }
    .admin-profile-actions,
    .avatar-management-actions {
        align-items: stretch;
    }
    .admin-profile-actions > *,
    .avatar-management-actions > * {
        width: 100%;
    }
}

/* ===== Home workspace: desktop discovery layout ===== */
.sidebar {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.sidebar nav {
    flex: 0 0 auto;
}
.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-nav-icon {
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    display: grid;
    place-items: center;
    color: currentColor;
    font-size: 21px;
    font-weight: 500;
    line-height: 1;
}
.sidebar nav a.active {
    border: 1px solid rgba(168, 85, 247, .75);
    background: linear-gradient(135deg, rgba(109, 40, 217, .36), rgba(76, 29, 149, .18));
    color: var(--text-primary);
    box-shadow: 0 0 24px rgba(124, 58, 237, .22), inset 0 0 18px rgba(168, 85, 247, .08);
}
.sidebar-footer {
    display: grid;
    gap: 12px;
    margin-top: auto;
    padding-top: 24px;
}
.sidebar-account-card,
.sidebar-premium-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: color-mix(in srgb, var(--bg-secondary) 72%, transparent);
}
.sidebar-account-card {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 11px;
}
.sidebar-account-card img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--media-bg);
}
.sidebar-account-card span {
    min-width: 0;
    display: grid;
}
.sidebar-account-card strong,
.sidebar-account-card small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-account-card strong {
    font-size: 12px;
}
.sidebar-account-card small,
.sidebar-premium-card small {
    color: var(--text-secondary);
    font-size: 10px;
}
.sidebar-account-card b {
    font-size: 18px;
}
.sidebar-premium-card {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 9px;
    padding: 13px;
}
.sidebar-premium-icon {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: rgba(124, 58, 237, .18);
    color: #c084fc;
    font-size: 17px;
}
.sidebar-premium-card > span:nth-child(2) {
    display: grid;
    gap: 3px;
}
.sidebar-premium-card strong {
    font-size: 12px;
}
.sidebar-premium-card > b {
    grid-column: 1 / -1;
    display: grid;
    place-items: center;
    min-height: 35px;
    border-radius: 8px;
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    color: #fff;
    font-size: 11px;
}

.home-page-shell {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 292px;
    align-items: start;
    gap: 18px;
}
.home-feed-column {
    min-width: 0;
    display: grid;
    gap: 12px;
}
.home-feed-column > .home-search {
    margin: 0;
    min-height: 45px;
    border-color: rgba(148, 163, 184, .22);
    background: color-mix(in srgb, var(--bg-secondary) 84%, transparent);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
.home-stories-panel,
.home-composer,
.home-rail-card,
.home-upload-card {
    border: 1px solid var(--border-color);
    background: color-mix(in srgb, var(--bg-secondary) 78%, transparent);
    box-shadow: 0 14px 38px rgba(2, 6, 23, .12);
    backdrop-filter: blur(18px);
}
.home-stories-panel {
    padding: 12px 14px 8px;
    border-radius: 15px;
    overflow: hidden;
}
.home-stories-panel .stories-rail {
    gap: 16px;
    padding: 2px 0 6px;
}
.home-stories-panel .story-card {
    min-width: 78px;
}
.home-stories-panel .story-card.story-ring {
    width: 78px;
    min-width: 78px;
    grid-template-rows: 68px auto;
}
.home-stories-panel .story-card small {
    display: none;
}
.home-stories-panel .story-card b {
    max-width: 78px;
    color: var(--text-primary);
    font-size: 11px;
}
.home-stories-panel .story-ring {
    filter: drop-shadow(0 0 7px rgba(168, 85, 247, .28));
}
.home-stories-panel .story-add > span {
    background: linear-gradient(135deg, #7c3aed, #9333ea);
    color: #fff;
}
.home-composer {
    overflow: hidden;
    border-radius: 15px;
}
.home-composer-prompt {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 62px;
    padding: 12px 16px;
    /* Rendered as a <button> (opens the inline composer): reset chrome. */
    appearance: none;
    width: 100%;
    border: 0;
    background: transparent;
    font: inherit;
    text-align: start;
    cursor: pointer;
    color: inherit;
}
.home-composer-prompt:hover span {
    color: var(--text-primary);
}
/* ===== Inline text composer (home) ===== */
.home-inline-composer {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
}
.home-inline-composer[hidden] {
    display: none;
}
.inline-composer-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--media-bg);
}
.inline-composer-main {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 10px;
}
.home-inline-composer textarea {
    width: 100%;
    min-height: 76px;
    resize: vertical;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font: inherit;
    font-size: 16px;
    line-height: 1.45;
}
.home-inline-composer textarea:focus {
    outline: none;
    border-color: var(--brand, #ff315a);
}
.inline-composer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.inline-composer-actions .primary-btn,
.inline-composer-actions .secondary-btn {
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 13px;
    cursor: pointer;
}
.inline-composer-actions .secondary-btn {
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
}
.inline-composer-actions .secondary-btn:hover {
    color: var(--text-primary);
}
.inline-composer-actions .primary-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}
.home-composer-prompt img {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--media-bg);
}
.home-composer-prompt span {
    color: var(--text-secondary);
    font-size: 15px;
}
.home-composer-actions {
    display: grid;
    /* 3 shortcuts: Photo / Loopz / Audio (GIF posts removed — GIFs are
       stickers for comments & DMs only). */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--border-color);
}
.home-composer-actions a {
    min-width: 0;
    min-height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 800;
}
.home-composer-actions a + a {
    border-left: 1px solid color-mix(in srgb, var(--border-color) 62%, transparent);
}
.home-composer-actions a:hover {
    background: color-mix(in srgb, var(--btn-bg-primary) 10%, transparent);
}
.composer-action-icon {
    min-width: 22px;
    color: #60a5fa;
    font-size: 18px;
    font-weight: 950;
    text-align: center;
}
.composer-action-icon.is-photo { color: #65d86e; }
.composer-action-icon.is-loopz { color: #a855f7; }
.composer-action-icon.is-audio { color: #60a5fa; }
.composer-action-icon.is-gif {
    color: #f472b6;
    font-size: 10px;
    border: 1px solid currentColor;
    border-radius: 4px;
    padding: 2px;
}
.home-feed-column > .feed {
    gap: 14px;
    justify-items: stretch;
}
.home-feed-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 2px 4px;
}
.home-feed-toolbar > span {
    display: grid;
    gap: 2px;
}
.home-feed-toolbar small {
    color: var(--text-secondary);
}
.home-feed-sentinel {
    min-height: 74px;
    display: grid;
    place-items: center;
}
.home-feed-sentinel i,
.home-pull-refresh i {
    width: 24px;
    height: 24px;
    border: 3px solid color-mix(in srgb, var(--text-secondary) 28%, transparent);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    opacity: .38;
}
.home-feed-sentinel.is-loading i,
.home-pull-refresh.is-refreshing i {
    opacity: 1;
    animation: home-feed-spin .72s linear infinite;
}
.home-pull-refresh {
    display: none;
}
@keyframes home-feed-spin {
    to { transform: rotate(360deg); }
}
.home-feed-column .post-card {
    width: 100%;
    max-width: none;
    border-radius: 15px;
    box-shadow: 0 15px 44px rgba(2, 6, 23, .16);
}
.home-feed-column .post-card:first-child {
    border-color: rgba(168, 85, 247, .5);
    box-shadow: 0 15px 44px rgba(2, 6, 23, .16), 0 0 24px rgba(124, 58, 237, .08);
}
.home-feed-column .post-head {
    border-bottom: 0;
    padding: 14px 16px 9px;
}
.home-feed-column .post-head + .post-body {
    padding: 0 16px 12px;
}
.home-feed-column .post-sound-link {
    width: fit-content;
    max-width: calc(100% - 32px);
    margin: -3px 16px 12px;
}
.home-feed-column .post-media {
    border-top: 1px solid color-mix(in srgb, var(--border-color) 55%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--border-color) 55%, transparent);
    background: color-mix(in srgb, var(--media-bg) 86%, transparent);
}
.home-feed-column .post-media > img,
.home-feed-column .post-media > video {
    /* Fill the card width so small/portrait images never float as a tiny
       thumbnail inside a large dark box. height:auto preserves the aspect
       ratio; very tall portraits are capped and letterboxed (no crop). */
    width: 100%;
    height: auto;
    max-height: 690px;
    object-fit: contain;
}
.home-feed-column .post-media .slider-track,
.home-feed-column .post-media .video-shell {
    width: 100%;
}
.home-feed-column .post-actions {
    padding: 11px 15px 7px;
}
.home-feed-column .liked-by {
    padding: 0 16px 12px;
}

.home-right-rail {
    position: sticky;
    top: 70px;
    display: grid;
    gap: 14px;
}
.home-rail-card {
    padding: 14px;
    border-radius: 14px;
}
.home-rail-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.home-rail-heading b {
    font-size: 13px;
}
.home-rail-heading a {
    color: #c084fc;
    font-size: 10px;
    font-weight: 850;
}
.home-trending-list,
.home-creator-list {
    display: grid;
    gap: 4px;
}
.home-trending-list > a {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 7px;
    min-height: 43px;
    padding: 5px 3px;
    border-radius: 9px;
}
.home-trending-list > a:hover,
.home-creator-row:hover {
    background: color-mix(in srgb, var(--btn-bg-primary) 9%, transparent);
}
.home-trend-hash {
    color: #c084fc;
    font-weight: 950;
}
.home-trending-list a > span:nth-child(2),
.home-creator-row a span {
    min-width: 0;
    display: grid;
}
.home-trending-list b,
.home-creator-row b {
    overflow: hidden;
    color: var(--text-primary);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.home-trending-list small,
.home-creator-row small {
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.home-trend-bars {
    height: 22px;
    display: flex;
    align-items: end;
    justify-content: flex-end;
    gap: 2px;
}
.home-trend-bars em {
    width: 3px;
    border-radius: 3px;
    background: #d946ef;
}
.home-trend-bars em:nth-child(1) { height: 7px; }
.home-trend-bars em:nth-child(2) { height: 13px; }
.home-trend-bars em:nth-child(3) { height: 10px; }
.home-trend-bars em:nth-child(4) { height: 18px; }
.home-trend-bars.trend-2 em { background: #60a5fa; }
.home-trend-bars.trend-3 em { background: #a3e635; }
.home-trend-bars.trend-4 em { background: #fb923c; }
.home-creator-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 50px;
    padding: 5px 3px;
    border-radius: 9px;
}
.home-creator-row > a {
    min-width: 0;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}
.home-creator-row img {
    width: 36px;
    height: 36px;
    border: 2px solid rgba(168, 85, 247, .52);
    border-radius: 50%;
    object-fit: cover;
    background: var(--media-bg);
}
.home-creator-row button {
    min-width: 57px;
    min-height: 30px;
    padding: 5px 8px;
    border: 1px solid rgba(168, 85, 247, .62);
    border-radius: 8px;
    background: transparent;
    color: #c084fc;
    font-size: 10px;
    font-weight: 900;
}
.home-creator-row button.is-followed {
    border-color: var(--border-color);
    color: var(--text-secondary);
}
.home-boost-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(168, 85, 247, .42);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(88, 28, 135, .72), rgba(30, 41, 59, .88));
    box-shadow: 0 14px 36px rgba(88, 28, 135, .18);
}
.home-boost-card span {
    display: grid;
    gap: 4px;
}
.home-boost-card b,
.home-boost-card small {
    color: #fff;
}
.home-boost-card b {
    font-size: 14px;
}
.home-boost-card small {
    color: #ddd6fe;
    font-size: 10px;
}
.home-boost-card strong,
.home-upload-card strong {
    width: fit-content;
    min-height: 33px;
    display: grid;
    place-items: center;
    padding: 0 16px;
    border-radius: 8px;
    background: #7c3aed;
    color: #fff;
    font-size: 10px;
}
.home-upload-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 14px;
    border-radius: 14px;
}
.home-upload-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 22px;
}
.home-upload-card > span:nth-child(2) {
    display: grid;
}
.home-upload-card b {
    font-size: 12px;
}
.home-upload-card small {
    color: var(--text-secondary);
    font-size: 9px;
}
.home-upload-card strong {
    grid-column: 1 / -1;
    justify-self: center;
}
.home-rail-empty {
    padding: 12px 4px;
    color: var(--text-secondary);
    font-size: 10px;
}

@media (min-width: 1200px) {
    body[data-page="home"] .sidebar {
        width: 236px;
        padding: 26px 14px 18px;
    }
    body[data-page="home"] .content {
        margin-left: 236px;
        padding: 18px 24px 90px;
    }
    body[data-page="home"] .screen {
        width: min(100%, 1220px);
    }
    body[data-page="home"] .topbar {
        position: absolute;
        top: 18px;
        right: max(24px, calc((100vw - 236px - 1220px) / 2));
        z-index: 45;
        width: auto;
        margin: 0;
    }
    body[data-page="home"] .home-right-rail {
        padding-top: 58px;
    }
    body[data-page="home"] .home-feed-column > .home-search {
        margin-right: 8px;
    }
}

@media (min-width: 761px) and (max-width: 1199px) {
    body[data-page="home"] .screen {
        width: min(100%, 820px);
    }
    .home-page-shell {
        grid-template-columns: minmax(0, 1fr);
    }
    .home-right-rail {
        display: none;
    }
}

@media (max-width: 760px) {
    html.home-pull-enabled,
    body[data-page="home"],
    body[data-page="explore"],
    body[data-page="profile"] {
        overscroll-behavior-y: contain;
    }
    .home-pull-refresh {
        --pull-distance: 0px;
        position: fixed;
        top: max(8px, env(safe-area-inset-top));
        left: 50%;
        z-index: 1900;
        display: flex;
        align-items: center;
        gap: 8px;
        min-height: 42px;
        padding: 8px 13px;
        border: 1px solid rgba(148, 163, 184, .24);
        border-radius: 999px;
        background: color-mix(in srgb, var(--panel) 92%, transparent);
        color: var(--text-primary);
        box-shadow: 0 12px 34px rgba(2, 6, 23, .26);
        opacity: 0;
        pointer-events: none;
        transform: translate(-50%, calc(-70px + min(var(--pull-distance), 96px)));
        transition: opacity .14s ease, border-color .14s ease;
        backdrop-filter: blur(16px);
    }
    .home-pull-refresh.is-visible {
        opacity: 1;
    }
    .home-pull-refresh.is-ready {
        border-color: rgba(139, 92, 246, .68);
    }
    .home-pull-refresh i {
        width: 18px;
        height: 18px;
        flex: 0 0 18px;
    }
    .home-pull-refresh span {
        font-size: 11px;
        font-weight: 900;
        white-space: nowrap;
    }
    html,
    body,
    .app-shell,
    .content,
    .screen,
    #app-root,
    .home-page-shell,
    .home-feed-column,
    .feed,
    .post-card,
    .home-composer,
    .home-inline-composer,
    .inline-composer-main {
        min-width: 0;
        max-width: 100%;
    }
    img,
    video,
    canvas,
    svg,
    input,
    textarea,
    select,
    button {
        max-width: 100%;
    }
    input,
    textarea,
    select {
        font-size: 16px;
    }
    .sidebar-footer {
        display: none;
    }
    .home-page-shell {
        display: block;
    }
    .home-feed-column {
        gap: 10px;
    }
    .home-right-rail {
        display: none;
    }
    .home-feed-column > .home-search {
        margin: 0 12px;
    }
    .home-stories-panel,
    .home-composer {
        border-left: 0;
        border-right: 0;
        border-radius: 0;
    }
    .home-stories-panel {
        padding-inline: 12px;
    }
    .home-composer-actions a {
        gap: 5px;
        font-size: 11px;
    }
    .home-inline-composer {
        gap: 10px;
        padding: 12px;
    }
    .inline-composer-actions {
        flex-wrap: wrap;
    }
    .inline-composer-actions .primary-btn,
    .inline-composer-actions .secondary-btn {
        min-width: 76px;
        font-size: 16px;
    }
    .post-head {
        gap: 8px;
        padding-inline: 10px;
    }
    .post-head .feed-follow-btn {
        flex: 0 1 auto;
        padding-inline: 9px;
    }
    .post-actions {
        gap: 5px;
        padding-inline: 9px;
    }
    .post-actions .action-left {
        min-width: 0;
        flex: 1 1 auto;
        justify-content: space-between;
        gap: 2px;
    }
    .post-actions .metric-action {
        min-width: 0;
        gap: 2px;
        padding-inline: 1px;
    }
    .post-actions .metric-action em {
        font-size: 11px;
    }
    .home-feed-column > .feed {
        gap: 10px;
    }
    .home-feed-column .post-card {
        border-radius: 0;
    }
    .home-feed-column .post-media > img,
    .home-feed-column .post-media > video {
        width: 100%;
        max-height: 72svh;
    }
}

/* ===== Creator Studio dashboard ===== */
body[data-page="studio"] .topbar {
    display: none;
}
body[data-page="studio"] .content {
    padding-top: 22px;
}
body[data-page="studio"] .screen {
    width: min(100%, 1380px);
}
.studio-dashboard {
    gap: 14px;
    color: var(--text-primary);
}
.studio-dashboard > .studio-kpi-grid,
.studio-dashboard > .studio-dashboard-grid,
.studio-dashboard > .studio-operations {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}
.studio-dashboard-loading {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 14px;
}
.studio-dashboard-head {
    position: relative;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    align-items: center;
    gap: 16px;
    min-height: 58px;
}
.studio-title-lockup {
    display: flex;
    align-items: center;
    gap: 13px;
}
.studio-title-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(168, 85, 247, .42);
    border-radius: 11px;
    background: linear-gradient(145deg, rgba(126, 34, 206, .66), rgba(88, 28, 135, .28));
    color: #e9d5ff;
    box-shadow: 0 12px 30px rgba(88, 28, 135, .28);
    font-size: 25px;
    font-weight: 900;
}
.studio-title-lockup h1 {
    margin: 0;
    color: var(--text-primary);
    font-size: 29px;
    line-height: 1.05;
}
.studio-title-lockup p {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
}
.studio-dashboard-filters {
    display: flex;
    align-items: center;
    gap: 10px;
}
.studio-period-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(78px, 1fr));
    border: 1px solid var(--border-color);
    border-radius: 9px;
    overflow: hidden;
    background: color-mix(in srgb, var(--bg-secondary) 80%, transparent);
}
.studio-period-tabs button {
    min-height: 39px;
    padding: 7px 14px;
    border: 0;
    border-right: 1px solid var(--border-color);
    border-radius: 0;
    background: transparent;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 850;
}
.studio-period-tabs button:last-child {
    border-right: 0;
}
.studio-period-tabs button.active {
    background: rgba(126, 34, 206, .25);
    color: #e9d5ff;
    box-shadow: inset 0 0 0 1px #9333ea, 0 0 18px rgba(147, 51, 234, .16);
}
.studio-calendar-btn {
    width: 42px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 900;
}
.studio-calendar-btn.active {
    border-color: #9333ea;
    color: #c084fc;
}
.studio-dashboard-custom-range {
    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    right: 0;
    width: min(100%, 520px);
    margin: 0;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    box-shadow: 0 22px 55px rgba(2, 6, 23, .42);
}

.studio-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}
.studio-kpi-card {
    position: relative;
    min-width: 0;
    min-height: 104px;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    overflow: hidden;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background:
        linear-gradient(145deg, color-mix(in srgb, var(--bg-secondary) 92%, transparent), color-mix(in srgb, var(--bg-primary) 74%, transparent));
    box-shadow: 0 15px 34px rgba(2, 6, 23, .14);
}
.studio-kpi-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    background: color-mix(in srgb, currentColor 12%, transparent);
    color: #a855f7;
    font-size: 18px;
    font-weight: 950;
}
.studio-kpi-card > div {
    min-width: 0;
    display: grid;
    gap: 2px;
}
.studio-kpi-card small,
.studio-kpi-card em {
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 10px;
    font-style: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.studio-kpi-card b {
    overflow: hidden;
    color: var(--text-primary);
    font-size: 22px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.studio-kpi-spark {
    position: absolute;
    right: 9px;
    bottom: 11px;
    height: 23px;
    display: flex;
    align-items: end;
    gap: 2px;
    opacity: .8;
}
.studio-kpi-spark u {
    width: 3px;
    border-radius: 4px;
    background: currentColor;
    text-decoration: none;
}
.studio-kpi-spark u:nth-child(1) { height: 7px; }
.studio-kpi-spark u:nth-child(2) { height: 16px; }
.studio-kpi-spark u:nth-child(3) { height: 12px; }
.studio-kpi-spark u:nth-child(4) { height: 22px; }
.studio-kpi-purple .studio-kpi-icon,
.studio-kpi-purple .studio-kpi-spark { color: #a855f7; }
.studio-kpi-blue .studio-kpi-icon,
.studio-kpi-blue .studio-kpi-spark { color: #38bdf8; }
.studio-kpi-pink .studio-kpi-icon,
.studio-kpi-pink .studio-kpi-spark { color: #d946ef; }
.studio-kpi-rose .studio-kpi-icon,
.studio-kpi-rose .studio-kpi-spark { color: #fb3d7d; }
.studio-kpi-cyan .studio-kpi-icon,
.studio-kpi-cyan .studio-kpi-spark { color: #0ea5e9; }

.studio-dashboard-grid {
    display: grid;
    gap: 14px;
}
.studio-dashboard-grid-primary {
    grid-template-columns: minmax(0, 1.7fr) minmax(320px, .95fr);
}
.studio-dashboard-grid-secondary {
    grid-template-columns: minmax(0, 1.65fr) minmax(340px, 1fr);
}
.studio-dashboard-grid-bottom {
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, .82fr) minmax(300px, .9fr);
}
.studio-dashboard-card {
    min-width: 0;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: color-mix(in srgb, var(--bg-secondary) 84%, transparent);
    box-shadow: 0 16px 40px rgba(2, 6, 23, .14);
}
.studio-card-head {
    min-height: 34px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.studio-card-head h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 14px;
}
.studio-card-head p {
    margin: 3px 0 0;
    color: var(--text-secondary);
    font-size: 10px;
}
.studio-card-head > a,
.studio-text-link {
    border: 0;
    background: transparent;
    color: #a78bfa;
    font-size: 10px;
    font-weight: 850;
    white-space: nowrap;
}
.studio-chart-legend {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-secondary);
    font-size: 9px;
}
.studio-chart-legend i {
    width: 14px;
    height: 2px;
    margin-left: 5px;
    background: #00a2ff;
}
.studio-chart-legend i:first-child {
    margin-left: 0;
    background: #a855f7;
}
.studio-chart-legend i:last-of-type {
    background: #22c55e;
}
.studio-main-chart {
    height: 245px;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.studio-earnings-body,
.studio-traffic-body {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    min-height: 220px;
}
.studio-donut {
    --studio-donut: #334155 0% 100%;
    position: relative;
    width: 142px;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(var(--studio-donut));
    box-shadow: 0 0 30px rgba(124, 58, 237, .12);
}
.studio-donut::before {
    content: "";
    position: absolute;
    inset: 27px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--bg-secondary);
}
.studio-donut span {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
}
.studio-donut b {
    color: var(--text-primary);
    font-size: 13px;
}
.studio-donut small {
    color: var(--text-secondary);
    font-size: 9px;
}
.studio-breakdown-list {
    min-width: 0;
    display: grid;
}
.studio-breakdown-list > div {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    border-bottom: 1px solid var(--border-color);
}
.studio-breakdown-list > div:last-child {
    border-bottom: 0;
}
.studio-breakdown-list i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}
.studio-breakdown-list span,
.studio-breakdown-list b,
.studio-breakdown-list small {
    font-size: 10px;
}
.studio-breakdown-list span,
.studio-breakdown-list small {
    color: var(--text-secondary);
}
.studio-text-link {
    padding: 7px 0 0;
}

.studio-top-content-card {
    overflow: hidden;
}
.studio-content-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(132px, 1fr));
    gap: 9px;
    overflow-x: auto;
    scrollbar-width: thin;
}
.studio-content-card {
    min-width: 132px;
    display: grid;
    gap: 4px;
    padding-bottom: 4px;
}
.studio-content-preview {
    position: relative;
    height: 100px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 7px;
    background: var(--media-bg);
}
.studio-content-preview img,
.studio-content-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.studio-content-preview > span {
    padding: 10px;
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}
.studio-content-preview em {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 3px 7px;
    border-radius: 5px;
    background: rgba(109, 40, 217, .9);
    color: #fff;
    font-size: 8px;
    font-style: normal;
    font-weight: 900;
}
.studio-content-preview i {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 26px;
    font-style: normal;
    text-shadow: 0 2px 10px #000;
}
.studio-content-card > b {
    overflow: hidden;
    color: var(--text-primary);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.studio-content-card > small {
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.studio-traffic-body {
    grid-template-columns: 150px minmax(0, 1fr);
    min-height: 175px;
}
.studio-traffic-donut {
    width: 135px;
}
.studio-traffic-bars {
    display: grid;
    gap: 10px;
}
.studio-traffic-bars > div {
    display: grid;
    grid-template-columns: 62px minmax(70px, 1fr) 40px;
    align-items: center;
    gap: 8px;
}
.studio-traffic-bars span,
.studio-traffic-bars b {
    color: var(--text-secondary);
    font-size: 9px;
}
.studio-traffic-bars b {
    text-align: right;
}
.studio-traffic-bars i {
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: color-mix(in srgb, var(--border-color) 75%, transparent);
}
.studio-traffic-bars u {
    display: block;
    height: 100%;
    border-radius: inherit;
    text-decoration: none;
}

.studio-tools-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}
.studio-tools-grid a {
    min-width: 0;
    min-height: 59px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 9px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: color-mix(in srgb, var(--bg-primary) 22%, transparent);
}
.studio-tools-grid a:hover {
    border-color: rgba(168, 85, 247, .55);
    background: rgba(124, 58, 237, .1);
}
.studio-tools-grid i {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(124, 58, 237, .18);
    color: #c084fc;
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
}
.studio-tools-grid span {
    min-width: 0;
    display: grid;
}
.studio-tools-grid b,
.studio-tools-grid small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.studio-tools-grid b {
    color: var(--text-primary);
    font-size: 10px;
}
.studio-tools-grid small,
.studio-tools-grid em {
    color: var(--text-secondary);
    font-size: 8px;
    font-style: normal;
}

.studio-suggestion-stack,
.studio-notification-list {
    display: grid;
}
.studio-suggestion-stack > div,
.studio-notification-list > a {
    min-width: 0;
    min-height: 51px;
    display: grid;
    grid-template-columns: 31px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
}
.studio-suggestion-stack > div:last-child,
.studio-notification-list > a:last-child {
    border-bottom: 0;
}
.studio-suggestion-stack i,
.studio-notification-list i {
    width: 29px;
    height: 29px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(168, 85, 247, .15);
    color: #c084fc;
    font-size: 12px;
    font-style: normal;
}
.studio-suggestion-stack span,
.studio-notification-list span {
    min-width: 0;
    display: grid;
}
.studio-suggestion-stack b,
.studio-suggestion-stack small,
.studio-notification-list b,
.studio-notification-list small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.studio-suggestion-stack b,
.studio-notification-list b {
    color: var(--text-primary);
    font-size: 9px;
}
.studio-suggestion-stack small,
.studio-notification-list small,
.studio-suggestion-stack em {
    color: var(--text-secondary);
    font-size: 8px;
    font-style: normal;
}
.studio-notification-list > a {
    grid-template-columns: 29px minmax(0, 1fr);
}
.studio-notification-list span {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}
.studio-notification-list b {
    min-width: 0;
}

.studio-operations {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}
.studio-operation-panel {
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: color-mix(in srgb, var(--bg-secondary) 84%, transparent);
}
.studio-operation-panel[open] {
    grid-column: 1 / -1;
}
.studio-operation-panel > summary {
    min-height: 65px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 15px;
    cursor: pointer;
    list-style: none;
}
.studio-operation-panel > summary::-webkit-details-marker {
    display: none;
}
.studio-operation-panel > summary span {
    display: grid;
    gap: 3px;
}
.studio-operation-panel > summary b {
    color: var(--text-primary);
    font-size: 12px;
}
.studio-operation-panel > summary small {
    color: var(--text-secondary);
    font-size: 9px;
}
.studio-operation-panel > summary i {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    color: var(--text-primary);
    font-style: normal;
}
.studio-operation-panel[open] > summary i {
    transform: rotate(45deg);
}
.studio-operation-panel > section,
.studio-operation-panel > .studio-leaderboard-panel {
    margin: 0 12px 12px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: color-mix(in srgb, var(--bg-primary) 22%, transparent);
    box-shadow: none;
    backdrop-filter: none;
}
.studio-wallet-panel {
    display: grid;
    gap: 12px;
}
.studio-wallet-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.studio-wallet-options .reward-box {
    margin: 0;
}
.studio-verification-card {
    display: grid;
    gap: 10px;
}

@media (min-width: 1400px) {
    body[data-page="studio"] .content {
        padding-inline: 28px;
    }
}

@media (max-width: 1220px) {
    .studio-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .studio-dashboard-grid-primary,
    .studio-dashboard-grid-secondary {
        grid-template-columns: 1fr;
    }
    .studio-dashboard-grid-bottom {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .studio-tools-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .studio-dashboard-head {
        grid-template-columns: 1fr;
    }
    .studio-dashboard-filters {
        justify-content: flex-start;
        overflow-x: auto;
    }
    .studio-dashboard-custom-range {
        position: static;
        width: 100%;
        grid-column: 1 / -1;
    }
    .studio-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .studio-dashboard-grid-bottom {
        grid-template-columns: 1fr;
    }
    .studio-tools-card {
        grid-column: auto;
    }
    .studio-operations {
        grid-template-columns: 1fr;
    }
    .studio-operation-panel[open] {
        grid-column: auto;
    }
}

@media (max-width: 760px) {
    body[data-page="studio"] .content {
        padding: 10px 0 84px;
    }
    body[data-page="studio"] .topbar {
        display: flex;
    }
    .studio-dashboard {
        padding: 0 10px 10px;
        gap: 10px;
    }
    .studio-dashboard-head {
        padding: 5px 2px 0;
    }
    .studio-title-icon {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }
    .studio-title-lockup h1 {
        font-size: 23px;
    }
    .studio-period-tabs {
        min-width: 360px;
    }
    .studio-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .studio-kpi-card {
        min-height: 92px;
        grid-template-columns: 40px minmax(0, 1fr);
        gap: 8px;
        padding: 11px;
    }
    .studio-kpi-card:last-child {
        grid-column: 1 / -1;
    }
    .studio-kpi-icon {
        width: 40px;
        height: 40px;
        font-size: 13px;
    }
    .studio-kpi-card b {
        font-size: 17px;
    }
    .studio-dashboard-card {
        padding: 12px;
        border-radius: 9px;
    }
    .studio-main-chart {
        height: 215px;
    }
    .studio-chart-legend {
        display: none;
    }
    .studio-earnings-body,
    .studio-traffic-body {
        grid-template-columns: 1fr;
        justify-items: center;
    }
    .studio-breakdown-list,
    .studio-traffic-bars {
        width: 100%;
    }
    .studio-content-strip {
        grid-template-columns: repeat(5, 150px);
    }
    .studio-tools-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .studio-wallet-options {
        grid-template-columns: 1fr;
    }
    .studio-operation-panel > section,
    .studio-operation-panel > .studio-leaderboard-panel {
        margin: 0 8px 8px;
        padding: 10px;
    }
}

@media (max-width: 430px) {
    .studio-kpi-grid {
        grid-template-columns: 1fr;
    }
    .studio-kpi-card:last-child {
        grid-column: auto;
    }
    .studio-tools-grid {
        grid-template-columns: 1fr;
    }
    .studio-title-lockup p {
        font-size: 11px;
    }
}

/* Final mobile shell guard.
   Keep this block last so later desktop component rules cannot revive the
   global sidebar or leave its desktop spacing behind on narrow screens. */
@media (max-width: 768px) {
    .app-shell > .sidebar,
    .app-shell > .desktop-sidebar,
    .app-shell > .left-sidebar,
    .app-shell > .side-nav {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        overflow: hidden !important;
        pointer-events: none !important;
    }

    .app-shell,
    .app-shell > .content,
    .app-shell > .main-content,
    .app-shell > .app-content,
    .app-shell > .page-content {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        padding-left: 0 !important;
    }

    .app-shell > .content {
        min-width: 0 !important;
        padding-right: 0 !important;
        padding-bottom: calc(84px + env(safe-area-inset-bottom)) !important;
    }

    .app-shell > .content > .topbar,
    .app-shell > .content > .screen,
    #app-root {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .app-shell > .bottom-nav.mobile-dock,
    body[data-page="loopz"] .app-shell > .bottom-nav.mobile-dock {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        z-index: 2000 !important;
        width: 100% !important;
        height: auto !important;
        min-height: calc(70px + env(safe-area-inset-bottom)) !important;
        display: grid !important;
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
        align-items: center !important;
        padding: 5px 8px calc(5px + env(safe-area-inset-bottom)) !important;
        border-top: 1px solid var(--border-color) !important;
        background: var(--bg-secondary) !important;
        background: color-mix(in srgb, var(--bg-secondary) 92%, transparent) !important;
        backdrop-filter: blur(18px) !important;
        -webkit-backdrop-filter: blur(18px) !important;
    }

    body[data-page="loopz"] .app-shell > .content {
        padding: 0 !important;
    }

    body[data-page="loopz"] .loopz-actions,
    body[data-page="loopz"] .loopz-meta {
        bottom: calc(86px + env(safe-area-inset-bottom)) !important;
    }
}

/* Final phone/PWA width guard. Keep this last so component-specific rules
   cannot reintroduce an oversized child after the mobile shell is applied. */
@media (max-width: 768px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        overscroll-behavior-x: none;
    }

    @supports (overflow: clip) {
        html,
        body {
            overflow-x: clip;
        }
    }

    body,
    .app-shell,
    .content,
    .screen,
    #app-root,
    .home-page-shell,
    .home-feed-column,
    .feed,
    .post-card,
    .shared-post,
    .post-comments-panel,
    .home-composer,
    .home-inline-composer,
    .composer-screen,
    .composer-form,
    .composer-workspace,
    .composer-panel {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .screen > *,
    #app-root > *,
    .home-feed-column > *,
    .post-card > *,
    .shared-post > *,
    .composer-form > * {
        min-width: 0;
        max-width: 100%;
    }

    input,
    textarea,
    select {
        min-width: 0;
        max-width: 100%;
        font-size: 16px !important;
    }

    button,
    a,
    input,
    textarea,
    select {
        touch-action: manipulation;
    }

    .topbar {
        width: 100%;
        max-width: 100%;
        padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right));
    }

    .home-feed-column > .home-search {
        width: auto;
        max-width: calc(100% - 24px);
    }

    .home-search input,
    .post-user-link,
    .shared-post-head > div,
    .inline-composer-main {
        min-width: 0;
        overflow: hidden;
    }

    .post-head {
        width: 100%;
        max-width: 100%;
    }

    .post-head .feed-follow-btn {
        max-width: 88px;
        overflow: hidden;
        text-overflow: ellipsis;
        flex-shrink: 1;
    }

    .post-options {
        flex: 0 0 34px;
        min-width: 34px;
        max-width: 34px;
    }

    .post-actions,
    .shared-post-actions {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .post-actions .action-left,
    .shared-post-actions .action-left {
        min-width: 0;
        max-width: calc(100% - 30px);
        flex: 1 1 auto;
        gap: clamp(2px, 2.4vw, 10px);
    }

    .post-actions .metric-action,
    .shared-post-actions .metric-action {
        flex: 0 1 auto;
        min-width: 0;
    }

    .shared-post-head {
        width: 100%;
        max-width: 100%;
        grid-template-columns: 34px 44px minmax(0, 1fr) 34px;
    }

    .shared-post-head p {
        overflow-wrap: anywhere;
    }

    .shared-post-head .shared-follow-btn {
        max-width: 100%;
        white-space: normal;
    }

    .comment-form {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .home-inline-composer {
        width: 100%;
    }

    .home-inline-composer textarea {
        resize: vertical;
    }

    .inline-composer-actions {
        width: 100%;
    }

    .bottom-nav,
    .app-shell > .bottom-nav.mobile-dock {
        max-width: 100%;
        overflow: hidden;
    }

    .bottom-nav a {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .bottom-nav a b {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .bottom-nav .create-fab {
        width: min(58px, 100%);
        max-width: 100%;
    }
}

/* Inbox and direct messages */
.inbox-titlebar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    padding: 8px 4px 2px;
}
.inbox-titlebar span {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.inbox-titlebar h1 {
    margin: 0;
    font-size: clamp(28px, 5vw, 38px);
    line-height: 1;
    letter-spacing: -.04em;
}
.inbox-chat-row {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    min-width: 0;
    padding: 12px 4px;
    border-radius: 14px;
    cursor: pointer;
}
.inbox-chat-row:hover,
.inbox-chat-row:focus-visible {
    background: var(--bg-secondary);
    outline: none;
}
.inbox-chat-row > img {
    width: 52px;
    height: 52px;
}
.inbox-chat-copy {
    min-width: 0;
}
.inbox-chat-copy > div {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.inbox-chat-copy b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.inbox-chat-copy small {
    max-width: 100%;
}
.inbox-chat-copy .inbox-chat-username {
    margin-bottom: 2px;
    color: var(--text-secondary);
    font-size: 11px;
}
.inbox-chat-row.has-unread [data-chat-preview] {
    color: var(--text);
    font-weight: 800;
}
.inbox-chat-meta {
    display: grid;
    justify-items: end;
    align-self: stretch;
    align-content: space-between;
    gap: 5px;
    color: var(--muted);
}
.inbox-chat-meta time {
    font-size: 10px;
    white-space: nowrap;
}
.inbox-chat-meta i {
    font-size: 21px;
    font-style: normal;
}
.inbox-unread-badge {
    min-width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--btn-bg-primary);
    color: var(--btn-text-primary);
    font-size: 10px;
    font-weight: 900;
}
.inbox-row-mark {
    flex: 0 0 auto;
    padding: 2px 5px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--btn-bg-primary) 14%, transparent);
    color: var(--btn-bg-primary);
    font-size: 9px;
    font-weight: 900;
}
.inbox-row-star {
    color: #f5b82e;
    font-size: 12px;
}
.request-row {
    grid-template-columns: 46px minmax(0, 1fr) auto;
}
.request-actions {
    display: flex;
    gap: 6px;
}
.request-actions .is-accept {
    border-color: var(--btn-bg-primary);
    background: var(--btn-bg-primary);
    color: var(--btn-text-primary);
}

.chat-shell-overlay {
    z-index: 2600;
}
.chat-shell {
    position: relative;
    width: min(500px, 100%);
    height: 100dvh;
    max-height: 100dvh;
    min-width: 0;
    overflow: hidden;
}
.chat-shell-head {
    flex: 0 0 auto;
    min-height: 66px;
    padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left));
    box-shadow: 0 1px 0 var(--line);
}
.chat-shell-back,
.chat-options-btn {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    font-size: 28px;
}
.chat-shell-back:hover,
.chat-options-btn:hover {
    background: var(--bg-secondary);
}
.chat-shell-peer {
    flex: 1 1 auto;
    min-width: 0;
}
.chat-shell-peer div {
    min-width: 0;
}
.chat-shell-peer b,
.chat-shell-peer small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-follow-btn {
    flex: 0 0 auto;
    min-width: 70px;
    padding: 7px 11px;
    border: 1px solid var(--btn-bg-primary);
    border-radius: 999px;
    background: var(--btn-bg-primary);
    color: var(--btn-text-primary);
    font-size: 11px;
    font-weight: 900;
}
.chat-follow-btn.is-followed {
    border-color: var(--line);
    background: transparent;
    color: var(--text);
}
.chat-search-bar {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 36px;
    gap: 7px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}
.chat-search-bar[hidden] {
    display: none;
}
.chat-search-bar input {
    width: 100%;
    min-width: 0;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--input-bg);
    color: var(--text);
    font: inherit;
}
.chat-search-bar button {
    border: 0;
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--text);
    font-size: 20px;
}
.chat-blocked-notice {
    flex: 0 0 auto;
    padding: 10px 14px;
    border-bottom: 1px solid color-mix(in srgb, #ef4444 28%, var(--line));
    background: color-mix(in srgb, #ef4444 10%, var(--panel));
    color: var(--text);
    font-size: 12px;
    line-height: 1.45;
    text-align: center;
}
.chat-blocked-notice[hidden] {
    display: none;
}
.active-chat-messages {
    min-width: 0;
    padding: 16px max(13px, env(safe-area-inset-right)) 20px max(13px, env(safe-area-inset-left));
    gap: 7px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}
.chat-message {
    max-width: min(82%, 360px);
    padding: 9px 12px;
    border: 0;
    border-radius: 18px 18px 18px 5px;
    background: var(--panel);
    box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.chat-message.is-me {
    border-radius: 18px 18px 5px 18px;
    background: var(--btn-bg-primary);
}
[dir="rtl"] .chat-message {
    border-radius: 18px 18px 5px 18px;
}
[dir="rtl"] .chat-message.is-me {
    border-radius: 18px 18px 18px 5px;
}
.chat-message p {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    unicode-bidi: plaintext;
}
.chat-date-separator {
    align-self: stretch;
    display: flex;
    justify-content: center;
    padding: 8px 0 4px;
}
.chat-date-separator span {
    padding: 4px 9px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--panel) 82%, transparent);
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
}
.chat-shared-post {
    min-width: min(270px, 72vw);
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    padding: 9px;
    border-radius: 13px;
    background: var(--bg-secondary);
    color: var(--text);
    text-decoration: none;
}
.chat-message.is-me .chat-shared-post {
    background: rgba(255,255,255,.15);
    color: var(--btn-text-primary);
}
.chat-shared-post-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: linear-gradient(135deg, #800080, #00a2ff);
    color: #fff;
    font-size: 11px;
    font-weight: 950;
}
.chat-shared-post b,
.chat-shared-post small {
    display: block;
}
.active-chat-messages .chat-message .chat-shared-post b {
    display: block;
}
.chat-shared-post b {
    font-size: 12px;
}
.chat-shared-post small {
    color: inherit;
    opacity: .72;
    font-size: 10px;
}
.chat-shared-post i {
    font-size: 22px;
    font-style: normal;
}
.chat-gallery-tile.is-gif-sticker {
    background: transparent;
}
.chat-gallery.is-single .chat-gallery-tile.is-gif-sticker .chat-media {
    width: min(210px, 58vw);
    max-height: 210px;
    object-fit: contain;
}
.chat-message.has-media:has(.is-gif-sticker):not(:has(p)) {
    padding: 0;
    background: transparent;
    box-shadow: none;
}
.chat-message.has-media:has(.is-gif-sticker):not(:has(p)) > small {
    color: var(--muted);
}
.chat-gif-picker {
    flex: 0 0 auto;
    max-height: min(34vh, 260px);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    overflow-y: auto;
    padding: 10px 12px;
    border-top: 1px solid var(--line);
    background: var(--panel);
}
.chat-gif-picker[hidden] {
    display: none;
}
.chat-gif-pick {
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-secondary);
}
.chat-gif-pick img {
    width: 100%;
    aspect-ratio: 1;
    display: block;
    object-fit: cover;
}
.chat-compose {
    flex: 0 0 auto;
    min-width: 0;
    align-items: center;
    padding: 9px max(10px, env(safe-area-inset-right)) calc(9px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
}
.chat-compose textarea {
    min-width: 0;
    min-height: 42px;
    padding: 10px 13px;
    font-size: 16px;
    unicode-bidi: plaintext;
}
.chat-compose.is-disabled {
    display: none;
}
.chat-attach-btn,
.chat-gif-btn {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
}
.chat-gif-btn {
    font-size: 11px;
    font-weight: 950;
}
.chat-attach-btn:hover,
.chat-gif-btn:hover {
    background: var(--bg-secondary);
}
.chat-send-btn {
    width: 40px;
    height: 40px;
    transition: opacity .15s ease, transform .15s ease;
}
.chat-send-btn:disabled {
    opacity: 0;
    pointer-events: none;
    transform: scale(.75);
}
.chat-options-panel {
    position: absolute;
    inset: 0;
    z-index: 5;
}
.chat-options-panel[hidden] {
    display: none;
}
.chat-options-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    border: 0;
    background: rgba(0,0,0,.44);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity .22s ease;
}
.chat-options-sheet {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    max-height: 88%;
    overflow-y: auto;
    padding: 0 14px calc(14px + env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0;
    background: var(--panel);
    box-shadow: 0 -18px 50px rgba(0,0,0,.2);
    transform: translateY(104%);
    transition: transform .26s cubic-bezier(.22,.61,.36,1);
}
.chat-options-panel.is-open .chat-options-backdrop {
    opacity: 1;
}
.chat-options-panel.is-open .chat-options-sheet {
    transform: translateY(0);
}
.chat-options-panel.is-closing .chat-options-backdrop {
    opacity: 0;
}
.chat-options-panel.is-closing .chat-options-sheet {
    transform: translateY(104%);
}
.chat-options-sheet header {
    position: sticky;
    top: 0;
    display: grid;
    grid-template-columns: 36px 1fr 36px;
    align-items: center;
    padding: 13px 0 9px;
    background: var(--panel);
    text-align: center;
}
.chat-options-sheet header button {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--text);
    font-size: 20px;
}
.chat-option-row {
    width: 100%;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 11px 2px;
    border: 0;
    border-top: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    text-align: start;
    text-decoration: none;
}
.chat-option-row > span {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: var(--bg-secondary);
    font-size: 10px;
    font-weight: 950;
}
.chat-option-row > b {
    font-size: 14px;
}
.chat-option-row > i {
    min-width: 24px;
    color: var(--muted);
    font-size: 22px;
    font-style: normal;
    text-align: center;
}
.chat-option-row[data-chat-preference] > i {
    width: 38px;
    height: 22px;
    position: relative;
    border-radius: 999px;
    background: var(--line);
}
.chat-option-row[data-chat-preference] > i::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--panel);
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
    transition: transform .18s ease;
}
.chat-option-row[data-chat-preference].is-active > i {
    background: var(--btn-bg-primary);
}
.chat-option-row[data-chat-preference].is-active > i::after {
    transform: translateX(16px);
}
[dir="rtl"] .chat-option-row[data-chat-preference].is-active > i::after {
    transform: translateX(-16px);
}
.chat-option-row.is-danger {
    color: #ef4444;
}
body.chat-shell-active {
    overflow: hidden;
}
body.chat-shell-active .app-shell > .bottom-nav.mobile-dock,
body.chat-shell-active .bottom-nav,
body.chat-shell-active .nabdex-fab {
    display: none !important;
}
body.chat-shell-active .media-lightbox {
    z-index: 3200;
}
body.chat-shell-active .report-picker-overlay {
    z-index: 3100;
}
body.chat-shell-active .toast {
    z-index: 3300;
}

@media (max-width: 768px) {
    body[data-page="inbox"] .topbar {
        display: none;
    }
    body[data-page="inbox"] .content {
        padding-top: 0 !important;
    }
    .inbox-screen {
        width: 100%;
        max-width: 100%;
        gap: 8px;
        padding: 0 10px 18px;
        overflow-x: hidden;
    }
    .inbox-titlebar {
        position: sticky;
        top: 0;
        z-index: 24;
        margin: 0 -10px;
        padding: calc(14px + env(safe-area-inset-top)) 16px 12px;
        border-bottom: 1px solid var(--line);
        background: color-mix(in srgb, var(--panel) 94%, transparent);
        backdrop-filter: blur(18px);
    }
    .inbox-titlebar span {
        display: none;
    }
    .inbox-titlebar h1 {
        font-size: 25px;
    }
    .inbox-mobile-switcher {
        position: sticky;
        top: calc(52px + env(safe-area-inset-top));
        z-index: 23;
        margin: 0 -2px 3px;
        border-color: var(--line);
        background: color-mix(in srgb, var(--panel) 94%, transparent);
    }
    .inbox-panel {
        min-width: 0;
        padding: 8px 4px 12px;
        border: 0;
        border-radius: 0;
        background: transparent;
    }
    .inbox-panel .section-head {
        padding: 5px 4px 2px;
    }
    .inbox-panel .section-head h2 {
        font-size: 16px;
    }
    .inbox-chat-row {
        width: 100%;
        max-width: 100%;
        grid-template-columns: 50px minmax(0, 1fr) auto;
        gap: 10px;
        padding: 11px 3px;
    }
    .inbox-chat-row > img {
        width: 50px;
        height: 50px;
    }
    .request-row {
        grid-template-columns: 44px minmax(0, 1fr);
        gap: 9px;
    }
    .request-row .request-actions {
        grid-column: 2;
        justify-content: flex-start;
    }
    body[data-page="inbox"] .nabdex-fab:not([hidden]) {
        bottom: calc(84px + env(safe-area-inset-bottom));
        inset-inline-end: 12px;
    }
    .chat-shell-overlay {
        background: var(--bg-primary);
        backdrop-filter: none;
    }
    .chat-shell {
        width: 100%;
        border: 0;
        box-shadow: none;
    }
    .chat-shell-head {
        min-height: calc(62px + env(safe-area-inset-top));
    }
    .chat-shell-peer img {
        width: 40px;
        height: 40px;
    }
    .chat-message {
        max-width: 86%;
    }
    .chat-options-sheet {
        max-height: 92%;
    }
}

/* ADMIN PANEL v2 STYLES APPENDED */

/* Mobile app navigation and header actions */
.topbar-user-actions {
    margin-inline-start: auto;
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}
.topbar-user-actions .topbar-admin-link {
    margin-left: 0;
}
.topbar-inbox-link {
    position: relative;
    display: none;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--panel);
    color: var(--text-primary);
}
.topbar-inbox-link svg,
.mobile-nav-icon svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.topbar-inbox-link .nav-badge {
    top: -4px;
    right: -5px;
    box-shadow: 0 0 0 2px var(--panel), 0 2px 8px rgba(224, 36, 94, .5);
}
.mobile-nav-icon {
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
}
.bottom-nav a.active .mobile-nav-icon {
    transform: translateY(-1px);
}
body[data-page="loopz"] .topbar-inbox-link {
    display: none !important;
}

/* Admin command workspace */
body[data-page="admin-system"] .screen,
body[data-page="admin"] .screen {
    width: min(100%, 1480px);
}
.system-admin-shell {
    grid-template-columns: 300px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background:
        radial-gradient(circle at 92% 2%, rgba(128, 0, 128, .09), transparent 28%),
        var(--bg-secondary);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .14);
}
.system-admin-side {
    height: calc(100vh - 36px);
    padding: 18px 12px;
    scrollbar-width: thin;
}
.system-admin-brand {
    align-items: center;
    padding: 2px 6px 16px;
}
.system-admin-brand > div {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.system-admin-brand > div > span:last-child {
    min-width: 0;
    display: grid;
}
.system-admin-brand-mark {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #7e22ce, #e0245e);
    color: #fff;
    font-size: 12px;
    font-weight: 950;
    letter-spacing: .08em;
    box-shadow: 0 10px 26px rgba(126, 34, 206, .24);
}
.system-admin-side nav {
    gap: 2px;
}
.system-admin-nav-section {
    display: grid;
    gap: 4px;
}
.system-admin-nav-group {
    margin: 16px 8px 4px;
}
.system-admin-side .system-admin-nav-button {
    width: 100%;
    min-height: 55px;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 11px;
    text-align: left;
}
.system-admin-nav-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 950;
    letter-spacing: .05em;
}
.system-admin-nav-button > span:last-child,
.system-admin-command-results button > span:last-child,
.system-admin-quick-grid button > span:nth-child(2) {
    min-width: 0;
    display: grid;
    gap: 2px;
}
.system-admin-nav-button b,
.system-admin-command-results b,
.system-admin-quick-grid b {
    font-size: 12px;
}
.system-admin-nav-button small {
    overflow: hidden;
    color: var(--text-muted);
    font-size: 9px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.system-admin-nav-button.active .system-admin-nav-icon {
    border-color: transparent;
    background: linear-gradient(135deg, #7e22ce, #e0245e);
    color: #fff;
}
.system-admin-side-tools {
    display: grid;
    gap: 6px;
    margin-top: 18px;
    padding: 14px 6px 2px;
    border-top: 1px solid var(--border-color);
}
.system-admin-side-tools > span {
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.system-admin-side-tools a {
    display: grid;
    gap: 1px;
    padding: 8px 9px;
    border-radius: 9px;
}
.system-admin-side-tools a:hover {
    background: var(--bg-secondary);
}
.system-admin-side-tools b {
    font-size: 11px;
}
.system-admin-side-tools small {
    color: var(--text-muted);
    font-size: 9px;
}
.system-admin-main {
    padding: 0 clamp(14px, 2.5vw, 34px) 40px;
}
.system-admin-head {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 82px;
    padding: 14px 0;
    background: color-mix(in srgb, var(--bg-secondary) 92%, transparent);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.system-admin-head h1 {
    font-size: clamp(21px, 3vw, 29px);
}
.system-admin-commandbar {
    position: sticky;
    top: 82px;
    z-index: 29;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 12px 0;
    background: color-mix(in srgb, var(--bg-secondary) 92%, transparent);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.system-admin-command-search {
    position: relative;
    min-width: 0;
}
.system-admin-command-search > svg {
    position: absolute;
    left: 13px;
    top: 50%;
    z-index: 2;
    width: 19px;
    height: 19px;
    transform: translateY(-50%);
    fill: none;
    stroke: var(--text-muted);
    stroke-width: 2;
    stroke-linecap: round;
}
.system-admin-command-search > input {
    width: 100%;
    min-height: 46px;
    padding: 10px 48px 10px 42px;
    border: 1px solid var(--border-color);
    border-radius: 13px;
    background: var(--panel);
    color: var(--text-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .06);
}
.system-admin-command-search > input:focus {
    outline: none;
    border-color: rgba(168, 85, 247, .62);
    box-shadow: 0 0 0 4px rgba(168, 85, 247, .11);
}
.system-admin-command-search > kbd {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    min-width: 24px;
    padding: 3px 6px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 11px;
    text-align: center;
}
.system-admin-command-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 80;
    overflow: hidden;
    max-height: min(480px, 62vh);
    overflow-y: auto;
    padding: 7px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--panel);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}
.system-admin-command-results button {
    width: 100%;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 9px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-primary);
    text-align: left;
}
.system-admin-command-results button:hover {
    background: var(--bg-secondary);
}
.system-admin-command-results small,
.system-admin-quick-grid small {
    color: var(--text-secondary);
    font-size: 10px;
    line-height: 1.35;
}
.system-admin-refresh {
    min-height: 44px;
    padding-inline: 16px;
    border-radius: 11px;
    white-space: nowrap;
}
.system-admin-current-detail,
.system-admin-dashboard-lede {
    margin: 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
}
.system-admin-current-detail {
    padding-bottom: 3px;
}
.system-admin-panel {
    padding-top: 16px;
}
.system-admin-quick-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0 18px;
}
.system-admin-quick-grid button {
    min-width: 0;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 13px;
    background: var(--panel);
    color: var(--text-primary);
    text-align: left;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .05);
}
.system-admin-quick-grid button:hover {
    border-color: rgba(168, 85, 247, .44);
    transform: translateY(-2px);
}
.system-admin-quick-grid button > i {
    color: var(--text-muted);
    font-size: 24px;
    font-style: normal;
}
.system-admin-attention {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    padding: 11px 13px;
    border: 1px solid rgba(245, 158, 11, .28);
    border-radius: 12px;
    background: rgba(245, 158, 11, .08);
}
.system-admin-attention.is-clear {
    border-color: rgba(34, 197, 94, .25);
    background: rgba(34, 197, 94, .07);
}
.system-admin-attention b {
    flex: 0 0 auto;
    font-size: 11px;
}
.system-admin-attention span {
    min-width: 0;
    color: var(--text-secondary);
    font-size: 11px;
}

@media (max-width: 768px) {
    .topbar-user-actions {
        gap: 7px;
    }
    .topbar-inbox-link {
        display: grid;
        flex: 0 0 40px;
    }
    .topbar-admin-link {
        display: none;
    }
    .mobile-brand {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .bottom-nav .mobile-nav-icon {
        font-size: 0 !important;
    }
    .system-admin-shell {
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }
    .system-admin-side {
        width: min(90vw, 340px);
    }
    .system-admin-main {
        padding-inline: 12px;
    }
    .system-admin-head {
        top: 58px;
        min-height: 70px;
    }
    .system-admin-commandbar {
        top: 128px;
        grid-template-columns: minmax(0, 1fr);
    }
    .system-admin-refresh {
        display: none;
    }
    .system-admin-head .system-admin-secure {
        display: none;
    }
    .system-admin-head .system-admin-killswitch {
        margin-left: auto;
    }
    .system-admin-quick-grid {
        grid-template-columns: 1fr;
    }
    .system-admin-attention {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }
}

@media (min-width: 769px) and (max-width: 1120px) {
    .system-admin-shell {
        grid-template-columns: 248px minmax(0, 1fr);
    }
    .system-admin-quick-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ===== Settings control center rebuild ===== */
body[data-page="settings"] .screen {
    width: min(100%, 1180px);
}
body[data-page="settings"] .content {
    overflow-x: clip;
}
.settings-pro-screen {
    min-width: 0;
    gap: 16px;
}
.settings-pro-screen > form[data-vform] {
    display: none;
}
.settings-pro-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px 28px;
    align-items: center;
    padding: 26px 28px;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    background:
        radial-gradient(circle at 5% 0%, rgba(168, 85, 247, .24), transparent 34%),
        radial-gradient(circle at 100% 20%, rgba(14, 165, 233, .18), transparent 34%),
        var(--panel);
    box-shadow: 0 22px 64px rgba(0, 0, 0, .12);
}
.settings-hero-copy {
    min-width: 0;
}
.settings-hero-copy h1 {
    margin: 5px 0 8px;
    font-size: clamp(34px, 5vw, 52px);
    line-height: 1;
    letter-spacing: -.04em;
}
.settings-hero-copy p {
    max-width: 620px;
    line-height: 1.55;
}
.settings-hero-account,
.settings-sidebar-account {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 11px;
    align-items: center;
    min-width: 0;
}
.settings-hero-account {
    min-width: 210px;
    padding: 11px 14px;
    border: 1px solid var(--border-color);
    border-radius: 17px;
    background: rgba(255, 255, 255, .055);
}
.settings-hero-account img,
.settings-sidebar-account img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-secondary);
}
.settings-hero-account div,
.settings-sidebar-account div {
    min-width: 0;
}
.settings-hero-account b,
.settings-hero-account small,
.settings-sidebar-account b,
.settings-sidebar-account small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.settings-hero-account small,
.settings-sidebar-account small {
    margin-top: 2px;
    color: var(--text-secondary);
    font-size: 12px;
}
.settings-hero-stats {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.settings-hero-stats > div {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 15px;
    background: rgba(255, 255, 255, .04);
}
.settings-hero-stats span {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.settings-hero-stats b {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.settings-pro-form {
    min-width: 0;
    gap: 16px;
}
.settings-segment-shell {
    grid-template-columns: 264px minmax(0, 1fr);
    gap: 16px;
}
.settings-segment-sidebar {
    top: 78px;
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--panel);
    box-shadow: 0 16px 44px rgba(0, 0, 0, .08);
}
.settings-sidebar-account {
    padding: 4px 4px 10px;
    border-bottom: 1px solid var(--border-color);
}
.settings-section-search {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 13px;
    background: var(--input-bg);
    color: var(--text-secondary);
}
.settings-section-search .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}
.settings-section-search:focus-within {
    border-color: rgba(168, 85, 247, .72);
    box-shadow: 0 0 0 3px rgba(128, 0, 128, .14);
}
.settings-section-search svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 2;
}
.settings-section-search input {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
}
.settings-section-search input:focus {
    border: 0;
    background: transparent;
    box-shadow: none;
}
.settings-segment-sidebar .settings-tabbar {
    display: grid;
    gap: 5px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
}
.settings-tabbar button {
    min-width: 0;
    min-height: 54px;
}
.settings-segment-sidebar .settings-tabbar button {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 10px;
    align-items: center;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 13px;
    text-align: left;
}
.settings-segment-sidebar .settings-tabbar button > span {
    grid-row: 1 / 3;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}
.settings-tabbar svg,
.settings-panel-icon svg,
.settings-security-note svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}
.settings-segment-sidebar .settings-tabbar button b,
.settings-segment-sidebar .settings-tabbar button small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.settings-segment-sidebar .settings-tabbar button b {
    font-size: 13px;
    white-space: nowrap;
}
.settings-segment-sidebar .settings-tabbar button small {
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}
.settings-segment-sidebar .settings-tabbar button.active {
    border-color: rgba(168, 85, 247, .3);
    background: linear-gradient(135deg, rgba(128, 0, 128, .2), rgba(14, 165, 233, .1));
    color: var(--text-primary);
    box-shadow: inset 3px 0 0 #a855f7;
}
.settings-segment-sidebar .settings-tabbar button.active > span {
    background: linear-gradient(135deg, #7c3aed, #0ea5e9);
    color: #fff;
}
.settings-segment-sidebar .settings-tabbar button[hidden] {
    display: none;
}
.settings-segment-panels {
    min-width: 0;
    gap: 12px;
}
.settings-panel {
    min-width: 0;
    gap: 12px;
}
.settings-panel-head {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 13px;
    align-items: center;
    padding: 5px 4px 7px;
}
.settings-panel-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(168, 85, 247, .22);
    border-radius: 15px;
    background: linear-gradient(135deg, rgba(128, 0, 128, .18), rgba(14, 165, 233, .1));
    color: #a855f7;
}
.settings-panel-head h2 {
    margin: 0 0 4px;
    font-size: clamp(23px, 3vw, 30px);
    letter-spacing: -.025em;
}
.settings-panel-head p,
.settings-card-head p,
.settings-avatar-preview p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
}
.settings-card {
    min-width: 0;
    gap: 14px;
    margin: 0;
    padding: 19px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--panel);
    box-shadow: 0 12px 36px rgba(0, 0, 0, .055);
}
.settings-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}
.settings-card-head h3,
.settings-avatar-preview h3,
.settings-verification-form h4 {
    margin: 0 0 4px;
    color: var(--text-primary);
}
.settings-card-head h3,
.settings-avatar-preview h3 {
    font-size: 16px;
}
.settings-card-head-action .mini-btn {
    flex: 0 0 auto;
}
.settings-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    min-width: 0;
}
.settings-field {
    display: grid;
    align-content: start;
    gap: 6px;
    min-width: 0;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 800;
}
.settings-field-wide {
    grid-column: 1 / -1;
}
.settings-field > span {
    padding-inline: 2px;
}
.settings-field > small {
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.4;
}
.settings-field input,
.settings-field select,
.settings-field textarea {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    margin: 0;
    border-radius: 12px;
}
.settings-field textarea {
    min-height: 92px;
    resize: vertical;
}
.settings-choice-group {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}
.settings-choice-group legend {
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 800;
}
.premium-ring-picker {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.premium-ring-picker label {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
}
.premium-ring-picker label:has(input:checked) {
    border-color: rgba(168, 85, 247, .65);
    background: rgba(168, 85, 247, .12);
}
.ios-switch-row {
    min-width: 0;
    min-height: 68px;
    padding: 11px 12px;
    border-color: var(--border-color);
    border-radius: 15px;
    background: var(--bg-secondary);
    cursor: pointer;
}
.ios-switch-row:has(input:focus-visible) {
    border-color: rgba(168, 85, 247, .7);
    box-shadow: 0 0 0 3px rgba(128, 0, 128, .14);
}
.ios-switch-row b {
    font-size: 13px;
}
.ios-switch-row small {
    font-size: 11px;
    line-height: 1.4;
}
.avatar-management-card {
    gap: 16px;
}
.settings-avatar-preview {
    grid-template-columns: 80px minmax(0, 1fr);
}
.settings-avatar-preview img {
    width: 80px;
    height: 80px;
    border: 3px solid rgba(168, 85, 247, .28);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .14);
}
.avatar-management-actions {
    position: relative;
}
#settings-avatar-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}
.settings-file-picker {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 13px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--btn-bg-secondary);
    color: var(--btn-text-secondary);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}
.settings-file-picker:focus-within,
.settings-file-picker:hover {
    border-color: rgba(168, 85, 247, .58);
}
.settings-inline-state {
    min-height: 16px;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.5;
}
.session-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.wallet-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.wallet-cards b {
    min-width: 0;
    overflow: hidden;
    padding: 17px;
    border: 1px solid rgba(168, 85, 247, .2);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(128, 0, 128, .14), rgba(14, 165, 233, .07));
    font-size: clamp(18px, 3vw, 24px);
    text-overflow: ellipsis;
}
.wallet-cards span {
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 10px;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.settings-security-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid rgba(34, 197, 94, .22);
    border-radius: 12px;
    background: rgba(34, 197, 94, .07);
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.45;
}
.settings-security-note svg {
    flex: 0 0 auto;
    color: #22c55e;
}
.account-type-switcher {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0;
    border: 0;
    background: transparent;
}
.account-type-card {
    min-height: 94px;
    justify-content: center;
    border-radius: 15px;
    background: var(--bg-secondary);
}
.settings-verification-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.settings-verification-form {
    display: grid;
    align-content: start;
    gap: 11px;
    min-width: 0;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-secondary);
}
.settings-verification-form h4 {
    font-size: 14px;
}
.settings-verification-form .primary-btn {
    min-height: 44px;
}
.account-switch-row {
    min-width: 0;
    min-height: 64px;
}
.account-switch-row .mini-btn,
.account-switch-actions .mini-btn,
.settings-card-head-action .mini-btn,
.support-form .primary-btn {
    min-height: 44px;
}
.faq-item {
    border-color: var(--border-color);
    border-radius: 14px;
    background: var(--bg-secondary);
}
.faq-item summary {
    min-height: 48px;
    padding: 14px;
}
.support-form {
    margin: 0;
}
.settings-save-bar {
    bottom: 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 9px;
    padding: 10px;
    border-radius: 17px;
    background: color-mix(in srgb, var(--panel) 92%, transparent);
    box-shadow: 0 16px 48px rgba(0, 0, 0, .18);
}
.settings-save-state {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
}
.settings-save-state i {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .12);
}
.settings-save-state[data-state="dirty"] i {
    background: #f59e0b;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, .12);
}
.settings-save-state[data-state="saving"] i {
    background: #0ea5e9;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, .12);
    animation: settings-saving-pulse 1s ease-in-out infinite;
}
.settings-save-state[data-state="error"] i {
    background: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, .12);
}
.settings-save-bar .mini-btn,
.settings-save-bar .primary-btn {
    min-height: 44px;
    margin: 0;
    padding-inline: 16px;
}
.settings-logout {
    border-color: rgba(239, 68, 68, .26);
    color: #ef4444;
}
@keyframes settings-saving-pulse {
    50% { opacity: .42; transform: scale(.82); }
}

@media (max-width: 767px) {
    body[data-page="settings"] .content {
        padding-inline: 0;
    }
    body[data-page="settings"] .screen {
        width: 100%;
    }
    .settings-pro-screen {
        gap: 9px;
    }
    .settings-pro-hero {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 14px 10px;
        padding: 18px 14px 14px;
        border-left: 0;
        border-right: 0;
        border-radius: 0;
        box-shadow: none;
    }
    .settings-hero-copy h1 {
        margin-block: 3px 6px;
        font-size: 34px;
    }
    .settings-hero-copy p {
        font-size: 12px;
        line-height: 1.45;
    }
    .settings-hero-account {
        min-width: 0;
        max-width: 42vw;
        grid-template-columns: 40px minmax(0, 1fr);
        padding: 8px 9px;
        border-radius: 14px;
    }
    .settings-hero-account img {
        width: 40px;
        height: 40px;
    }
    .settings-hero-account b {
        font-size: 12px;
    }
    .settings-hero-stats {
        gap: 6px;
    }
    .settings-hero-stats > div {
        padding: 9px 8px;
        border-radius: 12px;
    }
    .settings-hero-stats span {
        font-size: 8px;
    }
    .settings-hero-stats b {
        font-size: 11px;
    }
    .settings-pro-form {
        padding-bottom: 108px;
    }
    .settings-segment-shell {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .settings-segment-sidebar {
        position: sticky;
        top: 58px;
        z-index: 30;
        display: block;
        margin: 0;
        padding: 7px 0 6px;
        border: 0;
        border-bottom: 1px solid var(--border-color);
        border-radius: 0;
        background: color-mix(in srgb, var(--bg-primary) 94%, transparent);
        box-shadow: 0 8px 22px rgba(0, 0, 0, .08);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }
    .settings-sidebar-account,
    .settings-section-search {
        display: none;
    }
    .settings-segment-sidebar .settings-tabbar {
        display: flex;
        gap: 6px;
        padding: 0 8px;
        overflow-x: auto;
        scroll-padding-inline: 8px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .settings-segment-sidebar .settings-tabbar button {
        flex: 0 0 auto;
        min-height: 46px;
        display: grid;
        grid-template-columns: 24px auto;
        grid-template-rows: 1fr;
        gap: 6px;
        padding: 7px 11px;
        border: 1px solid var(--border-color);
        border-radius: 999px;
        background: var(--btn-bg-secondary);
        box-shadow: none;
    }
    .settings-segment-sidebar .settings-tabbar button > span {
        grid-row: 1;
        width: 24px;
        height: 24px;
        border-radius: 8px;
        background: transparent;
    }
    .settings-segment-sidebar .settings-tabbar button b {
        font-size: 12px;
    }
    .settings-segment-sidebar .settings-tabbar button small {
        display: none;
    }
    .settings-segment-sidebar .settings-tabbar button.active {
        border-color: rgba(168, 85, 247, .42);
        background: linear-gradient(135deg, rgba(124, 58, 237, .95), rgba(14, 165, 233, .82));
        color: #fff;
        box-shadow: none;
    }
    .settings-segment-sidebar .settings-tabbar button.active > span {
        background: transparent;
    }
    .settings-panel {
        gap: 9px;
    }
    .settings-panel-head {
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 11px;
        padding: 10px 14px 4px;
    }
    .settings-panel-icon {
        width: 42px;
        height: 42px;
        border-radius: 13px;
    }
    .settings-panel-head h2 {
        font-size: 22px;
    }
    .settings-panel-head p {
        font-size: 11px;
    }
    .settings-card {
        margin: 0 8px;
        padding: 15px;
        border-left: 1px solid var(--border-color);
        border-right: 1px solid var(--border-color);
        border-radius: 18px;
    }
    .settings-card-head {
        gap: 10px;
    }
    .settings-card-head-action {
        display: grid;
    }
    .settings-card-head-action .mini-btn {
        width: 100%;
    }
    .settings-field-grid,
    .settings-verification-grid {
        grid-template-columns: 1fr;
        gap: 11px;
    }
    .settings-field-wide {
        grid-column: auto;
    }
    .settings-field input,
    .settings-field select {
        min-height: 48px;
        font-size: 16px;
    }
    .settings-field textarea {
        min-height: 104px;
        font-size: 16px;
    }
    .premium-ring-picker {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .ios-switch-row {
        min-height: 72px;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
    }
    .settings-avatar-preview {
        grid-template-columns: 68px minmax(0, 1fr);
        justify-items: stretch;
    }
    .settings-avatar-preview img {
        width: 68px;
        height: 68px;
    }
    .avatar-management-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
    }
    .avatar-management-actions > * {
        width: 100%;
    }
    .wallet-cards {
        grid-template-columns: 1fr 1fr;
    }
    .wallet-cards b {
        padding: 13px 11px;
        font-size: 16px;
    }
    .account-type-switcher {
        grid-template-columns: 1fr;
    }
    .account-switch-row {
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr) auto;
    }
    .account-switch-row .danger {
        grid-column: 2 / -1;
        width: 100%;
    }
    .account-switch-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
    .settings-save-bar {
        bottom: calc(72px + env(safe-area-inset-bottom, 0px));
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin: 0 8px;
        padding: 9px;
        border-radius: 16px;
    }
    .settings-save-state {
        grid-column: 1 / -1;
        min-height: 22px;
        justify-content: center;
    }
    .settings-save-bar > .mini-btn,
    .settings-save-bar > .primary-btn {
        width: 100%;
        min-height: 46px;
        justify-content: center;
    }
}

@media (max-width: 390px) {
    .settings-hero-account {
        display: none;
    }
    .settings-pro-hero {
        grid-template-columns: 1fr;
    }
    .settings-hero-stats {
        grid-column: 1;
    }
    .settings-hero-stats > div {
        padding-inline: 6px;
    }
    .settings-hero-stats b {
        font-size: 10px;
    }
    .premium-ring-picker {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .settings-pro-hero::after {
        animation: none;
    }
    .settings-save-state[data-state="saving"] i {
        animation: none;
    }
}

/* ===== Mobile-first Settings list ===== */
body[data-page="settings"] .screen {
    width: min(100%, 820px);
}
.settings-list-screen {
    width: 100%;
    min-width: 0;
    display: grid;
    gap: 14px;
    padding: 2px 0 26px;
}
.settings-list-screen > form[data-vform] {
    display: none;
}
.settings-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 2px 2px;
}
.settings-list-header h1 {
    margin: 0;
    font-size: clamp(30px, 5vw, 42px);
    line-height: 1;
    letter-spacing: -.04em;
}
.settings-list-header p {
    margin: 7px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
}
.settings-profile-card {
    min-width: 0;
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: 22px;
    background:
        radial-gradient(circle at 100% 0%, rgba(14, 165, 233, .13), transparent 38%),
        radial-gradient(circle at 0% 100%, rgba(168, 85, 247, .16), transparent 42%),
        var(--panel);
    box-shadow: 0 18px 52px rgba(0, 0, 0, .09);
}
.settings-profile-card img {
    width: 72px;
    height: 72px;
    border: 3px solid rgba(168, 85, 247, .28);
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-secondary);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .14);
}
.settings-profile-card > div {
    min-width: 0;
}
.settings-profile-card h2,
.settings-profile-card p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.settings-profile-card h2 {
    margin: 0;
    font-size: 20px;
}
.settings-profile-card p {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
}
.settings-edit-profile-btn {
    min-height: 44px;
    padding: 9px 14px;
    border: 1px solid rgba(168, 85, 247, .32);
    border-radius: 12px;
    background: rgba(168, 85, 247, .1);
    color: var(--text-primary);
    font: inherit;
    font-size: 12px;
    font-weight: 900;
}
.settings-list-form {
    min-width: 0;
}
.settings-list-overview {
    display: grid;
    gap: 18px;
}
.settings-list-overview[hidden],
.settings-detail-stack[hidden],
.settings-detail-panel[hidden],
.settings-list-savebar[hidden] {
    display: none !important;
}
.settings-list-group {
    display: grid;
    gap: 8px;
    min-width: 0;
}
.settings-list-group > h2 {
    margin: 0;
    padding-inline: 5px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .075em;
    text-transform: uppercase;
}
.settings-list-group > h2:empty {
    display: none;
}
.settings-list-group > div {
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 19px;
    background: var(--panel);
    box-shadow: 0 12px 36px rgba(0, 0, 0, .045);
}
.settings-list-row {
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 72px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto 18px;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border: 0;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    text-align: start;
}
.settings-list-row:last-child {
    border-bottom: 0;
}
.settings-list-row:hover,
.settings-list-row:focus-visible {
    background: var(--bg-secondary);
}
.settings-list-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: rgba(168, 85, 247, .11);
    color: #a855f7;
}
.settings-list-icon.is-privacy,
.settings-list-icon.is-security {
    background: rgba(14, 165, 233, .11);
    color: #0ea5e9;
}
.settings-list-icon.is-alerts {
    background: rgba(245, 158, 11, .12);
    color: #f59e0b;
}
.settings-list-icon.is-language {
    background: rgba(34, 197, 94, .11);
    color: #22c55e;
}
.settings-list-icon.is-theme {
    background: rgba(99, 102, 241, .12);
    color: #818cf8;
}
.settings-list-icon.is-blocked,
.settings-list-icon.is-logout {
    background: rgba(239, 68, 68, .1);
    color: #ef4444;
}
.settings-list-icon svg,
.settings-detail-icon svg,
.settings-theme-picker svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.85;
}
.settings-list-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}
.settings-list-copy b,
.settings-list-copy small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.settings-list-copy b {
    font-size: 14px;
    white-space: nowrap;
}
.settings-list-copy small {
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.35;
    white-space: nowrap;
}
.settings-list-value {
    max-width: 170px;
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.settings-list-arrow {
    color: var(--text-muted);
    font-size: 25px;
    font-weight: 400;
    line-height: 1;
}
.settings-list-row.is-danger .settings-list-copy b {
    color: #ef4444;
}
.settings-list-danger-group > div {
    border-color: rgba(239, 68, 68, .2);
}
.settings-detail-stack,
.settings-detail-panel {
    min-width: 0;
}
.settings-detail-panel {
    display: grid;
    gap: 12px;
}
.settings-detail-head {
    display: grid;
    grid-template-columns: 44px 46px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    min-width: 0;
    padding: 5px 2px 9px;
}
.settings-detail-back {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 13px;
    background: var(--btn-bg-secondary);
    color: var(--btn-text-secondary);
    font-size: 29px;
    line-height: 1;
}
.settings-detail-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(124, 58, 237, .18), rgba(14, 165, 233, .11));
    color: #a855f7;
}
.settings-detail-head > div {
    min-width: 0;
}
.settings-detail-head h2 {
    margin: 0;
    overflow: hidden;
    font-size: clamp(22px, 4vw, 29px);
    letter-spacing: -.025em;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.settings-detail-head p {
    margin: 4px 0 0;
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.settings-detail-panel > .settings-card {
    margin: 0;
}
.settings-choice-list {
    padding: 0;
    overflow: hidden;
}
.settings-choice-list > button {
    width: 100%;
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 16px;
    border: 0;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    text-align: start;
}
.settings-choice-list > button:last-child {
    border-bottom: 0;
}
.settings-choice-list > button i {
    visibility: hidden;
    color: #22c55e;
    font-size: 19px;
    font-style: normal;
}
.settings-choice-list > button.is-selected {
    background: rgba(34, 197, 94, .07);
}
.settings-choice-list > button.is-selected i {
    visibility: visible;
}
.settings-theme-picker {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}
.settings-theme-picker label {
    min-width: 0;
}
.settings-theme-picker input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.settings-theme-picker label > span {
    min-height: 108px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 5px;
    padding: 13px 8px;
    border: 1px solid var(--border-color);
    border-radius: 15px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    text-align: center;
}
.settings-theme-picker label > span b {
    color: var(--text-primary);
    font-size: 13px;
}
.settings-theme-picker label > span small {
    color: var(--text-secondary);
    font-size: 9px;
}
.settings-theme-picker input:checked + span {
    border-color: rgba(168, 85, 247, .62);
    background: rgba(168, 85, 247, .11);
    box-shadow: 0 0 0 2px rgba(168, 85, 247, .1);
    color: #a855f7;
}
.settings-about-card {
    justify-items: center;
    padding-block: 28px;
    text-align: center;
}
.settings-about-logo {
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    border-radius: 23px;
    background: linear-gradient(135deg, #7c3aed, #ec4899 55%, #0ea5e9);
    color: #fff;
    font-size: 22px;
    font-weight: 950;
    box-shadow: 0 18px 42px rgba(124, 58, 237, .24);
}
.settings-about-card h3 {
    margin: 2px 0 0;
    font-size: 22px;
}
.settings-about-card > p {
    max-width: 500px;
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}
.settings-about-card dl {
    width: min(100%, 460px);
    margin: 8px 0 0;
    border: 1px solid var(--border-color);
    border-radius: 15px;
    overflow: hidden;
}
.settings-about-card dl > div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
}
.settings-about-card dl > div:last-child {
    border-bottom: 0;
}
.settings-about-card dt {
    color: var(--text-secondary);
}
.settings-about-card dd {
    margin: 0;
    font-weight: 800;
}
.settings-list-savebar {
    grid-template-columns: minmax(0, 1fr) auto;
}
.settings-load-error {
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 44px 18px;
    text-align: center;
}
.settings-load-error h1,
.settings-load-error p {
    margin: 0;
}
.settings-load-error p {
    color: var(--text-secondary);
}
[dir="rtl"] .settings-list-arrow {
    transform: rotate(180deg);
}
[dir="rtl"] .settings-detail-back {
    transform: rotate(180deg);
}

@media (max-width: 767px) {
    body[data-page="settings"] .content {
        padding-inline: 0 !important;
    }
    .settings-list-screen {
        gap: 10px;
        padding-bottom: calc(108px + env(safe-area-inset-bottom));
    }
    .settings-list-header {
        padding: 13px max(14px, env(safe-area-inset-right)) 5px max(14px, env(safe-area-inset-left));
    }
    .settings-list-header h1 {
        font-size: 32px;
    }
    .settings-list-header p {
        font-size: 12px;
    }
    .settings-profile-card {
        grid-template-columns: 62px minmax(0, 1fr);
        gap: 12px;
        margin: 0 8px;
        padding: 15px;
        border-radius: 18px;
    }
    .settings-profile-card img {
        width: 62px;
        height: 62px;
    }
    .settings-profile-card h2 {
        font-size: 17px;
    }
    .settings-edit-profile-btn {
        grid-column: 1 / -1;
        width: 100%;
        min-height: 46px;
    }
    .settings-list-overview {
        gap: 15px;
    }
    .settings-list-group {
        gap: 7px;
    }
    .settings-list-group > h2 {
        padding-inline: 16px;
    }
    .settings-list-group > div {
        margin: 0 8px;
        border-radius: 17px;
    }
    .settings-list-row {
        min-height: 70px;
        grid-template-columns: 40px minmax(0, 1fr) auto 15px;
        gap: 10px;
        padding: 10px 12px;
    }
    .settings-list-icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }
    .settings-list-copy b {
        font-size: 13px;
    }
    .settings-list-copy small {
        max-width: 55vw;
        font-size: 10px;
    }
    .settings-list-value {
        max-width: 22vw;
        font-size: 10px;
    }
    .settings-detail-panel {
        gap: 9px;
    }
    .settings-detail-head {
        position: sticky;
        top: 58px;
        z-index: 26;
        grid-template-columns: 42px 40px minmax(0, 1fr);
        gap: 9px;
        min-height: 66px;
        padding: 7px max(10px, env(safe-area-inset-right)) 7px max(10px, env(safe-area-inset-left));
        border-bottom: 1px solid var(--border-color);
        background: color-mix(in srgb, var(--bg-primary) 94%, transparent);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }
    .settings-detail-back {
        width: 42px;
        height: 42px;
    }
    .settings-detail-icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }
    .settings-detail-head h2 {
        font-size: 19px;
    }
    .settings-detail-head p {
        font-size: 9px;
    }
    .settings-detail-panel > .settings-card {
        margin: 0 8px;
        padding: 15px;
        border-radius: 17px;
    }
    .settings-detail-panel .settings-field input,
    .settings-detail-panel .settings-field select,
    .settings-detail-panel .settings-field textarea,
    .settings-detail-panel .support-form input,
    .settings-detail-panel .support-form select,
    .settings-detail-panel .support-form textarea {
        font-size: 16px;
    }
    .settings-theme-picker {
        grid-template-columns: 1fr;
    }
    .settings-theme-picker label > span {
        min-height: 74px;
        grid-template-columns: 28px minmax(0, 1fr);
        justify-items: start;
        text-align: start;
    }
    .settings-theme-picker label > span svg {
        grid-row: 1 / 3;
    }
    .settings-list-savebar {
        position: fixed;
        left: max(8px, env(safe-area-inset-left));
        right: max(8px, env(safe-area-inset-right));
        bottom: calc(76px + env(safe-area-inset-bottom));
        z-index: 45;
        width: auto;
        margin: 0;
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 8px;
    }
    .settings-list-savebar .settings-save-state {
        grid-column: auto;
        justify-content: flex-start;
        padding-inline: 5px;
    }
    .settings-list-savebar .settings-save-button {
        width: auto;
        min-width: 126px;
    }
}

@media (max-width: 420px) {
    .settings-list-row {
        grid-template-columns: 40px minmax(0, 1fr) 14px;
    }
    .settings-list-value {
        display: none;
    }
    .settings-list-copy small {
        max-width: 68vw;
    }
    .settings-list-savebar {
        grid-template-columns: 1fr;
    }
    .settings-list-savebar .settings-save-state {
        display: none;
    }
    .settings-list-savebar .settings-save-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .settings-list-row,
    .settings-detail-back,
    .settings-edit-profile-btn {
        scroll-behavior: auto;
        transition: none;
    }
}

/* ===== Feed media, actions, captions, and theme hardening ===== */
:root[data-theme="light"],
body.light-mode {
    --border-color: #d8dee9;
    --line: #d8dee9;
    --panel: rgba(255,255,255,.97);
    --bg-card: var(--panel);
    --premium-glass: rgba(255,255,255,.94);
}

.feed-video-shell {
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: min(76svh, 720px);
    aspect-ratio: var(--adaptive-media-ratio, 4 / 5);
    overflow: hidden;
    background: #080a0f;
}
.feed-video-shell .chaabi-custom-player {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: contain;
    background: #080a0f;
}
.feed-video-shell[data-media-shape="landscape"] {
    max-height: min(68svh, 620px);
}

.shared-media-slider {
    min-height: 0;
    background: #080a0f;
}
.shared-media-item {
    min-height: 0;
    background: var(--media-bg);
}
.shared-media-item.is-video {
    width: 100%;
    height: auto;
    max-height: min(76svh, 720px);
    aspect-ratio: var(--adaptive-media-ratio, 4 / 5);
    overflow: hidden;
    background: #080a0f;
}
.shared-media-item.is-video video {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: contain;
    background: #080a0f;
}
.shared-media-item:not(.is-video) img {
    width: 100%;
    height: auto;
    min-height: 0;
    object-fit: contain;
}

.post-actions,
.shared-post-actions {
    min-height: 50px;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 9px 14px 5px;
    border-top: 0;
}
.post-actions .action-left,
.shared-post-actions .action-left {
    min-width: 0;
    flex: 1 1 auto;
    justify-content: flex-start;
    gap: clamp(7px, 2.6vw, 16px);
}
.post-actions > .metric-action:last-child,
.shared-post-actions > .metric-action:last-child {
    margin-inline-start: auto;
}
.post-actions .metric-action,
.shared-post-actions .metric-action {
    min-width: 28px;
    max-width: 82px;
    padding: 4px 2px;
}
.post-actions .metric-action em,
.shared-post-actions .metric-action em {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-feed-column .post-sound-link {
    margin: 0 16px 14px;
}

.loopz-options-overlay {
    z-index: 2400;
}

.edit-profile-screen {
    background: var(--bg-primary);
    color: var(--text-primary);
}
.edit-profile-header {
    background: linear-gradient(180deg, var(--bg-primary) 72%, transparent);
}
.edit-profile-header h1,
.edit-profile-back {
    color: var(--text-primary);
}
.edit-profile-card {
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
}
.edit-profile-row {
    border-bottom-color: var(--border-color);
    color: var(--text-primary);
}
.edit-profile-row span,
.edit-profile-row i,
.edit-profile-section-title {
    color: var(--text-secondary);
}
.edit-profile-row input,
.edit-profile-row textarea,
.edit-profile-row.is-link b {
    color: var(--text-primary);
}

:where(
    .post-card,
    .shared-post,
    .post-comments-panel,
    .comment-row,
    .inbox-panel,
    .inbox-chat-row,
    .profile-hero,
    .profile-menu,
    .studio-dashboard-card,
    .studio-content-card,
    .studio-tools-card,
    .studio-operation-panel,
    .admin-control-card,
    .admin-user-card,
    .admin-user-form-card,
    .settings-list-group > div,
    .settings-detail-panel > .settings-card
) {
    color: var(--text-primary);
    background-color: var(--bg-card);
    border-color: var(--border-color);
}
:where(
    .post-comments-panel,
    .comment-row,
    .inbox-panel,
    .inbox-chat-row,
    .profile-menu,
    .studio-dashboard-card,
    .studio-content-card,
    .studio-tools-card,
    .studio-operation-panel,
    .admin-control-card,
    .admin-user-card,
    .admin-user-form-card
) :where(p, small, time) {
    color: var(--text-secondary);
}

@media (max-width: 640px) {
    .feed-video-shell,
    .shared-media-item.is-video {
        max-height: min(74svh, 660px);
    }
    .post-actions,
    .shared-post-actions {
        gap: 4px;
        min-height: 48px;
        padding-inline: 10px;
        overflow: visible;
    }
    .post-actions .action-left,
    .shared-post-actions .action-left {
        max-width: calc(100% - 34px);
        gap: clamp(3px, 2.4vw, 10px);
    }
    .post-actions .metric-action,
    .shared-post-actions .metric-action {
        flex: 0 1 auto;
        min-width: 26px;
    }
    input,
    textarea,
    select {
        font-size: 16px;
    }
}

@media (max-width: 350px) {
    .post-actions .metric-action,
    .shared-post-actions .metric-action {
        gap: 1px;
    }
    .post-actions .metric-action em,
    .shared-post-actions .metric-action em {
        max-width: 30px;
        font-size: 10px;
    }
}

/* ===== Single-caption post layout and video view metadata ===== */
.text-only-post-body.is-colored-text {
    min-height: clamp(220px, 46vw, 380px);
    display: grid;
    place-items: center;
    margin: 0 12px 12px;
    padding: clamp(24px, 6vw, 52px);
    border-radius: 18px;
    background: var(--post-text-bg, #111216);
    color: var(--post-text-color, #ffffff);
    text-align: center;
}
.text-only-post-body.is-colored-text .description,
.text-only-post-body.is-colored-text .description :where(span, a, b) {
    color: inherit;
    font-size: clamp(22px, 5vw, 38px);
    font-weight: 900;
    line-height: 1.2;
}
.explore-text-post {
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 16px;
    background: var(--explore-card-bg, #111216);
    color: var(--explore-card-color, #ffffff);
}
.post-view-count {
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 22px;
    padding: 0 14px 10px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 800;
}
.post-view-count b {
    color: var(--text-primary);
    font-size: inherit;
}
.post-view-count small {
    color: inherit;
    font-size: inherit;
}

.feed-follow-btn,
.shared-follow-btn {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 7px 13px;
    border-radius: 999px;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease;
}
.feed-follow-btn:hover,
.shared-follow-btn:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--btn-bg-primary) 78%, var(--border-color));
}
.feed-follow-btn:active,
.shared-follow-btn:active {
    transform: scale(.97);
}
.shared-post-head {
    grid-template-columns: 42px 54px minmax(0, 1fr) auto 38px;
}
.shared-post-head .shared-follow-btn {
    grid-column: 4;
    grid-row: 1;
    justify-self: end;
    max-width: 92px;
    white-space: nowrap;
}
.shared-post-head .post-options {
    grid-column: 5;
    grid-row: 1;
}

@media (max-width: 640px) {
    .shared-post-head {
        grid-template-columns: 34px 44px minmax(0, 1fr) auto 34px;
        gap: 7px;
    }
    .shared-post-head .post-back-btn {
        grid-column: 1;
        grid-row: 1;
    }
    .shared-post-head .shared-author-avatar {
        grid-column: 2;
        grid-row: 1;
    }
    .shared-post-head > div {
        grid-column: 3;
        grid-row: 1;
    }
    .shared-post-head .shared-follow-btn {
        grid-column: 4;
        grid-row: 1;
        max-width: 78px;
        padding-inline: 10px;
        white-space: nowrap;
    }
    .shared-post-head .post-options {
        grid-column: 5;
        grid-row: 1;
    }
    .post-view-count {
        padding-inline: 11px;
    }
    .text-only-post-body.is-colored-text {
        min-height: min(74vw, 330px);
        margin-inline: 10px;
    }
}

@media (max-width: 360px) {
    .shared-post-head {
        grid-template-columns: 32px 40px minmax(0, 1fr) auto 32px;
        gap: 5px;
        padding-inline: 7px;
    }
    .shared-author-avatar,
    .shared-post-head img {
        width: 40px;
        height: 40px;
    }
    .shared-post-head .shared-follow-btn {
        min-height: 30px;
        max-width: 68px;
        padding-inline: 8px;
        font-size: 11px;
    }
}

/* ===== Premium profile editor, Settings, and mobile dock ===== */
body.edit-profile-open {
    overflow: hidden;
}

.edit-profile-screen {
    --edit-bg: #020817;
    --edit-bg-soft: #07152d;
    --edit-card: rgba(10, 28, 57, .76);
    --edit-card-strong: rgba(11, 31, 63, .92);
    --edit-line: rgba(120, 166, 222, .25);
    --edit-text: #f8fbff;
    --edit-muted: #aebbd2;
    --edit-cyan: #34e8f5;
    --edit-purple: #8b5cf6;
    z-index: 1900;
    background:
        radial-gradient(circle at 50% 25%, rgba(45, 111, 255, .2), transparent 27%),
        radial-gradient(circle at 43% 39%, rgba(113, 40, 255, .16), transparent 24%),
        linear-gradient(165deg, var(--edit-bg), #03112a 56%, #020716);
    color: var(--edit-text);
    overscroll-behavior: contain;
}

:root[data-theme="light"] .edit-profile-screen,
body.light-mode .edit-profile-screen {
    --edit-bg: #eef6ff;
    --edit-bg-soft: #e7f1ff;
    --edit-card: rgba(255, 255, 255, .76);
    --edit-card-strong: rgba(255, 255, 255, .94);
    --edit-line: rgba(45, 91, 145, .2);
    --edit-text: #10213c;
    --edit-muted: #657590;
    background:
        radial-gradient(circle at 50% 25%, rgba(44, 164, 255, .17), transparent 28%),
        radial-gradient(circle at 42% 39%, rgba(139, 92, 246, .12), transparent 24%),
        linear-gradient(165deg, #f8fbff, var(--edit-bg) 62%, #e9f3ff);
}

.edit-profile-shell {
    width: min(100%, 720px);
    min-height: 100svh;
    padding: 18px clamp(18px, 4vw, 36px) 42px;
    padding: max(18px, env(safe-area-inset-top)) clamp(18px, 4vw, 36px) max(42px, env(safe-area-inset-bottom));
}

.edit-profile-header {
    grid-template-columns: 58px minmax(0, 1fr) 76px;
    min-height: 64px;
    padding: 4px 0 12px;
    background: linear-gradient(180deg, var(--edit-bg) 64%, transparent);
}

.edit-profile-header h1 {
    color: var(--edit-text);
    font-size: clamp(24px, 4vw, 32px);
    font-weight: 900;
    letter-spacing: -.025em;
}

.edit-profile-back {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--edit-line);
    border-radius: 50%;
    background: rgba(10, 28, 57, .5);
    color: var(--edit-text);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 12px 30px rgba(0, 0, 0, .14);
}

:root[data-theme="light"] .edit-profile-back,
body.light-mode .edit-profile-back {
    background: rgba(255, 255, 255, .7);
}

.edit-profile-back svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.4;
}

.edit-profile-save {
    min-height: 44px;
    justify-self: end;
    padding: 8px 2px;
    color: var(--edit-cyan);
    font-size: 18px;
    font-weight: 950;
}

.edit-profile-save:disabled {
    opacity: .58;
}

.edit-profile-form {
    gap: 24px;
}

.edit-profile-avatar {
    padding: 12px 0 5px;
}

.edit-profile-avatar label {
    gap: 16px;
}

.edit-profile-avatar .edit-profile-avatar-frame {
    width: clamp(170px, 31vw, 226px);
    overflow: visible;
    border: 3px solid var(--edit-cyan);
    background: linear-gradient(145deg, #0b304d, #05162d);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, .08),
        0 0 32px rgba(52, 232, 245, .24),
        0 0 68px rgba(139, 92, 246, .28),
        0 28px 70px rgba(0, 0, 0, .3);
}

.edit-profile-avatar .edit-profile-avatar-frame::before {
    content: "";
    position: absolute;
    inset: -18%;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(86, 77, 255, .25), transparent 67%);
    filter: blur(13px);
}

.edit-profile-avatar img {
    border-radius: 50%;
    background: var(--edit-bg-soft);
}

.edit-profile-avatar .edit-profile-camera-badge {
    position: absolute;
    inset: auto -2px 6px auto;
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border: 2px solid var(--edit-cyan);
    border-radius: 50%;
    background: linear-gradient(145deg, #174565, #0d2e50);
    color: #fff;
    font-size: 0;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .3);
}

.edit-profile-camera-badge svg {
    width: 27px;
    height: 27px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.edit-profile-avatar b {
    color: var(--edit-cyan);
    font-size: clamp(18px, 3vw, 23px);
    font-weight: 900;
    text-shadow: 0 0 22px rgba(52, 232, 245, .22);
}

.edit-profile-card {
    overflow: hidden;
    border: 1px solid var(--edit-line);
    border-radius: 26px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .035), transparent 58%),
        var(--edit-card);
    color: var(--edit-text);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .055),
        0 22px 60px rgba(0, 0, 0, .16);
    backdrop-filter: blur(22px) saturate(135%);
    -webkit-backdrop-filter: blur(22px) saturate(135%);
}

.edit-profile-row {
    min-height: 78px;
    grid-template-columns: 50px minmax(108px, 145px) minmax(0, 1fr);
    gap: 14px;
    padding: 13px 22px;
    border-bottom-color: var(--edit-line);
    color: var(--edit-text);
}

.edit-profile-row.is-link {
    grid-template-columns: 50px minmax(108px, 145px) minmax(0, 1fr) 46px;
}

.edit-profile-row-icon {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(100, 151, 218, .23);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(28, 58, 101, .72), rgba(10, 28, 57, .58));
    color: var(--edit-cyan) !important;
    font-size: 0 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045);
}

:root[data-theme="light"] .edit-profile-row-icon,
body.light-mode .edit-profile-row-icon {
    background: linear-gradient(145deg, rgba(255, 255, 255, .94), rgba(222, 239, 255, .86));
}

.edit-profile-row-icon svg,
.edit-profile-copy-icon svg {
    width: 27px;
    height: 27px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
}

.edit-profile-row > .edit-profile-row-label,
.edit-profile-field-stack > .edit-profile-row-label {
    color: var(--edit-muted);
    font-size: clamp(15px, 2.2vw, 18px);
    font-weight: 700;
}

.edit-profile-row input,
.edit-profile-row textarea {
    min-width: 0;
    padding: 8px 0;
    border: 0;
    background: transparent;
    color: var(--edit-text);
    caret-color: var(--edit-cyan);
    font-size: clamp(16px, 2.3vw, 19px);
    font-weight: 850;
}

.edit-profile-row input:focus,
.edit-profile-row textarea:focus {
    outline: none;
    box-shadow: none;
}

.edit-profile-row input::placeholder,
.edit-profile-row textarea::placeholder {
    color: color-mix(in srgb, var(--edit-muted) 74%, transparent);
}

.edit-profile-row.is-link b {
    min-width: 0;
    color: var(--edit-text);
    font-size: clamp(14px, 2vw, 17px);
    font-weight: 850;
}

.edit-profile-copy-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 1px solid var(--edit-line);
    border-radius: 15px;
    background: rgba(15, 37, 72, .52);
    color: var(--edit-text) !important;
    font-size: 0 !important;
}

:root[data-theme="light"] .edit-profile-copy-icon,
body.light-mode .edit-profile-copy-icon {
    background: rgba(238, 247, 255, .86);
}

.edit-profile-section-title {
    margin: 8px 30px -9px;
    color: var(--edit-text);
    font-size: clamp(19px, 3vw, 24px);
    font-weight: 900;
}

.edit-profile-row-tall {
    grid-template-columns: 50px minmax(0, 1fr);
    align-items: start;
    min-height: 220px;
    padding-top: 20px;
}

.edit-profile-field-stack {
    min-width: 0;
    display: grid;
    gap: 10px;
}

.edit-profile-field-stack textarea {
    min-height: 124px;
    padding: 14px 16px;
    border: 1px solid var(--edit-line);
    border-radius: 18px;
    background: rgba(4, 18, 42, .38);
    font-weight: 650;
    line-height: 1.45;
    resize: vertical;
}

:root[data-theme="light"] .edit-profile-field-stack textarea,
body.light-mode .edit-profile-field-stack textarea {
    background: rgba(239, 247, 255, .7);
}

.edit-profile-character-count {
    justify-self: end;
    color: var(--edit-muted);
    font-size: 12px;
    font-weight: 750;
}

.edit-profile-link-field {
    grid-template-columns: 50px minmax(108px, 145px) minmax(0, 1fr);
}

.edit-profile-remove-photo {
    min-height: 44px;
    margin: -4px auto 0;
    padding: 10px 18px;
    border-color: rgba(248, 113, 113, .3);
    background: rgba(127, 29, 29, .14);
    color: #fca5a5;
    font-size: 13px;
    font-weight: 850;
}

[dir="rtl"] .edit-profile-back svg {
    transform: rotate(180deg);
}

body[data-page="settings"] .content {
    background:
        radial-gradient(circle at 76% 12%, rgba(14, 165, 233, .08), transparent 24%),
        radial-gradient(circle at 25% 28%, rgba(139, 92, 246, .08), transparent 27%),
        var(--bg-primary);
}

.settings-list-screen {
    width: min(100%, 820px);
    margin-inline: auto;
    padding-bottom: 42px;
}

.settings-list-header {
    padding-top: 18px;
}

.settings-list-header h1 {
    background: linear-gradient(100deg, var(--text-primary) 20%, #22d3ee 74%, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.settings-profile-card,
.settings-list-group > div,
.settings-detail-panel > .settings-card {
    border-color: rgba(96, 165, 250, .19);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .045), transparent 58%),
        color-mix(in srgb, var(--panel) 88%, transparent);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .045),
        0 20px 58px rgba(0, 0, 0, .09);
    backdrop-filter: blur(20px) saturate(130%);
    -webkit-backdrop-filter: blur(20px) saturate(130%);
}

.settings-profile-card {
    border-radius: 26px;
    background:
        radial-gradient(circle at 96% 8%, rgba(34, 211, 238, .15), transparent 34%),
        radial-gradient(circle at 6% 100%, rgba(139, 92, 246, .18), transparent 39%),
        color-mix(in srgb, var(--panel) 88%, transparent);
}

.settings-profile-card img {
    border-color: #34e8f5;
    box-shadow: 0 0 0 4px rgba(52, 232, 245, .08), 0 12px 34px rgba(76, 72, 255, .2);
}

.settings-edit-profile-btn {
    border-color: rgba(52, 232, 245, .3);
    background: linear-gradient(135deg, rgba(34, 211, 238, .13), rgba(139, 92, 246, .13));
}

.settings-list-group > div {
    border-radius: 22px;
}

.settings-list-row {
    min-height: 76px;
}

.settings-list-row:hover,
.settings-list-row:focus-visible {
    background: linear-gradient(90deg, rgba(34, 211, 238, .055), rgba(139, 92, 246, .055));
}

.settings-list-icon {
    border: 1px solid rgba(96, 165, 250, .16);
    background: linear-gradient(145deg, rgba(34, 211, 238, .11), rgba(139, 92, 246, .1));
    color: #34d8e8;
}

.settings-detail-icon {
    border: 1px solid rgba(96, 165, 250, .18);
    background: linear-gradient(145deg, rgba(34, 211, 238, .14), rgba(139, 92, 246, .14));
    color: #34d8e8;
}

@media (max-width: 768px) {
    .app-shell > .content {
        padding-bottom: 112px !important;
        padding-bottom: calc(112px + env(safe-area-inset-bottom)) !important;
    }

    .app-shell > .bottom-nav.mobile-dock {
        left: 8px !important;
        right: 8px !important;
        bottom: 7px !important;
        left: max(8px, env(safe-area-inset-left)) !important;
        right: max(8px, env(safe-area-inset-right)) !important;
        bottom: max(7px, env(safe-area-inset-bottom)) !important;
        width: auto !important;
        min-height: 78px !important;
        padding: 8px 8px 9px !important;
        border: 1px solid rgba(114, 158, 218, .25) !important;
        border-radius: 27px !important;
        background: rgba(3, 15, 37, .92) !important;
        color: #f8fbff !important;
        overflow: visible !important;
        box-shadow: 0 18px 55px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .055) !important;
        backdrop-filter: blur(24px) saturate(145%) !important;
        -webkit-backdrop-filter: blur(24px) saturate(145%) !important;
    }

    :root[data-theme="light"] .app-shell > .bottom-nav.mobile-dock,
    body.light-mode .app-shell > .bottom-nav.mobile-dock {
        border-color: rgba(54, 94, 145, .18) !important;
        background: rgba(249, 252, 255, .93) !important;
        color: #14233d !important;
        box-shadow: 0 18px 48px rgba(41, 65, 97, .2), inset 0 1px 0 #fff !important;
    }

    .bottom-nav a {
        min-height: 58px;
        align-content: center;
        gap: 5px;
        padding: 3px 2px;
        border-radius: 16px;
        color: inherit;
    }

    .bottom-nav a > .mobile-nav-icon {
        width: 28px;
        height: 28px;
    }

    .bottom-nav a > .mobile-nav-icon svg {
        width: 27px;
        height: 27px;
        stroke-width: 2;
    }

    .bottom-nav b {
        color: inherit;
        font-size: 10px;
        font-weight: 850;
        letter-spacing: -.015em;
    }

    .bottom-nav a.active:not(.create-fab) {
        color: #34e8f5;
        background: linear-gradient(180deg, rgba(52, 232, 245, .09), transparent);
    }

    .bottom-nav .create-fab {
        width: 100% !important;
        height: 64px !important;
        min-height: 64px;
        align-content: start;
        gap: 0;
        overflow: visible;
        padding: 0 2px;
        border-radius: 0;
        background: transparent !important;
        color: #fff;
        box-shadow: none !important;
    }

    .bottom-nav .create-fab > span {
        width: 58px;
        height: 58px;
        display: grid;
        place-items: center;
        margin: -17px auto 0;
        border: 1px solid rgba(216, 180, 254, .7);
        border-radius: 50%;
        background: linear-gradient(145deg, #9d32ff, #7117a8);
        color: #fff;
        font-size: 38px !important;
        font-weight: 350;
        line-height: 1;
        box-shadow:
            0 0 0 7px rgba(118, 27, 177, .12),
            0 0 28px rgba(203, 69, 255, .68),
            0 16px 32px rgba(65, 12, 100, .44);
    }

    .bottom-nav .create-fab > b {
        margin-top: 3px;
        color: inherit;
        font-size: 10px;
    }

    .bottom-nav .create-fab.active > span {
        background: linear-gradient(145deg, #34e8f5, #7c3aed);
        box-shadow: 0 0 32px rgba(52, 232, 245, .48), 0 0 34px rgba(139, 92, 246, .5);
    }

    body[data-page="loopz"] .app-shell > .bottom-nav.mobile-dock {
        display: none !important;
    }

    body[data-page="loopz"] .app-shell > .content {
        padding-bottom: 0 !important;
    }

    body[data-page="loopz"] .loopz-actions,
    body[data-page="loopz"] .loopz-meta {
        bottom: 22px !important;
        bottom: max(22px, env(safe-area-inset-bottom)) !important;
    }

    .edit-profile-shell {
        padding-inline: 14px;
        padding-bottom: 128px;
        padding-inline: max(14px, env(safe-area-inset-left)) max(14px, env(safe-area-inset-right));
        padding-bottom: calc(128px + env(safe-area-inset-bottom));
    }

    .edit-profile-header {
        grid-template-columns: 52px minmax(0, 1fr) 66px;
    }

    .edit-profile-back {
        width: 46px;
        height: 46px;
    }

    .edit-profile-header h1 {
        font-size: 23px;
    }

    .edit-profile-save {
        font-size: 17px;
    }

    .edit-profile-avatar {
        padding-top: 7px;
    }

    .edit-profile-avatar .edit-profile-avatar-frame {
        width: clamp(154px, 48vw, 190px);
    }

    .edit-profile-avatar .edit-profile-camera-badge {
        width: 50px;
        height: 50px;
    }

    .edit-profile-card {
        border-radius: 22px;
    }

    .edit-profile-row {
        min-height: 74px;
        grid-template-columns: 44px minmax(82px, 28%) minmax(0, 1fr);
        gap: 10px;
        padding: 11px 13px;
    }

    .edit-profile-row.is-link {
        grid-template-columns: 44px minmax(82px, 28%) minmax(0, 1fr) 42px;
    }

    .edit-profile-row-icon {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .edit-profile-row-icon svg,
    .edit-profile-copy-icon svg {
        width: 24px;
        height: 24px;
    }

    .edit-profile-row > .edit-profile-row-label,
    .edit-profile-field-stack > .edit-profile-row-label {
        font-size: 15px;
    }

    .edit-profile-row input,
    .edit-profile-row textarea {
        font-size: 16px !important;
    }

    .edit-profile-copy-icon {
        width: 42px;
        height: 42px;
        border-radius: 13px;
    }

    .edit-profile-row-tall {
        grid-template-columns: 44px minmax(0, 1fr);
        min-height: 210px;
        padding-top: 16px;
    }

    .edit-profile-link-field {
        grid-template-columns: 44px minmax(82px, 28%) minmax(0, 1fr);
    }

    .settings-list-screen {
        padding-bottom: 126px;
        padding-bottom: calc(126px + env(safe-area-inset-bottom));
    }

    .settings-list-header {
        padding-top: 16px;
    }

    .settings-profile-card {
        border-radius: 22px;
    }

    .settings-list-group > div {
        border-radius: 20px;
    }

    .settings-list-savebar {
        bottom: 102px;
        bottom: calc(102px + env(safe-area-inset-bottom));
    }
}

@media (max-width: 390px) {
    .edit-profile-shell {
        padding-inline: 10px;
    }

    .edit-profile-row {
        grid-template-columns: 42px 78px minmax(0, 1fr);
        gap: 8px;
        padding-inline: 10px;
    }

    .edit-profile-row.is-link {
        grid-template-columns: 42px 78px minmax(0, 1fr) 38px;
    }

    .edit-profile-row-icon {
        width: 42px;
        height: 42px;
    }

    .edit-profile-copy-icon {
        width: 38px;
        height: 38px;
    }

    .edit-profile-row-tall {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .edit-profile-link-field {
        grid-template-columns: 42px 78px minmax(0, 1fr);
    }

    .edit-profile-row.is-link b {
        font-size: 12px;
    }

    .bottom-nav b,
    .bottom-nav .create-fab > b {
        font-size: 9px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .edit-profile-screen *,
    .app-shell > .bottom-nav.mobile-dock * {
        scroll-behavior: auto;
        transition: none !important;
    }
}

/* ===== 2026 global light/dark surface system ===== */
html {
    background: var(--bg-primary);
}

body:not([data-page="loopz"]) .content,
body:not([data-page="loopz"]) .screen {
    color: var(--text-primary);
}

.topbar {
    border-bottom-color: color-mix(in srgb, var(--border-color) 82%, transparent);
    background: color-mix(in srgb, var(--surface-raised) 88%, transparent);
    box-shadow: 0 1px 0 color-mix(in srgb, var(--border-color) 58%, transparent);
    backdrop-filter: blur(20px) saturate(135%);
    -webkit-backdrop-filter: blur(20px) saturate(135%);
}

.sidebar {
    border-inline-end-color: var(--border-color);
    background: color-mix(in srgb, var(--surface-raised) 96%, transparent);
}

.sidebar nav a:hover,
.sidebar nav a:focus-visible,
.sidebar nav a.active,
.sidebar-account-card:hover,
.sidebar-account-card:focus-visible {
    background: var(--surface-hover);
}

.topbar-inbox-link,
.avatar-link {
    border-color: var(--border-color);
    background: var(--surface-solid);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.panel,
.post-card,
.shared-post,
.post-comments-panel,
.comment-row,
.home-stories-panel,
.home-composer,
.home-rail-card,
.home-upload-card,
.profile-hero,
.profile-menu,
.inbox-panel,
.inbox-drawer-panel,
.auth-card:not(.pro-auth-card),
.composer-hero,
.composer-form,
.composer-panel,
.chat-shell,
.chat-shell-head,
.chat-compose,
.modal,
.gift-picker-card,
.report-picker-card,
.settings-card,
.settings-profile-card,
.settings-list-group > div,
.settings-detail-panel > .settings-card {
    border-color: var(--border-color);
    background-color: var(--surface-raised);
    color: var(--text-primary);
    box-shadow: var(--shadow-card);
}

.composer-hero {
    background:
        radial-gradient(circle at 92% 12%, color-mix(in srgb, var(--accent-cyan) 13%, transparent), transparent 34%),
        var(--surface-raised);
    color: var(--text-primary);
}

.composer-hero h1 {
    color: var(--text-primary);
}

.composer-hero p {
    color: var(--text-secondary);
}

.post-card:hover,
.panel:hover,
.inbox-panel:hover {
    background: var(--surface-raised);
}

.home-stories-panel,
.home-composer,
.home-rail-card,
.home-upload-card {
    background: var(--surface-raised);
}

.active-chat-messages {
    background:
        radial-gradient(circle at 92% 3%, color-mix(in srgb, var(--accent-cyan) 8%, transparent), transparent 32%),
        var(--bg-secondary);
}

.chat-message {
    border-color: var(--border-color);
    background: var(--surface-solid);
    box-shadow: var(--shadow-sm);
}

.chat-message.is-me {
    border-color: var(--accent-cyan);
    background: linear-gradient(135deg, var(--accent-cyan), #0891b2);
    color: #fff;
}

input,
textarea,
select,
.settings-control input,
.settings-control textarea,
.settings-control select {
    min-width: 0;
    border-color: var(--border-color);
    background: var(--surface-solid);
    color: var(--text-primary);
}

input:focus,
textarea:focus,
select:focus {
    border-color: color-mix(in srgb, var(--accent-cyan) 72%, var(--border-color));
    outline: 3px solid color-mix(in srgb, var(--accent-cyan) 14%, transparent);
    outline-offset: 1px;
}

.primary-btn,
.login-pill {
    border-color: transparent;
    background: linear-gradient(135deg, var(--accent-cyan), #0891b2);
    color: #fff;
    box-shadow: 0 10px 24px color-mix(in srgb, var(--accent-cyan) 22%, transparent);
}

.secondary-btn,
.btn-secondary,
.mini-btn,
button.secondary {
    border-color: var(--border-color);
    background: var(--surface-muted);
    color: var(--text-primary);
}

.post-options-sheet {
    border-color: var(--border-color);
    background: var(--surface-solid);
    color: var(--text-primary);
    box-shadow: 0 -24px 70px rgba(15, 23, 42, .2);
}

.post-options-head {
    border-bottom-color: var(--border-color);
    background: var(--surface-solid);
}

.post-options-head b,
.post-sheet-item {
    color: var(--text-primary);
}

.post-options-head small,
.post-sheet-item > i {
    color: var(--text-muted);
}

.post-options-head button,
.post-sheet-item > span {
    background: var(--surface-muted);
    color: var(--text-primary);
}

.post-sheet-item:hover,
.post-sheet-item:focus-visible,
.report-picker-reason:hover {
    background: var(--surface-hover);
}

.post-sheet-item.is-active {
    color: var(--accent-cyan);
}

.report-picker-detail textarea {
    background: var(--surface-solid);
}

:root[data-theme="dark"] .post-options-sheet,
body.dark-mode .post-options-sheet {
    box-shadow: 0 -28px 90px rgba(0, 0, 0, .56);
}

:root[data-theme="light"] .edit-profile-screen,
body.light-mode .edit-profile-screen {
    --edit-bg: #f8fafc;
    --edit-bg-soft: #f1f5f9;
    --edit-card: rgba(255, 255, 255, .94);
    --edit-card-strong: #ffffff;
    --edit-line: #e2e8f0;
    --edit-text: #0f172a;
    --edit-muted: #64748b;
    background:
        radial-gradient(circle at 50% 23%, rgba(34, 211, 238, .1), transparent 25%),
        radial-gradient(circle at 44% 37%, rgba(139, 92, 246, .07), transparent 24%),
        linear-gradient(180deg, #ffffff, #f8fafc 64%, #f1f5f9);
}

:root[data-theme="light"] .edit-profile-header,
body.light-mode .edit-profile-header {
    background: linear-gradient(180deg, rgba(248, 250, 252, .97) 66%, transparent);
}

:root[data-theme="light"] .edit-profile-back,
body.light-mode .edit-profile-back {
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .09);
}

:root[data-theme="light"] .edit-profile-avatar .edit-profile-avatar-frame,
body.light-mode .edit-profile-avatar .edit-profile-avatar-frame {
    background: linear-gradient(145deg, #ffffff, #eaf8fc);
    box-shadow:
        0 0 0 1px rgba(14, 165, 233, .08),
        0 0 30px rgba(34, 211, 238, .18),
        0 0 58px rgba(139, 92, 246, .16),
        0 24px 56px rgba(15, 23, 42, .12);
}

:root[data-theme="light"] .edit-profile-avatar .edit-profile-camera-badge,
body.light-mode .edit-profile-avatar .edit-profile-camera-badge {
    border-color: #ffffff;
    background: #ffffff;
    color: #06b6d4;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .14);
}

:root[data-theme="light"] .edit-profile-card,
body.light-mode .edit-profile-card {
    background: var(--edit-card);
    box-shadow: 0 18px 48px rgba(15, 23, 42, .08);
}

:root[data-theme="light"] .edit-profile-row-icon,
:root[data-theme="light"] .edit-profile-copy-icon,
body.light-mode .edit-profile-row-icon,
body.light-mode .edit-profile-copy-icon {
    border-color: #e2e8f0;
    background: #ffffff;
    box-shadow: 0 7px 20px rgba(15, 23, 42, .06);
}

:root[data-theme="light"] .edit-profile-field-stack textarea,
body.light-mode .edit-profile-field-stack textarea {
    background: #ffffff;
}

body[data-page="settings"] .content {
    background:
        radial-gradient(circle at 76% 12%, color-mix(in srgb, var(--accent-cyan) 7%, transparent), transparent 24%),
        radial-gradient(circle at 25% 28%, color-mix(in srgb, var(--accent-purple) 6%, transparent), transparent 27%),
        var(--bg-primary);
}

.settings-list-header h1 {
    background: none;
    color: var(--text-primary);
}

.settings-profile-card,
.settings-list-group > div,
.settings-detail-panel > .settings-card {
    border-color: var(--border-color);
    background: var(--surface-raised);
    box-shadow: var(--shadow-card);
}

.settings-profile-card {
    background:
        radial-gradient(circle at 96% 8%, color-mix(in srgb, var(--accent-cyan) 11%, transparent), transparent 34%),
        radial-gradient(circle at 6% 100%, color-mix(in srgb, var(--accent-purple) 9%, transparent), transparent 39%),
        var(--surface-raised);
}

.settings-edit-profile-btn {
    border-color: color-mix(in srgb, var(--accent-cyan) 32%, var(--border-color));
    background: color-mix(in srgb, var(--accent-cyan) 9%, var(--surface-solid));
    color: var(--text-primary);
}

.settings-list-row:hover,
.settings-list-row:focus-visible {
    background: var(--surface-hover);
}

@media (max-width: 768px) {
    body:not([data-page="loopz"]) .screen {
        padding-inline: max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-right));
    }

    .home-feed-column .post-card,
    .post-comments-panel,
    .shared-post,
    .profile-hero,
    .profile-menu,
    .inbox-panel,
    .composer-form,
    .composer-panel {
        width: 100%;
        max-width: 100%;
        border-radius: 20px;
    }

    .post-card:hover,
    .panel:hover,
    .inbox-panel:hover {
        transform: none;
    }

    input,
    textarea,
    select {
        font-size: 16px;
    }

    .app-shell > .bottom-nav.mobile-dock {
        border-color: color-mix(in srgb, var(--border-color) 76%, transparent) !important;
        background: color-mix(in srgb, var(--surface-raised) 94%, transparent) !important;
        color: var(--text-primary) !important;
        box-shadow: var(--shadow-floating), inset 0 1px 0 rgba(255, 255, 255, .08) !important;
    }

    .bottom-nav a.active:not(.create-fab) {
        background: linear-gradient(180deg, color-mix(in srgb, var(--accent-cyan) 11%, transparent), transparent);
        color: var(--accent-cyan);
    }

    :root[data-theme="light"] .app-shell > .bottom-nav.mobile-dock,
    body.light-mode .app-shell > .bottom-nav.mobile-dock {
        border-color: rgba(148, 163, 184, .27) !important;
        background: rgba(255, 255, 255, .93) !important;
        color: #1e293b !important;
        box-shadow: 0 18px 50px rgba(15, 23, 42, .15), inset 0 1px 0 #fff !important;
    }

    .bottom-nav .create-fab > span {
        background: linear-gradient(145deg, #b43cff, #7e22ce);
        box-shadow:
            0 0 0 7px rgba(147, 51, 234, .1),
            0 0 28px rgba(192, 38, 211, .54),
            0 16px 32px rgba(88, 28, 135, .32);
    }
}

@media (max-width: 520px) {
    .settings-profile-card {
        grid-template-columns: 58px minmax(0, 1fr);
        gap: 12px;
        padding: 15px;
    }

    .settings-profile-card img {
        width: 58px;
        height: 58px;
    }

    .settings-edit-profile-btn {
        grid-column: 1 / -1;
        width: 100%;
    }
}

@media (max-width: 360px) {
    .settings-list-row {
        grid-template-columns: 40px minmax(0, 1fr) 16px;
        gap: 9px;
        padding-inline: 11px;
    }

    .settings-list-value {
        display: none;
    }

    .edit-profile-header {
        grid-template-columns: 46px minmax(0, 1fr) 58px;
    }
}

/* ===== 2026 mobile-first profile experience ===== */
body[data-page="profile"] .screen,
body[data-page="public-profile"] .screen {
    width: 100%;
    max-width: 1040px;
    min-width: 0;
    margin-inline: auto;
    padding-bottom: 32px;
}

body[data-page="profile"] .profile-hero,
body[data-page="public-profile"] .profile-hero {
    width: 100%;
    max-width: 980px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 0 auto;
    padding: clamp(30px, 5vw, 48px);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    background:
        radial-gradient(circle at 50% 4%, color-mix(in srgb, var(--accent-cyan) 7%, transparent), transparent 27%),
        var(--surface-raised);
    color: var(--text-primary);
    box-shadow: var(--shadow-card);
    text-align: center;
    overflow: visible;
}

body[data-page="profile"] .profile-hero h1,
body[data-page="public-profile"] .profile-hero h1 {
    max-width: 100%;
    margin: 16px 0 0;
    color: var(--text-primary);
    font-size: clamp(28px, 6vw, 42px);
    font-weight: 950;
    line-height: 1.05;
    letter-spacing: -.035em;
    overflow-wrap: anywhere;
}

body[data-page="profile"] .profile-hero > p:not(.profile-bio),
body[data-page="public-profile"] .profile-hero > p:not(.profile-bio) {
    margin: 3px 0 0;
    color: var(--text-secondary);
    font-size: clamp(16px, 2.4vw, 20px);
}

body[data-page="profile"] .profile-bio,
body[data-page="public-profile"] .profile-bio {
    max-width: 620px;
    margin: 12px auto 2px !important;
    color: var(--text-secondary) !important;
    font-size: 15px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

body[data-page="profile"] .profile-website,
body[data-page="public-profile"] .profile-website {
    max-width: 100%;
    margin-top: 3px;
    color: var(--accent-cyan);
    font-size: 13px;
    overflow-wrap: anywhere;
}

body[data-page="profile"] .profile-photo-trigger,
body[data-page="public-profile"] .profile-photo-frame {
    width: clamp(116px, 24vw, 146px);
    height: clamp(116px, 24vw, 146px);
    padding: 4px;
    border-radius: 50%;
    background: var(--surface-solid);
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--border-color) 80%, transparent),
        0 15px 36px rgba(15, 23, 42, .14);
}

body[data-page="profile"] .profile-photo-trigger.story-ring,
body[data-page="public-profile"] .profile-photo-frame.story-ring {
    width: clamp(116px, 24vw, 146px);
    height: clamp(116px, 24vw, 146px);
    padding: 4px;
    background: linear-gradient(135deg, var(--accent-cyan), #8b5cf6, #ec4899);
}

body[data-page="profile"] .profile-photo,
body[data-page="public-profile"] .profile-photo {
    width: 100%;
    height: 100%;
    border: 3px solid var(--surface-solid);
    background: var(--surface-muted);
    box-shadow: none;
}

body[data-page="profile"] .profile-photo-trigger > span {
    inset: auto -2px 8px auto;
    width: 38px;
    height: 38px;
    border: 3px solid var(--surface-solid);
    background: linear-gradient(135deg, #38c8dc, #0ea5c6);
    color: #fff;
    font-size: 25px;
    font-weight: 750;
    line-height: 1;
    box-shadow: 0 8px 20px rgba(8, 145, 178, .28);
}

[dir="rtl"] body[data-page="profile"] .profile-photo-trigger > span {
    inset: auto auto 8px -2px;
}

.profile-card-menu-btn,
.public-profile-options-btn {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--surface-muted);
    color: var(--text-primary);
    box-shadow: none;
}

.profile-card-menu-btn {
    position: absolute;
    inset-block-start: 24px;
    inset-inline-end: 24px;
    z-index: 6;
}

.profile-card-menu-btn svg,
.public-profile-options-btn svg {
    width: 25px;
    height: 25px;
    fill: currentColor;
}

.public-profile-options {
    inset-block-start: 24px;
    inset-inline-end: 24px;
}

.public-profile-options-btn:hover,
.public-profile-options-btn:focus-visible,
.profile-card-menu-btn:hover,
.profile-card-menu-btn:focus-visible {
    background: var(--surface-hover);
}

body[data-page="profile"] .profile-menu,
body[data-page="public-profile"] .public-profile-menu {
    min-width: 210px;
    border-color: var(--border-color);
    border-radius: 17px;
    background: var(--surface-solid);
    box-shadow: var(--shadow-floating);
    text-align: start;
}

body[data-page="profile"] .profile-menu {
    inset-block-start: 82px;
    inset-inline: auto 24px;
}

body[data-page="profile"] .profile-menu a,
body[data-page="profile"] .profile-menu button,
body[data-page="public-profile"] .public-profile-menu button {
    min-height: 48px;
    border-color: var(--border-color);
    background: transparent;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 800;
    text-align: start;
}

body[data-page="public-profile"] .public-profile-menu .is-danger {
    color: #ef4444;
}

body[data-page="profile"] .profile-stats,
body[data-page="public-profile"] .profile-stats {
    width: 100%;
    max-width: 780px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
}

body[data-page="profile"] .profile-stats > b,
body[data-page="public-profile"] .profile-stats > b,
body[data-page="profile"] .profile-stat-btn,
body[data-page="public-profile"] .profile-stat-btn {
    min-width: 0;
    min-height: 96px;
    display: grid;
    align-content: center;
    gap: 7px;
    padding: 13px 8px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: color-mix(in srgb, var(--surface-solid) 90%, var(--bg-secondary));
    color: var(--text-primary);
    box-shadow: none;
}

body[data-page="profile"] .profile-stats > b,
body[data-page="public-profile"] .profile-stats > b,
body[data-page="profile"] .profile-stat-btn > b,
body[data-page="public-profile"] .profile-stat-btn > b {
    color: var(--text-primary);
    font-size: clamp(18px, 3vw, 23px);
    font-weight: 950;
    line-height: 1;
}

body[data-page="profile"] .profile-stats span,
body[data-page="public-profile"] .profile-stats span {
    min-width: 0;
    color: var(--text-secondary);
    font-size: clamp(11px, 1.8vw, 14px);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.profile-action-row {
    width: 100%;
    max-width: 780px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 18px auto 0;
}

.profile-primary-action,
.profile-secondary-action,
.profile-follow-btn,
.profile-message-btn {
    min-width: 0;
    min-height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: 18px;
    font: inherit;
    font-size: 15px;
    font-weight: 900;
    text-decoration: none;
}

.profile-primary-action,
.profile-follow-btn:not(.is-following) {
    background: linear-gradient(135deg, #42c7d8, #20b3c8);
    color: #fff;
    box-shadow: 0 12px 28px rgba(8, 145, 178, .2);
}

.profile-secondary-action,
.profile-message-btn,
.profile-follow-btn.is-following {
    border-color: var(--border-color);
    background: var(--surface-solid);
    color: var(--text-primary);
    box-shadow: none;
}

.profile-primary-action svg,
.profile-secondary-action svg,
.profile-action-icon,
.profile-action-icon svg {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
}

.profile-action-icon {
    display: inline-grid;
    place-items: center;
}

.creator-alert-bell {
    min-height: 50px;
    margin: 14px auto 0;
    padding: 10px 22px;
    border-color: var(--border-color);
    background: var(--surface-solid);
    color: var(--text-primary);
    box-shadow: none;
}

.creator-alert-bell:hover,
.creator-alert-bell.is-active,
.creator-alert-bell.is-active:hover {
    border-color: color-mix(in srgb, var(--accent-cyan) 52%, var(--border-color));
    background: color-mix(in srgb, var(--accent-cyan) 11%, var(--surface-solid));
    color: var(--accent-cyan);
}

body[data-page="profile"] .profile-tabs,
body[data-page="public-profile"] .profile-tabs,
body[data-page="profile"] .profile-sort-tabs,
body[data-page="public-profile"] .profile-sort-tabs {
    width: 100%;
    max-width: 980px;
    display: grid;
    gap: 10px;
    margin: 18px auto 0;
    padding: 5px;
    border: 1px solid color-mix(in srgb, var(--border-color) 70%, transparent);
    border-radius: 24px;
    background: color-mix(in srgb, var(--surface-raised) 90%, transparent);
    box-shadow: var(--shadow-sm);
    overflow: visible;
}

body[data-page="profile"] .profile-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

body[data-page="public-profile"] .profile-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

body[data-page="profile"] .profile-sort-tabs,
body[data-page="public-profile"] .profile-sort-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 12px;
}

body[data-page="profile"] .profile-tabs button,
body[data-page="public-profile"] .profile-tabs button,
body[data-page="profile"] .profile-sort-tabs button,
body[data-page="public-profile"] .profile-sort-tabs button {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px;
    border: 0;
    border-radius: 19px;
    background: transparent;
    color: var(--text-primary);
    box-shadow: none;
    font-size: 14px;
    font-weight: 900;
    white-space: nowrap;
}

body[data-page="profile"] .profile-tabs button svg,
body[data-page="public-profile"] .profile-tabs button svg,
body[data-page="profile"] .profile-tab-icon,
body[data-page="profile"] .profile-tab-icon .ig-action-icon {
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

body[data-page="profile"] .profile-tabs button > span:last-child,
body[data-page="public-profile"] .profile-tabs button > span:last-child,
.profile-primary-action > span:last-child,
.profile-secondary-action > span:last-child,
.profile-follow-btn > span:last-child,
.profile-message-btn > span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

body[data-page="profile"] .profile-tabs button > span:last-child,
body[data-page="public-profile"] .profile-tabs button > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

body[data-page="profile"] .profile-tabs button.active,
body[data-page="public-profile"] .profile-tabs button.active,
body[data-page="profile"] .profile-sort-tabs button.active,
body[data-page="public-profile"] .profile-sort-tabs button.active {
    border-color: transparent;
    background: linear-gradient(135deg, #47c8dc, #23b5cb);
    color: #fff;
    box-shadow: 0 10px 24px rgba(8, 145, 178, .2);
}

body[data-page="profile"] .profile-grid,
body[data-page="public-profile"] .profile-grid {
    width: 100%;
    max-width: 980px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 16px auto 0;
}

body[data-page="profile"] .profile-grid .grid-card,
body[data-page="public-profile"] .profile-grid .grid-card {
    min-width: 0;
    aspect-ratio: 1 / 1;
    border: 1px solid color-mix(in srgb, var(--border-color) 78%, transparent);
    border-radius: 16px;
    background: var(--surface-solid);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    isolation: isolate;
}

body[data-page="profile"] .profile-grid .grid-card img,
body[data-page="profile"] .profile-grid .grid-card video,
body[data-page="public-profile"] .profile-grid .grid-card img,
body[data-page="public-profile"] .profile-grid .grid-card video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

body[data-page="profile"] .text-grid,
body[data-page="public-profile"] .text-grid {
    place-items: center;
    padding: clamp(14px, 4vw, 30px);
    background: var(--profile-text-bg, var(--surface-solid));
    color: var(--profile-text-color, var(--text-primary));
}

.profile-text-preview {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    color: inherit;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(14px, 2.6vw, 25px);
    font-weight: 650;
    line-height: 1.45;
    text-align: start;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
}

body[data-page="profile"] .grid-item-overlay,
body[data-page="public-profile"] .grid-item-overlay {
    inset: auto 0 0;
    min-height: 44px;
    justify-content: flex-start;
    gap: 12px;
    padding: 18px 10px 9px;
    background: linear-gradient(180deg, transparent, rgba(2, 6, 23, .62));
    opacity: 1;
}

body[data-page="profile"] .text-grid .grid-item-overlay,
body[data-page="public-profile"] .text-grid .grid-item-overlay {
    background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--profile-text-bg, #fff) 88%, rgba(15, 23, 42, .16)));
}

body[data-page="profile"] .grid-item-overlay b,
body[data-page="public-profile"] .grid-item-overlay b {
    color: #fff;
    font-size: 11px;
    text-shadow: 0 1px 5px rgba(0, 0, 0, .5);
}

body[data-page="profile"] .text-grid .grid-item-overlay b,
body[data-page="public-profile"] .text-grid .grid-item-overlay b,
body[data-page="profile"] .text-grid .grid-item-overlay span,
body[data-page="public-profile"] .text-grid .grid-item-overlay span {
    color: var(--profile-text-color, var(--text-primary));
    text-shadow: none;
}

.grid-badge {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: #0f172a;
    text-shadow: none;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .18);
}

.grid-badge svg {
    width: 21px;
    height: 21px;
    fill: currentColor;
}

.profile-media-placeholder {
    width: 100%;
    height: 100%;
    display: block;
    background:
        radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--accent-cyan) 24%, transparent), transparent 35%),
        var(--surface-muted);
}

.profile-empty-state {
    grid-column: 1 / -1;
    min-height: 210px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    padding: 28px;
    border: 1px dashed var(--border-color);
    border-radius: 24px;
    background: var(--surface-raised);
    color: var(--text-secondary);
    text-align: center;
}

.profile-empty-state > span {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent-cyan) 12%, var(--surface-solid));
    color: var(--accent-cyan);
    font-size: 30px;
}

.profile-empty-state b {
    color: var(--text-secondary);
    font-size: 14px;
}

:root[data-theme="dark"] body[data-page="profile"] .profile-hero,
:root[data-theme="dark"] body[data-page="public-profile"] .profile-hero,
body.dark-mode[data-page="profile"] .profile-hero,
body.dark-mode[data-page="public-profile"] .profile-hero {
    background:
        radial-gradient(circle at 50% 4%, rgba(34, 211, 238, .08), transparent 28%),
        var(--surface-raised);
}

@media (max-width: 768px) {
    body[data-page="profile"] .screen,
    body[data-page="public-profile"] .screen {
        padding-inline: max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-right));
        padding-bottom: calc(126px + env(safe-area-inset-bottom));
    }

    body[data-page="profile"] .profile-hero,
    body[data-page="public-profile"] .profile-hero {
        padding: 28px 16px 22px;
        border-radius: 26px;
    }

    .profile-card-menu-btn,
    .public-profile-options-btn {
        width: 46px;
        height: 46px;
    }

    .profile-card-menu-btn,
    .public-profile-options {
        inset-block-start: 15px;
        inset-inline-end: 15px;
    }

    body[data-page="profile"] .profile-menu {
        inset-block-start: 66px;
        inset-inline-end: 15px;
    }

    body[data-page="profile"] .profile-stats,
    body[data-page="public-profile"] .profile-stats {
        gap: 6px;
    }

    body[data-page="profile"] .profile-stats > b,
    body[data-page="public-profile"] .profile-stats > b,
    body[data-page="profile"] .profile-stat-btn,
    body[data-page="public-profile"] .profile-stat-btn {
        min-height: 82px;
        padding: 10px 3px;
        border-radius: 16px;
    }

    .profile-action-row {
        gap: 8px;
    }

    .profile-primary-action,
    .profile-secondary-action,
    .profile-follow-btn,
    .profile-message-btn {
        min-height: 52px;
        padding-inline: 10px;
        border-radius: 16px;
        font-size: 13px;
    }

    body[data-page="profile"] .profile-tabs,
    body[data-page="public-profile"] .profile-tabs,
    body[data-page="profile"] .profile-sort-tabs,
    body[data-page="public-profile"] .profile-sort-tabs {
        gap: 4px;
        padding: 4px;
        border-radius: 21px;
    }

    body[data-page="profile"] .profile-tabs button,
    body[data-page="public-profile"] .profile-tabs button,
    body[data-page="profile"] .profile-sort-tabs button,
    body[data-page="public-profile"] .profile-sort-tabs button {
        min-height: 48px;
        gap: 5px;
        padding-inline: 4px;
        border-radius: 17px;
        font-size: 11px;
    }

    body[data-page="profile"] .profile-tabs button svg,
    body[data-page="public-profile"] .profile-tabs button svg,
    body[data-page="profile"] .profile-tab-icon,
    body[data-page="profile"] .profile-tab-icon .ig-action-icon {
        width: 18px;
        height: 18px;
        flex-basis: 18px;
    }

    body[data-page="profile"] .profile-grid,
    body[data-page="public-profile"] .profile-grid {
        gap: 8px;
        margin-top: 12px;
    }

    body[data-page="profile"] .profile-grid .grid-card,
    body[data-page="public-profile"] .profile-grid .grid-card {
        border-radius: 13px;
    }

    body[data-page="profile"] .app-shell > .bottom-nav.mobile-dock a[data-nav-key="profile"].active,
    body[data-page="public-profile"] .app-shell > .bottom-nav.mobile-dock a[data-nav-key="profile"].active {
        border-radius: 20px;
        background: color-mix(in srgb, var(--accent-cyan) 13%, transparent);
        color: var(--accent-cyan);
    }
}

@media (max-width: 390px) {
    body[data-page="profile"] .profile-hero,
    body[data-page="public-profile"] .profile-hero {
        padding-inline: 12px;
    }

    .profile-primary-action,
    .profile-secondary-action,
    .profile-follow-btn,
    .profile-message-btn {
        gap: 6px;
        font-size: 12px;
    }

    .profile-primary-action svg,
    .profile-secondary-action svg,
    .profile-action-icon,
    .profile-action-icon svg {
        width: 19px;
        height: 19px;
        flex-basis: 19px;
    }

    body[data-page="profile"] .profile-tabs button,
    body[data-page="public-profile"] .profile-tabs button {
        font-size: 10px;
    }
}

@media (max-width: 340px) {
    body[data-page="profile"] .profile-tabs button,
    body[data-page="public-profile"] .profile-tabs button {
        gap: 3px;
        font-size: 9px;
    }

    body[data-page="profile"] .profile-tabs button svg,
    body[data-page="public-profile"] .profile-tabs button svg,
    body[data-page="profile"] .profile-tab-icon,
    body[data-page="profile"] .profile-tab-icon .ig-action-icon {
        width: 16px;
        height: 16px;
        flex-basis: 16px;
    }

    body[data-page="profile"] .profile-stats span,
    body[data-page="public-profile"] .profile-stats span {
        font-size: 9px;
    }
}
