:root {
    color-scheme: dark;
    --bg: #0a0a0a;
    --surface: #121212;
    --surface-2: #181818;
    --border: #1d1d1d;
    --border-strong: #2c2c2c;
    --text: #ededed;
    --text-2: #c8c8c8;
    --text-dim: #7a7a7a;
    --text-faint: #4a4a4a;
    --font: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.55;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -.005em;
}
button, input, textarea { font: inherit; color: inherit; }
button {
    background: none;
    border: 0;
    cursor: pointer;
    padding: 0;
    color: inherit;
}
::selection { background: var(--text); color: var(--bg); }
.app {
    height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-height: 0;
    position: relative;
    z-index: 1;
}
/* ============ AMBIENT BACKGROUND ============ */
.ambient {
    position: fixed;
    inset: -22%;
    z-index: 0;
    pointer-events: none;
    filter: blur(80px);
    opacity: .8;
}
/* Static glow: an animated backdrop would force the 80px blur and every
   backdrop-filter above it to re-render each frame. */
.ambient i { position: absolute; border-radius: 50%; }
.ambient i:nth-child(1) {
    width: 46vmax;
    height: 46vmax;
    top: -4%;
    left: 6%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.052), transparent 62%);
}
.ambient i:nth-child(2) {
    width: 38vmax;
    height: 38vmax;
    bottom: -6%;
    right: 2%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.04), transparent 60%);
}
.ambient i:nth-child(3) {
    width: 26vmax;
    height: 26vmax;
    top: 40%;
    left: 44%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.034), transparent 58%);
}
/* ============ MODEL SWITCHER (liquid-glass pill) ============ */
.liquid-glass {
    background: rgba(255, 255, 255, 0.01);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: none;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}
.liquid-glass::before, .input-shell::before, .menu-btn::before, .user .bubble::before,
.image-action-btn::before, .thought-fragment::before, .thinking-text::before,
.attach-chip::before, .toast::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}
.liquid-glass::before, .input-shell::before {
    padding: 1.4px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.15) 20%, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0) 60%, rgba(255, 255, 255, 0.15) 80%, rgba(255, 255, 255, 0.45) 100%);
}
.model-pill {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 66;
    width: min(250px, calc(100vw - 28px));
    display: grid;
    gap: 5px;
    padding: 8px;
    border-radius: 14px;
    overflow: hidden;
    scrollbar-width: none;
    background: rgba(16, 16, 16, 0.84);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 18px 46px rgba(0, 0, 0, .38);
    transform-origin: top right;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(.94);
    transition: opacity .2s ease, transform .28s cubic-bezier(.2, .7, .2, 1), visibility 0s linear .28s;
    pointer-events: none;
}
.model-pill.open {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    transition: opacity .22s ease, transform .36s cubic-bezier(.34, 1.2, .5, 1);
}
.model-pill.open .model-btn {
    animation: modelItemIn .36s cubic-bezier(.2, .7, .2, 1) both;
}
.model-pill.open .model-btn:nth-child(1) { animation-delay: .03s; }
.model-pill.open .model-btn:nth-child(2) { animation-delay: .06s; }
.model-pill.open .model-btn:nth-child(3) { animation-delay: .09s; }
.model-pill.open .model-btn:nth-child(4) { animation-delay: .12s; }
.model-pill.open .model-btn:nth-child(5) { animation-delay: .15s; }
.model-pill.open .model-btn:nth-child(6) { animation-delay: .18s; }
@keyframes modelItemIn {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: none; }
}
.model-pill::-webkit-scrollbar { display: none; }
.model-btn {
    width: 100%;
    min-height: 36px;
    padding: 8px 10px;
    font-size: 12px;
    letter-spacing: .02em;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    border-radius: 8px;
    transition: color .2s ease, background .2s ease, transform .12s ease;
    font-family: var(--font);
    position: relative;
    z-index: 1;
    background: transparent;
    text-align: left;
}
.model-btn:hover, .video-option-btn:hover { color: rgba(255, 255, 255, 0.95); background: rgba(255, 255, 255, .055); }
.model-btn:active, .video-option-btn:active { transform: scale(.97); }
.model-btn.active, .video-option-btn.active { color: #fff; background: rgba(255, 255, 255, 0.11); }
.model-btn.active::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 11px;
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: #fff;
    transform: translateY(-50%);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}
@media (max-width: 720px) {
    .model-btn { padding: 5px 10px; font-size: 11.5px; }
}
/* ============ TOP BAR ============ */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    position: relative;
    z-index: 20;
    padding: 14px 22px 8px;
    animation: bootIn .5s cubic-bezier(.2, .7, .2, 1) .04s both;
}
@keyframes bootIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}
.top-left { display: flex; align-items: center; gap: 14px; }
.menu-btn {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    transition: color .18s ease, background .18s ease, transform .12s ease, box-shadow .18s ease;
}
.menu-btn::before {
    padding: 1.2px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.4) 100%);
}
@media (hover: hover) {
    .menu-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
}
.menu-btn.active { color: #fff; background: rgba(255, 255, 255, .07); }
.menu-btn svg { width: 16px; height: 16px; position: relative; }
#modelMenuBtn svg { transition: transform .36s cubic-bezier(.34, 1.2, .5, 1); }
#modelMenuBtn.active { background: rgba(255, 255, 255, .1); box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.16), 0 0 16px rgba(255, 255, 255, 0.07); }
#modelMenuBtn.active svg { transform: rotate(90deg) scale(1.06); color: #fff; }
.top-right { display: flex; align-items: center; gap: 12px; position: relative; margin-left: auto; }
/* ============ CHAT ============ */
.chat {
    overflow: auto;
    padding: 48px clamp(20px, 5vw, 40px) 28px;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}
.chat::-webkit-scrollbar { width: 10px; }
.chat::-webkit-scrollbar-track { background: transparent; }
.chat::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    border: 3px solid transparent;
    background-clip: content-box;
}
.chat::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, 0.2); }
.chat-inner {
    width: min(680px, 100%);
    margin: 0 auto;
    display: grid;
    gap: 28px;
}
/* Welcome */
.welcome {
    padding: clamp(20px, 6vh, 42px) 0 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.welcome.leaving { pointer-events: none; }
@keyframes letterArrive {
    0% {
        top: calc(var(--y, 0) * 100% + var(--in-y));
        left: calc(var(--x) * 100% + var(--in-x));
    }
    100% { top: calc(var(--y, 0) * 100%); left: calc(var(--x) * 100%); }
}
@keyframes letterFlyAway {
    0% {
        top: var(--leave-from-top, calc(var(--y, 0) * 100%));
        left: var(--leave-from-left, calc(var(--x) * 100%));
    }
    100% {
        top: calc(var(--y, 0) * 100% + var(--out-y));
        left: calc(var(--x) * 100% + var(--out-x));
    }
}
@keyframes welcomeFloat {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-7px); }
    50% { transform: translateY(-12px); }
    75% { transform: translateY(-6px); }
}
@keyframes letterIdle1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    24% { transform: translate(-1.7px, -2.1px) rotate(-.3deg); }
    48% { transform: translate(1.3px, -4.8px) rotate(.52deg); }
    76% { transform: translate(-.8px, -1.2px) rotate(-.2deg); }
}
@keyframes letterIdle2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    19% { transform: translate(1.4px, -1.8px) rotate(.28deg); }
    46% { transform: translate(-1.2px, -5.5px) rotate(-.62deg); }
    73% { transform: translate(.9px, -1.9px) rotate(.35deg); }
}
@keyframes letterIdle3 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    31% { transform: translate(.9px, -3.5px) rotate(.36deg); }
    58% { transform: translate(-1.2px, -1.3px) rotate(-.42deg); }
    82% { transform: translate(.6px, -2.4px) rotate(.18deg); }
}
@keyframes letterIdle4 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    22% { transform: translate(-1px, -1.5px) rotate(-.28deg); }
    51% { transform: translate(1.5px, -4.4px) rotate(-.56deg); }
    79% { transform: translate(-1.1px, -1.8px) rotate(.44deg); }
}
@keyframes letterIdle5 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    17% { transform: translate(1.6px, -1.6px) rotate(.3deg); }
    43% { transform: translate(-1.5px, -5.2px) rotate(.58deg); }
    69% { transform: translate(1.1px, -2.1px) rotate(-.38deg); }
}
@keyframes letterIdle6 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    27% { transform: translate(-1.4px, -2px) rotate(-.34deg); }
    54% { transform: translate(1.2px, -4.3px) rotate(-.52deg); }
    81% { transform: translate(-.7px, -1.1px) rotate(.28deg); }
}
@keyframes letterIdle7 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    21% { transform: translate(1px, -2.4px) rotate(.52deg); }
    47% { transform: translate(-1.2px, -6.1px) rotate(.95deg); }
    74% { transform: translate(.8px, -1.7px) rotate(-.62deg); }
}
@keyframes rise {
    from { opacity: 0; transform: translateY(10px) scale(.988); filter: blur(4px); }
    to { opacity: 1; transform: none; filter: none; }
}
.welcome-photo {
    position: relative;
    width: min(520px, 78%);
    max-height: min(220px, 30vh);
    aspect-ratio: 3216 / 1280;
    pointer-events: auto;
    user-select: none;
    touch-action: none;
    animation: welcomeFloat 4.8s ease-in-out .78s infinite;
}
.welcome.leaving .welcome-photo { animation: none; }
.welcome-letter {
    position: absolute;
    top: calc(var(--y, 0) * 100%);
    left: calc(var(--x) * 100%);
    width: calc(var(--w) * 100%);
    height: calc(var(--h, 1) * 100%);
    overflow: visible;
    pointer-events: none;
    animation: letterArrive 2.45s cubic-bezier(.2, 0, .16, 1) var(--letter-delay, 0s) backwards;
    will-change: top, left;
}
.welcome.leaving .welcome-letter {
    animation: letterFlyAway 1.18s cubic-bezier(.42, 0, .82, .18) var(--leave-delay, 0s) both;
}
.welcome-letter-body {
    position: absolute;
    inset: 0;
    transform: translate(var(--repel-x, 0px), var(--repel-y, 0px)) rotate(var(--repel-rot, 0deg));
    transform-origin: 50% 56%;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
.welcome-letter picture, .welcome-letter img { width: 100%; height: 100%; display: block; }
.welcome-letter img {
    pointer-events: none;
    user-select: none;
    animation: letterIdle1 var(--idle-duration, 4.8s) ease-in-out calc(2.65s + var(--idle-delay, 0s)) infinite;
    transform-origin: 50% 58%;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
.welcome-letter:nth-child(1) img {
    --idle-duration: 4.95s;
    --idle-delay: .85s;
    animation-name: letterIdle1;
}
.welcome-letter:nth-child(2) img {
    --idle-duration: 4.25s;
    --idle-delay: .18s;
    animation-name: letterIdle2;
}
.welcome-letter:nth-child(3) img {
    --idle-duration: 4.6s;
    --idle-delay: 1.45s;
    animation-name: letterIdle3;
}
.welcome-letter:nth-child(4) img {
    --idle-duration: 4.05s;
    --idle-delay: .55s;
    animation-name: letterIdle4;
}
.welcome-letter:nth-child(5) img {
    --idle-duration: 5.05s;
    --idle-delay: 2.2s;
    animation-name: letterIdle5;
}
.welcome-letter:nth-child(6) img {
    --idle-duration: 3.95s;
    --idle-delay: .05s;
    animation-name: letterIdle6;
}
.welcome-letter:nth-child(7) img {
    --idle-duration: 4.35s;
    --idle-delay: 1.65s;
    animation-name: letterIdle7;
}
/* Messages */
.message {
    display: flex;
    flex-direction: column;
    max-width: 100%;
    min-width: 0;
    animation: rise .32s cubic-bezier(.2, .7, .2, 1) both;
}
.message.user { align-items: flex-end; }
.message.clearing { pointer-events: none; animation: messageFadeOut .48s ease both; }
@keyframes messageFadeOut {
    0% { opacity: 1; filter: brightness(1); }
    100% { opacity: 0; filter: brightness(.35); }
}
.bubble {
    max-width: 100%;
    line-height: 1.65;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    font-size: 14px;
}
.user .bubble {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    max-width: min(540px, 90%);
    background: rgba(255, 255, 255, 0.02);
    border: none;
    border-radius: 8px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.11), inset 0 -1px 0 rgba(255, 255, 255, 0.035), 0 14px 34px rgba(0, 0, 0, 0.18);
    padding: 12px 14px;
    color: var(--text);
}
.user .bubble::before {
    z-index: 0;
    padding: 1px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.13) 24%, rgba(255, 255, 255, 0.025) 54%, rgba(255, 255, 255, 0.16) 100%);
}
.user .bubble::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 35%), radial-gradient(circle at 82% 0%, rgba(255, 255, 255, 0.1), transparent 36%);
    opacity: .44;
}
.user .bubble > * { position: relative; z-index: 1; }
.assistant .bubble { padding: 0; color: var(--text); }
.content.streaming { white-space: pre-wrap; }
.photos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
    width: min(460px, 100%);
}
.user .photos {
    grid-template-columns: repeat(auto-fit, minmax(88px, 138px));
    justify-content: flex-end;
    justify-items: end;
    margin-left: auto;
    width: min(440px, 100%);
}
.assistant .photos {
    grid-template-columns: minmax(180px, min(420px, 100%));
    width: min(420px, 100%);
}
.photo-tile {
    position: relative;
    display: block;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    background: transparent;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
    animation: photoTileIn .5s cubic-bezier(.2, .7, .2, 1) both;
    cursor: zoom-in;
}
.photo-tile:focus-visible {
    outline: 1px solid rgba(255, 255, 255, 0.72);
    outline-offset: 3px;
}
@keyframes photoTileIn {
    from { opacity: 0; transform: translateY(10px) scale(.972); }
    to { opacity: 1; transform: none; }
}
.photo-tile img {
    display: block;
    width: 100%;
    height: auto;
    opacity: 0;
    filter: blur(16px) saturate(1.35);
    transform: scale(1.07);
    transition: opacity .6s ease, filter .75s cubic-bezier(.2, .7, .2, 1), transform .75s cubic-bezier(.2, .7, .2, 1);
}
.photo-tile.is-loaded img { opacity: 1; filter: none; transform: none; }
.photo-tile.gen-reveal::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.32), transparent 48%), repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.2) 0 2px, transparent 2px 10px), repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.14) 0 2px, transparent 2px 10px);
    opacity: 0;
    mix-blend-mode: screen;
    image-rendering: pixelated;
    animation: photoPixelResolve 1.15s steps(12, end) .05s 1 both;
}
@keyframes photoPixelResolve {
    0% { opacity: .86; clip-path: inset(0); filter: contrast(2.2); }
    46% { opacity: .58; clip-path: inset(12% 8% 10% 8%); }
    78% { opacity: .24; clip-path: inset(34% 24% 30% 24%); }
    100% { opacity: 0; clip-path: inset(50%); filter: none; }
}
.photo-tile.gen-reveal.is-loaded img {
    animation: generatedPhotoSettle 1.2s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes generatedPhotoSettle {
    0% {
        opacity: .28;
        filter: blur(14px) contrast(1.55) saturate(1.05);
        transform: scale(1.035);
    }
    58% {
        opacity: .78;
        filter: blur(3px) contrast(1.18) saturate(1.02);
        transform: scale(1.012);
    }
    100% { opacity: 1; filter: none; transform: none; }
}
.photo-assemble {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}
.photo-viewer {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: photoViewerIn .18s ease both;
}
@keyframes photoViewerIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.photo-viewer-stage {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 66px 18px 22px;
    cursor: zoom-out;
}
.photo-viewer-img {
    display: block;
    max-width: calc(100vw - 36px);
    max-height: calc(100vh - 92px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.58);
    transform: translate3d(var(--viewer-pan-x, 0px), var(--viewer-pan-y, 0px), 0) scale(var(--viewer-scale, 1));
    transform-origin: center;
    transition: transform .18s cubic-bezier(.2, .7, .2, 1);
    cursor: grab;
    user-select: none;
    -webkit-user-drag: none;
}
.photo-viewer-img.dragging { cursor: grabbing; transition: none; }
.photo-viewer-controls {
    position: absolute;
    top: max(14px, env(safe-area-inset-top));
    right: max(14px, env(safe-area-inset-right));
    z-index: 2;
    display: inline-flex;
    gap: 7px;
    align-items: center;
}
.photo-viewer-btn {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(12, 12, 12, 0.72);
    color: rgba(255, 255, 255, 0.86);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 12px 30px rgba(0, 0, 0, 0.34);
    transition: background .16s ease, color .16s ease, border-color .16s ease, opacity .16s ease;
}
.photo-viewer-btn:hover, .photo-viewer-btn:focus-visible {
    background: rgba(32, 32, 32, 0.86);
    border-color: rgba(255, 255, 255, 0.28);
    color: #fff;
    outline: none;
}
.photo-viewer-btn:disabled { opacity: .38; cursor: default; }
.photo-viewer-btn svg { width: 17px; height: 17px; stroke-width: 1.7; }
/* ============ IMAGE GENERATION SKELETON ============ */
.gen-photos {
    display: grid;
    grid-template-columns: minmax(180px, min(420px, 100%));
    width: min(420px, 100%);
    margin-bottom: 10px;
}
.gen-tile {
    --gen-spill: 56px;
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 7px;
    overflow: visible;
    isolation: isolate;
    animation: genTileIn .28s cubic-bezier(.2, .7, .2, 1) both;
}
.gen-frame {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    overflow: hidden;
    border: 1px solid #262626;
    background: #000;
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.32), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
@keyframes genTileIn {
    from { opacity: 0; transform: translateY(6px) scale(.986); }
    to { opacity: 1; transform: none; }
}
.gen-canvas {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: #000;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}
.gen-spill-canvas {
    position: absolute;
    top: calc(-1 * var(--gen-spill));
    left: calc(-1 * var(--gen-spill));
    z-index: 0;
    display: block;
    width: calc(100% + var(--gen-spill) + var(--gen-spill));
    height: calc(100% + var(--gen-spill) + var(--gen-spill));
    pointer-events: none;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}
.gen-frame::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.24), transparent 24%), radial-gradient(circle at 72% 68%, rgba(255, 255, 255, 0.16), transparent 30%), linear-gradient(135deg, transparent 18%, rgba(255, 255, 255, 0.1) 46%, transparent 72%);
    mix-blend-mode: screen;
    opacity: .32;
    animation: genLightDrift 8s ease-in-out infinite;
}
.gen-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 4;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), inset 0 0 34px rgba(0, 0, 0, 0.64);
}
@keyframes genLightDrift {
    0%, 100% { transform: translate3d(-2%, -1%, 0) scale(1); opacity: .26; }
    50% { transform: translate3d(2%, 1%, 0) scale(1.05); opacity: .38; }
}
.photo-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-size: 11px;
}
.image-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: min(420px, 100%);
    margin: -2px 0 12px;
}
.image-quality-meta {
    flex: 1 0 100%;
    color: var(--text-2);
    font-size: 11.5px;
    line-height: 1.4;
    letter-spacing: .01em;
}
.image-action-btn {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 34px;
    max-width: 100%;
    padding: 8px 11px;
    border-radius: 7px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 11.5px;
    line-height: 1;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.022);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.11), inset 0 -1px 0 rgba(255, 255, 255, 0.035), 0 12px 28px rgba(0, 0, 0, 0.2);
    transition: color .16s ease, background .16s ease, opacity .16s ease, transform .12s ease;
    text-decoration: none;
}
.image-action-btn::before {
    z-index: 0;
    padding: 1px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0.12) 24%, rgba(255, 255, 255, 0.025) 54%, rgba(255, 255, 255, 0.16) 100%);
}
.image-action-btn > * { position: relative; z-index: 1; }
.image-action-btn svg {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    stroke-width: 1.8;
}
.image-action-btn:hover, .image-action-btn:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.055);
    outline: none;
}
.image-action-btn:active:not(:disabled) { transform: scale(.975); }
.image-action-btn:disabled { opacity: .42; cursor: default; transform: none; }
@media (max-width: 520px) {
    .image-actions { width: 100%; }
    .image-action-btn { flex: 1 1 150px; }
}
.thoughts {
    display: grid;
    gap: 7px;
    width: min(520px, 100%);
    margin-bottom: 12px;
}
.thought-fragment {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 10px 12px 10px 14px;
    background: rgba(255, 255, 255, 0.018);
    border: none;
    border-radius: 8px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.11), inset 0 -1px 0 rgba(255, 255, 255, 0.035), 0 14px 34px rgba(0, 0, 0, 0.2);
    animation: thoughtGlassIn .24s ease both;
}
.thought-fragment::before {
    z-index: 0;
    padding: 1px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0.12) 25%, rgba(255, 255, 255, 0.025) 52%, rgba(255, 255, 255, 0.16) 100%);
}
.thought-fragment::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.13), transparent 34%), radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.11), transparent 38%);
    opacity: .45;
}
.thought-title {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-2);
    margin-bottom: 6px;
}
.thought-title::before {
    content: "";
    width: 5px;
    height: 5px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--text);
    opacity: .78;
    box-shadow: 8px 0 0 rgba(255, 255, 255, 0.42), 16px 0 0 rgba(255, 255, 255, 0.2);
}
.thought-body {
    position: relative;
    z-index: 1;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    color: #919191;
}
/* Markdown */
.content :first-child { margin-top: 0; }
.content :last-child { margin-bottom: 0; }
.content p { margin: .6em 0; }
.content h1, .content h2, .content h3 {
    margin: 1.2em 0 .4em;
    font-weight: 500;
    letter-spacing: -.01em;
    line-height: 1.3;
    color: var(--text);
}
.content h1 { font-size: 18px; }
.content h2 { font-size: 16px; }
.content h3 { font-size: 14px; color: var(--text-2); }
.content ul, .content ol { margin: .6em 0; padding-left: 1.4em; }
.content li { margin: .25em 0; }
.content li::marker { color: var(--text-faint); }
.content code {
    background: var(--surface);
    padding: .08em .35em;
    font-size: .92em;
    color: var(--text);
    border: 1px solid var(--border);
}
.content pre {
    margin: 1em 0;
    padding: 14px 16px;
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--border);
}
.content pre code {
    padding: 0;
    background: transparent;
    border: 0;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text);
}
.content blockquote {
    margin: 1em 0;
    padding: 4px 0 4px 14px;
    border-left: 1px solid var(--border-strong);
    color: var(--text-2);
}
.content a {
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: var(--border-strong);
    text-underline-offset: 3px;
    transition: text-decoration-color .15s ease;
}
.content a:hover { text-decoration-color: var(--text); }
.content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    font-size: 12.5px;
}
.content th, .content td {
    border-bottom: 1px solid var(--border);
    padding: 7px 10px;
    text-align: left;
}
.content th {
    color: var(--text-dim);
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: uppercase;
    font-size: 10.5px;
}
.content .katex { font-size: 1.05em; color: var(--text); }
.content .katex-display { margin: .9em 0; overflow: auto hidden; padding: 6px 0; }
.content .katex-display > .katex { font-size: 1.15em; }
.thinking-text {
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    width: fit-content;
    max-width: 100%;
    min-height: 34px;
    padding: 8px 12px 8px 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
    border: none;
    border-radius: 8px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.12), inset 0 -1px 0 rgba(255, 255, 255, 0.04), 0 14px 34px rgba(0, 0, 0, 0.18);
    color: var(--text-2);
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}
.thinking-text::before {
    z-index: 0;
    padding: 1px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0.14) 23%, rgba(255, 255, 255, 0.025) 53%, rgba(255, 255, 255, 0.17) 100%);
}
.thinking-text::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient( 105deg, transparent 0%, transparent 34%, rgba(255, 255, 255, 0.16) 47%, transparent 60%, transparent 100% );
    opacity: .62;
    transform: translateX(-120%);
    animation: glassSweep 2.8s cubic-bezier(.42, 0, .2, 1) infinite;
}
.think-mark {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, 4px);
    grid-auto-rows: 4px;
    gap: 3px;
    flex: 0 0 auto;
}
.think-mark .px {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: var(--text);
    opacity: .22;
    box-shadow: 0 0 9px rgba(255, 255, 255, 0.24);
    animation: glassBlink 1.18s ease-in-out infinite;
}
.think-mark .px:nth-child(2), .think-mark .px:nth-child(4), .think-mark .px:nth-child(6), .think-mark .px:nth-child(8) {
    animation-delay: .18s;
}
.think-mark .px:nth-child(3), .think-mark .px:nth-child(5), .think-mark .px:nth-child(7) {
    animation-delay: .36s;
}
.thinking-label {
    position: relative;
    z-index: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
@keyframes glassBlink {
    0%, 100% { opacity: .18; transform: scale(.92); }
    48% { opacity: .9; transform: scale(1); }
}
@keyframes glassSweep {
    0%, 38% { transform: translateX(-120%); }
    100% { transform: translateX(120%); }
}
@keyframes thoughtGlassIn {
    from { opacity: 0; filter: brightness(.8) blur(1px); transform: translateY(4px); }
    to { opacity: 1; filter: brightness(1); transform: none; }
}
/* ============ GENERATION AURA + PIXEL BURST ============ */
.shell-aura {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.6px;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity .55s ease;
    pointer-events: none;
    z-index: 2;
}
.shell-aura.haze { padding: 2.6px; filter: blur(7px); }
.shell-aura .beam {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 175%;
    aspect-ratio: 1;
    background: conic-gradient( transparent 0deg, transparent 246deg, rgba(255, 255, 255, 0.16) 286deg, rgba(255, 255, 255, 0.56) 324deg, #fff 345deg, rgba(255, 255, 255, 0.9) 353deg, transparent 360deg);
    transform: translate(-50%, -50%) rotate(0deg);
    animation: auraOrbit 3.1s linear infinite;
    animation-play-state: paused;
}
@keyframes auraOrbit {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}
body.generating .shell-aura { opacity: 1; }
body.generating .shell-aura .beam { animation-play-state: running; }
body.generating .input-shell {
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15), 0 6px 26px rgba(0, 0, 0, 0.28), 0 0 30px rgba(255, 255, 255, 0.055);
}
.pixel-burst {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 40;
    pointer-events: none;
    image-rendering: pixelated;
}
/* ============ COMPOSER ============ */
.composer {
    padding: 14px clamp(20px, 5vw, 40px) max(16px, env(safe-area-inset-bottom));
    animation: bootIn .5s cubic-bezier(.2, .7, .2, 1) .12s both;
}
.composer-inner { width: min(680px, 100%); margin: 0 auto; }
.attachments {
    display: none;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.attachments.active { display: flex; }
.attach-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 240px;
    padding: 5px 6px 5px 12px;
    border-radius: 9999px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 11.5px;
    background: rgba(255, 255, 255, 0.02);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}
.attach-chip::before {
    padding: 1px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.4) 100%);
}
.attach-chip .name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: relative;
}
.attach-chip button {
    width: 16px;
    height: 16px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    line-height: 1;
    transition: color .15s ease;
    position: relative;
}
.attach-chip button:hover { color: #fff; }
.input-shell {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: end;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.015);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.12), 0 6px 24px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
    transition: box-shadow .2s ease;
}
.input-shell:focus-within {
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.18), 0 6px 28px rgba(0, 0, 0, 0.32);
}
.icon-btn {
    width: 30px;
    height: 30px;
    color: rgba(255, 255, 255, 0.7);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 9999px;
    transition: color .15s ease, background .15s ease;
    align-self: end;
    margin-bottom: 3px;
    position: relative;
}
.icon-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.icon-btn svg { width: 14px; height: 14px; }
textarea {
    max-height: 200px;
    resize: none;
    border: 0;
    outline: 0;
    padding: 7px 6px;
    background: transparent;
    line-height: 1.5;
    min-height: 28px;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    position: relative;
}
textarea::placeholder { color: rgba(255, 255, 255, 0.35); }
.send-btn {
    align-self: end;
    width: 30px;
    height: 30px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--bg);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    margin-bottom: 3px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 6px rgba(0, 0, 0, 0.25);
    transition: opacity .15s ease, transform .12s ease;
    position: relative;
}
.send-btn:hover { opacity: .9; }
.send-btn:active { transform: scale(.94); }
.send-btn.sent { animation: sendPop .38s cubic-bezier(.2, .7, .2, 1); }
@keyframes sendPop {
    0% { transform: scale(1); }
    32% { transform: scale(.8); }
    68% {
        transform: scale(1.1);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 18px rgba(255, 255, 255, 0.35);
    }
    100% { transform: scale(1); }
}
.send-btn svg { width: 12px; height: 12px; }
.send-btn:disabled, .icon-btn:disabled { opacity: .3; cursor: not-allowed; }
.send-btn:disabled:hover { opacity: .3; }
.composer-hint {
    margin-top: 8px;
    text-align: center;
    font-size: 10.5px;
    color: var(--text-faint);
    letter-spacing: .04em;
}
/* ============ LOGIN ============ */
.login {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--bg);
    z-index: 70;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease, visibility 0s linear .18s;
}
.login.hidden { display: none; }
.login.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity .18s ease;
}
.login-card { width: min(340px, 100%); text-align: center; animation: rise .5s ease both; }
.login-card .mark {
    font-size: 13px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 36px;
}
.login-card h2 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -.01em;
    color: var(--text);
}
.login-card p {
    margin: 0 0 28px;
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.55;
}
.login-form { display: grid; gap: 14px; }
.auth-field {
    display: grid;
    gap: 7px;
    text-align: left;
    color: var(--text-dim);
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.auth-field .phrase { text-align: left; }
.phrase {
    width: 100%;
    height: 42px;
    border: 0;
    border-bottom: 1px solid var(--border-strong);
    background: transparent;
    padding: 0 0 4px;
    outline: 0;
    text-align: center;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    transition: border-color .2s ease;
}
.phrase:focus { border-color: var(--text); }
.phrase::placeholder { color: var(--text-faint); }
.login-submit {
    height: 40px;
    background: var(--text);
    color: var(--bg);
    font-size: 12px;
    letter-spacing: .15em;
    text-transform: uppercase;
    transition: opacity .15s ease;
}
.login-submit:hover { opacity: .85; }
.login-submit:disabled { opacity: .55; cursor: wait; }
.auth-status {
    min-height: 17px;
    margin-top: -4px;
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.35;
    text-align: left;
}
.auth-status.error { color: #ffb8b8; }
.auth-status.success { color: #c8ffd9; }
.auth-field.error .phrase { border-color: rgba(255, 184, 184, .8); }
.toast {
    position: fixed;
    left: 50%;
    bottom: 90px;
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.04);
    border: 0;
    border-radius: 9999px;
    backdrop-filter: blur(12px) saturate(1.18);
    -webkit-backdrop-filter: blur(12px) saturate(1.18);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.16), 0 12px 30px rgba(0, 0, 0, 0.28);
    color: var(--text);
    padding: 10px 18px;
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
    transition: opacity .2s ease, transform .2s ease;
    z-index: 80;
    max-width: calc(100vw - 24px);
    overflow: hidden;
}
.toast::before {
    padding: 1.2px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.16) 36%, rgba(255, 255, 255, 0.08) 64%, rgba(255, 255, 255, 0.42) 100%);
}
.toast.active { opacity: 1; transform: translateX(-50%) translateY(0); }

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: 0 0 18px;
    padding: 4px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.025);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08);
}
.auth-tab {
    min-height: 30px;
    border-radius: 9999px;
    color: var(--text-dim);
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    transition: background .16s ease, color .16s ease;
}
.auth-tab.active { background: rgba(255, 255, 255, 0.12); color: var(--text); }
.register-only { display: none; }
.login.register-mode .register-only { display: grid; }
/* ============ SIDEBAR (liquid glass panel) ============ */
.side-backdrop {
    position: fixed;
    inset: 0;
    z-index: 58;
    background: rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity .42s cubic-bezier(.32, .72, 0, 1);
}
.side-backdrop.open { opacity: 1; }
.sidebar {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    bottom: max(12px, env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
    z-index: 59;
    width: min(288px, calc(100vw - 48px));
    display: flex;
    flex-direction: column;
    padding: 16px 13px 12px;
    border-radius: 30px;
    isolation: isolate;
    overflow: hidden;
}
/* all glass chrome lives on this layer so it can dissolve, leaving the logo */
.sidebar > .side-glass {
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    background:
        radial-gradient(150% 46% at 16% -8%, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.014) 56%, transparent 74%),
        radial-gradient(130% 36% at 86% 108%, rgba(255, 255, 255, 0.05), transparent 66%),
        rgba(13, 13, 14, 0.55);
    backdrop-filter: blur(30px) saturate(1.5);
    -webkit-backdrop-filter: blur(30px) saturate(1.5);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.16),
        inset 0 -1px 1px rgba(255, 255, 255, 0.045),
        0 30px 80px rgba(0, 0, 0, 0.55),
        0 6px 22px rgba(0, 0, 0, 0.38);
    pointer-events: none;
    transition: opacity .22s ease, visibility 0s;
}
/* gradient ring border (masked) */
.side-glass::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.4px;
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.14) 16%, rgba(255, 255, 255, 0.035) 40%, rgba(255, 255, 255, 0.02) 62%, rgba(255, 255, 255, 0.24) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}
/* drifting specular sheen — the "liquid" light inside the glass */
.side-glass::after {
    content: "";
    position: absolute;
    top: -28%;
    left: -48%;
    width: 92%;
    height: 62%;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(255, 255, 255, 0.065), transparent 72%);
    filter: blur(6px);
    animation: sideSheen 17s ease-in-out infinite alternate;
    pointer-events: none;
}
@keyframes sideSheen {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(46%, 30%) scale(1.28); }
    100% { transform: translate(92%, 70%) scale(.88); }
}
.side-glow { position: absolute; inset: 0; z-index: 0; pointer-events: none; transition: opacity .22s ease, visibility 0s; }
.side-glow i {
    position: absolute;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.055), transparent 70%);
    filter: blur(14px);
}
.side-glow i:nth-child(1) { top: 24%; left: -20%; animation: sideBlobA 19s ease-in-out infinite alternate; }
.side-glow i:nth-child(2) { bottom: 2%; right: -24%; width: 195px; height: 195px; animation: sideBlobB 24s ease-in-out infinite alternate; }
@keyframes sideBlobA {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(70px, 110px) scale(1.3); }
    100% { transform: translate(130px, -40px) scale(.85); }
}
@keyframes sideBlobB {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-80px, -150px) scale(1.22); }
    100% { transform: translate(-30px, -300px) scale(.9); }
}
.sidebar > :not(.side-glow):not(.side-glass) { position: relative; z-index: 1; }
/* --- top row: logo + new chat bubble --- */
.side-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 6px 20px;
}
.side-logo-btn {
    padding: 0;
    line-height: 0;
    border-radius: 16px;
    transition: transform .22s cubic-bezier(.2, .7, .2, 1);
}
.side-logo-btn:hover { transform: scale(1.06); }
.side-logo-btn:active { transform: scale(.94); }
.side-logo {
    width: 46px;
    height: 46px;
    object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.55));
    user-select: none;
    -webkit-user-drag: none;
}
.side-top-actions { display: flex; align-items: center; gap: 8px; }
.side-new {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.85);
    background:
        radial-gradient(130% 145% at 26% 6%, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0.02) 58%),
        rgba(255, 255, 255, 0.015);
    box-shadow:
        inset 0 1px 1.3px rgba(255, 255, 255, 0.32),
        inset 0 -4px 10px rgba(255, 255, 255, 0.04),
        0 10px 24px rgba(0, 0, 0, 0.36);
    position: relative;
    overflow: hidden;
    transition: transform .16s ease, box-shadow .24s ease, color .18s ease, opacity .2s ease;
}
.side-new::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.2px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.06) 55%, rgba(255, 255, 255, 0.26));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}
.side-new:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 1.3px rgba(255, 255, 255, 0.4),
        inset 0 -4px 10px rgba(255, 255, 255, 0.05),
        0 14px 30px rgba(0, 0, 0, 0.44),
        0 0 24px rgba(255, 255, 255, 0.06);
}
.side-new:active { transform: scale(.93); }
.side-new:disabled { opacity: .4; cursor: default; transform: none; }
.side-new svg { width: 17px; height: 17px; }
/* --- mode switcher (Chat / Image / Video) --- */
.side-modes {
    position: relative;
    display: grid;
    gap: 11px;
    padding: 0 2px;
}
.side-mode {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 48px;
    padding: 0 17px;
    border-radius: 9999px;
    font-size: 13px;
    letter-spacing: .02em;
    color: rgba(255, 255, 255, 0.6);
    transition: color .25s ease, transform .14s ease;
}
.side-mode:hover { color: rgba(255, 255, 255, 0.95); }
.side-mode:active { transform: scale(.97); }
.side-mode:disabled { opacity: .5; cursor: default; }
.side-mode.active { color: #fff; text-shadow: 0 0 16px rgba(255, 255, 255, 0.28); }
.side-mode svg { width: 17px; height: 17px; flex: 0 0 auto; opacity: .78; transition: opacity .2s ease; }
.side-mode.active svg, .side-mode:hover svg { opacity: 1; }
/* the liquid bubble that flows between modes */
.side-mode-blob {
    position: absolute;
    top: 0;
    left: 2px;
    right: 2px;
    height: 48px;
    z-index: 0;
    border-radius: 9999px;
    opacity: 0;
    background:
        radial-gradient(130% 190% at 20% -22%, rgba(255, 255, 255, 0.19), rgba(255, 255, 255, 0.03) 55%, transparent 74%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
    box-shadow:
        inset 0 1px 1.4px rgba(255, 255, 255, 0.32),
        inset 0 -6px 14px rgba(255, 255, 255, 0.045),
        inset 1.5px 0 5px rgba(255, 255, 255, 0.05),
        0 14px 30px rgba(0, 0, 0, 0.42);
    transition:
        transform .34s cubic-bezier(.3, 1.12, .3, 1.06),
        height .34s cubic-bezier(.3, 1.12, .3, 1.06),
        opacity .3s ease;
    will-change: transform, height;
    pointer-events: none;
}
.side-mode-blob::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.3px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.08) 44%, rgba(255, 255, 255, 0.02) 66%, rgba(255, 255, 255, 0.22));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}
/* droplet highlight riding on the bubble */
.side-mode-blob::after {
    content: "";
    position: absolute;
    top: 6px;
    left: 15px;
    width: 36px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(255, 255, 255, 0.26), transparent 78%);
    filter: blur(2.5px);
}
.side-mode-blob.ready { opacity: 1; }
/* --- sections --- */
.side-section-label {
    padding: 22px 17px 9px;
    font-size: 11.5px;
    letter-spacing: .04em;
    color: var(--text-dim);
}
.side-admin .side-section-label { padding: 4px 17px 6px; }
.side-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: rgba(255, 255, 255, .72);
    background: rgba(255, 255, 255, .035);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
    transition: color .16s ease, background .16s ease;
}
.side-icon:hover { color: #fff; background: rgba(255, 255, 255, .09); }
.side-icon svg { width: 15px; height: 15px; }
.admin-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text);
}
.admin-create, .context-banner button {
    min-height: 36px;
    border-radius: 9px;
    background: var(--text);
    color: var(--bg);
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
}
/* --- chat list --- */
.chat-list {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
    min-height: 0;
    overflow-y: auto;
    padding: 2px 2px 8px;
    scrollbar-width: none;
}
.chat-list::-webkit-scrollbar { display: none; }
.chat-item {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 46px;
    padding: 0 12px 0 15px;
    border-radius: 16px;
    text-align: left;
    color: var(--text-2);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.012));
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.09),
        inset 0 0 0 1px rgba(255, 255, 255, 0.035);
    cursor: pointer;
    transition: background .2s ease, box-shadow .2s ease, color .2s ease, transform .12s ease, opacity .3s ease, min-height .35s ease, margin .35s ease, padding .35s ease;
}
.chat-item:hover {
    color: var(--text);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.02));
}
.chat-item:active { transform: scale(.98); }
.chat-item.active {
    color: #fff;
    background:
        radial-gradient(130% 180% at 16% -25%, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.015) 60%),
        rgba(255, 255, 255, 0.015);
    box-shadow:
        inset 0 1px 1.2px rgba(255, 255, 255, 0.24),
        inset 0 0 0 1px rgba(255, 255, 255, 0.085),
        0 10px 26px rgba(0, 0, 0, 0.32);
}
/* glowing droplet marking the active chat */
.chat-item::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 16px;
    width: 5px;
    height: 5px;
    margin-top: -2.5px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.75);
    opacity: 0;
    transform: scale(.4);
    transition: opacity .25s ease, transform .25s ease;
    pointer-events: none;
}
.chat-item.active::after { opacity: 1; transform: none; }
.chat-item:hover::after { opacity: 0; transform: scale(.4); }
.chat-item.removing {
    opacity: 0;
    transform: translateX(-16px) scale(.96);
    min-height: 0;
    max-height: 0;
    margin-top: -7px;
    overflow: hidden;
    pointer-events: none;
}
.chat-name {
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 24px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12.5px;
}
.chat-del {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: var(--text-dim);
    opacity: 0;
    transform: translateY(-50%) scale(.85);
    transition: color .16s ease, background .16s ease, opacity .18s ease, transform .14s ease;
}
.chat-item:hover .chat-del { opacity: 1; transform: translateY(-50%); }
.chat-del:hover { color: #ff8585; background: rgba(225, 80, 80, 0.14); }
.chat-del:active { transform: translateY(-50%) scale(.86); background: rgba(225, 60, 60, 0.32); color: #fff; }
.chat-del:disabled { opacity: .35; cursor: default; pointer-events: none; }
.chat-del svg { width: 14px; height: 14px; }
@media (hover: none) {
    .chat-del { opacity: 1; transform: translateY(-50%); }
    .chat-item.active::after { opacity: 0; }
}
/* --- admin + footer --- */
.side-admin {
    display: grid;
    gap: 2px;
    padding: 10px 0 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.side-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 6px 2px 17px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.side-user {
    min-width: 0;
    font-size: 11px;
    color: var(--text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.side-link {
    min-height: 32px;
    padding: 0 11px;
    text-align: left;
    color: var(--text-dim);
    font-size: 11.5px;
    border-radius: 10px;
    transition: color .18s ease, background .18s ease;
}
.side-admin .side-link { margin: 0 6px; }
.side-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.045); }
.side-foot .side-link { flex: 0 0 auto; }
@keyframes orbJelly {
    0% { transform: scale(1); }
    35% { transform: scale(1.12, .86); }
    65% { transform: scale(.92, 1.08); }
    100% { transform: scale(1); }
}
/* helper: apply state without animating (boot restore) */
body.side-anim-off .app,
body.side-anim-off .sidebar,
body.side-anim-off .sidebar > .side-glass,
body.side-anim-off .side-glow,
body.side-anim-off .side-logo-btn,
body.side-anim-off .side-top-actions,
body.side-anim-off .side-modes,
body.side-anim-off .side-section-label,
body.side-anim-off .chat-list,
body.side-anim-off .side-admin,
body.side-anim-off .side-foot {
    transition: none !important;
    animation: none !important;
}
/* --- docked panel on wide screens --- */
@media (min-width: 961px) {
    .app {
        padding-left: calc(288px + 26px);
        transition: padding-left .62s cubic-bezier(.34, 1.06, .32, 1);
    }
    .sidebar {
        transform: none !important;
        clip-path: circle(140% at 42px 43px);
        -webkit-clip-path: circle(140% at 42px 43px);
        transition: clip-path .62s cubic-bezier(.34, 1.18, .32, 1);
    }
    .sidebar[hidden] { display: flex !important; }
    .side-backdrop { display: none !important; }
    .side-close { display: none !important; }
    .top-left { display: none; }
    /* panel content dissolves while the glass condenses, blooms back on expand */
    .side-top-actions, .side-modes, .side-section-label, .chat-list, .side-admin, .side-foot {
        transition: opacity .34s ease .16s, visibility 0s 0s;
    }
    /* collapsed: the panel condenses into a droplet that evaporates, leaving the logo */
    body.side-collapsed .app { padding-left: 104px; }
    body.side-collapsed .sidebar {
        clip-path: circle(27px at 42px 43px);
        -webkit-clip-path: circle(27px at 42px 43px);
        cursor: pointer;
    }
    body.side-collapsed .sidebar > .side-glass,
    body.side-collapsed .side-glow {
        opacity: 0;
        visibility: hidden;
        transition: opacity .3s ease .42s, visibility 0s .72s;
    }
    body.side-collapsed .side-logo-btn { animation: orbJelly .62s cubic-bezier(.34, 1.2, .4, 1) .34s both; }
    body.side-collapsed .side-top-actions,
    body.side-collapsed .side-modes,
    body.side-collapsed .side-section-label,
    body.side-collapsed .chat-list,
    body.side-collapsed .side-admin,
    body.side-collapsed .side-foot {
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s ease, visibility 0s .6s;
    }
}
/* --- slide-in drawer on small screens --- */
@media (max-width: 960px) {
    .sidebar {
        width: min(304px, calc(100vw - 52px));
        transform: translateX(calc(-100% - 80px));
        transition: transform .5s cubic-bezier(.32, .72, 0, 1);
        will-change: transform;
    }
    .sidebar.open { transform: translateX(0); }
    .side-collapse { display: none !important; }
    .sidebar.open > :not(.side-glow):not(.side-glass) { animation: sideItemIn .5s cubic-bezier(.2, .7, .2, 1) both; }
    .sidebar.open > :nth-child(3) { animation-delay: .05s; }
    .sidebar.open > :nth-child(4) { animation-delay: .09s; }
    .sidebar.open > :nth-child(5) { animation-delay: .13s; }
    .sidebar.open > :nth-child(6) { animation-delay: .17s; }
    .sidebar.open > :nth-child(7) { animation-delay: .21s; }
    .sidebar.open > :nth-child(8) { animation-delay: .25s; }
}
@keyframes sideItemIn {
    from { opacity: 0; transform: translateX(-12px); }
    to { opacity: 1; transform: none; }
}
.admin-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(0, 0, 0, .46);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}
.admin-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 61;
    width: min(720px, calc(100vw - 28px));
    max-height: min(680px, calc(100vh - 40px));
    display: grid;
    gap: 12px;
    grid-template-rows: auto auto minmax(0, 1fr);
    padding: 16px;
    border-radius: 8px;
    background: rgba(12, 12, 12, 0.94);
    border: 1px solid var(--border-strong);
    box-shadow: 0 22px 60px rgba(0, 0, 0, .42);
    backdrop-filter: blur(18px) saturate(1.14);
    -webkit-backdrop-filter: blur(18px) saturate(1.14);
    transform: translate(-50%, -50%);
}
.admin-row { display: grid; grid-template-columns: 82px 1fr; gap: 8px; }
.admin-input {
    min-width: 0;
    height: 36px;
    border: 1px solid var(--border-strong);
    border-radius: 7px;
    background: transparent;
    padding: 0 10px;
    outline: 0;
}
.admin-list {
    display: grid;
    align-content: start;
    gap: 7px;
    min-height: 0;
    overflow: auto;
}
.user-list { display: grid; gap: 7px; }
.invite-result {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 2px;
}
.invite-result:empty { display: none; }
.invite-result::before {
    content: "Новые коды — скопируйте сейчас";
    width: 100%;
    font-size: 9.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #79e0a3;
    opacity: .85;
}
.invite-list {
    display: grid;
    gap: 6px;
    align-content: start;
}
/* Info on the left, a "⋯" toggle on the right; the model/delete buttons live in
   a collapsed row below so a long account list stays short enough to scan. */
.user-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
    overflow: hidden;
    border-radius: 7px;
    padding: 8px 9px;
    background: rgba(255, 255, 255, .03);
    color: var(--text-2);
    font-size: 11px;
    overflow-wrap: anywhere;
}
.invite-code {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, .05);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08);
    color: var(--text);
    font-size: 11px;
    cursor: pointer;
    transition: background .16s ease, transform .12s ease;
}
.invite-code::after {
    content: "";
    width: 12px;
    height: 12px;
    flex: 0 0 auto;
    opacity: .5;
    background: currentColor;
    -webkit-mask: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='1.3'%3E%3Crect x='5' y='5' width='8' height='8' rx='1.4'/%3E%3Cpath d='M11 5V3.6A1.6 1.6 0 0 0 9.4 2H3.6A1.6 1.6 0 0 0 2 3.6v5.8A1.6 1.6 0 0 0 3.6 11H5'/%3E%3C/svg%3E");
    mask: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='1.3'%3E%3Crect x='5' y='5' width='8' height='8' rx='1.4'/%3E%3Cpath d='M11 5V3.6A1.6 1.6 0 0 0 9.4 2H3.6A1.6 1.6 0 0 0 2 3.6v5.8A1.6 1.6 0 0 0 3.6 11H5'/%3E%3C/svg%3E");
}
.invite-code:hover { background: rgba(255, 255, 255, .09); }
.invite-code:active { transform: scale(.95); }
.invite-section {
    margin: 6px 0 1px;
    font-size: 9.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 9px;
}
.invite-section:first-child { margin-top: 0; }
.invite-section::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,.1), transparent);
}
.invite-row {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 34px;
    padding: 5px 6px 5px 11px;
    border-radius: 9px;
    background: rgba(255, 255, 255, .03);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
    color: var(--text-2);
    font-size: 11.5px;
}
.invite-row.used { opacity: .55; }
.invite-row-dot {
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    border-radius: 9999px;
    background: var(--text-faint);
}
.invite-row.active .invite-row-dot { background: #79e0a3; box-shadow: 0 0 8px rgba(121, 224, 163, .6); }
.invite-row-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.invite-row-meta { flex: 0 0 auto; color: var(--text-dim); font-size: 10px; }
.invite-row-revoke {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 9999px;
    color: var(--text-dim);
    font-size: 15px;
    line-height: 1;
    transition: color .15s ease, background .15s ease;
}
.invite-row-revoke:hover { color: #ff8585; background: rgba(225, 80, 80, .16); }
.invite-empty {
    padding: 6px 2px;
    color: var(--text-dim);
    font-size: 11px;
}
.admin-item-main {
    display: grid;
    gap: 4px;
    min-width: 0;
}
.admin-item-title { color: var(--text); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-item-meta { color: var(--text-dim); font-size: 10px; line-height: 1.35; }
.admin-item-toggle {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: rgba(255, 255, 255, .62);
    background: rgba(255, 255, 255, .05);
    transition: color .16s ease, background .16s ease;
}
.admin-item-toggle svg { width: 14px; height: 14px; }
.admin-item-toggle:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.admin-item-toggle.open { color: #fff; background: rgba(255, 255, 255, .12); }
/* one toggle per video model, so the row has to wrap instead of stretching */
.admin-item-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding-top: 2px;
}
.admin-small-btn {
    min-height: 28px;
    padding: 0 10px;
    border-radius: 7px;
    color: var(--text-2);
    background: rgba(255, 255, 255, .05);
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.admin-small-btn:hover { color: #fff; background: rgba(255, 255, 255, .09); }
.admin-small-btn.on { color: #cfe9d3; background: rgba(96, 200, 130, .16); }
.admin-small-btn.on:hover { color: #fff; background: rgba(96, 200, 130, .24); }
.admin-small-btn.danger:hover { color: #ffb8b8; background: rgba(225, 80, 80, .14); }
.context-banner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-2);
    font-size: 12px;
}
.context-banner button { min-height: 30px; padding: 0 10px; }

.video-panel {
    grid-row: 2;
    grid-column: 1;
    display: none;
    overflow: hidden;
    min-height: 0;
    padding: clamp(26px, 5vh, 58px) clamp(20px, 3.4vw, 56px) 0;
}
.video-panel.active { display: block; }
.mode-fade-in { animation: modeFadeIn .5s cubic-bezier(.22, .9, .28, 1) both; }
@keyframes modeFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}
.video-inner {
    display: grid;
    grid-template-columns: minmax(380px, 540px) minmax(0, 1fr);
    gap: clamp(30px, 4.5vw, 86px);
    width: min(1640px, 100%);
    height: 100%;
    margin: 0 auto;
    align-items: stretch;
}
/* right column scrolls the feed; left column is a fixed composer */
.video-left,
.video-right {
    min-width: 0;
    max-height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    padding: 6px 18px 48px 10px;
}
.video-left::-webkit-scrollbar,
.video-right::-webkit-scrollbar { display: none; }
/* prompt dock pinned to the bottom, references orbit in the space above */
.video-left {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: visible;
    padding-bottom: 30px;
}
/* staggered entrance when switching into video mode (class removed after entry) */
.video-panel.entering .video-dock > *:not(.video-settings-pop),
.video-panel.entering .video-orbit-add,
.video-panel.entering .video-orbit-hint,
.video-panel.entering .video-right > .video-title,
.video-panel.entering .video-empty {
    animation: videoRiseIn .68s cubic-bezier(.22, .9, .28, 1) both;
}
.video-panel.entering .video-orbit-add { animation-delay: .04s; }
.video-panel.entering .video-orbit-hint { animation-delay: .08s; }
.video-panel.entering .video-dock > *:nth-child(1) { animation-delay: .1s; }
.video-panel.entering .video-dock > *:nth-child(2) { animation-delay: .16s; }
.video-panel.entering .video-dock > *:nth-child(3) { animation-delay: .22s; }
.video-panel.entering .video-dock > *:nth-child(4) { animation-delay: .28s; }
.video-panel.entering .video-right > .video-title { animation-delay: .1s; }
.video-panel.entering .video-empty { animation-delay: .2s; }
@keyframes videoRiseIn {
    from { opacity: 0; transform: translateY(22px) scale(.985); filter: blur(6px); }
    to { opacity: 1; transform: none; filter: none; }
}
/* gentle levitation of the controls */
@keyframes videoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
.video-title {
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.video-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,.14), transparent);
}
.video-count {
    color: var(--text-faint);
    letter-spacing: .04em;
}
.video-field { margin: 0; min-width: 0; }
.video-field > span {
    display: block;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-dim);
    margin-bottom: 8px;
}
/* the dock drifts as one piece; interacting with it pins it in place.
   z-index keeps it (and the settings popover) above the orbit cards/center */
.video-dock {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: videoFloat 7.5s ease-in-out -2.2s infinite;
    will-change: transform;
}
.video-dock:focus-within,
.video-dock.settings-open { animation-play-state: paused; }
/* these sit inside animated ancestors — a backdrop-filter here would re-blur
   per frame, and behind them is only the flat page background anyway */
.video-choice-pill.liquid-glass,
.video-duration-control.liquid-glass,
.video-settings-btn.liquid-glass,
.video-settings-pop.liquid-glass,
.video-orbit-add.liquid-glass {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.video-prompt {
    width: 100%;
    background: rgba(255, 255, 255, 0.028);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 16px 18px;
    color: var(--text);
    font-size: 14px;
    line-height: 1.55;
    resize: vertical;
    min-height: 158px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), 0 18px 44px rgba(0, 0, 0, .3);
    transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
}
.video-prompt:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.32);
    background: rgba(255, 255, 255, 0.045);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.06), 0 0 0 4px rgba(255, 255, 255, .045), 0 22px 54px rgba(0, 0, 0, .36);
}
.video-duration-control {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 6px 10px;
    border-radius: 12px;
    background: rgba(16, 16, 16, 0.74);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 14px 34px rgba(0, 0, 0, .22);
}
.video-duration-input {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    min-width: 0;
    height: 24px;
    background: transparent;
    cursor: pointer;
}
.video-duration-input:focus { outline: none; }
.video-duration-input:disabled { opacity: .45; cursor: not-allowed; }
.video-duration-input::-webkit-slider-runnable-track {
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 1px 1px rgba(0,0,0,.25);
}
.video-duration-input::-moz-range-track {
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 1px 1px rgba(0,0,0,.25);
}
.video-duration-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    margin-top: -5.5px;
    border-radius: 999px;
    border: 0;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255,255,255,.08), 0 5px 14px rgba(0,0,0,.32);
}
.video-duration-input::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 0;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255,255,255,.08), 0 5px 14px rgba(0,0,0,.32);
}
.video-duration-value {
    flex: 0 0 auto;
    min-width: 42px;
    color: rgba(255,255,255,.82);
    font-size: 12px;
    text-align: right;
}
.video-choice-pill {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    padding: 6px;
    border-radius: 12px;
    background: rgba(16, 16, 16, 0.74);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 14px 34px rgba(0, 0, 0, .22);
}
.video-choice-pill.ratio, .video-choice-pill.thinking {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.video-choice-pill.frame-rate {
    grid-template-columns: 1fr;
}
.video-choice-pill.model {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.video-choice-pill.model .video-option-btn {
    padding: 8px 7px;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
}
.video-option-btn {
    width: 100%;
    min-height: 34px;
    padding: 8px 10px;
    font-size: 12px;
    letter-spacing: .02em;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    border-radius: 8px;
    transition: color .2s ease, background .2s ease, transform .12s ease;
    font-family: var(--font);
    position: relative;
    z-index: 1;
    background: transparent;
    text-align: left;
}
.video-option-btn:disabled { opacity: .45; cursor: not-allowed; }
.video-option-btn.active::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 10px;
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: #fff;
    transform: translateY(-50%);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}
/* ============ REFERENCE ORBIT ============ */
.video-orbit-zone {
    position: relative;
    flex: 1 1 auto;
    min-height: 230px;
    margin-bottom: 22px;
}
.video-orbit {
    position: absolute;
    inset: 0;
    --orbit-r: 150px;
    --orbit-card-w: 96px;
    --orbit-card-h: 120px;
}
.video-ref-item {
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--orbit-card-w);
    height: var(--orbit-card-h);
    margin: calc(var(--orbit-card-h) / -2) 0 0 calc(var(--orbit-card-w) / -2);
    animation: videoOrbitSpin 44s linear infinite;
    will-change: transform;
    z-index: 1;
}
/* hovering the zone stops the carousel so cards can be clicked */
.video-orbit-zone:hover .video-ref-item { animation-play-state: paused; }
@keyframes videoOrbitSpin {
    from { transform: rotate(var(--orbit-from, 0deg)) translateX(var(--orbit-r)) rotate(calc(var(--orbit-from, 0deg) * -1)); }
    to { transform: rotate(calc(var(--orbit-from, 0deg) + 360deg)) translateX(var(--orbit-r)) rotate(calc(var(--orbit-from, 0deg) * -1 - 360deg)); }
}
.video-ref-card {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.035);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255, 255, 255, .1), inset 0 1px 1px rgba(255, 255, 255, .12);
    cursor: zoom-in;
    isolation: isolate;
    animation: videoRefPop .55s cubic-bezier(.3, 1.35, .45, 1) both;
}
.video-ref-card.settled { animation: none; }
@keyframes videoRefPop {
    from { opacity: 0; transform: scale(.4); filter: blur(10px); }
    to { opacity: 1; transform: none; filter: none; }
}
.video-ref-card:focus-visible {
    outline: 1px solid rgba(255, 255, 255, .7);
    outline-offset: 3px;
}
.video-ref-card img,
.video-ref-card video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}
.video-ref-card span {
    position: absolute;
    left: 7px;
    right: 7px;
    bottom: 6px;
    color: rgba(255,255,255,.85);
    font-size: 9.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 8px rgba(0,0,0,.8);
    z-index: 2;
}
.video-ref-card::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 44px;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,.72));
    pointer-events: none;
    z-index: 1;
}
.video-ref-card.uploading {
    display: grid;
    place-items: center;
    cursor: default;
    color: var(--text-dim);
    font-size: 10px;
    text-align: center;
    background:
        linear-gradient(110deg, rgba(255,255,255,0) 30%, rgba(255,255,255,.06) 50%, rgba(255,255,255,0) 70%) no-repeat,
        rgba(255, 255, 255, 0.03);
    background-size: 240% 100%;
    animation: videoRefPop .55s cubic-bezier(.3, 1.35, .45, 1) both, videoShimmer 2s ease-in-out .55s infinite;
}
.video-ref-card.uploading span { position: static; white-space: normal; padding: 0 8px; }
.video-ref-card button {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: rgba(255,255,255,.78);
    background: rgba(0,0,0,.45);
    border: 1px solid rgba(255,255,255,.14);
    cursor: pointer;
    z-index: 3;
    opacity: 0;
    transition: opacity .2s ease, background .2s ease, color .2s ease;
}
.video-ref-item:hover .video-ref-card button,
.video-ref-card button:focus-visible { opacity: 1; }
.video-ref-card button:hover { color: #fff; background: rgba(0,0,0,.66); }
.video-orbit-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    display: grid;
    justify-items: center;
    gap: 12px;
    text-align: center;
    pointer-events: none;
}
.video-orbit-add {
    pointer-events: auto;
    width: 58px;
    height: 58px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: var(--text-2);
    background: rgba(18, 18, 18, .66);
    box-shadow: inset 0 1px 1px rgba(255,255,255,.12), 0 18px 44px rgba(0,0,0,.38);
    transition: color .2s ease, background .25s ease, box-shadow .25s ease;
    animation: videoFloat 6.8s ease-in-out infinite;
}
.video-orbit-add svg { width: 20px; height: 20px; }
.video-orbit-add:hover {
    color: #fff;
    background: rgba(32, 32, 32, .8);
    box-shadow: inset 0 1px 1px rgba(255,255,255,.16), 0 22px 54px rgba(0,0,0,.44), 0 0 0 7px rgba(255,255,255,.03);
}
.video-orbit-add:disabled { opacity: .4; cursor: not-allowed; }
.video-orbit-hint {
    max-width: 230px;
    font-size: 10px;
    line-height: 1.7;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-faint);
    pointer-events: none;
}
/* ============ DOCK ROW + SETTINGS POPOVER ============ */
.video-dock-row { display: flex; gap: 10px; align-items: stretch; }
.video-dock-row .video-field { flex: 1; }
.video-settings-btn {
    flex: 0 0 auto;
    width: 46px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: var(--text-2);
    background: #161616;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 14px 34px rgba(0, 0, 0, .22);
    transition: color .2s ease, background .25s ease;
}
.video-settings-btn svg { width: 17px; height: 17px; }
.video-settings-btn:hover,
.video-settings-btn.open { color: #fff; background: #272727; }
.video-settings-btn:disabled { opacity: .45; cursor: not-allowed; }
.video-settings-pop {
    position: absolute;
    bottom: calc(100% + 12px);
    right: 0;
    z-index: 70;
    width: min(330px, 100%);
    max-height: min(60vh, 520px);
    overflow-y: auto;
    scrollbar-width: none;
    display: grid;
    gap: 15px;
    padding: 15px;
    border-radius: 16px;
    background: #101010;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 26px 64px rgba(0, 0, 0, .52);
    transform-origin: bottom right;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(.95);
    transition: opacity .2s ease, transform .28s cubic-bezier(.2, .7, .2, 1), visibility 0s linear .28s;
    pointer-events: none;
}
.video-settings-pop::-webkit-scrollbar { display: none; }
.video-settings-pop.open {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    transition: opacity .22s ease, transform .34s cubic-bezier(.34, 1.2, .5, 1);
}
.video-settings-group { display: grid; gap: 15px; }
.video-generate-btn {
    position: relative;
    width: 100%;
    min-height: 46px;
    padding: 12px;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff, #d9d9d9);
    border: none;
    color: #0a0a0a;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 16px 44px rgba(255, 255, 255, .09), 0 10px 30px rgba(0,0,0,.4);
    transition: box-shadow .25s ease, filter .2s ease;
}
.video-generate-btn::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 40%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.85), transparent);
    transform: translateX(-150%) skewX(-18deg);
    animation: videoBtnSheen 4.5s ease-in-out infinite;
    pointer-events: none;
}
@keyframes videoBtnSheen {
    0%, 55% { transform: translateX(-150%) skewX(-18deg); }
    85%, 100% { transform: translateX(325%) skewX(-18deg); }
}
.video-generate-btn:hover {
    filter: brightness(1.07);
    box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 22px 60px rgba(255, 255, 255, .16), 0 14px 34px rgba(0,0,0,.44);
}
.video-generate-btn:active { filter: brightness(.92); }
.video-generate-btn:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(.4); }
.video-generate-btn:disabled::after { display: none; }
.video-error {
    color: #ffb8b8;
    font-size: 12px;
    line-height: 1.45;
    margin-top: 9px;
    word-break: break-word;
}
.video-list { display: flex; flex-direction: column; gap: clamp(26px, 3.4vh, 44px); }
.video-empty {
    color: var(--text-faint);
    font-size: 12.5px;
    letter-spacing: .05em;
    padding: 34px 0;
    text-align: center;
    border: 1px dashed rgba(255,255,255,.09);
    border-radius: 18px;
}
.video-item { position: relative; min-width: 0; }
.video-panel.entering .video-item { animation: videoRiseIn .7s cubic-bezier(.22, .9, .28, 1) both; }
.video-panel.entering .video-item:nth-child(1) { animation-delay: .18s; }
.video-panel.entering .video-item:nth-child(2) { animation-delay: .28s; }
.video-panel.entering .video-item:nth-child(3) { animation-delay: .38s; }
.video-panel.entering .video-item:nth-child(4) { animation-delay: .46s; }
.video-frame {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .5), 0 6px 22px rgba(0, 0, 0, .4), inset 0 0 0 1px rgba(255,255,255,.07);
    transition: box-shadow .35s ease, transform .35s cubic-bezier(.2,.7,.2,1);
}
.video-item:hover .video-frame {
    transform: translateY(-3px);
    box-shadow: 0 40px 110px rgba(0, 0, 0, .56), 0 10px 28px rgba(0, 0, 0, .44), inset 0 0 0 1px rgba(255,255,255,.13);
}
.video-frame video {
    width: 100%;
    display: block;
    max-height: min(62vh, 640px);
    object-fit: contain;
    background: #000;
}
.video-frame.pending {
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 9;
    max-height: min(50vh, 460px);
    background:
        linear-gradient(110deg, rgba(255,255,255,0) 30%, rgba(255,255,255,.05) 50%, rgba(255,255,255,0) 70%) no-repeat,
        rgba(255, 255, 255, 0.018);
    background-size: 240% 100%;
    animation: videoShimmer 2.4s ease-in-out infinite;
}
@keyframes videoShimmer {
    0% { background-position: 120% 0; }
    100% { background-position: -120% 0; }
}
.video-frame.pending .video-pending-label {
    display: grid;
    justify-items: center;
    gap: 12px;
    color: var(--text-dim);
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.video-frame.pending .video-pending-label::before {
    content: "";
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 2px solid rgba(255,255,255,.14);
    border-top-color: rgba(255,255,255,.75);
    animation: videoSpin 1s linear infinite;
}
@keyframes videoSpin { to { transform: rotate(360deg); } }
.video-frame.failed { aspect-ratio: auto; animation: none; }
.video-caption { padding: 13px 6px 0; }
.video-caption-prompt {
    color: var(--text-2);
    font-size: 13px;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    cursor: pointer;
    word-break: break-word;
    transition: color .2s ease;
}
.video-caption-prompt:hover { color: var(--text); }
.video-caption-prompt.expanded { display: block; -webkit-line-clamp: unset; white-space: pre-wrap; }
.video-caption-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    margin-top: 9px;
    font-size: 10.5px;
    letter-spacing: .05em;
    color: var(--text-faint);
}
.video-item-status {
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: .1em;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    box-shadow: inset 0 1px 1px rgba(255,255,255,.07);
    color: var(--text-dim);
}
.video-item-status.succeeded { color: #7fffa8; background: rgba(96, 220, 144, .09); }
.video-item-status.failed { color: #ffb8b8; background: rgba(225, 90, 90, .1); }
.video-item-status.running, .video-item-status.queued { color: #ffd992; background: rgba(255, 200, 60, .08); }
.video-item-link {
    color: var(--text-faint);
    transition: color .2s ease;
}
.video-item-link:hover { color: #fff; }
.video-item-warning { color: #ffcf8a; font-size: 12px; line-height: 1.45; padding: 10px 6px 0; word-break: break-word; }
.video-item-error { color: #ffb8b8; font-size: 12px; line-height: 1.5; padding: 16px; word-break: break-word; }
.video-item-del {
    margin-left: auto;
    color: var(--text-faint);
    font-size: 10.5px;
    letter-spacing: .05em;
    cursor: pointer;
    opacity: 0;
    transition: opacity .25s ease, color .2s ease;
}
.video-item:hover .video-item-del { opacity: 1; }
.video-item-del:hover { color: #ffb8b8; }
@media (max-width: 900px) {
    .video-panel { overflow: auto; padding-bottom: 40px; }
    .video-inner { grid-template-columns: 1fr; gap: 40px; height: auto; }
    .video-left, .video-right { max-height: none; overflow: visible; }
    .video-orbit-zone { min-height: 300px; }
    .video-orbit { --orbit-card-w: 80px; --orbit-card-h: 100px; }
    .video-ref-card button { opacity: 1; }
    .video-choice-pill.ratio { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .video-item-del { opacity: 1; }
}
@media (max-width: 720px) {
    .topbar { padding: 12px 14px; gap: 10px; }
    .chat { padding: 24px 14px 12px; }
    .composer { padding: 12px 14px max(14px, env(safe-area-inset-bottom)); }
    .admin-panel { width: calc(100vw - 22px); max-height: calc(100vh - 24px); }
    .welcome { padding-top: 24px; }
    .welcome-photo { width: min(430px, 82%); max-height: 150px; }
    .composer-hint { display: none; }
    /* iOS Safari: anything under 16px triggers auto-zoom on focus */
    textarea, .phrase { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .shell-aura, .pixel-burst { display: none !important; }
    .ambient i, .topbar, .composer, .send-btn.sent, .content.streaming::after, .welcome, .welcome-photo, .welcome-letter, .welcome-letter img, .thought-fragment, .thinking-text::after, .think-mark .px, .photo-tile, .photo-tile img, .photo-tile.gen-reveal::after, .photo-tile.gen-reveal.is-loaded img, .photo-assemble, .photo-viewer, .photo-viewer-img, .gen-tile, .gen-frame, .gen-spill-canvas, .gen-frame::before, .gen-frame::after, .message.clearing, .model-pill, .model-pill.open .model-btn, .app, .sidebar, .sidebar > .side-glass, .side-glass::after, .sidebar.open > :not(.side-glow):not(.side-glass), .side-logo-btn, .side-glow, .side-glow i, .side-mode-blob, .side-backdrop, .chat-item {
        animation: none !important;
        transition: none !important;
    }
    .video-dock, .video-ref-item, .video-ref-card, .video-orbit-add,
    .video-generate-btn::after, .video-frame.pending, .video-ref-card.uploading, .mode-fade-in,
    .video-panel.entering .video-dock > *:not(.video-settings-pop),
    .video-panel.entering .video-orbit-hint,
    .video-panel.entering .video-right > .video-title,
    .video-panel.entering .video-empty,
    .video-panel.entering .video-item {
        animation: none !important;
    }
    .model-pill { transform: none; }
    .chat-del { opacity: 1; transform: none; }
    .photo-tile img { opacity: 1; filter: none; transform: none; }
}
/* ============ DRAG & DROP OVERLAY ============ */
.drop-overlay {
    position: fixed;
    inset: 0;
    z-index: 210;
    display: grid;
    place-items: center;
    padding: 26px;
    background: rgba(4, 4, 4, .52);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .22s ease, visibility 0s linear .22s;
    pointer-events: none;
}
.drop-overlay.active {
    opacity: 1;
    visibility: visible;
    transition: opacity .22s ease;
}
.drop-overlay-box {
    border-radius: 22px;
    padding: 46px 60px;
    background: rgba(14, 14, 14, .6);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, .12), 0 30px 90px rgba(0, 0, 0, .5);
    text-align: center;
    display: grid;
    justify-items: center;
    gap: 14px;
    transform: scale(.94) translateY(10px);
    transition: transform .28s cubic-bezier(.2, .7, .2, 1);
}
.drop-overlay.active .drop-overlay-box { transform: none; }
.drop-overlay-box::after {
    content: "";
    position: absolute;
    inset: 9px;
    border-radius: 15px;
    border: 1.5px dashed rgba(255, 255, 255, .22);
    pointer-events: none;
}
.drop-overlay-box svg { width: 30px; height: 30px; color: var(--text-2); }
.drop-overlay-box span {
    font-size: 11.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--text-2);
}
