*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

@property --p {
    syntax: "<number>";
    inherits: true;
    initial-value: 0;
}

:root {
    --font-display: "Space Grotesk", "SF Pro Display", -apple-system, sans-serif;
    --font-body: -apple-system, "SF Pro Text", system-ui, "Segoe UI", sans-serif;
    --accent: #4A90E2;
    --accent-pressed: #3A7BC8;
    --accent-light: #7FB2EE;
    --like: #FF4D6D;
    --flame: #FF7A1A;
    --gold: #FFD43B;
    --silver: #C9CDD6;
    --bronze: #D08B5B;
    --r-xs: 8px; --r-sm: 11px; --r: 14px; --r-lg: 18px; --r-xl: 22px; --r-card: 24px;
    --pad: clamp(1rem, 2.4vw, 2rem);
    --nav-w: 244px;
    --rail-w: 300px;
    --feed-w: 500px;
    --tabbar-h: 72px;
}
html[data-theme="dark"] {
    --bg: #000000;
    --surface: #141416;
    --elevated: #1F1F23;
    --hairline: #2A2A2E;
    --text: #FFFFFF;
    --text2: #9A9AA2;
    --text3: #8A8A94;
    --success: #34C759;
    --error: #FF453A;
    --warning: #FF9F0A;
    --glass: rgba(20,20,22,0.66);
    --glass-strong: rgba(14,14,16,0.8);
    --hover: rgba(255,255,255,0.05);
    --press: rgba(255,255,255,0.09);
    --scrim: rgba(0,0,0,0.6);
    --on-media: rgba(0,0,0,0.4);
    color-scheme: dark;
}
html[data-theme="light"] {
    --bg: #F2F2F4;
    --surface: #FFFFFF;
    --elevated: #FFFFFF;
    --hairline: #E2E2E6;
    --text: #111114;
    --text2: #5E6470;
    --text3: #666E7A;
    --success: #34C759;
    --error: #FF3B30;
    --warning: #FF9500;
    --glass: rgba(255,255,255,0.72);
    --glass-strong: rgba(255,255,255,0.85);
    --hover: rgba(10,22,40,0.045);
    --press: rgba(10,22,40,0.08);
    --scrim: rgba(0,0,0,0.45);
    --on-media: rgba(0,0,0,0.4);
    color-scheme: light;
}

html { overscroll-behavior-y: none; }
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100dvh;
    text-rendering: optimizeLegibility;
    -webkit-tap-highlight-color: transparent;
    font-size: 15px;
    line-height: 1.45;
}
img { display: block; max-width: 100%; -webkit-user-drag: none; user-select: none; }
::selection { background: rgba(74, 144, 226, 0.45); }
::-moz-selection { background: rgba(74, 144, 226, 0.45); }
html[data-theme="light"] ::selection { background: rgba(74, 144, 226, 0.3); }
html[data-theme="light"] ::-moz-selection { background: rgba(74, 144, 226, 0.3); }

.tooltip {
    position: fixed; z-index: 210;
    background: var(--glass-strong);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    border: 1px solid var(--hairline);
    color: var(--text);
    border-radius: 10px;
    padding: 0.32rem 0.65rem;
    font-size: 0.74rem; font-weight: 600;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 8px 28px rgba(0,0,0,0.25);
    animation: tipIn 0.16s ease;
}
@keyframes tipIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--text); }
a { color: inherit; text-decoration: none; }
::placeholder { color: var(--text3); }
:focus { outline: none; }
input:focus-visible, textarea:focus-visible, select:focus-visible { border-color: var(--accent); }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { border: 1px solid var(--accent); }
.skip-focus:focus-visible { border: none; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.display { font-family: var(--font-display); }

.wordmark {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.4px;
    font-size: 1.65rem;
    line-height: 1;
    display: inline-flex;
    user-select: none;
    cursor: pointer;
}
.wordmark span { transition: color 0.22s ease; }
.wordmark .dot { color: var(--accent); display: inline-block; transform-origin: bottom; }
.wordmark span.lit { color: var(--accent); }
.wordmark .dot.jump { animation: dotJump 0.62s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes dotJump {
    0% { transform: none; }
    38% { transform: translateY(-0.36em) scale(1.3); }
    70% { transform: translateY(0.02em) scale(1); }
    100% { transform: none; }
}

.hidden { display: none !important; }
.muted { color: var(--text2); }
.tiny { font-size: 0.78rem; }

.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; overflow: hidden; flex-shrink: 0;
    color: #fff; font-weight: 600; font-family: var(--font-display);
    background: var(--accent);
    position: relative;
    user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-wrap { position: relative; display: inline-flex; flex-shrink: 0; }
.avatar-wrap.ring::after {
    content: ""; position: absolute; inset: -4px; border-radius: 50%;
    border: 2px solid var(--accent); pointer-events: none;
}
.avatar-wrap.ring-gold::after { border-color: var(--gold); }
.avatar-wrap.ring-silver::after { border-color: var(--silver); }
.avatar-wrap.ring-bronze::after { border-color: var(--bronze); }

.dot-badge {
    position: absolute; top: -1px; right: -1px;
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--like);
    border: 2px solid var(--bg);
}
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--like); flex-shrink: 0; }
@media (prefers-contrast: more) {
    .unread-dot, .dot-badge { border-radius: 1px; transform: rotate(45deg); }
}

.glass {
    background: var(--glass);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
}
.glass-strong {
    background: var(--glass-strong);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
}
@media (prefers-reduced-transparency: reduce) {
    .glass, .glass-strong { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

.shell { display: none; }
.shell.active { display: block; }

.sidenav {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--nav-w);
    border-right: 1px solid var(--hairline);
    padding: 1.6rem 0.85rem 1.1rem;
    display: flex; flex-direction: column; gap: 2px;
    z-index: 40;
}
.sidenav .wordmark { padding: 0.25rem 0.85rem 1.5rem; }
.nav-item {
    display: flex; align-items: center; gap: 0.9rem;
    padding: 0.72rem 0.85rem;
    border-radius: 13px;
    color: var(--text2);
    font-size: 0.92rem; font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    position: relative;
    width: 100%;
    text-align: left;
}
.nav-item [data-lucide] { width: 21px; height: 21px; flex-shrink: 0; }
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active { color: var(--text); font-weight: 700; }
.nav-item.active [data-lucide] { stroke-width: 2.4; }
.nav-item .nav-dot { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--like); }
.nav-item .nav-me { margin-left: -3px; }
.sidenav .spacer { flex: 1; }

body.nav-collapsed { --nav-w: 80px; }
body.nav-collapsed .sidenav { padding: 1.6rem 0.7rem 1.1rem; align-items: center; }
body.nav-collapsed .sidenav .wordmark span { display: none; }
body.nav-collapsed .sidenav .wordmark span:first-child,
body.nav-collapsed .sidenav .wordmark span.dot { display: inline-block; }
body.nav-collapsed .sidenav .wordmark { padding: 0.25rem 0 1.5rem; }
body.nav-collapsed .nav-item { width: 52px; height: 48px; justify-content: center; padding: 0; }
body.nav-collapsed .nav-item .nav-label { display: none; }
body.nav-collapsed .nav-item .nav-dot { position: absolute; top: 9px; right: 9px; margin: 0; }

.topbar {
    display: none;
    position: fixed; top: 0; left: 0; right: 0; z-index: 40;
    align-items: center; justify-content: space-between;
    padding: calc(0.6rem + env(safe-area-inset-top)) 1rem 0.6rem;
    border-bottom: 1px solid var(--hairline);
}
.topbar .wordmark { font-size: 1.45rem; }
.topbar-actions { display: flex; gap: 0.4rem; }

.tabbar {
    display: none;
    position: fixed; left: 50%; transform: translateX(-50%);
    bottom: calc(0.8rem + env(safe-area-inset-bottom));
    z-index: 40;
    border-radius: 999px;
    border: 1px solid var(--hairline);
    padding: 0.3rem;
    gap: 0.15rem;
    box-shadow: 0 12px 40px rgba(0,0,0,0.28);
}
.tabbar .tab-btn {
    width: 56px; height: 50px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 999px;
    color: var(--text2);
    position: relative;
    transition: background 0.15s, color 0.15s;
}
.tabbar .tab-btn [data-lucide] { width: 23px; height: 23px; }
.tabbar .tab-btn.active { color: var(--text); background: var(--press); }
.tabbar .tab-btn.active [data-lucide] { stroke-width: 2.4; }
.tabbar .tab-btn .dot-badge { top: 7px; right: 12px; border-color: transparent; }

.icon-btn {
    width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    color: var(--text);
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    cursor: pointer;
    position: relative;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
    flex-shrink: 0;
}
.icon-btn:hover { background: var(--hover); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn [data-lucide] { width: 19px; height: 19px; }
.icon-btn.plain { border-color: transparent; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.icon-btn.plain:hover { background: var(--hover); }
.icon-btn.liked { color: var(--like); }
.icon-btn.danger:hover { color: var(--error); border-color: var(--error); }

.main {
    margin-left: var(--nav-w);
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    padding: 1.6rem var(--pad) 4rem;
}
.column { width: 100%; max-width: var(--feed-w); min-width: 0; }
.column.wide { max-width: 935px; }

.rail {
    width: var(--rail-w); flex-shrink: 0;
    position: sticky; top: 1.6rem;
    align-self: flex-start;
    display: flex; flex-direction: column; gap: 1rem;
}

@media (max-width: 1200px) { .rail { display: none; } }
@media (max-width: 900px) {
    .sidenav { display: none; }
    .topbar { display: flex; }
    .tabbar { display: inline-flex; }
    .main { margin-left: 0; padding: calc(4rem + env(safe-area-inset-top)) 0 calc(var(--tabbar-h) + 3rem); }
    .column { max-width: 100%; }
}

.card {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-card);
    overflow: hidden;
}
.card-pad { padding: 1.15rem 1.25rem; }

.page-title {
    font-family: var(--font-display);
    font-weight: 500; font-size: 1.75rem;
    letter-spacing: 0.2px;
    margin-bottom: 1.2rem;
    display: flex; align-items: center; gap: 0.7rem;
}
.page-title .grow { flex: 1; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
    padding: 0.6rem 1.1rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.88rem; font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.08s, opacity 0.15s;
    white-space: nowrap;
    user-select: none;
}
.btn [data-lucide] { width: 16px; height: 16px; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-pressed); }
.btn-secondary { background: var(--elevated); color: var(--text); border-color: var(--hairline); }
.btn-secondary:hover { background: var(--hover); }
.btn-tint { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.btn-tint:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.btn-danger { background: color-mix(in srgb, var(--error) 14%, transparent); color: var(--error); }
.btn-danger:hover { background: var(--error); color: #fff; }
.btn-big {
    width: 100%; min-height: 54px;
    font-family: var(--font-display);
    font-size: 1.05rem; font-weight: 500;
    border-radius: var(--r-lg);
}
.btn-ghost { color: var(--text2); }
.btn-ghost:hover { color: var(--text); background: var(--hover); }

.field {
    display: flex; align-items: center; gap: 0.75rem;
    background: var(--elevated);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    padding: 0.78rem 1rem;
    transition: border-color 0.18s;
}
.field:focus-within { border-color: var(--accent); }
.field [data-lucide] { width: 17px; height: 17px; color: var(--text3); flex-shrink: 0; transition: color 0.18s; }
.field:focus-within [data-lucide] { color: var(--accent); }
.field input, .field textarea {
    flex: 1; min-width: 0;
    background: none; border: none;
    font-size: 0.95rem;
}
.field textarea { resize: none; }
.field .at { color: var(--text3); font-weight: 600; }

.hint { font-size: 0.78rem; color: var(--text3); padding: 0 0.3rem; }
.hint.bad { color: var(--error); }
.hint.good { color: var(--success); }

.seg {
    display: inline-flex; gap: 0.25rem;
    background: var(--elevated);
    padding: 0.25rem; border-radius: var(--r);
    border: 1px solid var(--hairline);
}
.seg button {
    padding: 0.48rem 1rem; border-radius: 10px;
    color: var(--text2); font-size: 0.82rem; font-weight: 600;
    transition: background 0.15s, color 0.15s;
}
.seg button.active { background: var(--accent); color: #fff; }

.switch {
    position: relative; width: 46px; height: 28px; border-radius: 999px;
    background: var(--elevated); border: 1px solid var(--hairline);
    cursor: pointer; flex-shrink: 0;
    transition: background 0.18s, border-color 0.18s;
}
.switch::after {
    content: ""; position: absolute; top: 2px; left: 2px;
    width: 22px; height: 22px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    transition: transform 0.18s ease;
}
.switch.on { background: var(--accent); border-color: var(--accent); }
.switch.on::after { transform: translateX(18px); }

.row-item {
    display: flex; align-items: center; gap: 0.85rem;
    padding: 0.7rem 1.1rem;
    cursor: pointer;
    transition: background 0.13s;
    width: 100%;
    text-align: left;
    color: var(--text);
}
.row-item:hover { background: var(--hover); }
.row-info { flex: 1; min-width: 0; }
.row-info strong { display: block; font-weight: 600; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-info span { display: block; font-size: 0.78rem; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-side { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.row-time { font-size: 0.72rem; color: var(--text3); flex-shrink: 0; }

.empty {
    display: flex; flex-direction: column; align-items: center; gap: 0.7rem;
    padding: 3rem 1.5rem; text-align: center;
}
.empty [data-lucide] { width: 40px; height: 40px; color: var(--text3); stroke-width: 1.4; }
.empty h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.15rem; }
.empty p { color: var(--text2); font-size: 0.88rem; max-width: 300px; }

.spinner {
    width: 22px; height: 22px; border-radius: 50%;
    border: 2.5px solid var(--hairline); border-top-color: var(--accent);
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}
.spinner.big { width: 32px; height: 32px; margin: 3rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast-host {
    position: fixed; bottom: calc(1.4rem + env(safe-area-inset-bottom)); left: 50%;
    transform: translateX(-50%);
    display: flex; flex-direction: column; gap: 0.5rem;
    z-index: 200; pointer-events: none;
    width: min(92vw, 420px);
    align-items: center;
}
@media (max-width: 900px) { .toast-host { bottom: calc(var(--tabbar-h) + 2rem); } }
.toast {
    background: var(--glass-strong);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid var(--hairline);
    color: var(--text);
    border-radius: 999px;
    padding: 0.65rem 1.2rem;
    font-size: 0.85rem; font-weight: 500;
    box-shadow: 0 10px 36px rgba(0,0,0,0.3);
    animation: toastIn 0.24s ease;
    max-width: 100%;
    display: flex; align-items: center; gap: 0.5rem;
    pointer-events: auto;
}
.toast.err { border-color: color-mix(in srgb, var(--error) 45%, var(--hairline)); }
.toast [data-lucide] { width: 15px; height: 15px; flex-shrink: 0; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.overlay {
    position: fixed; inset: 0; z-index: 160;
    background: var(--scrim);
    display: flex; align-items: center; justify-content: center;
    padding: 1.2rem;
    animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-card);
    width: min(94vw, 430px);
    max-height: min(86dvh, 720px);
    display: flex; flex-direction: column;
    overflow: hidden;
    animation: modalIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.modal.wide { width: min(96vw, 780px); max-height: 94dvh; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.96) translateY(10px); } to { opacity: 1; transform: none; } }
.modal-head {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--hairline);
    flex-shrink: 0;
}
.modal-head h2 { font-family: var(--font-display); font-weight: 500; font-size: 1.12rem; flex: 1; }
.modal-body { padding: 1.2rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.9rem; }
.modal-body.flush { padding: 0; gap: 0; }
.modal-foot { padding: 1rem 1.2rem; border-top: 1px solid var(--hairline); display: flex; gap: 0.6rem; justify-content: flex-end; flex-shrink: 0; }

.auth-screen {
    min-height: 100dvh;
    display: flex; align-items: center; justify-content: center;
    padding: 1.5rem;
}
.auth-box { width: min(100%, 390px); display: flex; flex-direction: column; gap: 0.9rem; }
.auth-box .wordmark { font-size: 2.6rem; align-self: center; margin-bottom: 0.2rem; }
.auth-tagline { text-align: center; color: var(--text2); font-size: 0.92rem; margin-bottom: 1.4rem; }
.auth-alt { text-align: center; font-size: 0.88rem; color: var(--text2); margin-top: 0.8rem; }
.auth-alt button { color: var(--accent); font-weight: 600; }
.auth-step-head { text-align: center; margin-bottom: 0.6rem; }
.auth-step-head .emoji { font-size: 2.2rem; display: block; margin-bottom: 0.5rem; }
.auth-step-head h1 { font-family: var(--font-display); font-weight: 500; font-size: 1.6rem; }
.auth-step-head p { color: var(--text2); font-size: 0.9rem; margin-top: 0.2rem; }
.auth-progress { display: flex; gap: 5px; justify-content: center; margin-bottom: 1.4rem; }
.auth-progress span { width: 26px; height: 4px; border-radius: 2px; background: var(--hairline); transition: background 0.2s; }
.auth-progress span.done { background: var(--accent); }
.terms-box {
    background: var(--elevated); border: 1px solid var(--hairline);
    border-radius: var(--r-lg); padding: 1rem;
    font-size: 0.82rem; color: var(--text2);
    max-height: 200px; overflow-y: auto;
    line-height: 1.55;
}

.feed-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; gap: 0.7rem; }
.journal-strip {
    display: flex; gap: 0.7rem;
    overflow-x: auto;
    padding: 0.2rem 0.1rem 0.6rem;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
}
.journal-strip::-webkit-scrollbar { display: none; }
.journal-card {
    position: relative; flex-shrink: 0;
    width: 104px; aspect-ratio: 3/4.2;
    border-radius: var(--r-lg);
    overflow: hidden;
    isolation: isolate;
    background: var(--elevated);
    border: none; padding: 0; cursor: pointer;
    scroll-snap-align: start;
    color: #fff;
    transition: transform 0.18s ease;
}
.journal-card:hover { transform: translateY(-2px); }
.journal-card > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.journal-card .jc-shade { position: absolute; inset: 0; background: rgba(0,0,0,0.18); border-radius: inherit; }
.journal-card .jc-bottom {
    position: absolute; left: 0; right: 0; bottom: 0;
    display: flex; flex-direction: row; align-items: center; gap: 0.35rem;
    padding: 0.38rem 0.45rem;
    background: rgba(0,0,0,0.38);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.journal-card .jc-bottom .avatar { border: none; }
.journal-card .jc-name {
    font-size: 0.72rem; font-weight: 600;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    text-align: left;
}
.journal-card.unseen { box-shadow: inset 0 0 0 2px var(--accent); }
.journal-card.unseen .jc-count {
    position: absolute; top: 0.45rem; right: 0.45rem;
    min-width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent);
}
.journal-card.mine .jc-name { color: var(--accent-light); }
.journal-card.add {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem;
    color: var(--text2); background: var(--elevated);
    border: 1.5px dashed var(--hairline);
}
.journal-card.add [data-lucide] { width: 24px; height: 24px; color: var(--accent); }
.journal-card.add span { font-size: 0.72rem; font-weight: 600; }

.snap-card { margin-bottom: 1.4rem; }
.snap-head { display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem 1rem; }
.snap-head .who { flex: 1; min-width: 0; cursor: pointer; }
.snap-head .who strong { display: block; font-size: 0.92rem; font-weight: 600; }
.snap-head .who span { font-size: 0.75rem; color: var(--text2); }
.snap-media {
    position: relative;
    background: var(--elevated);
    cursor: pointer;
    user-select: none;
    overflow: hidden;
}
.snap-media img { width: 100%; height: 100%; object-fit: cover; }
.big-heart {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    pointer-events: none; opacity: 0; z-index: 4;
}
.big-heart [data-lucide] { width: 96px; height: 96px; color: var(--like); fill: var(--like); filter: drop-shadow(0 4px 24px rgba(0,0,0,0.45)); }
.big-heart.unlike [data-lucide] { color: #fff; fill: none; stroke-width: 1.6; }
.big-heart.pop { animation: heartPop 0.85s cubic-bezier(0.2, 0.9, 0.3, 1); }
.big-heart.unlike.pop { animation: heartDrop 0.7s ease; }
@keyframes heartDrop {
    0% { opacity: 0; transform: scale(1.05); }
    20% { opacity: 1; transform: scale(1); }
    60% { opacity: 1; transform: scale(0.92) rotate(-4deg); }
    100% { opacity: 0; transform: scale(0.7) rotate(-7deg) translateY(14px); }
}
@keyframes heartPop {
    0% { opacity: 0; transform: scale(0.4); }
    18% { opacity: 1; transform: scale(1.08); }
    55% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1); }
}
.snap-badges { position: absolute; top: 0.7rem; right: 0.7rem; display: flex; gap: 0.35rem; }
.media-chip {
    display: inline-flex; align-items: center; gap: 0.3rem;
    background: var(--on-media); color: #fff;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 999px; padding: 0.28rem 0.65rem;
    font-size: 0.72rem; font-weight: 600;
    font-family: var(--font-display);
}
.media-chip [data-lucide] { width: 12px; height: 12px; }
.snap-actions { display: flex; align-items: center; gap: 0.15rem; padding: 0.5rem 0.6rem 0; }
.snap-actions .grow { flex: 1; }
.act-btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 0.6rem; border-radius: 999px;
    color: var(--text); font-size: 0.85rem; font-weight: 600;
    transition: background 0.13s, color 0.13s, transform 0.1s;
}
.act-btn [data-lucide] { width: 22px; height: 22px; }
.act-btn:hover { background: var(--hover); }
.act-btn:active { transform: scale(0.92); }
.act-btn.liked { color: var(--like); }
.act-btn.liked [data-lucide] { fill: var(--like); }
.snap-body { padding: 0.35rem 1.05rem 1rem; display: flex; flex-direction: column; gap: 0.3rem; }
.snap-caption { font-size: 0.9rem; }
.snap-caption strong { font-weight: 600; margin-right: 0.4rem; }
.snap-caption .more { color: var(--text2); font-weight: 500; }
.boost-row { display: flex; gap: 0.35rem; flex-wrap: wrap; padding-top: 0.15rem; }
.boost-pill {
    display: inline-flex; align-items: center; gap: 0.3rem;
    background: var(--elevated); border: 1px solid var(--hairline);
    border-radius: 999px; padding: 0.24rem 0.6rem;
    font-size: 0.82rem; cursor: pointer;
    transition: border-color 0.13s, background 0.13s, transform 0.1s;
}
.boost-pill:active { transform: scale(0.92); }
.boost-pill.mine { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.boost-pill b { font-family: var(--font-display); font-weight: 500; font-size: 0.76rem; }
.view-comments { color: var(--text2); font-size: 0.85rem; text-align: left; padding: 0.1rem 0; }
.snap-song {
    display: inline-flex; align-items: center; gap: 0.45rem;
    color: var(--text2); font-size: 0.78rem;
    padding: 0.1rem 0; max-width: 100%;
}
.snap-song [data-lucide] { width: 13px; height: 13px; flex-shrink: 0; }
.snap-song span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snap-song.playing { color: var(--accent); }

.feed-cap { text-align: center; padding: 2.2rem 1rem 1rem; color: var(--text2); font-size: 0.85rem; }
.feed-cap .display { font-size: 1.05rem; color: var(--text); margin-bottom: 0.2rem; }

.new-posts-pill {
    position: fixed; top: calc(1.1rem + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
    z-index: 60;
    animation: toastIn 0.24s ease;
}
@media (max-width: 900px) { .new-posts-pill { top: calc(4.4rem + env(safe-area-inset-top)); } }

.coach-card { border-color: color-mix(in srgb, var(--accent) 35%, var(--hairline)); margin-bottom: 1.4rem; }
.coach-card .card-pad { display: flex; gap: 0.9rem; align-items: flex-start; }
.coach-card svg.lead { width: 26px; height: 26px; color: var(--accent); flex-shrink: 0; margin-top: 0.1rem; }
.coach-card h4 { font-family: var(--font-display); font-weight: 500; font-size: 1rem; }
.coach-card p { color: var(--text2); font-size: 0.84rem; margin: 0.2rem 0 0.7rem; }

.sensitive-scrim {
    position: absolute; inset: 0; z-index: 3;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.55rem;
    background: color-mix(in srgb, var(--bg) 40%, transparent);
    backdrop-filter: blur(34px);
    -webkit-backdrop-filter: blur(34px);
    color: #fff; text-align: center; padding: 1rem;
    cursor: pointer;
}
.sensitive-scrim [data-lucide] { width: 30px; height: 30px; }
.sensitive-scrim strong { font-family: var(--font-display); font-weight: 500; font-size: 0.95rem; }
.sensitive-scrim small { font-size: 0.76rem; opacity: 0.75; }
.sensitive-scrim .pill { background: rgba(255,255,255,0.18); border-radius: 999px; padding: 0.35rem 0.9rem; font-size: 0.8rem; font-weight: 600; }

.viewer {
    position: fixed; inset: 0; z-index: 120;
    background: rgba(0,0,0,0.92);
    display: flex; flex-direction: column;
    align-items: center;
    animation: fadeIn 0.2s ease;
    user-select: none;
}
.viewer-inner {
    display: flex; flex-direction: column;
    width: min(100vw, calc((100dvh - 40px) * 0.62), 560px);
    height: 100dvh;
}
.viewer-bars { display: flex; gap: 4px; padding: calc(0.8rem + env(safe-area-inset-top)) 0.9rem 0; }
.viewer-bars span { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.28); overflow: hidden; position: relative; }
.viewer-bars span::after { content: ""; position: absolute; inset: 0; background: #fff; transform: scaleX(var(--p, 0)); transform-origin: left; }
.viewer-head { display: flex; align-items: center; gap: 0.7rem; padding: 0.8rem 0.9rem; color: #fff; }
.viewer-head strong { font-size: 0.92rem; }
.viewer-head span { font-size: 0.75rem; opacity: 0.7; }
.viewer-head .grow { flex: 1; }
.viewer-stage { flex: 1; position: relative; min-height: 0; display: flex; align-items: center; justify-content: center; }
.viewer-stage img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-lg); }
.viewer-stage.landscape img { object-fit: contain; background: #000; }
.viewer-stage .zone { position: absolute; top: 0; bottom: 0; width: 30%; z-index: 2; }
.viewer-stage .zone.prev { left: 0; }
.viewer-stage .zone.next { right: 0; width: 70%; }
.viewer-foot { padding: 0.8rem 0.9rem calc(1rem + env(safe-area-inset-bottom)); color: #fff; display: flex; align-items: center; gap: 0.6rem; }
.viewer-foot .caption { flex: 1; font-size: 0.88rem; min-width: 0; }
.viewer .icon-btn { color: #fff; border-color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.1); }
.viewer .icon-btn.liked { color: var(--like); }
.viewer .icon-btn.liked [data-lucide] { fill: var(--like); }
.viewer-song {
    display: inline-flex; align-items: center; gap: 0.45rem;
    max-width: 100%;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 999px;
    padding: 0.32rem 0.8rem;
    font-size: 0.76rem; font-weight: 600; color: #fff;
    align-self: flex-start;
    margin: 0 0.9rem;
}
.viewer-song [data-lucide] { width: 13px; height: 13px; color: var(--accent-light); flex-shrink: 0; }
.viewer-song span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-song .eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 11px; flex-shrink: 0; }
.viewer-song .eq i { width: 2.5px; background: var(--accent-light); border-radius: 1px; animation: eqBounce 0.9s ease-in-out infinite; }
.viewer-song .eq i:nth-child(2) { animation-delay: 0.2s; }
.viewer-song .eq i:nth-child(3) { animation-delay: 0.45s; }
@keyframes eqBounce { 0%, 100% { height: 4px; } 50% { height: 11px; } }

.lightbox {
    position: fixed; inset: 0; z-index: 130;
    background: var(--scrim);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: center;
    padding: 1.2rem; cursor: zoom-out;
    animation: fadeIn 0.18s ease;
}
.lightbox img { max-width: 96vw; max-height: 92dvh; object-fit: contain; border-radius: var(--r); }

.comments-list { display: flex; flex-direction: column; padding: 0.4rem 0; }
.comment { display: flex; gap: 0.7rem; padding: 0.55rem 1.2rem; }
.comment.reply { padding-left: 3.2rem; }
.comment-body { flex: 1; min-width: 0; }
.comment-body p { font-size: 0.88rem; overflow-wrap: anywhere; }
.comment-body p strong { font-weight: 600; margin-right: 0.35rem; }
.comment-meta { display: flex; gap: 0.8rem; font-size: 0.72rem; color: var(--text3); margin-top: 0.15rem; }
.comment-meta button { color: var(--text3); font-weight: 600; }
.comment-meta button:hover { color: var(--text); }
.mention { color: var(--accent); font-weight: 600; }

.emoji-tray { display: flex; gap: 0.3rem; flex-wrap: wrap; justify-content: center; padding: 0.5rem 0; }
.emoji-tray button {
    font-size: 1.5rem; width: 52px; height: 52px;
    border-radius: var(--r); display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.13s, transform 0.1s;
}
.emoji-tray button:hover { background: var(--hover); }
.emoji-tray button:active { transform: scale(0.88); }
.emoji-tray button.mine { background: color-mix(in srgb, var(--accent) 14%, transparent); }

.chat-layout { display: flex; gap: 0; height: calc(100dvh - 3.2rem); border: 1px solid var(--hairline); border-radius: var(--r-card); overflow: hidden; background: var(--surface); }
@media (max-width: 900px) { .chat-layout { height: calc(100dvh - var(--tabbar-h) - 7.4rem); border-radius: var(--r-lg); margin: 0 0.7rem; } }
.chat-list { width: 340px; flex-shrink: 0; border-right: 1px solid var(--hairline); display: flex; flex-direction: column; min-height: 0; }
@media (max-width: 900px) {
    .chat-list { width: 100%; border-right: none; }
    .chat-layout.in-thread .chat-list { display: none; }
    .chat-layout:not(.in-thread) .chat-thread { display: none; }
}
.chat-list-head { display: flex; align-items: center; gap: 0.5rem; padding: 1rem 1.1rem 0.6rem; }
.chat-list-head h2 { font-family: var(--font-display); font-weight: 500; font-size: 1.3rem; flex: 1; }
.chat-rows { flex: 1; overflow-y: auto; min-height: 0; padding-bottom: 0.5rem; }
.chat-thread { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.thread-head { display: flex; align-items: center; gap: 0.7rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--hairline); flex-shrink: 0; }
.thread-head .who { flex: 1; min-width: 0; cursor: pointer; }
.thread-head .who strong { display: block; font-size: 0.95rem; }
.thread-head .who span { font-size: 0.74rem; color: var(--text2); }
.thread-scroll { flex: 1; overflow-y: auto; padding: 1rem 1rem 0.5rem; display: flex; flex-direction: column; gap: 0.18rem; min-height: 0; }
.load-older { align-self: center; margin-bottom: 0.7rem; }
.day-divider { text-align: center; font-size: 0.7rem; color: var(--text3); padding: 0.7rem 0 0.4rem; text-transform: uppercase; letter-spacing: 0.5px; }
.msg { display: flex; flex-direction: column; max-width: min(72%, 420px); align-self: flex-start; position: relative; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg-sender { font-size: 0.68rem; color: var(--text3); padding: 0.35rem 0.8rem 0.1rem; font-weight: 600; }
.bubble {
    background: var(--elevated);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    padding: 0.55rem 0.85rem;
    font-size: 0.92rem;
    overflow-wrap: anywhere;
    position: relative;
    cursor: default;
}
.msg.mine .bubble { background: var(--accent); border-color: var(--accent); color: #fff; }
.bubble img { border-radius: var(--r-sm); max-height: 340px; object-fit: cover; cursor: pointer; margin: -0.2rem -0.5rem; min-width: 140px; }
.bubble.media { padding: 0.35rem 0.5rem; background: var(--elevated); border-color: var(--hairline); }
.msg-reactions { display: flex; gap: 0.2rem; margin-top: -0.4rem; z-index: 2; padding: 0 0.5rem; }
.msg-reactions span {
    background: var(--surface); border: 1px solid var(--hairline);
    border-radius: 999px; padding: 0.05rem 0.4rem; font-size: 0.78rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.14);
}
.msg-time { font-size: 0.66rem; color: var(--text3); padding: 0.15rem 0.4rem; }
.msg-seen { font-size: 0.68rem; color: var(--text3); padding: 0.1rem 0.4rem; }
.instant-bubble {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.7rem 1rem;
    border-radius: var(--r-lg);
    border: 1.5px dashed color-mix(in srgb, var(--accent) 55%, var(--hairline));
    color: var(--accent); font-weight: 600; font-size: 0.85rem;
    cursor: pointer; background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.instant-bubble.opened { color: var(--text3); border-color: var(--hairline); background: none; cursor: default; }
.instant-bubble [data-lucide] { width: 17px; height: 17px; }
.system-note { align-self: center; font-size: 0.74rem; color: var(--text3); padding: 0.4rem 1rem; text-align: center; }
.system-card {
    align-self: center; text-align: center;
    background: var(--elevated); border: 1px solid var(--hairline);
    border-radius: var(--r-lg); padding: 0.8rem 1.1rem;
    font-size: 0.82rem; color: var(--text2); max-width: 85%;
}
.typing-row { display: flex; gap: 4px; padding: 0.5rem 0.9rem; align-self: flex-start; }
.typing-row span { width: 7px; height: 7px; border-radius: 50%; background: var(--text3); animation: typingBlink 1.2s ease-in-out infinite; }
.typing-row span:nth-child(2) { animation-delay: 0.15s; }
.typing-row span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBlink { 0%, 60%, 100% { opacity: 0.35; } 30% { opacity: 1; transform: translateY(-2px); } }
.composer-bar {
    display: flex; align-items: flex-end; gap: 0.5rem;
    padding: 0.7rem 0.9rem calc(0.7rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--hairline);
    flex-shrink: 0;
}
.composer-bar .field { flex: 1; padding: 0.55rem 0.9rem; border-radius: 22px; transition: border-radius 0.15s; }
.composer-bar .field.tall { border-radius: var(--r-lg); }
.composer-bar .field textarea { max-height: 120px; }
.send-btn { background: var(--accent); color: #fff; border: none; }
.send-btn:hover { background: var(--accent-pressed); }
.send-btn:disabled { opacity: 0.4; }

.poll-bubble { min-width: 220px; display: flex; flex-direction: column; gap: 0.45rem; padding: 0.75rem 0.85rem; }
.poll-q { font-weight: 600; font-size: 0.9rem; }
.poll-opt {
    position: relative; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
    border: 1px solid var(--hairline); border-radius: var(--r-sm);
    padding: 0.5rem 0.7rem; font-size: 0.84rem;
    cursor: pointer; overflow: hidden;
    background: var(--surface);
    color: var(--text);
    text-align: left; width: 100%;
    transition: border-color 0.15s;
}
.poll-opt .fill { position: absolute; inset: 0; background: color-mix(in srgb, var(--accent) 16%, transparent); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform 0.3s ease; }
.poll-opt span, .poll-opt b { position: relative; }
.poll-opt.mine { border-color: var(--accent); }
.poll-opt b { font-family: var(--font-display); font-weight: 500; font-size: 0.76rem; color: var(--text2); }
.poll-count { font-size: 0.72rem; color: var(--text3); }

.rollcall {
    border: 1px solid color-mix(in srgb, var(--flame) 45%, var(--hairline));
    background: color-mix(in srgb, var(--flame) 8%, transparent);
    border-radius: var(--r-lg); padding: 0.8rem 1rem;
    display: flex; flex-direction: column; gap: 0.3rem;
    min-width: 220px;
}
.rollcall strong { display: flex; align-items: center; gap: 0.45rem; font-family: var(--font-display); font-weight: 500; font-size: 0.92rem; }
.rollcall strong [data-lucide] { width: 16px; height: 16px; color: var(--flame); }
.rollcall span { font-size: 0.78rem; color: var(--text2); }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; border-radius: var(--r-lg); overflow: hidden; }
.grid-cell { position: relative; aspect-ratio: 3/4; background: var(--elevated); cursor: pointer; overflow: hidden; isolation: isolate; border: none; padding: 0; }
.grid-cell img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s ease; }
.grid-cell:hover img { transform: scale(1.04); }
.grid-cell .cell-chip { position: absolute; top: 6px; right: 6px; }

.profile-head { display: flex; flex-direction: column; align-items: center; gap: 0.8rem; padding: 1.6rem 1.2rem 1.2rem; text-align: center; }
.profile-head h1 { font-family: var(--font-display); font-weight: 500; font-size: 1.5rem; }
.profile-head .handle { color: var(--text2); font-size: 0.9rem; margin-top: -0.6rem; }
.profile-bio { font-size: 0.9rem; max-width: 380px; white-space: pre-wrap; }
.profile-stats { display: flex; gap: 2.2rem; justify-content: center; padding: 0.4rem 0; }
.profile-stats button { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; color: var(--text); }
.profile-stats b { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; }
.profile-stats span { font-size: 0.74rem; color: var(--text2); }
.streak-chip { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--flame); font-family: var(--font-display); font-weight: 500; font-size: 0.95rem; }
.streak-chip [data-lucide] { width: 17px; height: 17px; fill: var(--flame); }
.profile-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; justify-content: center; }
.anthem-card {
    display: flex; align-items: center; gap: 0.85rem;
    background: var(--elevated); border: 1px solid var(--hairline);
    border-radius: var(--r-lg); padding: 0.7rem 0.9rem;
    width: min(100%, 380px);
    text-align: left;
}
.anthem-card img { width: 46px; height: 46px; border-radius: var(--r-xs); object-fit: cover; }
.anthem-card .info { flex: 1; min-width: 0; }
.anthem-card .info strong { display: block; font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anthem-card .info span { font-size: 0.76rem; color: var(--text2); }
.carousel { position: relative; border-radius: var(--r-card); overflow: hidden; isolation: isolate; background: var(--elevated); }
.carousel-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    max-height: min(72dvh, 640px);
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track img {
    width: 100%; flex-shrink: 0;
    object-fit: cover;
    scroll-snap-align: center;
    scroll-snap-stop: always;
}
.carousel .zone { position: absolute; top: 0; bottom: 0; width: 26%; z-index: 2; border: none; background: none; cursor: pointer; }
.carousel .zone.prev { left: 0; }
.carousel .zone.next { right: 0; width: 40%; left: auto; }
.carousel-dots { position: absolute; bottom: 0.7rem; left: 0; right: 0; display: flex; gap: 5px; justify-content: center; z-index: 3; pointer-events: none; }
.carousel-dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.45); transition: background 0.2s; }
.carousel-dots span.on { background: #fff; }

.rail-me { display: flex; align-items: center; gap: 0.8rem; padding: 0.4rem 0.3rem; }
.rail-me .who { flex: 1; min-width: 0; cursor: pointer; }
.rail-me .who strong { display: block; font-size: 0.92rem; }
.rail-me .who span { font-size: 0.78rem; color: var(--text2); }
.rail-title { font-size: 0.78rem; font-weight: 700; color: var(--text2); padding: 0.2rem 0.3rem 0.5rem; display: flex; align-items: center; }
.rail-title .grow { flex: 1; }
.rail-title button { color: var(--accent); font-size: 0.75rem; font-weight: 600; }
.rail .row-item { border-radius: var(--r); padding: 0.5rem 0.4rem; }
.rail-legal { padding: 0 0.3rem; display: flex; flex-direction: column; gap: 0.2rem; }
.rail-legal p { font-size: 0.74rem; color: var(--text3); }
.rail-legal a { color: var(--text3); transition: color 0.13s; }
.rail-legal a:hover { color: var(--text2); }

.settings-group { margin-bottom: 1.3rem; }
.settings-group h3 { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text2); padding: 0 0.4rem 0.5rem; }
.settings-row {
    display: flex; align-items: center; gap: 0.85rem;
    padding: 0.85rem 1.1rem;
    width: 100%; text-align: left; color: var(--text);
    transition: background 0.12s;
}
.settings-row + .settings-row { border-top: 1px solid var(--hairline); }
button.settings-row:hover, a.settings-row:hover { background: var(--hover); }
.settings-row svg.lead { width: 19px; height: 19px; color: var(--text2); flex-shrink: 0; }
.settings-row .label { flex: 1; min-width: 0; }
.settings-row .label strong { display: block; font-size: 0.92rem; font-weight: 500; }
.settings-row .label span { display: block; font-size: 0.76rem; color: var(--text2); }
.settings-row.danger, .settings-row.danger svg.lead { color: var(--error); }
.settings-row svg.chev { width: 16px; height: 16px; color: var(--text3); }

.notif-row { border-radius: 0; }
.notif-row.unread { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.notif-thumb { width: 44px; height: 44px; border-radius: var(--r-xs); object-fit: cover; flex-shrink: 0; }

.capture-stage {
    position: relative; border-radius: var(--r-card); overflow: hidden;
    background: #000; aspect-ratio: 3/4;
    display: flex; align-items: center; justify-content: center;
}
.capture-stage video, .capture-stage img, .capture-stage canvas { width: 100%; height: 100%; object-fit: cover; }
.capture-stage .stage-msg { color: rgba(255,255,255,0.65); font-size: 0.88rem; text-align: center; padding: 1.5rem; position: absolute; }
.capture-controls { display: flex; align-items: center; justify-content: center; gap: 1.6rem; padding: 1.1rem 0; }
.shutter {
    width: 74px; height: 74px; border-radius: 50%;
    border: 4px solid var(--text);
    display: inline-flex; align-items: center; justify-content: center;
    transition: transform 0.1s;
}
.shutter::after { content: ""; width: 58px; height: 58px; border-radius: 50%; background: var(--text); transition: transform 0.1s; }
.shutter:active::after { transform: scale(0.88); }
.film-toggle { display: flex; align-items: center; gap: 0.5rem; justify-content: center; }
.compose-row { display: flex; align-items: center; gap: 0.7rem; }
.compose-row .field { flex: 1; }

.option-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.option-tile {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem;
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    background: var(--elevated);
    padding: 0.75rem 0.95rem;
    text-align: left;
    transition: border-color 0.15s, background 0.15s;
    min-width: 0;
}
.option-tile:hover { background: var(--hover); }
.option-tile .ot-top { display: flex; align-items: center; gap: 0.45rem; font-weight: 600; font-size: 0.9rem; max-width: 100%; }
.option-tile .ot-top [data-lucide] { width: 16px; height: 16px; flex-shrink: 0; }
.option-tile .ot-sub { font-size: 0.72rem; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.option-tile.glow .ot-top [data-lucide] { color: color-mix(in srgb, var(--gold) 75%, var(--text)); }
.option-tile.song .ot-top [data-lucide] { color: var(--accent); }
.option-tile.set { border-color: var(--accent); }
.option-tile:disabled { opacity: 0.5; }

.blocker {
    position: fixed; inset: 0; z-index: 300;
    background: var(--bg);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.9rem; padding: 2rem; text-align: center;
}
.blocker [data-lucide] { width: 46px; height: 46px; color: var(--text3); stroke-width: 1.3; }
.blocker h1 { font-family: var(--font-display); font-weight: 500; font-size: 1.5rem; }
.blocker p { color: var(--text2); max-width: 340px; font-size: 0.92rem; }

.context-menu {
    position: fixed; z-index: 190;
    background: var(--glass-strong);
    backdrop-filter: blur(26px) saturate(170%);
    -webkit-backdrop-filter: blur(26px) saturate(170%);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    padding: 0.35rem;
    min-width: 190px;
    box-shadow: 0 14px 48px rgba(0,0,0,0.35);
    animation: modalIn 0.16s ease;
}
.context-menu button {
    display: flex; align-items: center; gap: 0.7rem;
    width: 100%; text-align: left;
    padding: 0.6rem 0.8rem; border-radius: var(--r-sm);
    font-size: 0.88rem; font-weight: 500; color: var(--text);
    transition: background 0.12s;
}
.context-menu button:hover { background: var(--hover); }
.context-menu button [data-lucide] { width: 17px; height: 17px; color: var(--text2); }
.context-menu button.danger, .context-menu button.danger [data-lucide] { color: var(--error); }

.search-results { display: flex; flex-direction: column; max-height: 320px; overflow-y: auto; }

.tag-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag-chip {
    display: inline-flex; align-items: center; gap: 0.35rem;
    border: 1px solid var(--hairline); border-radius: 999px;
    padding: 0.35rem 0.8rem; font-size: 0.82rem; font-weight: 500;
    cursor: pointer; color: var(--text2);
    transition: border-color 0.13s, color 0.13s, background 0.13s;
}
.tag-chip.on { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }

.song-result { display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 1.1rem; cursor: pointer; width: 100%; text-align: left; color: var(--text); }
.song-result:hover { background: var(--hover); }
.song-result img { width: 42px; height: 42px; border-radius: var(--r-xs); }
.song-result .info { flex: 1; min-width: 0; }
.song-result .info strong { display: block; font-size: 0.86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-result .info span { font-size: 0.74rem; color: var(--text2); }

.field.good { border-color: var(--success); }
.field.good [data-lucide] { color: var(--success); }
.field.bad { border-color: var(--error); }
.field.bad [data-lucide] { color: var(--error); }

.floating-close {
    position: absolute; top: 0.7rem; right: 0.7rem; z-index: 5;
    background: var(--glass-strong);
}
.modal { position: relative; }

.snap-media.contain { background: #000; aspect-ratio: auto !important; }
.snap-media.contain img { object-fit: contain; max-height: min(72dvh, 780px); width: 100%; height: auto; margin: 0 auto; }

.tss-footer {
    display: flex; flex-direction: column; align-items: center; gap: 0.55rem;
    padding: 1.6rem 0 2.4rem;
}
.tss-footer img {
    width: 92px; height: auto;
    filter: grayscale(1) opacity(0.4);
}
.tss-footer p { font-size: 0.74rem; color: var(--text3); }

.auth-screen { gap: 3.5rem; }
.auth-side { display: none; }
@media (min-width: 1080px) {
    .auth-side {
        display: flex; flex-direction: column; gap: 1.2rem;
        width: 460px; flex-shrink: 0;
        position: relative;
        min-height: 560px;
        justify-content: center;
    }
    .auth-side .shot {
        position: absolute;
        width: 240px;
        border-radius: 26px;
        border: 1px solid var(--hairline);
        box-shadow: 0 24px 70px rgba(0,0,0,0.45);
        overflow: hidden;
    }
    .auth-side .shot img { width: 100%; display: block; }
    .auth-side .shot.a { left: 0; top: 44%; transform: translateY(-50%) rotate(-5deg); z-index: 2; }
    .auth-side .shot.b { right: 0; top: 56%; transform: translateY(-50%) rotate(4.5deg); }
    .auth-side .side-tag {
        position: absolute; bottom: 0.4rem; left: 0; right: 0;
        text-align: center;
        color: var(--text2); font-size: 0.85rem;
    }
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
