/* ═══════════════════════════════════════════════════════════
   bleuet.css — design system for bleuet.quebec
   Tokens → base → layout → components → pages
   ═══════════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
    --bg: #f5f6fb;
    --surface: #ffffff;
    --surface-2: #eef0f7;
    --surface-3: #e4e7f1;
    --border: #e1e4ee;
    --border-strong: #cdd2e1;
    --text: #151830;
    --text-2: #3f4460;
    --muted: #6c7190;
    --brand: #3d4ed8;
    --brand-strong: #2e3cb8;
    --brand-soft: #eceeff;
    --brand-ring: rgba(61, 78, 216, 0.22);
    --brand-fill: #3d4ed8;
    --brand-fill-hover: #2e3cb8;
    --leaf: #2f8f5b;
    --leaf-soft: #e5f4ec;
    --danger: #d23f38;
    --danger-soft: #fdecea;
    --warn: #b7791f;
    --warn-soft: #fdf3e1;
    --violet: #8a3fd9;
    --violet-soft: rgba(138, 63, 217, 0.1);

    --stage: #0d0f1e;
    --stage-2: #161a33;
    --on-stage: #eef0ff;
    --on-stage-muted: rgba(238, 240, 255, 0.62);

    --shadow-sm: 0 1px 2px rgba(20, 24, 48, 0.06), 0 1px 1px rgba(20, 24, 48, 0.04);
    --shadow-md: 0 8px 24px -8px rgba(20, 24, 48, 0.16), 0 2px 6px rgba(20, 24, 48, 0.05);
    --shadow-lg: 0 28px 60px -20px rgba(20, 24, 48, 0.32), 0 6px 16px rgba(20, 24, 48, 0.08);

    --r-sm: 6px;
    --r-md: 8px;
    --r-lg: 12px;
    --r-xl: 16px;
    --r-pill: 999px;

    --header-h: 64px;
    --tabbar-h: 0px;

    --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0a0c17;
        --surface: #12152a;
        --surface-2: #191d36;
        --surface-3: #222743;
        --border: #242944;
        --border-strong: #333a5c;
        --text: #eceefa;
        --text-2: #c3c7dd;
        --muted: #8e94b3;
        --brand: #8390ff;
        --brand-strong: #a3adff;
        --brand-soft: rgba(131, 144, 255, 0.14);
        --brand-ring: rgba(131, 144, 255, 0.32);
        --brand-fill: #5463ea;
        --brand-fill-hover: #6470f2;
        --leaf: #5cc58b;
        --leaf-soft: rgba(92, 197, 139, 0.14);
        --danger: #ff6b62;
        --danger-soft: rgba(255, 107, 98, 0.14);
        --warn: #f2b857;
        --warn-soft: rgba(242, 184, 87, 0.14);
        --violet: #c59bff;
        --violet-soft: rgba(197, 155, 255, 0.14);
        --stage: #05060d;
        --stage-2: #10132a;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
        --shadow-md: 0 10px 28px -10px rgba(0, 0, 0, 0.6);
        --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, 0.75);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #0a0c17;
    --surface: #12152a;
    --surface-2: #191d36;
    --surface-3: #222743;
    --border: #242944;
    --border-strong: #333a5c;
    --text: #eceefa;
    --text-2: #c3c7dd;
    --muted: #8e94b3;
    --brand: #8390ff;
    --brand-strong: #a3adff;
    --brand-soft: rgba(131, 144, 255, 0.14);
    --brand-ring: rgba(131, 144, 255, 0.32);
    --brand-fill: #5463ea;
    --brand-fill-hover: #6470f2;
    --leaf: #5cc58b;
    --leaf-soft: rgba(92, 197, 139, 0.14);
    --danger: #ff6b62;
    --danger-soft: rgba(255, 107, 98, 0.14);
    --warn: #f2b857;
    --warn-soft: rgba(242, 184, 87, 0.14);
    --violet: #c59bff;
    --violet-soft: rgba(197, 155, 255, 0.14);
    --stage: #05060d;
    --stage-2: #10132a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 28px -10px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, 0.75);
    color-scheme: dark;
}

@media (max-width: 760px) {
    :root { --header-h: 56px; --tabbar-h: 64px; }
}

/* ── Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

[hidden] { display: none !important; }

/* Content protection: no dragging, selecting or iOS long-press "Save image" on media */
.thumb img, .stage-img, .lightbox img, .player-cover img, .tile img, .frame img, video {
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}
.media-shield { position: absolute; inset: 0; z-index: 2; cursor: zoom-in; -webkit-touch-callout: none; }
.lightbox .media-shield { cursor: zoom-out; }
.lightbox-frame { position: relative; display: inline-block; max-width: 100%; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: 6px;
}

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}


/* ── Buttons ────────────────────────────────────────────── */
.btn {
    --btn-bg: var(--surface-2);
    --btn-fg: var(--text);
    --btn-bd: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border-radius: var(--r-pill);
    border: 1px solid var(--btn-bd);
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.18s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease), color 0.18s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn i { font-size: 0.9em; }

.btn-primary { --btn-bg: var(--brand-fill); --btn-fg: #fff; box-shadow: 0 6px 16px -6px var(--brand-fill); }
.btn-primary:hover { background: var(--brand-fill-hover); }

.btn-ghost { --btn-bg: transparent; --btn-fg: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-outline { --btn-bg: transparent; --btn-bd: var(--border-strong); }
.btn-outline:hover { background: var(--surface-2); }

.btn-danger { --btn-bg: var(--danger); --btn-fg: #fff; }
.btn-danger:hover { background: var(--danger); filter: brightness(0.92); }

.btn-lg { height: 48px; padding: 0 22px; font-size: 0.95rem; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 0.8rem; }
.btn-block { width: 100%; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-2);
    transition: background 0.18s var(--ease), color 0.18s, transform 0.18s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(0.94); }

/* ── Header ─────────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-h);
    display: grid;
    grid-template-columns: 1fr minmax(0, 560px) 1fr;
    align-items: center;
    gap: 16px;
    padding: 0 20px;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(160%) blur(16px);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.header-start { display: flex; align-items: center; gap: 6px; justify-self: start; min-width: 0; }
.rail-toggle { font-size: 1.05rem; }
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-self: start;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-size: 1.15rem;
}
.brand img { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 3px 6px rgba(61, 78, 216, 0.35)); transition: transform 0.3s var(--ease); }
.brand:hover img { transform: rotate(-8deg) scale(1.06); }
.brand-word { display: inline-flex; align-items: baseline; max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap; margin-left: -10px;
    transition: max-width 0.35s var(--ease), opacity 0.25s var(--ease), margin-left 0.35s var(--ease); }
.brand:hover .brand-word, .brand:focus-visible .brand-word { max-width: 12em; opacity: 1; margin-left: 0; }
.brand-word em { font-style: normal; font-weight: 600; color: var(--brand); }

.header-actions {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Search ─────────────────────────────────────────────── */
.search { position: relative; width: 100%; }
.search-field {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 42px;
    padding: 0 14px;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    border: 1px solid transparent;
    color: var(--muted);
    transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.search-field:focus-within {
    background: var(--surface);
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-ring);
}
.search-field input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text);
    font-size: 0.9rem;
}
.search-field input::placeholder { color: var(--muted); }
.search-field kbd {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid var(--border-strong);
    color: var(--muted);
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    padding: 6px;
    border-radius: var(--r-md);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    display: none;
    max-height: 360px;
    overflow-y: auto;
}
.search-results.open { display: block; animation: pop-in 0.16s var(--ease); }
.search-results .item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
}
.search-results .item:hover,
.search-results .item.active { background: var(--surface-2); }
.search-results .item .at { color: var(--muted); font-weight: 400; }
.search-results .empty { padding: 14px 10px; color: var(--muted); font-size: 0.85rem; text-align: center; }
.search-results .sr-group { padding: 10px 10px 4px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.search-results .sr-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results .at { flex-shrink: 0; font-size: 0.8rem; }
.search-results .sr-thumb {
    display: grid;
    place-items: center;
    width: 48px;
    height: 27px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 0.75rem;
}
.search-results .sr-thumb img { width: 100%; height: 100%; object-fit: cover; }
.search-results .sr-all { margin-top: 4px; border-top: 1px solid var(--border); border-radius: 0 0 var(--r-sm) var(--r-sm); color: var(--brand); font-weight: 600; }
.search-results .sr-all i { width: 28px; text-align: center; }

/* Avatar pictures */
.avatar.has-img { background: var(--surface-3); overflow: hidden; }
.avatar.has-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* Visibility / processing badges */
.thumb-wrap { position: relative; }
.vis-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    padding: 0 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.62);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    backdrop-filter: blur(6px);
    white-space: nowrap;
}
.vis-badge.processing { background: rgba(61, 78, 216, 0.85); }
.vis-badge.failed { background: rgba(185, 28, 28, 0.85); }
.vis-badge.on-thumb { position: absolute; left: 8px; top: 8px; z-index: 2; }
.vis-badge.on-tile { position: absolute; left: 8px; top: 8px; z-index: 2; }
.vis-chip { background: var(--surface-3); color: var(--text-2); }
.vis-options { display: flex; flex-wrap: wrap; gap: 6px; }
.vis-option input { position: absolute; opacity: 0; pointer-events: none; }
.vis-option span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 36px;
    padding: 0 14px;
    border-radius: var(--r-pill);
    border: 1px solid var(--border-strong);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-2);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.vis-option input:checked + span { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.vis-option input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
a.tagl:hover { text-decoration: underline; }
.processing-card { color: var(--on-stage); padding: 48px 24px; max-width: 460px; }
.processing-card h2 { font-size: 1.25rem; font-weight: 800; }
.processing-card p { color: var(--on-stage-muted); }
.processing-card i { font-size: 2.4rem; color: #9aa6ff; }
.processing-card.failed i { color: #ff6b62; }

/* Profile banner + bio */
.profile-hero.has-banner { background: var(--banner) center / cover no-repeat; }
.profile-hero.has-banner::after { display: none; }
.profile-bio { margin-top: 8px; max-width: 620px; color: var(--text-2); white-space: pre-line; overflow-wrap: anywhere; font-size: 0.925rem; }
.profile-bio.empty { color: var(--muted); font-size: 0.85rem; }

/* Profile editor (account settings) */
.profile-edit { position: relative; margin-bottom: 44px; }
.banner-pick {
    position: relative;
    display: block;
    aspect-ratio: 3 / 1;
    border-radius: var(--r-lg);
    overflow: hidden;
    cursor: pointer;
    background:
        radial-gradient(60% 120% at 15% 0%, hsl(var(--h) 80% 70% / 0.55), transparent 60%),
        linear-gradient(135deg, hsl(var(--h) 45% 22%), hsl(calc(var(--h) + 30) 50% 14%));
}
.banner-pick.has-img { background: var(--banner) center / cover no-repeat; }
.banner-pick input, .avatar-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pick-hint {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: var(--r-pill);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(6px);
}
.avatar-pick { position: absolute; left: 20px; bottom: -40px; cursor: pointer; }
.avatar-pick .avatar { --size: 96px; box-shadow: 0 0 0 4px var(--surface), var(--shadow-md); }
.avatar-pick-cam {
    position: absolute;
    right: 0;
    bottom: 2px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand-fill);
    color: #fff;
    font-size: 0.8rem;
    box-shadow: 0 0 0 3px var(--surface);
}
.pick-actions { display: flex; gap: 16px; flex-wrap: wrap; justify-content: flex-end; font-size: 0.85rem; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

/* App + notifications */
.app-rows { display: flex; flex-direction: column; }
.app-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); }
.app-row:first-child { border-top: none; padding-top: 0; }
.app-row > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.app-row > div span { font-size: 0.82rem; color: var(--muted); }
.app-row-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); flex-shrink: 0; }
.app-push.is-on { --btn-bg: var(--leaf-soft); --btn-fg: var(--leaf); }
.notif-foot { border-top: 1px solid var(--border); padding: 6px; }
.notif-push {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: var(--r-sm);
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 0.82rem;
    font-weight: 700;
}
.notif-push.is-on { background: transparent; color: var(--muted); font-weight: 500; }
.install-card { text-align: center; }
.install-icon { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 12px; box-shadow: var(--shadow-md); }
.install-steps { text-align: left; margin: 0 0 4px; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; font-size: 0.9rem; color: var(--text-2); }
.ios-share { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); color: var(--brand); font-weight: 600; }

/* Followers-only lock page */
.locked { min-height: calc(100dvh - var(--header-h) - var(--tabbar-h)); display: grid; place-items: center; padding: 24px 16px;
          background: radial-gradient(50% 45% at 50% 35%, hsl(var(--h) 70% 55% / 0.18), transparent 70%); }
.locked-card { max-width: 440px; width: 100%; padding: 32px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.locked-card h1 { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em; }
.locked-card p { color: var(--text-2); }
.locked-orb { position: relative; margin-bottom: 6px; }
.locked-lock { position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
               background: var(--text); color: var(--bg); box-shadow: 0 0 0 4px var(--surface); }
.locked-actions { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 8px; }

/* ── Paid features ─────────────────────────────────────── */
:root { --gold: #d99a06; --gold-soft: rgba(217, 154, 6, 0.12); }
.btn-paid { --btn-bg: linear-gradient(135deg, #f5b300, #e07a00); --btn-fg: #fff; background: linear-gradient(135deg, #f5b300, #e07a00); box-shadow: 0 6px 16px -6px #e07a00; }
.btn-paid:hover { filter: brightness(1.05); background: linear-gradient(135deg, #f5b300, #e07a00); }
.btn-tip { --btn-bg: var(--leaf-soft); --btn-fg: var(--leaf); }
.btn-tip:hover { background: var(--leaf-soft); filter: brightness(0.97); }
.vis-badge.paid { background: linear-gradient(135deg, rgba(245, 179, 0, 0.92), rgba(224, 122, 0, 0.92)); }
.sponsor-banner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    padding: 6px 12px;
    border-radius: var(--r-pill);
    background: var(--gold-soft);
    color: var(--gold);
    font-size: 0.82rem;
    font-weight: 600;
}
.sponsor-banner strong { color: var(--text); }
.owner-money {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
    padding: 12px 16px;
    border-radius: var(--r-md);
    border: 1px dashed color-mix(in srgb, var(--leaf) 45%, var(--border));
    background: var(--leaf-soft);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-2);
}
.owner-money i { color: var(--leaf); }
.owner-money-note { margin-left: auto; font-size: 0.75rem; font-weight: 500; color: var(--muted); }
.pay-note { display: flex; gap: 8px; margin-top: 16px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--muted); font-size: 0.8rem; line-height: 1.45; }
.pay-note i { margin-top: 3px; color: var(--brand); }
.modal-icon.money { background: var(--leaf-soft); color: var(--leaf); }
.amount-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.amount input { position: absolute; opacity: 0; pointer-events: none; }
.amount span { display: grid; place-items: center; height: 48px; border-radius: var(--r-md); border: 1px solid var(--border-strong); font-weight: 800; font-size: 1.05rem; cursor: pointer; transition: all 0.15s; }
.amount input:checked + span { border-color: var(--leaf); background: var(--leaf-soft); color: var(--leaf); }
.amount input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.locked-card.paid .locked-lock { background: linear-gradient(135deg, #f5b300, #e07a00); color: #fff; }
.locked-pitch { margin: 0; padding: 10px 14px; border-left: 3px solid var(--gold); background: var(--gold-soft); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--text-2); font-style: italic; text-align: left; }
.locked-card .pay-note { text-align: left; }
.paid-pitch { display: flex; gap: 8px; align-items: baseline; margin: 14px 24px 0; color: var(--text-2); font-size: 0.9rem; }
.paid-pitch i { color: var(--gold); }
.live-locked .btn-paid { margin-top: 6px; }

/* Comments */
.comments { display: flex; flex-direction: column; gap: 16px; padding-top: 8px; }
.comments-title { font-size: 1.05rem; font-weight: 800; }
.comment-form { display: flex; gap: 12px; align-items: flex-start; }
.comment-input { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.comment-input textarea.input { min-height: 44px; height: 44px; resize: none; overflow: hidden; padding-top: 11px; }
.comment-form-actions { display: flex; justify-content: flex-end; gap: 6px; }
.comment-login { display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: var(--r-md); background: var(--surface-2); color: var(--text-2); font-weight: 600; font-size: 0.9rem; align-self: flex-start; }
.comment-login:hover { color: var(--brand); }
.comments-paid { margin-left: 8px; font-size: 0.72rem; font-weight: 700; color: var(--gold); vertical-align: middle; text-transform: uppercase; letter-spacing: 0.04em; }
.comment-gate { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--r-md); background: var(--surface-2); color: var(--text-2); font-weight: 600; font-size: 0.9rem; }
.comment-gate i { margin-right: 6px; }
.comment-gate.owner:hover { color: var(--brand); }
.comment-list { display: flex; flex-direction: column; gap: 18px; }
.comment { display: flex; gap: 12px; align-items: flex-start; }
.comment.reply { margin-top: 12px; }
.comment.reply .avatar { --size: 28px; }
.c-body { flex: 1; min-width: 0; }
.c-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.82rem; }
.c-user { font-weight: 700; color: var(--text); }
.c-user:hover { color: var(--brand); }
.c-owner { padding: 1px 7px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); font-size: 0.68rem; font-weight: 700; }
.c-when { color: var(--muted); }
.c-text { margin-top: 3px; color: var(--text-2); white-space: pre-line; overflow-wrap: anywhere; font-size: 0.925rem; }
.c-text.deleted { color: var(--muted); font-style: italic; }
.c-actions { display: flex; gap: 4px; margin-top: 2px; margin-left: -8px; }
.c-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: none; border-radius: var(--r-pill); background: none; color: var(--muted); font-size: 0.78rem; font-weight: 600; }
.c-btn:hover { background: var(--surface-2); color: var(--text); }
.c-replies { border-left: 2px solid var(--border); padding-left: 12px; margin-top: 4px; }
.c-replies:empty { display: none; }
.c-reply-slot .comment-form { margin-top: 10px; }
.comment-empty { color: var(--muted); font-size: 0.9rem; }

/* Revenus */
.money-icon { background: var(--leaf-soft); color: var(--leaf); }
.money-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.money-card { display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }
.money-card strong { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.money-card span { font-size: 0.78rem; color: var(--muted); }
.mc-label { font-weight: 700; color: var(--text-2) !important; }
.mc-label i { color: var(--gold); }
.nav-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 0.68rem; }
.sub-title { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.settings-card-head + .sub-title { margin-top: 0; }
.empty-line { color: var(--muted); font-size: 0.875rem; }
.muted { color: var(--muted); font-size: 0.82rem; }
.offer-list, .ledger { display: flex; flex-direction: column; }
.offer, .ledger-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.offer:first-child, .ledger-row:first-child { border-top: none; }
.offer-main, .ledger-main { flex: 1; min-width: 0; }
.offer-top { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.offer-amount { margin-left: auto; font-weight: 800; color: var(--leaf); font-variant-numeric: tabular-nums; }
.offer-msg { margin-top: 6px; color: var(--text-2); font-size: 0.875rem; font-style: italic; overflow-wrap: anywhere; }
.offer-actions { display: flex; gap: 6px; flex-shrink: 0; }
.ledger-amount { display: flex; flex-direction: column; align-items: flex-end; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pay-status { font-size: 0.7rem; font-weight: 600; color: var(--muted); }
.status-pill { padding: 1px 8px; border-radius: 6px; font-size: 0.72rem; font-weight: 700; background: var(--surface-3); color: var(--text-2); }
.status-pill.st-acceptee { background: var(--leaf-soft); color: var(--leaf); }
.status-pill.st-refusee { background: var(--danger-soft); color: var(--danger); }
.status-pill.st-proposee { background: var(--gold-soft); color: var(--gold); }
@media (max-width: 760px) {
    .money-cards { grid-template-columns: 1fr; }
    .offer { flex-direction: column; align-items: stretch; }
    .offer-actions { justify-content: flex-end; }
    .owner-money-note { margin-left: 0; }
}

/* Follow button states */
.btn-following { --btn-bg: var(--surface-2); --btn-fg: var(--text); --btn-bd: var(--border-strong); }
.btn-following:hover { --btn-bd: var(--danger); color: var(--danger); background: var(--danger-soft); }
.watch-author-row { display: flex; align-items: center; gap: 16px; min-width: 0; }

/* Notifications */
.notif-trigger { position: relative; font-size: 1.05rem; }
.notif-badge {
    position: absolute;
    top: 4px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--bg);
}
.notif-panel { width: min(380px, calc(100vw - 24px)); padding: 0; overflow: hidden; }
.notif-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }
.notif-list { max-height: min(460px, 70vh); overflow-y: auto; padding: 6px; }
.notif-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--r-sm);
    font-size: 0.85rem;
    color: var(--text-2);
}
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: var(--brand-soft); }
.notif-item.unread:hover { background: color-mix(in srgb, var(--brand-soft) 70%, var(--surface-2)); }
.notif-item strong { color: var(--text); }
.notif-item em { font-style: normal; font-weight: 600; color: var(--text); }
.notif-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.35; }
.notif-when { display: inline-flex; align-items: center; gap: 5px; font-size: 0.72rem; color: var(--muted); }
.notif-when img { width: 12px; height: 12px; }
.notif-when i { font-size: 0.65rem; color: var(--brand); }
.notif-thumb { width: 56px; height: 32px; flex-shrink: 0; object-fit: cover; border-radius: 6px; }
.notif-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 16px; color: var(--muted); font-size: 0.875rem; text-align: center; }
.notif-empty i { font-size: 1.4rem; }

/* Visitor welcome + follow chip */
.welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding: 28px 32px;
    border-radius: var(--r-xl);
    color: #fff;
    background:
        radial-gradient(70% 140% at 0% 0%, rgba(131, 144, 255, 0.55), transparent 60%),
        radial-gradient(60% 120% at 100% 100%, rgba(47, 143, 91, 0.35), transparent 60%),
        linear-gradient(135deg, #1b2266, #0d1030);
    position: relative;
    overflow: hidden;
}
.welcome::after {
    content: '';
    position: absolute;
    right: -40px;
    bottom: -70px;
    width: 260px;
    height: 260px;
    background: url('/static/icone.webp') center / contain no-repeat;
    opacity: 0.18;
    pointer-events: none;
}
.welcome-text { max-width: 620px; position: relative; }
.welcome h1 { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.welcome h1 em { font-style: normal; color: #c7ccff; }
.welcome p { margin-top: 8px; color: rgba(255, 255, 255, 0.82); }
.welcome-cta { display: flex; gap: 10px; flex-wrap: wrap; position: relative; }
.welcome .btn-outline { --btn-bd: rgba(255, 255, 255, 0.4); --btn-fg: #fff; }
.welcome .btn-outline:hover { background: rgba(255, 255, 255, 0.12); }
.fchip-sep { width: 1px; align-self: stretch; margin: 6px 2px; background: var(--border-strong); flex-shrink: 0; }
@media (max-width: 760px) {
    .btn-signup { display: none; }
    .welcome { margin: 12px 12px 0; padding: 22px 20px; }
    .welcome h1 { font-size: 1.45rem; }
    .welcome-cta .btn { flex: 1; }
    .watch-author-row { justify-content: space-between; width: 100%; }
}

/* ── Live ────────────────────────────────────────────────── */
:root { --live: #ef4444; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; animation: live-pulse 1.6s ease-in-out infinite; }
.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 24px;
    padding: 0 10px;
    border-radius: 6px;
    background: var(--live);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}
.live-pill .live-dot { background: #fff; }
.live-pill.off { background: var(--surface-3); color: var(--muted); }
.live-pill.off .live-dot { background: var(--muted); animation: none; }
.live-text { color: var(--live); font-weight: 700; font-style: normal; }
@keyframes live-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.8); } }

.live-row { padding-top: 22px; }
.live-row-title { display: flex; align-items: center; gap: 10px; font-size: 1rem; font-weight: 800; color: var(--live); margin-bottom: 12px; }
.live-cards { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.live-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 0 0 min(360px, 86vw);
    padding: 18px;
    border-radius: 12px;
    color: #fff;
    background:
        radial-gradient(90% 140% at 0% 0%, hsl(var(--h) 80% 60% / 0.55), transparent 60%),
        linear-gradient(135deg, #2a0d18, #140a24);
    border: 1px solid rgba(239, 68, 68, 0.45);
    box-shadow: 0 14px 34px -18px rgba(239, 68, 68, 0.7);
    transition: transform 0.25s var(--ease), box-shadow 0.25s;
}
.live-card:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -18px rgba(239, 68, 68, 0.85); }
.live-card .live-pill { position: absolute; top: 12px; right: 12px; }
.live-card .avatar { --size: 58px; box-shadow: 0 0 0 3px var(--live); }
.live-card-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding-right: 70px; }
.live-card-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-card-text span { font-size: 0.8rem; color: rgba(255, 255, 255, 0.75); }

.live-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 24px 0;
    padding: 12px 16px;
    border-radius: var(--r-md);
    background: color-mix(in srgb, var(--live) 12%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--live) 40%, var(--border));
    font-weight: 600;
}
.live-banner-cta { margin-left: auto; color: var(--live); font-weight: 700; }

.live-stage .vp { background: #000; }
.live-overlay { position: absolute; top: 14px; left: 14px; z-index: 4; display: flex; gap: 8px; align-items: center; }
.live-viewers { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 6px; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 0.75rem; font-weight: 600; }
/* Connection screen while the live stream starts */
.live-connect {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 24px;
    color: #fff;
    text-align: center;
    background:
        radial-gradient(45% 55% at 50% 42%, hsl(var(--h) 70% 45% / 0.45), transparent 70%),
        radial-gradient(90% 90% at 50% 50%, #120c24, #05060d);
    transition: opacity 0.6s var(--ease), visibility 0.6s;
}
.live-connect.gone { opacity: 0; visibility: hidden; }
.lc-orb { position: relative; display: grid; place-items: center; width: 132px; height: 132px; }
.lc-orb .avatar { --size: 96px; position: relative; z-index: 2; box-shadow: 0 0 0 3px var(--live), 0 0 40px -6px var(--live); animation: lc-breathe 2.4s ease-in-out infinite; }
.lc-ring { position: absolute; inset: 18px; border-radius: 50%; border: 2px solid var(--live); opacity: 0; animation: lc-ring 2.4s cubic-bezier(0.2, 0.6, 0.3, 1) infinite; }
.lc-ring:nth-child(2) { animation-delay: 0.8s; }
.lc-ring:nth-child(3) { animation-delay: 1.6s; }
.lc-text { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.05rem; }
.lc-text #lp-status { transition: opacity 0.16s, transform 0.16s; }
.lc-text #lp-status.swap { opacity: 0; transform: translateY(4px); }
.lc-bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 16px; }
.lc-bars i { width: 4px; border-radius: 2px; background: var(--live); animation: lc-bar 1.1s ease-in-out infinite; }
.lc-bars i:nth-child(1) { height: 25%; animation-delay: 0s; }
.lc-bars i:nth-child(2) { height: 50%; animation-delay: 0.15s; }
.lc-bars i:nth-child(3) { height: 75%; animation-delay: 0.3s; }
.lc-bars i:nth-child(4) { height: 100%; animation-delay: 0.45s; }
.lc-sub { max-width: 80%; font-size: 0.85rem; color: var(--on-stage-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes lc-ring { 0% { transform: scale(0.85); opacity: 0.9; } 100% { transform: scale(2.1); opacity: 0; } }
@keyframes lc-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes lc-bar { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
.live-buffer { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; color: rgba(255, 255, 255, 0.85); font-size: 2rem; pointer-events: none; }
@media (max-width: 760px) {
    .lc-orb { width: 104px; height: 104px; }
    .lc-orb .avatar { --size: 72px; }
    .lc-text { font-size: 0.95rem; }
}
.live-sync { --btn-bg: var(--live); --btn-fg: #fff; margin-left: 6px; }
.live-offline { background: radial-gradient(80% 90% at 50% 0%, hsl(var(--h) 45% 22%), var(--stage)); }
.offline-card { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 24px; text-align: center; color: var(--on-stage); max-width: 460px; }
.offline-card h2 { font-size: 1.35rem; font-weight: 800; }
.offline-card p { color: var(--on-stage-muted); }

/* Stream from this device */
.device-offer {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 20px;
    border-color: color-mix(in srgb, var(--live) 40%, var(--border));
    background: linear-gradient(135deg, color-mix(in srgb, var(--live) 10%, var(--surface)), var(--surface));
    animation: rise 0.4s var(--ease) both;
}
.device-offer-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 10px; background: var(--live); color: #fff; font-size: 1.3rem; flex-shrink: 0; }
.device-offer-text { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }
.device-offer-text span { font-size: 0.85rem; color: var(--muted); }
.device-offer-actions { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; }
.device-offer-actions .btn-primary { --btn-bg: var(--live); box-shadow: 0 6px 16px -6px var(--live); flex: 1; }
.device-offer-actions .btn-primary:hover { background: var(--live); filter: brightness(0.93); }
.device-desktop { font-size: 0.875rem; margin-top: -6px; }

body.cam-open { overflow: hidden; }
.cam {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: #000;
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.cam-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }   /* 16:9 frame, as viewers see it */
.cam-top, .cam-bottom, .cam-title, .cam-msg, .cam-hint { position: relative; z-index: 2; }
.cam-top { display: flex; align-items: center; gap: 8px; padding: 14px 14px 0; }
.cam-stat { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 6px; background: rgba(0, 0, 0, 0.55); font-size: 0.75rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.cam-title { margin: 10px 16px 0; font-weight: 700; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cam-msg { margin: 12px 16px 0; padding: 10px 14px; border-radius: var(--r-md); background: rgba(0, 0, 0, 0.65); font-size: 0.875rem; backdrop-filter: blur(8px); }
.cam-msg.error { background: rgba(185, 28, 28, 0.85); }
.cam-msg.ok { background: rgba(21, 128, 61, 0.85); }
.cam-bottom {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 18px 16px 8px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
}
.cam-round {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 1.15rem;
    backdrop-filter: blur(10px);
}
.cam-round.off { background: rgba(239, 68, 68, 0.85); }
.cam-round.on { background: rgba(255, 255, 255, 0.92); color: #12152a; }
.cam-small { width: 44px; height: 44px; font-size: 0.95rem; }
.cam-rotate {
    position: relative;
    z-index: 2;
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 14px;
    border-radius: var(--r-pill);
    background: rgba(0, 0, 0, 0.6);
    font-size: 0.8rem;
    font-weight: 600;
    backdrop-filter: blur(8px);
}
.cam-rotate i { animation: cam-turn 2.4s ease-in-out infinite; }
@keyframes cam-turn { 0%, 30% { transform: rotate(0); } 55%, 85% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
.cam[data-state="live"] .cam-rotate { display: none; }
.cam-top .cam-round { width: 40px; height: 40px; font-size: 1rem; }
.cam-go {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 60px;
    padding: 0 26px;
    border: none;
    border-radius: 30px;
    background: var(--live);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    box-shadow: 0 10px 28px -8px var(--live);
    transition: transform 0.15s var(--ease), background 0.2s;
}
.cam-go:active { transform: scale(0.96); }
.cam-go:disabled { opacity: 0.75; }
.cam-go-dot { width: 14px; height: 14px; border-radius: 50%; background: #fff; }
.cam[data-state="live"] .cam-go { background: rgba(255, 255, 255, 0.95); color: #b91c1c; }
.cam[data-state="live"] .cam-go-dot { border-radius: 3px; background: #b91c1c; }
.cam[data-state="connecting"] .cam-go-dot { animation: live-pulse 1s ease-in-out infinite; }
.cam[data-state="live"] #cam-pill .live-dot { animation: live-pulse 1.6s ease-in-out infinite; }
.cam-hint { margin: 0 20px 10px; text-align: center; font-size: 0.72rem; color: rgba(255, 255, 255, 0.7); }

/* Studio */
.studio-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 12px; background: color-mix(in srgb, var(--live) 14%, var(--surface)); color: var(--live); font-size: 1.5rem; flex-shrink: 0; }
.studio-status { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.studio-status.is-live { border-color: color-mix(in srgb, var(--live) 45%, var(--border)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--live) 14%, transparent); }
.studio-status-text { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }
.studio-status-text span { font-size: 0.85rem; color: var(--muted); }
.copy-field { display: flex; gap: 8px; }
.copy-field .input { flex: 1; min-width: 0; }
.input.mono { font-family: 'SFMono-Regular', Consolas, Menlo, monospace; font-size: 0.85rem; }
.toggle { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-size: 0.9rem; }
.toggle input { position: absolute; opacity: 0; }
.toggle-ui { position: relative; width: 42px; height: 24px; flex-shrink: 0; border-radius: 12px; background: var(--surface-3); transition: background 0.2s; margin-top: 2px; }
.toggle-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform 0.2s var(--ease); }
.toggle input:checked + .toggle-ui { background: var(--brand-fill); }
.toggle input:checked + .toggle-ui::after { transform: translateX(18px); }
.toggle input:focus-visible + .toggle-ui { outline: 2px solid var(--brand); outline-offset: 2px; }
.obs-grid { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 0; font-size: 0.875rem; }
.obs-grid dt { color: var(--muted); }
.obs-grid dd { margin: 0; color: var(--text-2); }
.history { display: flex; flex-direction: column; }
.history-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.history-row:first-child { border-top: none; }
.history-row strong { display: block; font-size: 0.9rem; }
.history-row span { font-size: 0.8rem; color: var(--muted); }
@media (max-width: 760px) {
    .live-row { padding: 16px 12px 0; }
    .live-banner { margin: 14px 12px 0; }
    .copy-field { flex-wrap: wrap; }
    .obs-grid { grid-template-columns: 1fr; gap: 2px; }
    .obs-grid dd { margin-bottom: 8px; }
}

/* Search results page */
.search-head { padding: 28px 0 6px; }
.search-head h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; overflow-wrap: anywhere; }
.search-head h1 em { font-style: normal; color: var(--brand); }
.search-head p { color: var(--muted); margin-top: 4px; font-size: 0.9rem; }
.people { display: flex; gap: 12px; overflow-x: auto; padding: 16px 2px 6px; scrollbar-width: thin; }
.person {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 0 0 132px;
    padding: 16px 10px 14px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    text-align: center;
    transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
}
.person .avatar { --size: 64px; }
.person strong { font-size: 0.875rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person span { font-size: 0.75rem; color: var(--muted); }
.person:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); box-shadow: var(--shadow-md); }

/* Account settings */
.settings { max-width: 720px; margin: 0 auto; padding: 28px 20px 64px; display: flex; flex-direction: column; gap: 18px; }
.settings-head { display: flex; align-items: center; gap: 16px; }
.settings-head .avatar { --size: 64px; }
.settings-head h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.settings-head p { color: var(--muted); font-size: 0.9rem; }
.settings-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.settings-nav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 14px;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 0.85rem;
    font-weight: 600;
}
.settings-nav a:hover { background: var(--surface-3); color: var(--text); }
.settings-card { padding: 22px; scroll-margin-top: calc(var(--header-h) + 16px); }
.settings-card:target { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); box-shadow: 0 0 0 4px var(--brand-ring); }
.settings-card-head { margin-bottom: 18px; }
.settings-card-head h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.settings-card-head p { color: var(--muted); font-size: 0.875rem; overflow-wrap: anywhere; }
.settings-card-head strong { color: var(--text-2); }
.settings-form { display: flex; flex-direction: column; gap: 14px; }
.settings-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
@media (max-width: 760px) {
    .settings { padding: 18px 12px 32px; }
    .settings-card { padding: 18px; }
    .search-head { padding: 18px 12px 4px; }
    .people { padding: 12px; }
}

/* ── Avatar ─────────────────────────────────────────────── */
.avatar {
    --h: 232;
    --size: 36px;
    width: var(--size);
    height: var(--size);
    flex-shrink: 0;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, hsl(var(--h) 72% 62%), hsl(calc(var(--h) + 38) 70% 44%));
    color: #fff;
    font-weight: 700;
    font-size: calc(var(--size) * 0.42);
    text-transform: uppercase;
    letter-spacing: 0;
    user-select: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.avatar-sm { --size: 28px; }
.avatar-lg { --size: 96px; }
.avatar-xl { --size: 120px; }

/* ── Menu (avatar dropdown) ─────────────────────────────── */
.menu { position: relative; }
.menu-trigger { border: none; background: none; padding: 2px; border-radius: 50%; display: grid; }
.menu-trigger:hover .avatar { filter: brightness(1.06); }
.menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 220px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    display: none;
}
.menu.open .menu-panel { display: block; animation: pop-in 0.16s var(--ease); }
.menu-head { display: flex; align-items: center; gap: 10px; padding: 10px; }
.menu-head strong { display: block; font-size: 0.9rem; }
.menu-head span { font-size: 0.78rem; color: var(--muted); }
.menu-sep { height: 1px; background: var(--border); margin: 4px 0; }
.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border-radius: var(--r-sm);
    border: none;
    background: none;
    font-size: 0.875rem;
    color: var(--text-2);
    text-align: left;
}
.menu-item i { width: 16px; text-align: center; color: var(--muted); }
.menu-item:hover { background: var(--surface-2); color: var(--text); }
.menu-item.danger:hover { color: var(--danger); background: var(--danger-soft); }
.menu-item.danger:hover i { color: var(--danger); }

/* ── Mobile tab bar ─────────────────────────────────────── */
.tabbar { display: none; }

@media (max-width: 760px) {
    .site-header { grid-template-columns: auto 1fr auto; padding: 0 12px; gap: 10px; }
    .brand-word { display: none; }
    .header-actions .btn-publish { display: none; }
    .site-header .search, .site-header .search-field { min-width: 0; }
    .header-actions > .btn-primary { padding: 0 12px; height: 36px; font-size: 0.85rem; white-space: nowrap; }
    .search-field kbd { display: none; }
    .search-field { height: 38px; }

    .tabbar {
        position: fixed;
        z-index: 50;
        left: 0;
        right: 0;
        bottom: 0;
        height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        align-items: center;
        background: color-mix(in srgb, var(--surface) 88%, transparent);
        backdrop-filter: saturate(160%) blur(16px);
        -webkit-backdrop-filter: saturate(160%) blur(16px);
        border-top: 1px solid var(--border);
    }
    .tab {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        font-size: 0.68rem;
        font-weight: 600;
        color: var(--muted);
    }
    .tab i { font-size: 1.15rem; }
    .tab.active { color: var(--brand); }
    .tab-publish span.plus {
        display: grid;
        place-items: center;
        width: 46px;
        height: 34px;
        border-radius: 8px;
        background: var(--brand-fill);
        color: #fff;
        box-shadow: 0 6px 16px -6px var(--brand-fill);
    }
    .tab-publish span.plus i { font-size: 1rem; }
    body.has-tabbar { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
}

/* ── Toasts ─────────────────────────────────────────────── */
.toasts {
    position: fixed;
    z-index: 200;
    top: calc(var(--header-h) + 12px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(440px, calc(100vw - 32px));
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--r-md);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    color: var(--text);
    pointer-events: auto;
    animation: toast-in 0.28s var(--ease);
}
.toast.leaving { animation: toast-out 0.22s var(--ease) forwards; }
.toast-icon {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.75rem;
    background: var(--brand-soft);
    color: var(--brand);
}
.toast.success .toast-icon { background: var(--leaf-soft); color: var(--leaf); }
.toast.danger .toast-icon, .toast.error .toast-icon { background: var(--danger-soft); color: var(--danger); }
.toast.warn .toast-icon { background: var(--warn-soft); color: var(--warn); }
.toast-body { flex: 1; padding-top: 2px; }
.toast-close { border: none; background: none; color: var(--muted); padding: 2px 4px; }
.toast-close:hover { color: var(--text); }

/* ── Chips / badges ─────────────────────────────────────── */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 10px;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}
.chip i { font-size: 0.7rem; }
.chip-image { background: var(--brand-soft); color: var(--brand); }
.chip-video { background: var(--violet-soft); color: var(--violet); }
.chip-audio { background: var(--leaf-soft); color: var(--leaf); }
.chip-tag { background: transparent; border: 1px solid var(--border-strong); font-weight: 500; }
.chip-tag::before { content: '#'; color: var(--muted); margin-right: -3px; }

/* ── Like (bleuet) ──────────────────────────────────────── */
.like {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px 0 10px;
    border-radius: var(--r-pill);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    font-weight: 600;
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
    transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.18s var(--ease);
}
.like img { width: 22px; height: 22px; object-fit: contain; transition: filter 0.25s, transform 0.25s var(--ease); filter: grayscale(1) opacity(0.45); }
.like:hover { border-color: var(--border-strong); }
.like:hover img { filter: grayscale(0.4) opacity(0.8); }
.like:active { transform: scale(0.95); }
.like.liked { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.like.liked img { filter: none; }
.like.pop img { animation: bleuet-pop 0.5s var(--ease); }

.like-on-stage { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.12); color: var(--on-stage); }
.like-on-stage:hover { border-color: rgba(255, 255, 255, 0.24); }
.like-on-stage.liked { background: rgba(131, 144, 255, 0.2); color: #c7ccff; }

/* ── Forms ──────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-2);
}
.field-label .opt { color: var(--muted); font-weight: 400; }
.field-hint { font-size: 0.75rem; color: var(--muted); }
.counter { font-size: 0.72rem; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.counter.warn { color: var(--warn); }
.counter.over { color: var(--danger); }

.input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border-radius: var(--r-md);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color 0.18s, box-shadow 0.18s;
}
.input::placeholder { color: var(--muted); opacity: 0.8; }
.input:hover { border-color: var(--muted); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
textarea.input { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input.code {
    height: 58px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
}

.input-wrap { position: relative; }
.input-wrap .input { padding-right: 46px; }
.input-wrap .reveal {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
}
.input-with-icon { position: relative; }
.input-with-icon > i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 0.9rem;
    pointer-events: none;
}
.input-with-icon .input { padding-left: 40px; }

.segmented {
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    padding: 4px;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    gap: 2px;
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 34px;
    padding: 0 16px;
    border-radius: var(--r-pill);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.segmented input:checked + label { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 1px; }

/* Tag input */
.tag-input {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 46px;
    padding: 6px 10px;
    border-radius: var(--r-md);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    cursor: text;
    transition: border-color 0.18s, box-shadow 0.18s;
}
.tag-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.tag-input input { flex: 1; min-width: 120px; height: 32px; border: none; outline: none; background: transparent; font-size: 0.9rem; }
.tag-input .chip { background: var(--brand-soft); color: var(--brand); padding-right: 4px; }
.tag-input .chip button {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 0.65rem;
}
.tag-input .chip button:hover { background: rgba(0, 0, 0, 0.08); }

/* ── Cards / surfaces ───────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
}

/* ── Modal ──────────────────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: none;
    place-items: center;
    padding: 16px;
    background: rgba(8, 10, 22, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.modal.open { display: grid; animation: fade-in 0.18s var(--ease); }
.modal-card {
    width: 100%;
    max-width: 460px;
    padding: 24px;
    border-radius: var(--r-xl);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    animation: pop-in 0.22s var(--ease);
}
.modal-card h3 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 4px; }
.modal-card .sub { color: var(--muted); font-size: 0.875rem; margin-bottom: 20px; }
.modal-card .stack { display: flex; flex-direction: column; gap: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.modal-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-bottom: 14px;
    background: var(--danger-soft);
    color: var(--danger);
    font-size: 1.1rem;
}

/* ── Audio player ───────────────────────────────────────── */
.player {
    --accent: #9aa6ff;
    position: relative;
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 24px;
    align-items: center;
    width: min(760px, 100%);
    padding: 22px;
    border-radius: var(--r-xl);
    color: var(--on-stage);
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(99, 115, 255, 0.28), transparent 55%),
        radial-gradient(120% 140% at 100% 100%, rgba(47, 143, 91, 0.16), transparent 55%),
        linear-gradient(160deg, #141833 0%, #0c0f22 100%);
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    overflow: hidden;
    isolation: isolate;
}
.player::before {
    content: '';
    position: absolute;
    inset: -40%;
    z-index: -1;
    background: var(--cover) center / cover no-repeat;
    filter: blur(60px) saturate(1.4);
    opacity: 0.28;
}
.player-cover {
    position: relative;
    aspect-ratio: 1;
    border-radius: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #2a2f55, #151935);
    box-shadow: 0 22px 44px -14px rgba(0, 0, 0, 0.7);
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 2.6rem;
}
.player-cover img { width: 100%; height: 100%; object-fit: cover; }
.player.is-playing .player-cover { animation: breathe 3.2s ease-in-out infinite; }

.player-body { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.player-kicker { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--on-stage-muted); }
.player-title { font-weight: 700; font-size: 1.45rem; line-height: 1.2; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.player-artist { font-size: 0.875rem; color: var(--on-stage-muted); }
.player-artist a:hover { color: var(--on-stage); text-decoration: underline; }

.waveform {
    position: relative;
    display: flex;
    align-items: center;
    gap: 3px;
    height: 64px;
    cursor: pointer;
    touch-action: none;
}
.waveform .bar {
    flex: 1;
    min-width: 2px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.2);
    transition: background 0.15s, transform 0.2s var(--ease);
}
.waveform .bar.on { background: linear-gradient(180deg, #ffffff, var(--accent)); }
.waveform:hover .bar { transform: scaleY(1.06); }

.player-controls { display: flex; align-items: center; gap: 12px; }
.player-play {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: #12152a;
    font-size: 1.05rem;
    box-shadow: 0 10px 24px -8px rgba(154, 166, 255, 0.7);
    transition: transform 0.18s var(--ease);
}
.player-play:hover { transform: scale(1.05); }
.player-play:active { transform: scale(0.95); }
.player-play .fa-play { margin-left: 3px; }
.player-time { font-size: 0.8rem; color: var(--on-stage-muted); font-variant-numeric: tabular-nums; }
.player-spacer { flex: 1; }
.player-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: var(--on-stage);
    font-size: 0.85rem;
    transition: background 0.18s;
}
.player-icon:hover { background: rgba(255, 255, 255, 0.16); }

.tracklist { display: flex; flex-direction: column; gap: 2px; max-height: 176px; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.track {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    border: none;
    background: transparent;
    color: var(--on-stage-muted);
    font-size: 0.85rem;
    text-align: left;
}
.track:hover { background: rgba(255, 255, 255, 0.06); color: var(--on-stage); }
.track.active { background: rgba(154, 166, 255, 0.16); color: #fff; }
.track-num { font-variant-numeric: tabular-nums; font-size: 0.75rem; text-align: center; }
.track.active .track-num { color: var(--accent); }
.track-eq { display: none; gap: 2px; align-items: flex-end; height: 12px; }
.track.active.playing .track-eq { display: inline-flex; }
.track-eq span { width: 3px; background: var(--accent); border-radius: 2px; animation: eq 0.9s ease-in-out infinite; }
.track-eq span:nth-child(2) { animation-delay: -0.3s; }
.track-eq span:nth-child(3) { animation-delay: -0.6s; }

.player audio { display: none; }

/* Post page: large cover art */
/* the player IS the stage: blurred artwork fills it, no card-in-a-box */
.stage:has(.player-lg) { padding: 0; background: #07080f; place-items: stretch; }
.stage:has(.player-lg)::before { display: none; }
.stage .player.player-lg { margin: 0; }
.player-lg {
    width: 100%;
    min-height: 100%;
    grid-template-columns: clamp(280px, 42%, 520px) minmax(0, 1fr);
    gap: clamp(28px, 4vw, 56px);
    padding: clamp(22px, 3.2vw, 48px);
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: #07080f;
}
.player-lg::before { inset: -15%; opacity: 0.55; filter: blur(70px) saturate(1.35); }
.player-lg::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(7, 8, 15, 0.25) 0%, rgba(7, 8, 15, 0.7) 60%, rgba(7, 8, 15, 0.82) 100%),
        linear-gradient(0deg, rgba(7, 8, 15, 0.55), transparent 45%);
}
.player-lg .player-cover {
    cursor: pointer;
    font-size: 4rem;
    border-radius: 0;
    box-shadow: 0 34px 70px -24px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.06);
    transition: transform 0.3s var(--ease);
}
.player-lg .player-cover:hover { transform: translateY(-3px); }
.player-lg .player-cover:focus-visible { outline: 3px solid #9aa6ff; outline-offset: 4px; }
.player-lg.is-playing .player-cover { animation: none; transform: scale(1.015); }
.player-cover-play {
    position: absolute;
    right: 14px;
    bottom: 14px;
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
    color: #12152a;
    font-size: 1.1rem;
    box-shadow: 0 10px 28px -8px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s, transform 0.25s var(--ease);
}
.player-cover-play .fa-play { margin-left: 3px; }
.player-lg .player-cover:hover .player-cover-play, .player-lg .player-cover:focus-visible .player-cover-play { opacity: 1; transform: none; }
.player-lg .player-body { gap: 22px; align-self: center; }
.player-lg .player-title { font-size: clamp(1.7rem, 3vw, 2.8rem); line-height: 1.1; letter-spacing: -0.03em; }
.player-lg .player-artist { font-size: 1.05rem; margin-top: 6px; }
.player-lg .player-artist a { color: var(--on-stage); font-weight: 600; }
.player-lg .waveform { height: 88px; }
.player-lg .player-controls { gap: 8px; flex-wrap: wrap; }
.player-lg .player-play { width: 64px; height: 64px; font-size: 1.25rem; margin: 0 4px; }
.player-lg .player-icon { width: 42px; height: 42px; font-size: 0.95rem; background: transparent; }
.player-lg .player-icon:hover { background: rgba(255, 255, 255, 0.12); }
.player-lg .player-time { margin-left: 8px; font-weight: 600; }
.player-volume { display: flex; align-items: center; gap: 4px; }
.player-volume .vp-slider { width: 96px; }
@media (pointer: coarse) { .player-volume .vp-slider { display: none; } }
.player-lg .tracklist { max-height: 220px; border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 10px; }
@media (max-width: 760px) {
    .player-lg { grid-template-columns: 1fr; gap: 20px; padding: 20px 16px 22px; }
    .player-lg::after { background: linear-gradient(180deg, rgba(7, 8, 15, 0.2), rgba(7, 8, 15, 0.8) 55%); }
    .player-lg .player-cover { width: min(100%, 38vh, 420px); margin: 0 auto; }
    .player-lg .waveform { height: 60px; }
    .player-lg .player-body { gap: 16px; }
    .player-lg .player-cover-play { opacity: 1; transform: none; width: 46px; height: 46px; }
    .player-lg .player-title { font-size: 1.6rem; }
    .player-lg .player-controls { justify-content: center; }
    .player-lg .player-time { order: 10; width: 100%; text-align: center; margin: 0; }
    .player-lg .player-spacer, .player-lg .player-volume { display: none; }
}

@media (max-width: 640px) {
    .player { grid-template-columns: 1fr; gap: 18px; padding: 18px; }
    .player-cover { width: min(220px, 70%); margin: 0 auto; }
    .player-title { font-size: 1.35rem; }
}

/* ── Video stage (inline in feed) ───────────────────────── */
.vid-wrap { position: relative; background: #000; }
.vid-wrap video { width: 100%; height: 100%; object-fit: contain; }
.vid-sound {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.85rem;
    backdrop-filter: blur(6px);
    transition: background 0.18s;
}
.vid-sound:hover { background: rgba(0, 0, 0, 0.8); }
.vid-badge {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--r-pill);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    backdrop-filter: blur(6px);
}

/* ── Full video player (patente page) ───────────────────── */
.vp { position: relative; background: #000; border-radius: var(--r-lg); overflow: hidden; user-select: none; }
.vp video { width: 100%; max-height: calc(100dvh - var(--header-h) - 96px); object-fit: contain; cursor: pointer; }
.vp-big {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.92);
    color: #12152a;
    font-size: 1.4rem;
    box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.6);
    transition: opacity 0.25s, transform 0.25s var(--ease);
}
.vp-big .fa-play { margin-left: 4px; }
.vp.playing .vp-big { opacity: 0; pointer-events: none; transform: translate(-50%, -50%) scale(0.85); }
.vp-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 36px 14px 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
    color: #fff;
    transition: opacity 0.3s;
}
.vp.playing.idle .vp-bar { opacity: 0; }
.vp.playing.idle { cursor: none; }
.vp-track { position: relative; height: 16px; display: flex; align-items: center; cursor: pointer; }
.vp-rail { position: relative; width: 100%; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.25); transition: height 0.15s; }
.vp-track:hover .vp-rail { height: 6px; }
.vp-buf, .vp-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; }
.vp-buf { background: rgba(255, 255, 255, 0.3); }
.vp-fill { background: linear-gradient(90deg, var(--brand), #9aa6ff); }
.vp-hover { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; background: rgba(255, 255, 255, 0.22); opacity: 0; transition: opacity 0.15s; }
.vp-track:hover .vp-hover { opacity: 1; }
.vp-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    transform: translateY(-50%) scale(0);
    transition: transform 0.15s;
}
.vp-track:hover .vp-fill::after, .vp.scrubbing .vp-fill::after { transform: translateY(-50%) scale(1); }
.vp.scrubbing .vp-rail { height: 6px; }
.vp-fill::after { box-shadow: 0 0 0 4px rgba(154, 166, 255, 0.35); }
.vp-tip {
    position: absolute;
    bottom: 22px;
    transform: translateX(-50%);
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(12, 14, 30, 0.9);
    font-size: 0.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    white-space: nowrap;
}
.vp-track:hover .vp-tip, .vp.scrubbing .vp-tip { opacity: 1; }
.vp-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.vp-btn {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-size: 0.95rem;
    transition: background 0.15s;
}
.vp-btn:hover { background: rgba(255, 255, 255, 0.14); }
.vp-time { font-size: 0.82rem; font-weight: 600; font-variant-numeric: tabular-nums; margin-left: 6px; white-space: nowrap; }
.vp-time span { opacity: 0.65; font-weight: 500; }
.vp-bar { backdrop-filter: none; }
.vp-row .vp-btn:focus-visible, .vp-track:focus-visible { outline: 2px solid #9aa6ff; outline-offset: 2px; }

/* volume: the slider slides out on hover (desktop); phones use the hardware buttons */
.vp-vol { display: flex; align-items: center; }
.vp-vol .vp-slider { width: 0; opacity: 0; transition: width 0.25s var(--ease), opacity 0.2s, margin 0.25s var(--ease); margin: 0; }
.vp-vol:hover .vp-slider, .vp-vol:focus-within .vp-slider { width: 84px; opacity: 1; margin: 0 8px 0 2px; }
@media (pointer: coarse) { .vp-vol .vp-slider { display: none; } .vp-skip { display: none; } }
.vp-slider {
    --v: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 4px;
    background: linear-gradient(90deg, #fff var(--v), rgba(255, 255, 255, 0.28) var(--v));
    cursor: pointer;
    outline: none;
}
.vp-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #fff; border: none; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); }
.vp-slider::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: #fff; border: none; }
.vp-slider:focus-visible { box-shadow: 0 0 0 3px rgba(154, 166, 255, 0.5); }

.vp-speed { width: auto; min-width: 40px; padding: 0 10px; border-radius: 99px; font-size: 0.8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.vp-menu-wrap { position: relative; }
.vp-menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    min-width: 150px;
    padding: 6px;
    border-radius: var(--r-md);
    background: rgba(14, 16, 34, 0.94);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.7);
    z-index: 5;
}
.vp-menu-title { padding: 6px 10px 8px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.6; }
.vp-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: none; border-radius: 8px; background: none; color: #fff; font-size: 0.85rem; text-align: left; }
.vp-menu button::before { content: ''; width: 14px; text-align: center; font: var(--fa-font-solid); font-size: 0.75rem; }
.vp-menu button[aria-checked="true"]::before { content: '\f00c'; color: #9aa6ff; }
.vp-menu button:hover { background: rgba(255, 255, 255, 0.1); }

/* centre feedback (play / pause / ±10 s / volume) */
.vp-flash {
    position: absolute;
    left: 50%;
    top: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 1.35rem;
    transform: translate(-50%, -50%) scale(0.7);
    opacity: 0;
    pointer-events: none;
    z-index: 2;
}
.vp-flash span { font-size: 0.7rem; font-weight: 700; }
.vp-flash.show { animation: vp-flash 0.6s var(--ease) forwards; }
@keyframes vp-flash {
    0% { opacity: 0.95; transform: translate(-50%, -50%) scale(0.75); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.25); }
}
.vp-spinner {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 46px;
    height: 46px;
    margin: -23px 0 0 -23px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    opacity: 0;
    pointer-events: none;
    animation: spin 0.8s linear infinite;
    transition: opacity 0.2s;
    z-index: 2;
}
.vp.buffering .vp-spinner { opacity: 1; transition-delay: 0.3s; }
@keyframes spin { to { transform: rotate(360deg); } }
.vp-unmute {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border: none;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.92);
    color: #12152a;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.6);
    animation: pop-in 0.35s var(--ease);
}
.vp-unmute:hover { background: #fff; }
.vp.is-fs video { max-height: 100vh; height: 100vh; }
.vp.is-fs .vp-bar { padding: 48px 28px 18px; }
@media (max-width: 760px) {
    .vp-bar { padding: 28px 8px 6px; }
    .vp-btn { width: 40px; height: 40px; }
    .vp-time { font-size: 0.75rem; }
}
.vp-spacer { flex: 1; }
.vp:fullscreen { border-radius: 0; display: grid; place-items: center; }
.vp:fullscreen video { max-height: 100vh; height: 100vh; }

/* ── Lightbox ───────────────────────────────────────────── */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 160;
    display: none;
    place-items: center;
    background: rgba(5, 6, 13, 0.94);
    padding: 24px;
}
.lightbox.open { display: grid; animation: fade-in 0.2s var(--ease); }
.lightbox img { max-width: 100%; max-height: calc(100dvh - 48px); object-fit: contain; border-radius: 6px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.lightbox-actions { position: absolute; top: 16px; right: 16px; display: flex; gap: 8px; }
.lightbox-actions .icon-btn { background: rgba(255, 255, 255, 0.1); color: #fff; }
.lightbox-actions .icon-btn:hover { background: rgba(255, 255, 255, 0.2); }

/* ═══════════════════════════════════════════════════════════
   FEED — video-style grid
   ═══════════════════════════════════════════════════════════ */
.home { max-width: 1760px; margin: 0 auto; padding: 0 40px 56px; }

.filterbar {
    position: sticky;
    top: var(--header-h);
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 0;
    margin-bottom: 8px;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
}
.filter-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.filter-chips::-webkit-scrollbar { display: none; }
.fchip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px;
    border-radius: var(--r-sm);
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.18s, color 0.18s;
}
.fchip:hover { background: var(--surface-3); color: var(--text); }
.fchip.active { background: var(--text); color: var(--bg); }
.fchip i { font-size: 0.8em; }
.sort-toggle { flex-shrink: 0; }
.sort-toggle .segmented label { height: 30px; padding: 0 12px; font-size: 0.8rem; }

.cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));      /* desktop: 3 big cards per row */
    gap: 40px 28px;
}

.vcard {
    --accent: var(--brand);
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    isolation: isolate;
    animation: rise 0.5s var(--ease) both;
}
.vcard[data-type="video"] { --accent: var(--violet); }
.vcard[data-type="audio"] { --accent: var(--leaf); }
/* artwork glow: a blurred copy of the thumbnail blooms behind it on hover */
.thumb-wrap::before {
    content: '';
    position: absolute;
    inset: 10% 6% -4%;
    z-index: -1;
    border-radius: 10px;
    background: var(--art, var(--accent)) center / cover no-repeat;
    filter: blur(30px) saturate(1.6);
    opacity: 0;
    transform: scale(0.94);
    transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
    pointer-events: none;
}
.vcard .thumb { border-radius: 8px; transition: border-radius 0.3s var(--ease), transform 0.3s var(--ease); }
@media (hover: hover) {
    .vcard:hover .thumb-wrap::before { opacity: 0.5; transform: scale(1.02) translateY(8px); }
    .vcard:hover .thumb { transform: translateY(-3px); }
}
.vcard:focus-within .thumb { box-shadow: 0 0 0 2px var(--accent); }

.thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--surface-2);
    isolation: isolate;
}
.thumb > img,
.thumb > video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease), opacity 0.3s;
}
.vcard:hover .thumb > img { transform: scale(1.04); }
.thumb > video { opacity: 0; background: #000; }
.thumb.previewing > video { opacity: 1; }
.thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

/* audio: blurred cover fill + square artwork */
.thumb-audio { background: linear-gradient(135deg, #1b2050, #0d1026); }
.thumb-audio::before {
    content: '';
    position: absolute;
    inset: -20%;
    z-index: -1;
    background: var(--art, none) center / cover no-repeat;
    filter: blur(28px) saturate(1.4) brightness(0.7);
}
.thumb-audio > img {
    inset: 12% auto 12% 50%;
    width: auto;
    height: 76%;
    aspect-ratio: 1;
    transform: translateX(-50%);
    border-radius: 0;
    box-shadow: 0 16px 34px -10px rgba(0, 0, 0, 0.7);
}
.vcard:hover .thumb-audio > img { transform: translateX(-50%) scale(1.04); }
.thumb-audio .thumb-icon { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, 0.55); font-size: 2rem; }
.thumb-empty { display: grid; place-items: center; color: var(--muted); font-size: 1.6rem; }

.thumb-badge {
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 7px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.thumb-badge i { font-size: 0.65rem; }

.vmeta { display: flex; gap: 12px; align-items: flex-start; min-width: 0; padding: 12px 2px 0; }
.vmeta .avatar { margin-top: 2px; }
.vmeta-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vline { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 0.85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vline .dot { opacity: 0.6; }
.vtitle { margin-bottom: 2px; }
.vtitle {
    font-weight: 600;
    font-size: 0.975rem;
    line-height: 1.35;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}
.vtitle:hover { color: var(--brand); }
.vby { font-size: 0.85rem; color: var(--muted); }
.vby:hover { color: var(--text); }
.vstats { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--muted); }
.vstats img { width: 13px; height: 13px; object-fit: contain; }
.vstats i { font-size: 0.72rem; opacity: 0.8; }
.vstats .dot { opacity: 0.6; }

.cards-skel .vcard { animation: none; }
.cards-skel .thumb { background: none; }
.cards-more { display: flex; justify-content: center; padding: 32px 0 0; }
.cards-end { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 40px 0 0; }
.cards-end img { width: 36px; margin: 0 auto 8px; opacity: 0.8; }

@media (max-width: 760px) {
    .home { padding: 0 0 24px; }
    .filterbar { padding: 10px 12px; margin-bottom: 4px; }
    .sort-toggle .segmented label span { display: none; }
    .cards { grid-template-columns: 1fr; gap: 28px; padding: 0 16px; }
}
@media (min-width: 761px) and (max-width: 1100px) {
    .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 22px; }
}

/* ═══════════════════════════════════════════════════════════
   WATCH — patente detail page
   ═══════════════════════════════════════════════════════════ */
.watch {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 24px 64px;
}
.watch-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.stage {
    position: relative;
    display: grid;
    place-items: center;
    min-height: min(56.25vw, 70vh);
    max-height: calc(100dvh - var(--header-h) - 150px);
    border-radius: var(--r-lg);
    background: radial-gradient(80% 80% at 50% 0%, var(--stage-2), var(--stage));
    overflow: hidden;
    isolation: isolate;
}
.stage::before {
    content: '';
    position: absolute;
    inset: -20%;
    z-index: -1;
    background: var(--ambient, none) center / cover no-repeat;
    filter: blur(80px) saturate(1.3);
    opacity: 0.35;
}
.stage-img {
    max-width: 100%;
    max-height: calc(100dvh - var(--header-h) - 150px);
    object-fit: contain;
    cursor: zoom-in;
}
.stage .vp { position: absolute; inset: 0; border-radius: 0; display: grid; place-items: center; }
.stage .vp video { width: 100%; height: 100%; max-height: none; }
.stage:has(.vp) { aspect-ratio: 16 / 9; min-height: 0; background: #000; }
.stage:has(.vp)::before { opacity: 0.18; }
.stage .player { margin: 24px; }
.stage-tools { position: absolute; top: 14px; right: 14px; display: flex; gap: 8px; z-index: 3; }
.stage-tools .icon-btn { background: rgba(0, 0, 0, 0.45); color: #fff; backdrop-filter: blur(8px); }
.stage-tools .icon-btn:hover { background: rgba(0, 0, 0, 0.7); }
.stage-empty { color: var(--on-stage-muted); text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; padding: 60px; }
.stage-empty i { font-size: 2.2rem; }

.watch-title { margin-top: 6px; font-size: 1.6rem; font-weight: 700; line-height: 1.25; letter-spacing: -0.015em; overflow-wrap: anywhere; }

.watch-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.watch-author { display: flex; align-items: center; gap: 12px; min-width: 0; }
.watch-author strong { font-size: 0.975rem; }
.wa-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; min-width: 0; }
.wa-line .wa-meta::before { content: '·'; margin-right: 8px; opacity: 0.7; }
.watch-author strong:hover { color: var(--brand); }
.watch-author span { font-size: 0.8rem; color: var(--muted); }
.watch-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.desc-box {
    padding: 14px 16px;
    border-radius: var(--r-md);
    background: var(--surface-2);
    font-size: 0.9rem;
}
.desc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-weight: 600; margin-bottom: 6px; }
.desc-head .chip { height: 22px; font-size: 0.72rem; }
.desc-head .tagl { color: var(--brand); font-weight: 500; }
.desc-text { color: var(--text-2); white-space: pre-line; overflow-wrap: anywhere; }
.desc-text.empty { color: var(--muted); font-style: italic; }

/* Desktop: video/photo sized so title + actions stay on the first screen; comments scroll below */
@media (min-width: 761px) {
    .watch { padding-top: 20px; }
    .watch-main { gap: 12px; }
    .stage { --stage-max: calc(100dvh - var(--header-h) - 190px); height: max(360px, var(--stage-max)); max-height: none; min-height: 0; }
    .stage:has(.vp) { height: auto; aspect-ratio: 16 / 9; max-height: max(360px, var(--stage-max)); }
    .stage:has(.player) { height: auto; min-height: 0; }
    .stage-img {
        position: absolute;
        inset: 0;
        margin: auto;
        max-width: 100%;
        max-height: 100%;
    }
    .watch-title { margin-top: 2px; }


    /* Cinema mode: the video spans the window, black, edge to edge */
    .watch.cinema { padding-top: 0; }
    .watch.cinema .stage {
        width: 100vw;
        margin-left: calc(50% - 50vw);
        border-radius: 0;
        background: #000;
        max-height: calc(100dvh - var(--header-h) - 110px);
    }
    .watch.cinema .stage::before { display: none; }
    body:has(.watch.cinema) { overflow-x: clip; }
}
.vp-cinema-btn { display: none; }
@media (min-width: 761px) { .vp-cinema-btn { display: grid; } }

@media (max-width: 760px) {
    .watch { padding: 0 0 24px; gap: 12px; }
    .watch-main { gap: 12px; }
    .stage { border-radius: 0; min-height: 56.25vw; }
    .stage:has(.vp) { min-height: 0; max-height: 75vh; }
    .stage .player { margin: 12px; }
    .watch-title, .watch-bar, .desc-box, .comments, .comment-gate.owner, .sponsor-banner, .owner-money { margin: 0 12px; }
    .watch-title { font-size: 1.2rem; }
}


/* ═══════════════════════════════════════════════════════════
   PROFILE
   ═══════════════════════════════════════════════════════════ */
.profile { max-width: 1080px; margin: 0 auto; padding: 0 20px 48px; }
.profile-hero {
    position: relative;
    margin: 20px 0 0;
    border-radius: var(--r-xl);
    overflow: hidden;
    height: 180px;
    background:
        radial-gradient(60% 120% at 15% 0%, hsl(var(--h) 80% 70% / 0.55), transparent 60%),
        radial-gradient(60% 120% at 85% 100%, hsl(calc(var(--h) + 40) 70% 50% / 0.5), transparent 60%),
        linear-gradient(135deg, hsl(var(--h) 45% 22%), hsl(calc(var(--h) + 30) 50% 14%));
}
.profile-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url('/static/icone.webp') right -30px bottom -60px / 260px no-repeat;
    opacity: 0.16;
    filter: saturate(0.4);
}
.profile-head {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    padding: 0 24px;
    margin-top: -56px;
    position: relative;
    justify-content: space-between;
}
.profile-head .avatar { box-shadow: 0 0 0 5px var(--bg), var(--shadow-md); }
.profile-id { min-width: 0; padding: 14px 24px 0; }
.profile-id h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; overflow-wrap: anywhere; }
.profile-id .handle { color: var(--muted); font-size: 0.9rem; }
.profile-cta { padding-bottom: 8px; display: flex; gap: 8px; }

.stats { display: flex; flex-wrap: wrap; gap: 10px 24px; padding: 18px 24px 0; }
.stat { display: inline-flex; align-items: center; gap: 8px; cursor: default; }
.stat i { color: var(--muted); font-size: 0.95rem; width: 1.1em; text-align: center; }
.stat img { width: 18px; height: 18px; object-fit: contain; }
.stat strong { font-size: 1.1rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.tabs {
    display: flex;
    gap: 4px;
    margin: 28px 0 16px;
    padding: 4px;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    width: max-content;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}
.tabs button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 16px;
    border: none;
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.18s, color 0.18s;
}
.tabs button .n { font-size: 0.72rem; font-weight: 700; padding: 1px 7px; border-radius: 10px; background: var(--surface-3); color: var(--muted); }
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tabs button.active .n { background: var(--brand-soft); color: var(--brand); }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.tile {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--surface-2);
    animation: rise 0.5s var(--ease) both;
}
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.tile:hover img { transform: scale(1.05); }
.tile-shade {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 14px;
    background: linear-gradient(180deg, transparent 45%, rgba(8, 10, 22, 0.78));
    color: #fff;
    opacity: 0;
    transition: opacity 0.25s var(--ease);
}
.tile:hover .tile-shade, .tile:focus-visible .tile-shade { opacity: 1; }
.tile-title { font-weight: 600; font-size: 0.95rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-sub { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; opacity: 0.85; margin-top: 2px; }
.tile-sub img { width: 14px; height: 14px; }
.tile-type {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 0.7rem;
    backdrop-filter: blur(6px);
}
.tile-audio {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #1b2050, #0d1026);
    color: rgba(255, 255, 255, 0.6);
    font-size: 2rem;
}
.tile.hidden { display: none; }

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 64px 20px;
    text-align: center;
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--r-xl);
    color: var(--muted);
}
.empty-state img { width: 64px; opacity: 0.85; }
.empty-state h3 { color: var(--text); font-size: 1.1rem; }

@media (max-width: 760px) {
    .profile { padding: 0 12px 32px; }
    .profile-hero { height: 130px; margin-top: 12px; border-radius: var(--r-lg); }
    .profile-head { gap: 12px; padding: 0 12px; margin-top: -44px; }
    .profile-id { padding: 12px 12px 0; }
    .profile-head .avatar { --size: 88px; }
    .profile-id h1 { font-size: 1.45rem; }
    .profile-cta { padding: 0 0 4px; flex-wrap: wrap; justify-content: flex-end; }
    .stats { padding: 14px 12px 0; gap: 10px 20px; }
    .grid { grid-template-columns: repeat(3, 1fr); gap: 3px; }
    .tile { border-radius: 4px; }
    .tile-shade { display: none; }
    .tabs { margin: 20px 0 12px; }
}

/* ═══════════════════════════════════════════════════════════
   COMPOSER — nouveau
   ═══════════════════════════════════════════════════════════ */
.composer { max-width: 1180px; margin: 0 auto; padding: 28px 24px 48px; }
.composer-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.composer-head h1 { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.composer-head h1 em { font-style: normal; color: var(--brand); }
.composer-head p { color: var(--muted); margin-top: 6px; }

.composer-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }

.dropzone {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 460px;
    border-radius: var(--r-xl);
    border: 2px dashed var(--border-strong);
    background:
        radial-gradient(60% 60% at 50% 40%, var(--brand-soft), transparent 70%),
        var(--surface);
    text-align: center;
    padding: 32px;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease);
}
.dropzone:hover { border-color: var(--brand); }
.dropzone.dragover { border-color: var(--brand); transform: scale(0.99); background: var(--brand-soft); }
.dropzone input[type="file"] { display: none; }
.dz-empty { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 360px; }
.dz-orb {
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    color: var(--brand);
    font-size: 1.6rem;
    animation: float 4s ease-in-out infinite;
}
.dz-empty h2 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }
.dz-empty p { color: var(--muted); font-size: 0.9rem; }
.dz-types { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

.dz-preview { position: absolute; inset: 0; display: none; place-items: center; background: var(--stage); padding: 16px; }
.dropzone.has-file { border-style: solid; border-color: var(--border); cursor: default; }
.dropzone.has-file .dz-empty { visibility: hidden; }
.dropzone.has-file .dz-preview { display: grid; }
.dz-preview img, .dz-preview video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.dz-preview .player { width: 100%; }
.dz-replace { position: absolute; top: 12px; right: 12px; z-index: 3; display: flex; gap: 8px; }
.dz-replace .btn { background: rgba(255, 255, 255, 0.14); color: #fff; backdrop-filter: blur(8px); }
.dz-replace .btn:hover { background: rgba(255, 255, 255, 0.24); }
.dz-file {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: calc(100% - 24px);
    padding: 8px 12px;
    border-radius: var(--r-md);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.8rem;
    backdrop-filter: blur(8px);
}
.dz-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-file .muted { opacity: 0.7; flex-shrink: 0; }

.panel { padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.panel-section-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

.cover-pick {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: var(--r-md);
    border: 1px dashed var(--border-strong);
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s;
}
.cover-pick:hover, .cover-pick.dragover { border-color: var(--brand); background: var(--brand-soft); }
.cover-pick input { display: none; }
.cover-thumb {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: var(--r-sm);
    background: var(--surface-2);
    color: var(--muted);
    overflow: hidden;
}
.cover-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cover-pick strong { display: block; font-size: 0.875rem; }
.cover-pick span { font-size: 0.78rem; color: var(--muted); }

.album-list { display: flex; flex-direction: column; gap: 6px; }
.album-row {
    display: grid;
    grid-template-columns: 14px 28px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--r-sm);
    background: var(--surface-2);
    font-size: 0.85rem;
}
.album-row .n { font-size: 0.72rem; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.album-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.album-row .size { font-size: 0.75rem; color: var(--muted); }

.notice {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--r-md);
    background: var(--brand-soft);
    color: var(--text-2);
    font-size: 0.82rem;
    line-height: 1.45;
}
.notice i { color: var(--brand); margin-top: 3px; }

.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; border-top: 1px solid var(--border); }

.upload-status { display: none; flex-direction: column; gap: 8px; }
.upload-status.show { display: flex; }
.upload-status .row { display: flex; justify-content: space-between; font-size: 0.82rem; font-weight: 600; }
.upload-status .row span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.progress { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.progress > div { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #8e7bff); transition: width 0.2s linear; }
.progress.indeterminate > div { width: 35%; animation: indeterminate 1.2s var(--ease) infinite; }

@media (max-width: 960px) {
    .composer-grid { grid-template-columns: 1fr; }
    .dropzone { min-height: 320px; }
}
@media (max-width: 760px) {
    .composer { padding: 18px 12px 32px; }
    .composer-head h1 { font-size: 1.5rem; }
    .composer-head .btn { display: none; }
    .panel { padding: 18px; }
}

/* ═══════════════════════════════════════════════════════════
   AUTH
   ═══════════════════════════════════════════════════════════ */
.auth {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    min-height: 100dvh;
}
.auth-art {
    position: relative;
    overflow: hidden;
    background: #0d1a14 url('/static/bleuet.jpg') center / cover no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 36px;
    color: #fff;
}
.auth-art::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(10, 14, 40, 0.15) 0%, rgba(10, 14, 40, 0.1) 40%, rgba(10, 14, 40, 0.82) 100%),
        linear-gradient(90deg, rgba(40, 52, 160, 0.25), transparent 60%);
}
.auth-art > * { position: relative; }
.auth-art .brand { color: #fff; }
.auth-art .brand-word em { color: #c7ccff; }
.auth-quote { max-width: 440px; }
.auth-quote h2 { font-weight: 800; font-size: 2.4rem; line-height: 1.1; letter-spacing: -0.03em; }
.auth-quote p { margin-top: 14px; font-size: 1rem; color: rgba(255, 255, 255, 0.8); }
.auth-pills { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.auth-pills span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 0.8rem;
    font-weight: 600;
    backdrop-filter: blur(8px);
}

.auth-main {
    display: grid;
    place-items: center;
    padding: 40px 24px;
    background: var(--bg);
}
.auth-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 24px; animation: rise 0.5s var(--ease) both; }
.auth-card .brand { display: none; }
.auth-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 1.2rem;
}
.auth-head h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.auth-head p { color: var(--muted); margin-top: 6px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; }
.auth-foot { text-align: center; font-size: 0.9rem; color: var(--muted); }
.link { color: var(--brand); font-weight: 600; }
.link:hover { text-decoration: underline; }

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--r-md);
    font-size: 0.85rem;
    line-height: 1.45;
    background: var(--brand-soft);
    color: var(--text-2);
    border: 1px solid transparent;
}
.alert i { margin-top: 3px; color: var(--brand); }
.alert.success { background: var(--leaf-soft); }
.alert.success i { color: var(--leaf); }
.alert.danger, .alert.error { background: var(--danger-soft); }
.alert.danger i, .alert.error i { color: var(--danger); }
.alerts { display: flex; flex-direction: column; gap: 8px; }

.pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 2px; }
.pw-meter span { height: 4px; border-radius: 4px; background: var(--surface-3); transition: background 0.2s; }
.pw-meter[data-score="1"] span:nth-child(-n+1) { background: var(--danger); }
.pw-meter[data-score="2"] span:nth-child(-n+2) { background: var(--warn); }
.pw-meter[data-score="3"] span:nth-child(-n+3) { background: var(--leaf); }
.pw-meter[data-score="4"] span { background: var(--leaf); }
.match-hint { font-size: 0.75rem; color: var(--muted); min-height: 1em; }
.match-hint.ok { color: var(--leaf); }
.match-hint.bad { color: var(--danger); }

@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; }
    .auth-art { display: none; }
    .auth-main { align-items: start; padding-top: 48px; background:
        radial-gradient(90% 50% at 50% 0%, var(--brand-soft), transparent 70%), var(--bg); }
    .auth-card .brand { display: inline-flex; margin-bottom: 8px; }
}

/* ── Animations ─────────────────────────────────────────── */
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px) scale(0.97); } }
@keyframes bleuet-pop { 0% { transform: scale(1); } 30% { transform: scale(1.45) rotate(-10deg); } 60% { transform: scale(0.9); } 100% { transform: scale(1); } }
@keyframes nudge { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 6px); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.025); } }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 12px; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes indeterminate { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
    .feed { scroll-behavior: auto; }
}

/* ═══════════════════════════════════════════════════════════
   VISITORS (not logged in): blurred previews
   ═══════════════════════════════════════════════════════════ */
body:not([data-user]) .thumb > img,
body:not([data-user]) .tile img {
    filter: blur(14px) saturate(1.1) brightness(0.85);
    transform: scale(1.12);
}
body:not([data-user]) .thumb-audio > img { transform: translateX(-50%) scale(1.04); }
body:not([data-user]) .vcard:hover .thumb > img,
body:not([data-user]) .tile:hover img { transform: scale(1.14); }
body:not([data-user]) .vcard:hover .thumb-audio > img { transform: translateX(-50%) scale(1.06); }
body:not([data-user]) .thumb::after,
body:not([data-user]) .tile::after {
    content: '\f070';
    font: var(--fa-font-solid);
    font-size: 0.95rem;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.92);
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.38) 0 22px, transparent 23px);
}
body:not([data-user]) .tile::after { content: '\f070'; position: absolute; inset: 0; pointer-events: none; z-index: 1; }

/* post page */
.stage:has(.guest-lock) { min-height: 340px; }
.guest-lock { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
.guest-blur {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(28px) saturate(1.2) brightness(0.6);
    transform: scale(1.2);
}
.guest-card {
    position: relative;
    z-index: 2;
    max-width: 440px;
    margin: 16px;
    padding: 28px 26px;
    border-radius: var(--r-xl);
    text-align: center;
    color: var(--on-stage);
    background: rgba(12, 14, 30, 0.55);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-lg);
}
.guest-icon {
    display: inline-grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
    color: #12152a;
    font-size: 1.2rem;
}
.guest-icon .fa-play { margin-left: 3px; }
.guest-card h2 { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
.guest-card p { margin: 6px 0 18px; color: var(--on-stage-muted); font-size: 0.92rem; }
.guest-card strong { color: var(--on-stage); }
.guest-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.guest-card .btn-outline { color: #fff; border-color: rgba(255, 255, 255, 0.35); background: transparent; }
.guest-card .btn-outline:hover { background: rgba(255, 255, 255, 0.1); }
@media (max-width: 760px) {
    .stage:has(.guest-lock) { min-height: 360px; }
    .guest-card { padding: 22px 18px; }
    .guest-card h2 { font-size: 1.15rem; }
}


/* ═══════════════════════════════════════════════════════════
   HOME SIDEBAR (hamburger): full / mini rail on desktop, drawer below 1200px
   ═══════════════════════════════════════════════════════════ */
:root { --rail-w: 240px; --rail-mini-w: 76px; }
.home-shell { display: flex; align-items: flex-start; }
.home-shell > .home { flex: 1; min-width: 0; margin: 0; max-width: none; padding: 0 32px 56px; }
.rail {
    position: sticky;
    top: var(--header-h);
    flex-shrink: 0;
    width: var(--rail-w);
    height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    padding: 12px 12px 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: width 0.25s var(--ease);
}
.rail-group { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; }
.rail-group + .rail-group { border-top: 1px solid var(--border); }
.rail-label { padding: 6px 12px 6px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.rail-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    height: 42px;
    padding: 0 12px;
    border-radius: 6px;
    color: var(--text-2);
    font-size: 0.92rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.rail-item > i { width: 22px; text-align: center; font-size: 1.05rem; flex-shrink: 0; }
.rail-item > span:not(.avatar):not(.rail-live-dot) { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rail-item:hover { background: var(--surface-2); color: var(--text); }
.rail-item.active { background: var(--surface-2); color: var(--text); }
.rail-item.active > i { color: var(--brand); }
.rail-live > i { color: var(--danger); }
.rail-count { margin-left: auto; font-style: normal; font-size: 0.72rem; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--danger); color: #fff; }
.rail-person { gap: 14px; font-weight: 500; }
.rail-person .avatar { --size: 26px; flex-shrink: 0; margin: 0 -2px; }
.rail-live-dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 25%, transparent); flex-shrink: 0; }
.rail-hint { padding: 4px 12px; font-size: 0.82rem; color: var(--muted); white-space: normal; }
.rail-cta { padding: 14px 12px; gap: 10px; }
.rail-cta p { font-size: 0.85rem; color: var(--text-2); }
.rail-cta .btn { align-self: flex-start; }
.rail-foot { margin-top: auto; padding: 16px 12px 0; font-size: 0.72rem; color: var(--muted); }
.rail-backdrop { display: none; }

/* desktop: the rail replaces the filter chips; a heading takes their place */
.feed-heading { display: none; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; flex: 1; }
.feed-heading span { color: var(--muted); font-weight: 600; font-size: 0.9em; }
@media (min-width: 1200px) {
    .home-shell .filter-chips { display: none; }
    .home-shell .feed-heading { display: block; }
    .home-shell .filterbar { padding: 16px 0 12px; }
    /* mini rail: icons with small labels, like video sites */
    html.rail-mini .rail { width: var(--rail-mini-w); padding: 8px 4px; }
    html.rail-mini .rail-label, html.rail-mini .rail-people, html.rail-mini .rail-cta,
    html.rail-mini .rail-foot, html.rail-mini .rail-count { display: none; }
    html.rail-mini .rail-group + .rail-group { border-top: none; }
    html.rail-mini .rail-group { padding: 0; }
    html.rail-mini .rail-item { flex-direction: column; justify-content: center; gap: 6px; height: 68px; padding: 0 2px; font-size: 0.66rem; font-weight: 500; }
    html.rail-mini .rail-item > span { max-width: 100%; }
}
@media (max-width: 1199px) {
    .rail {
        position: fixed;
        z-index: 70;
        top: 0;
        left: 0;
        height: 100dvh;
        width: min(280px, 84vw);
        padding-top: calc(var(--header-h) + 8px);
        background: var(--bg);
        border-right: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
        transform: translateX(-102%);
        transition: transform 0.28s var(--ease);
        visibility: hidden;
    }
    body.rail-open .rail { transform: none; visibility: visible; }
    body.rail-open .rail-backdrop { display: block; position: fixed; inset: 0; z-index: 60; background: rgba(5, 6, 13, 0.55); backdrop-filter: blur(2px); animation: fade-in 0.2s; }
    body.rail-open .site-header { z-index: 80; }
    body.rail-open { overflow: hidden; }
    .home-shell > .home { padding: 0 24px 56px; }
}
@keyframes fade-in { from { opacity: 0; } }
@media (max-width: 760px) {
    .home-shell > .home { padding: 0 0 24px; }
    .rail-toggle { width: 36px; height: 36px; }
}

/* ☰ in the header: tablets, and phones only for visitors (members have the tab bar) */
@media (min-width: 1200px) { .rail-toggle { display: none; } }
@media (max-width: 760px) { body.has-tabbar .rail-toggle { display: none; } }
.rail-collapse { margin-top: auto; border: none; background: none; width: 100%; font: inherit; font-size: 0.85rem; color: var(--muted); cursor: pointer; }
.rail-collapse:hover { color: var(--text); }
.rail-collapse + .rail-foot { margin-top: 0; padding-top: 8px; }
@media (max-width: 1199px) { .rail-collapse { display: none; } .rail-collapse + .rail-foot { margin-top: auto; } }

/* Abonnements feed: people you follow as a scrollable row (the desktop rail already lists them) */
.follow-strip {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 16px 2px 4px;
}
.follow-strip::-webkit-scrollbar { display: none; }
.follow-bubble { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 68px; flex-shrink: 0; }
.follow-bubble .avatar { --size: 60px; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--border); transition: transform 0.2s var(--ease); }
.follow-bubble:hover .avatar { transform: scale(1.05); }
.follow-bubble.is-live .avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--danger); }
.follow-bubble > span { max-width: 100%; font-size: 0.75rem; font-weight: 600; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.follow-bubble em {
    position: absolute;
    top: 48px;
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--danger);
    color: #fff;
    font-style: normal;
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}
@media (min-width: 1200px) { .home-shell .follow-strip { display: none; } }
@media (max-width: 760px) { .follow-strip { padding: 12px 16px 2px; gap: 14px; } }

.auth-quote p:empty { display: none; }

/* ═══════════════════════════════════════════════════════════
   POST PAGE: info panel (description, stats, comments)
   desktop: toggled panel on the right · phones/tablets: always under the content
   ═══════════════════════════════════════════════════════════ */
.watch-info-inner { display: flex; flex-direction: column; gap: 16px; }
.watch-info-head { display: flex; align-items: center; justify-content: space-between; }
.watch-info-head strong { font-size: 1.05rem; font-weight: 800; }
.watch-info .desc-box, .watch-info .comments, .watch-info .owner-money, .watch-info .comment-gate.owner { margin: 0; }
.btn-info-toggle.active { background: var(--text); color: var(--bg); }
.info-count { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; padding: 1px 7px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); font-size: 0.75rem; font-weight: 700; }
.info-count i { font-size: 0.7rem; }
.btn-info-toggle.active .info-count { background: color-mix(in srgb, var(--bg) 25%, transparent); color: inherit; }

@media (min-width: 1100px) {
    /* the grid is always there; only the panel column's width animates (0 → panel width) */
    .watch {
        --info-w: clamp(340px, 26vw, 420px);
        --info-ease: cubic-bezier(0.22, 0.8, 0.24, 1);
        display: grid;
        grid-template-columns: minmax(0, 1fr) 0px;
        column-gap: 0px;
        align-items: start;
        transition: max-width 0.45s var(--info-ease), grid-template-columns 0.45s var(--info-ease), column-gap 0.45s var(--info-ease);
    }
    .watch.info-open { max-width: 1640px; grid-template-columns: minmax(0, 1fr) var(--info-w); column-gap: 24px; }
    .watch-info {
        position: sticky;
        top: calc(var(--header-h) + 20px);
        min-width: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0s linear 0.45s;
    }
    .watch.info-open .watch-info { opacity: 1; visibility: visible; transition: opacity 0.35s ease 0.1s, visibility 0s; }
    .watch-info-inner {
        width: var(--info-w);            /* fixed: the text never reflows while the column grows */
        max-height: calc(100dvh - var(--header-h) - 40px);
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        padding: 16px;
        border-radius: var(--r-lg);
        background: var(--surface);
        border: 1px solid var(--border);
        box-shadow: var(--shadow-sm);
        transform: translateX(24px);
        transition: transform 0.45s var(--info-ease);
    }
    .watch.info-open .watch-info-inner { transform: none; }
    /* cinema mode needs the full width: the panel drops below the content */
    .watch.cinema { display: block; }
    .watch.cinema .watch-info { position: static; margin-top: 16px; }
    .watch.cinema:not(.info-open) .watch-info { display: none; }
    .watch.cinema .watch-info-inner { width: auto; max-height: none; box-shadow: none; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .watch, .watch-info, .watch-info-inner { transition: none !important; }
}
@media (max-width: 1099px) {
    .btn-info-toggle, .watch-info-head { display: none; }
    .watch-info { margin-top: 4px; }
}
@media (max-width: 760px) {
    .watch-info { padding: 0 12px; }
}

/* ═══════════════════════════════════════════════════════════
   SONG PAGE (desktop): the player fills the first screen
   ═══════════════════════════════════════════════════════════ */
.watch:has(.player-lg) .watch-title { display: none; }          /* the title is already in the player */
@media (min-width: 1100px) {
    .stage:has(.player-lg) {
        height: calc(100dvh - var(--header-h) - 130px);
        min-height: 460px;
        container-type: size;
    }
    .stage:has(.player-lg) .player-lg {
        height: 100%;
        min-height: 0;
        padding: 40px;
        grid-template-columns: auto minmax(0, 1fr);
        gap: clamp(28px, 4cqw, 64px);
        align-items: center;
    }
    .stage:has(.player-lg) .player-lg .player-cover { width: min(46cqw, calc(100cqh - 80px), 620px); }
    .stage:has(.player-lg) .player-lg .player-body { max-height: calc(100cqh - 80px); min-height: 0; }
    .stage:has(.player-lg) .player-lg .player-title { font-size: clamp(1.8rem, 4.4cqw, 3.6rem); }
    .stage:has(.player-lg) .player-lg .player-kicker { font-size: 0.78rem; }
    .stage:has(.player-lg) .player-lg .waveform { height: clamp(64px, 12cqh, 110px); }
    .stage:has(.player-lg) .player-lg .tracklist { max-height: none; flex: 0 1 auto; min-height: 56px; overflow-y: auto; }
}

/* ═══════════════════════════════════════════════════════════
   MINI-PLAYER (music keeps playing while browsing)
   ═══════════════════════════════════════════════════════════ */
:root { --mini-h: 64px; }
.mini-player {
    position: fixed;
    z-index: 55;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--mini-h);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(160%) blur(16px);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -10px 30px -18px rgba(0, 0, 0, 0.6);
    animation: mini-in 0.3s var(--ease);
}
.mini-player[hidden] { display: none; }
@keyframes mini-in { from { transform: translateY(100%); } }
.mini-progress { position: absolute; left: 0; right: 0; top: -2px; height: 4px; cursor: pointer; background: var(--surface-3); }
.mini-progress:hover { height: 6px; top: -3px; }
.mini-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), #9aa6ff); }
.mini-cover { width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); overflow: hidden; }
.mini-cover img { width: 100%; height: 100%; object-fit: cover; }
.mini-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mini-title { font-weight: 700; font-size: 0.9rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-title:hover { color: var(--brand); }
.mini-artist { font-size: 0.78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-controls { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.mini-btn { display: grid; place-items: center; width: 38px; height: 38px; border: none; border-radius: 50%; background: transparent; color: var(--text-2); font-size: 0.9rem; }
.mini-btn:hover { background: var(--surface-2); color: var(--text); }
.mini-play { width: 42px; height: 42px; background: var(--text); color: var(--bg); font-size: 0.95rem; }
.mini-play:hover { background: var(--text); color: var(--bg); transform: scale(1.05); }
.mini-play .fa-play { margin-left: 2px; }
.mini-time { min-width: 86px; text-align: center; font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
body.has-mini { padding-bottom: var(--mini-h); }
@media (min-width: 1200px) { body.has-mini .rail { height: calc(100dvh - var(--header-h) - var(--mini-h)); } }
@media (min-width: 1100px) { body.has-mini .watch.info-open .watch-info-inner { max-height: calc(100dvh - var(--header-h) - var(--mini-h) - 40px); } }
@media (max-width: 760px) {
    .mini-player { gap: 10px; padding: 0 10px; }
    .mini-skip, .mini-time { display: none; }
    body.has-tabbar .mini-player { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
    body.has-tabbar.has-mini { padding-bottom: calc(var(--tabbar-h) + var(--mini-h) + env(safe-area-inset-bottom)); }
}

/* page-to-page loading bar (seamless navigation) */
.nav-progress { position: fixed; z-index: 300; top: 0; left: 0; height: 2px; width: 0; background: linear-gradient(90deg, var(--brand), #9aa6ff); opacity: 0; pointer-events: none; }
.nav-progress.on { opacity: 1; width: 80%; transition: width 2.5s cubic-bezier(0.1, 0.7, 0.2, 1); }

/* profile: on phones the "new post" button is just a + */
@media (max-width: 760px) {
    .profile-cta .btn-new { width: 40px; padding: 0; justify-content: center; }
    .profile-cta .btn-new .btn-label { display: none; }
}

/* gifted access */
.grant-note { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.grant-note i { color: var(--gold); }
.status-pill.gift, .ledger .status-pill.gift { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 0.75rem; font-weight: 700; background: color-mix(in srgb, var(--leaf) 16%, transparent); color: var(--leaf); }
.ledger-amount .btn-sm { margin-left: 6px; }
@media (max-width: 760px) {
    .profile-cta .btn-grant { width: 40px; padding: 0; justify-content: center; }
    .profile-cta .btn-grant .btn-label { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   PHOTO ALBUMS
   ═══════════════════════════════════════════════════════════ */
.album-nav {
    position: absolute;
    top: 50%;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-top: -23px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 1rem;
    backdrop-filter: blur(8px);
    opacity: 0.85;
    transition: opacity 0.2s, background 0.2s, transform 0.2s var(--ease);
}
.album-nav:hover { opacity: 1; background: rgba(0, 0, 0, 0.7); transform: scale(1.06); }
.album-nav.prev { left: 14px; }
.album-nav.next { right: 14px; }
.album-count { position: absolute; top: 14px; left: 14px; z-index: 3; padding: 4px 10px; border-radius: 99px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 0.78rem; font-weight: 700; font-variant-numeric: tabular-nums; backdrop-filter: blur(8px); }
.album-dots { position: absolute; bottom: 14px; left: 50%; z-index: 3; transform: translateX(-50%); display: flex; gap: 6px; padding: 5px 8px; border-radius: 99px; background: rgba(0, 0, 0, 0.35); backdrop-filter: blur(8px); max-width: 80%; overflow: hidden; }
.album-dots button { width: 7px; height: 7px; padding: 0; border: none; border-radius: 50%; background: rgba(255, 255, 255, 0.5); flex-shrink: 0; transition: background 0.2s, transform 0.2s; }
.album-dots button.on { background: #fff; transform: scale(1.3); }
@media (max-width: 760px) {
    .stage:has(.album-nav) { aspect-ratio: 4 / 5; min-height: 0; }
    .stage:has(.album-nav) .stage-img { position: absolute; inset: 0; margin: auto; max-height: 100%; }
    .album-nav { width: 38px; height: 38px; margin-top: -19px; font-size: 0.85rem; }
    .album-nav.prev { left: 8px; }
    .album-nav.next { right: 8px; }
}

/* upload page: album grid */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; width: 100%; padding: 12px; align-self: start; }
.photo-cell { position: relative; aspect-ratio: 1; margin: 0; overflow: hidden; border-radius: var(--r-sm); background: var(--surface-2); }
.photo-cell img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.photo-cell.is-cover { outline: 2px solid var(--brand); outline-offset: 2px; }
.photo-cell .n { position: absolute; left: 6px; bottom: 6px; padding: 2px 7px; border-radius: 99px; background: rgba(0, 0, 0, 0.65); color: #fff; font-size: 0.7rem; font-weight: 700; }
.photo-rm, .photo-first { position: absolute; top: 6px; display: grid; place-items: center; width: 26px; height: 26px; border: none; border-radius: 50%; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 0.72rem; }
.photo-rm { right: 6px; }
.photo-first { left: 6px; opacity: 0; transition: opacity 0.2s; }
.photo-cell:hover .photo-first, .photo-first:focus-visible { opacity: 1; }
@media (hover: none) { .photo-first { opacity: 1; } }
.photo-add { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 2px dashed var(--border); border-radius: var(--r-sm); background: none; color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.photo-add:hover { border-color: var(--brand); color: var(--brand); }
.dz-preview:has(.photo-grid) { overflow-y: auto; place-items: start stretch; padding: 50px 0 56px; }

/* reorder: photos (grid) and tracks (list) */
.photo-cell { cursor: grab; }
.photo-cell.dragging { opacity: 0.4; }
.photo-cell.drop-target { outline: 2px dashed var(--brand); outline-offset: 2px; }
.photo-moves { position: absolute; right: 6px; bottom: 6px; display: flex; gap: 4px; }
.photo-moves button { display: grid; place-items: center; width: 26px; height: 26px; border: none; border-radius: 50%; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 0.68rem; }
.photo-moves button:hover { background: rgba(0, 0, 0, 0.85); }
.album-row { cursor: grab; }
.album-row.dragging { opacity: 0.4; }
.album-row.drop-target { box-shadow: inset 0 2px 0 var(--brand); }
.album-row .grip { color: var(--muted); font-size: 0.75rem; }
.row-moves { display: flex; gap: 2px; margin-left: 6px; }
.row-moves button { display: grid; place-items: center; width: 28px; height: 28px; border: none; border-radius: var(--r-sm); background: none; color: var(--muted); font-size: 0.72rem; }
.row-moves button:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.row-moves button:disabled { opacity: 0.3; }

/* edit modal: album order */
.order-list { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.order-photos { flex-direction: row; flex-wrap: wrap; }
.order-item { position: relative; display: flex; align-items: center; gap: 10px; border-radius: var(--r-sm); background: var(--surface-2); cursor: grab; user-select: none; }
.order-item.dragging { opacity: 0.4; }
.order-photos .order-item { width: 92px; height: 92px; overflow: hidden; }
.order-photos .order-item img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.order-photos .n { position: absolute; left: 4px; top: 4px; padding: 1px 6px; border-radius: 99px; background: rgba(0, 0, 0, 0.65); color: #fff; font-size: 0.65rem; font-weight: 700; }
.order-photos .order-moves { position: absolute; left: 0; right: 0; bottom: 4px; display: flex; justify-content: space-between; padding: 0 4px; }
.order-moves button { display: grid; place-items: center; width: 24px; height: 24px; border: none; border-radius: 50%; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 0.62rem; }
.order-tracks .order-item { padding: 8px 10px; }
.order-tracks .n { width: 22px; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.order-tracks .name { flex: 1; font-size: 0.88rem; }
.order-tracks .grip { color: var(--muted); font-size: 0.75rem; }
.order-tracks .order-moves { display: flex; gap: 4px; }
.order-tracks .order-moves button { background: var(--surface-3); color: var(--text-2); }

/* album: native swipe track (scroll-snap) */
.album-track {
    position: absolute;
    inset: 0;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.album-track::-webkit-scrollbar { display: none; }
.album-slide { position: relative; flex: 0 0 100%; height: 100%; display: grid; place-items: center; scroll-snap-align: center; scroll-snap-stop: always; }
.album-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border-radius: 0; }   /* whole photo, any shape */
.album-slide .media-shield { position: absolute; inset: 0; cursor: zoom-in; }
#lightbox .media-shield { touch-action: pan-y; }
@media (pointer: coarse) { .album-nav { display: none; } }     /* phones: swipe */

/* post page: the media + title + actions block sits in the middle of the screen */
.watch-main { justify-content: center; }
@media (min-width: 761px) {
    .watch { padding-bottom: 20px; }
    .watch-main { min-height: calc(100dvh - var(--header-h) - 40px); }
    body.has-mini .watch-main { min-height: calc(100dvh - var(--header-h) - var(--mini-h) - 40px); }
}
@media (max-width: 760px) {
    .watch-main { min-height: calc(100dvh - var(--header-h) - var(--tabbar-h) - env(safe-area-inset-bottom) - 24px); }
    body.has-mini .watch-main { min-height: calc(100dvh - var(--header-h) - var(--tabbar-h) - var(--mini-h) - env(safe-area-inset-bottom) - 24px); }
}

/* album background: stacked blurred layers, cross-faded by the swipe position (JS sets opacity) */
.stage:has(.album-ambient)::before { display: none; }
.album-ambient { position: absolute; inset: -20%; z-index: -1; opacity: 0.35; pointer-events: none; }
.album-ambient span {
    position: absolute;
    inset: 0;
    background: center / cover no-repeat;
    filter: blur(80px) saturate(1.3);
    opacity: 0;
    will-change: opacity;
}
