/* ============================================================
   FILE: ./assets/css/app.css
   AURA / AresGPT — Full App Styles
   ============================================================ */

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

:root {
    --glass-bg:   rgba(255,255,255,0.055);
    --glass-bg-h: rgba(255,255,255,0.090);
    --glass-b:    rgba(255,255,255,0.10);
    --glass-bh:   rgba(255,255,255,0.18);
    --accent:     #a78bfa;
    --ar:         167,139,250;
    --a2:         #67e8f9;
    --a3:         #f472b6;
    --bg:         #07050f;
    --t1:         rgba(255,255,255,0.92);
    --t2:         rgba(255,255,255,0.52);
    --t3:         rgba(255,255,255,0.28);
    --success:    #4ade80;
    --danger:     #f87171;
    --font:       'Outfit', sans-serif;
    --mono:       'JetBrains Mono', monospace;
    --sb-radius:  20px;
    --main-radius:18px;
    --app-gap:    8px;
    --app-pad:    10px;
}

html, body { height: 100%; overflow: hidden; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--t1);
    display: flex;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* ── SVG sizing ──────────────────────────────────────────── */
svg { display: block; flex-shrink: 0; }
.logo-ic svg   { width: 24px; height: 24px; }
.btn-nc svg    { width: 14px; height: 14px; }
.ibt svg       { width: 14px; height: 14px; }
.ibts svg      { width: 14px; height: 14px; }
.sndb svg      { width: 14px; height: 14px; }
.scrb svg      { width: 12px; height: 12px; }
.aav svg       { width: 13px; height: 13px; }
.ci-ic svg     { width: 11px; height: 11px; }
.u-more-btn svg{ width: 14px; height: 14px; }
.umenu-item svg{ width: 14px; height: 14px; flex-shrink: 0; }
.msg-act svg   { width: 11px; height: 11px; flex-shrink: 0; }
.ci-act-btn svg{ width: 11px; height: 11px; }
.hdr-rename-btn svg { width: 13px; height: 13px; }
.sn-back svg   { width: 14px; height: 14px; }
.modal-title svg { width: 15px; height: 15px; }
.modal-close svg { width: 14px; height: 14px; }

/* ══════════════════════════════════════════════════════════
   BACKGROUND
   ══════════════════════════════════════════════════════════ */
.bgc {
    position: fixed; inset: 0;
    z-index: 0; overflow: hidden; pointer-events: none;
}
.blob {
    position: absolute; border-radius: 50%;
    filter: blur(80px); opacity: .55;
    animation: bd linear infinite;
}
.b1 { width:600px;height:600px;background:radial-gradient(circle,#3b1fa8,transparent 70%);top:-100px;left:-100px;animation-duration:28s; }
.b2 { width:500px;height:500px;background:radial-gradient(circle,#6b21a8,transparent 70%);top:30%;right:-80px;animation-duration:22s;animation-delay:-8s; }
.b3 { width:450px;height:450px;background:radial-gradient(circle,#0e4a6e,transparent 70%);bottom:-80px;left:30%;animation-duration:34s;animation-delay:-14s; }
.b4 { width:380px;height:380px;background:radial-gradient(circle,#4c1a6a,transparent 70%);bottom:10%;right:20%;animation-duration:26s;animation-delay:-5s; }

.noise {
    position: fixed; inset: 0; z-index: 1;
    pointer-events: none; opacity: .04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes bd {
    0%   { transform: translate(0,0)       scale(1); }
    33%  { transform: translate(60px,-40px) scale(1.08); }
    66%  { transform: translate(-40px,50px) scale(.95); }
    100% { transform: translate(0,0)       scale(1); }
}

/* ══════════════════════════════════════════════════════════
   APP SHELL
   ══════════════════════════════════════════════════════════ */
.app {
    position: relative; z-index: auto;
    display: flex; width: 100%; height: 100vh;
    min-width: 0;
    padding: var(--app-pad);
    gap: var(--app-gap);
}

/* ══════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════ */
.sidebar {
    width: 262px; flex-shrink: 0;
    display: flex; flex-direction: column;
    position: relative;
    background: linear-gradient(
            158deg,
            rgba(255,255,255,0.115) 0%,
            rgba(255,255,255,0.068) 48%,
            rgba(255,255,255,0.042) 100%
    );
    backdrop-filter: blur(56px) saturate(185%) brightness(107%);
    -webkit-backdrop-filter: blur(56px) saturate(185%) brightness(107%);
    border-radius: var(--sb-radius);
    border: 1px solid rgba(255,255,255,0.16);
    box-shadow:
            0 1px 2px  rgba(0,0,0,0.08),
            0 4px 12px rgba(0,0,0,0.22),
            0 16px 40px rgba(0,0,0,0.28),
            0 40px 80px rgba(0,0,0,0.22),
            inset 0  1px 0 rgba(255,255,255,0.26),
            inset 0 -1px 0 rgba(0,0,0,0.10),
            inset 1px 0 0 rgba(255,255,255,0.08),
            inset -1px 0 0 rgba(0,0,0,0.04);
    overflow: hidden;
    animation: sli .5s cubic-bezier(.34,1.2,.64,1) both;
}

/* Specular highlight */
.sidebar::before {
    content: '';
    position: absolute; inset: 0;
    border-radius: inherit;
    background: linear-gradient(
            148deg,
            rgba(255,255,255,0.13) 0%,
            rgba(255,255,255,0.03) 35%,
            transparent 60%
    );
    pointer-events: none;
    z-index: 0;
}

.sb-top, .divider, .sb-lbl, .chat-list, .sb-foot {
    position: relative; z-index: 1;
}

@keyframes sli {
    from { transform: translateX(-28px); opacity: 0; }
    to   { transform: translateX(0);     opacity: 1; }
}

/* ── Sidebar top ─────────────────────────────────────────── */
.sb-top { padding: 18px 14px 10px; }

.logo {
    display: flex; align-items: center; gap: 10px;
    padding: 0 6px; margin-bottom: 18px;
}
.logo-ic {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--a2));
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; color: white;
    box-shadow: 0 0 18px rgba(var(--ar),.45), inset 0 1px 0 rgba(255,255,255,.3);
}
.logo-n { font-size: 17px; font-weight: 650; letter-spacing: -.025em; }

/* New chat button */
.btn-nc {
    width: 100%; display: flex; align-items: center; gap: 9px;
    padding: 10px 14px; border-radius: 12px; cursor: pointer;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--t1); font-family: var(--font);
    font-size: 14px; font-weight: 500;
    transition: all .2s ease;
    position: relative; overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.12);
}
.btn-nc::after {
    content: ''; position: absolute; inset: -1px;
    border-radius: 13px;
    background: linear-gradient(135deg,rgba(var(--ar),.35),rgba(103,232,249,.25));
    opacity: 0; transition: opacity .3s; z-index: 0;
}
.btn-nc > * { position: relative; z-index: 1; }
.btn-nc:hover {
    background: rgba(255,255,255,0.11);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-nc:hover::after { opacity: 1; }
.btn-nc:active { transform: scale(.98) translateY(0); }

/* ── Divider & label ─────────────────────────────────────── */
.divider {
    height: 1px;
    background: rgba(255,255,255,.07);
    margin: 12px 0 8px;
    position: relative; z-index: 1;
}

.sb-lbl {
    font-size: 10px; font-weight: 600; letter-spacing: .09em;
    color: var(--t3); text-transform: uppercase;
    padding: 0 20px; margin-bottom: 6px;
    display: flex; align-items: center; gap: 5px;
}
.sb-lbl svg { width: 10px; height: 10px; opacity: .7; }

/* ── Chat list ───────────────────────────────────────────── */
.chat-list {
    flex: 1; overflow-y: auto; padding: 0 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.1) transparent;
}
.chat-list::-webkit-scrollbar { width: 3px; }
.chat-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.12); border-radius: 2px;
}

/* Chat item */
.ci {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 10px; border-radius: 11px; cursor: pointer;
    transition: background .15s, border-color .15s;
    margin-bottom: 2px;
    border: 1px solid transparent;
    position: relative;
    min-width: 0;
}
.ci:hover {
    background: rgba(255,255,255,.07);
    border-color: rgba(255,255,255,.08);
}
.ci.active {
    background: rgba(var(--ar),.13);
    border-color: rgba(var(--ar),.22);
    box-shadow: inset 3px 0 0 var(--accent);
}

.ci-ic {
    flex-shrink: 0;
    color: var(--t3);
    display: flex; align-items: center;
}
.ci.active .ci-ic { color: var(--accent); }

.ci-t {
    font-size: 13px; color: var(--t2);
    white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; flex: 1; min-width: 0;
    transition: color .15s;
}
.ci.active .ci-t { color: var(--t1); }
.ci:hover .ci-t   { color: var(--t1);max-width: 117px; }

.ci-d {
    font-size: 10px; color: var(--t3);
    flex-shrink: 0; white-space: nowrap;
    transition: opacity .15s;
}

/* ── Chat item action buttons (appear on hover) ──────────── */
.ci-actions {
    display: none;
    align-items: center;
    gap: 2px;
    position: absolute;
    right: 3px; top: 50%;
    transform: translateY(-50%);
    padding-left: 18px;
    border-radius: 0 8px 8px 0;
}
.ci:hover .ci-actions { display: flex; }

.ci-act-btn {
    width: 22px; height: 22px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,.09);
    background: rgba(255,255,255,.07);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--t3);
    transition: all .15s;
    flex-shrink: 0;
    padding: 0;
}
.ci-act-btn:hover {
    background: rgba(255,255,255,.14);
    border-color: rgba(255,255,255,.18);
    color: var(--t1);
    transform: scale(1.1);
}
.ci-act-btn:active { transform: scale(.92); }
.ci-act-btn.danger:hover {
    background: rgba(248,113,113,.18);
    border-color: rgba(248,113,113,.3);
    color: var(--danger);
}

/* Empty state */
.cl-empty {
    text-align: center;
    padding: 32px 16px;
    font-size: 13px;
    color: var(--t3);
    line-height: 1.6;
}

/* ── Sidebar footer ──────────────────────────────────────── */
.sb-foot {
    padding: 10px 14px 18px;
    border-top: 1px solid rgba(255,255,255,.06);
    position: relative; z-index: 1;
}

.urow {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: 11px; cursor: pointer;
    transition: background .15s;
    position: relative;
}
.urow:hover { background: rgba(255,255,255,.06); }

.uav {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, #f472b6, #a78bfa);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: #fff;
    box-shadow: 0 2px 8px rgba(244,114,182,.3);
    user-select: none;
}

.u-info { flex: 1; min-width: 0; }
.un     { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uplan  { font-size: 10px; color: var(--accent); margin-top: 1px; letter-spacing: .04em; }

.u-more-btn {
    width: 28px; height: 28px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,.09);
    background: rgba(255,255,255,.05);
    cursor: pointer;
    color: var(--t3);
    transition: all .15s;
    flex-shrink: 0;
}
.u-more-btn:hover {
    background: rgba(255,255,255,.12);
    border-color: rgba(255,255,255,.16);
    color: var(--t1);
    transform: scale(1.08);
}
.u-more-btn:active { transform: scale(.92); }

/* ══════════════════════════════════════════════════════════
   USER MINI MENU (popover)
   ══════════════════════════════════════════════════════════ */
.umenu {
    position: fixed;
    z-index: 500;
    width: 210px;
    background: linear-gradient(
            158deg,
            rgba(30, 22, 52, .97) 0%,
            rgba(14, 10, 28, .99) 100%
    );
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 15px;
    box-shadow:
            0 4px 20px rgba(0,0,0,.4),
            0 16px 50px rgba(0,0,0,.5),
            inset 0 1px 0 rgba(255,255,255,.12);
    padding: 6px;
    /* hidden by default */
    opacity: 0;
    pointer-events: none;
    transform: scale(.93) translateY(8px);
    transform-origin: bottom left;
    transition: opacity .2s cubic-bezier(.34,1.56,.64,1),
    transform .2s cubic-bezier(.34,1.56,.64,1);
}
.umenu.show {
    opacity: 1;
    pointer-events: all;
    transform: scale(1) translateY(0);
}

.umenu-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13.5px; font-weight: 450;
    color: var(--t2);
    transition: background .15s, color .15s;
    user-select: none;
}
.umenu-item:hover {
    background: rgba(255,255,255,.08);
    color: var(--t1);
}
.umenu-item:hover svg { color: var(--accent); }
.umenu-item:active { transform: scale(.97); }

.umenu-item.danger       { color: var(--danger); }
.umenu-item.danger svg   { color: var(--danger) !important; }
.umenu-item.danger:hover { background: rgba(248,113,113,.12); color: var(--danger); }

.umenu-divider {
    height: 1px;
    background: rgba(255,255,255,.07);
    margin: 5px 0;
}

/* ══════════════════════════════════════════════════════════
   MAIN PANEL
   ══════════════════════════════════════════════════════════ */
.main {
    flex: 1; display: flex; flex-direction: column;
    overflow: hidden; min-width: 0;
    border-radius: var(--main-radius);
    background: rgba(255,255,255,0.028);
    backdrop-filter: blur(30px) saturate(145%);
    -webkit-backdrop-filter: blur(30px) saturate(145%);
    border: 1px solid rgba(255,255,255,0.075);
    box-shadow:
            0 2px 8px  rgba(0,0,0,0.12),
            0 8px 32px rgba(0,0,0,0.18),
            inset 0 1px 0 rgba(255,255,255,0.09);
}

/* ══════════════════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════════════════ */
.hdr {
    height: 56px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 10px;
    background: rgba(255,255,255,.025);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,.06);
    transition: border-color .3s, box-shadow .3s;
    animation: slt .45s cubic-bezier(.34,1.2,.64,1) .1s both;
}
.hdr.scrolled {
    border-bottom-color: rgba(255,255,255,.1);
    box-shadow: 0 1px 20px rgba(0,0,0,.25);
}
@keyframes slt {
    from { transform: translateY(-14px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

.hdr-l {
    display: flex; align-items: center; gap: 8px;
    min-width: 0; flex: 1;
}
.hdr-t {
    font-size: 15px; font-weight: 500;
    color: var(--t2); letter-spacing: -.01em;
    transition: opacity .15s;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 300px;
}

/* Rename button next to header title */
.hdr-rename-btn {
    width: 26px; height: 26px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--t3);
    transition: all .15s;
    flex-shrink: 0;
}
.hdr-rename-btn:hover {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.1);
    color: var(--t2);
    transform: scale(1.08);
}
.hdr-rename-btn:active { transform: scale(.92); }

.hdr-a { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Icon buttons (header) ───────────────────────────────── */
.ibt {
    width: 34px; height: 34px; border-radius: 50%;
    min-width: 34px;
    border: 1px solid rgba(255,255,255,.09);
    background: rgba(255,255,255,.05);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .2s;
    color: var(--t2);
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.ibt:hover {
    background: rgba(255,255,255,.1);
    color: var(--t1);
    transform: scale(1.08);
    border-color: rgba(255,255,255,.16);
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.ibt:active { transform: scale(.92); }

/* Share active (public link enabled) */
.ibt.share-active {
    background: rgba(74,222,128,.12);
    border-color: rgba(74,222,128,.3);
    color: var(--success);
    box-shadow: 0 0 12px rgba(74,222,128,.2), 0 2px 8px rgba(0,0,0,.15);
}
.ibt.share-active:hover {
    background: rgba(74,222,128,.22);
    border-color: rgba(74,222,128,.45);
    box-shadow: 0 0 18px rgba(74,222,128,.3), 0 4px 12px rgba(0,0,0,.2);
}

/* ══════════════════════════════════════════════════════════
   FEED
   ══════════════════════════════════════════════════════════ */
.fw {
    flex: 1; overflow-y: auto; overflow-x: hidden;
    position: relative; min-width: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.1) transparent;
}
.fw::-webkit-scrollbar { width: 4px; }
.fw::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

.feed {
    max-width: 720px; margin: 0 auto;
    padding: 28px 24px 12px;
    display: flex; flex-direction: column; gap: 6px;
    animation: ffi .5s ease .25s both;
    min-width: 0;
}
@keyframes ffi {
    from { opacity: 0; filter: blur(6px); }
    to   { opacity: 1; filter: blur(0); }
}

/* ══════════════════════════════════════════════════════════
   WELCOME
   ══════════════════════════════════════════════════════════ */
.wlc {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    min-height: calc(100vh - 56px - 130px);
    text-align: center; padding: 40px 24px;
}
.wlc-t {
    font-size: 38px; font-weight: 700;
    letter-spacing: -.035em; line-height: 1.1;
    background: linear-gradient(135deg, #fff 0%, var(--accent) 50%, var(--a2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: wta .6s cubic-bezier(.34,1.4,.64,1) .3s both;
}
.wlc-s {
    font-size: 16px; color: var(--t2);
    margin-top: 10px; font-weight: 300;
    animation: wta .6s cubic-bezier(.34,1.4,.64,1) .42s both;
}
@keyframes wta {
    from { opacity: 0; transform: translateY(24px); filter: blur(8px); }
    to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}

.suggs {
    display: flex; flex-wrap: wrap; gap: 10px;
    justify-content: center; margin-top: 36px;
}
.sug {
    padding: 10px 18px; border-radius: 50px;
    background: rgba(255,255,255,.055);
    border: 1px solid rgba(255,255,255,.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    font-size: 13px; color: var(--t2);
    cursor: pointer; transition: all .2s; white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,.15), inset 0 1px 0 rgba(255,255,255,.1);
    animation: wta .5s cubic-bezier(.34,1.4,.64,1) both;
}
.sug:hover {
    background: rgba(255,255,255,.09);
    color: var(--t1);
    border-color: rgba(var(--ar),.35);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.14);
}
.sug:active { transform: translateY(0) scale(.97); }

/* ══════════════════════════════════════════════════════════
   MESSAGES
   ══════════════════════════════════════════════════════════ */
.mr {
    display: flex; align-items: flex-end; gap: 10px;
    margin-bottom: 10px; min-width: 0;
}
.mr.user { justify-content: flex-end; }
.mr.ai   { justify-content: flex-start; }

/* AI avatar */
.aav {
    width: 30px; height: 30px; border-radius: 50%;
    flex-shrink: 0; margin-bottom: 2px;
    background: linear-gradient(135deg, var(--accent), var(--a2));
    display: flex; align-items: center; justify-content: center;
    color: white;
    box-shadow: 0 0 14px rgba(var(--ar),.4), 0 2px 6px rgba(0,0,0,.25);
}

/* Bubble base */
.bbl {
    max-width: 68%;
    padding: 12px 16px 28px;   /* bottom padding for action buttons */
    line-height: 1.65; font-size: 14.5px;
    animation: mi .38s cubic-bezier(.34,1.56,.64,1) both;
    position: relative;
    min-width: 0; overflow: visible;
    word-break: break-word;
}
@keyframes mi {
    from { opacity: 0; transform: translateY(14px) scale(.96); filter: blur(4px); }
    to   { opacity: 1; transform: translateY(0)    scale(1);   filter: blur(0); }
}

.bbl.user {
    background: rgba(var(--ar),.18);
    border: 1px solid rgba(var(--ar),.28);
    border-radius: 20px 20px 4px 20px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 4px 20px rgba(0,0,0,.3);
}
.bbl.ai {
    background: rgba(255,255,255,.055);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 20px 20px 20px 4px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 4px 24px rgba(0,0,0,.3);
}

/* Timestamp */
.bbl .ts {
    font-size: 10px; color: var(--t3);
    display: block; margin-top: 6px;
    opacity: 0; transition: opacity .2s;
}
.bbl:hover .ts { opacity: 1; }

/* Inline markdown */
.bbl strong { font-weight: 650; }
.bbl em     { font-style: italic; }
.bbl code {
    background: rgba(255,255,255,.08);
    padding: 1px 5px; border-radius: 4px;
    font-family: var(--mono); font-size: 12px;
}

/* ── Message action buttons ──────────────────────────────── */
.msg-actions {
    display: none;
    align-items: center;
    gap: 4px;
    position: absolute;
    bottom: 6px; right: 10px;
    z-index: 5;
}
/* Show on bubble hover */
.bbl:hover .msg-actions { display: flex; }

.msg-act {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.06);
    backdrop-filter: blur(8px);
    color: var(--t3);
    font-size: 11px; font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    line-height: 1;
}
.msg-act:hover {
    background: rgba(255,255,255,.14);
    border-color: rgba(255,255,255,.2);
    color: var(--t1);
    transform: translateY(-1px);
}
.msg-act:active { transform: scale(.94); }

/* ══════════════════════════════════════════════════════════
   EDIT MESSAGE
   ══════════════════════════════════════════════════════════ */
.edit-msg-wrap {
    background: rgba(var(--ar),.1);
    border: 1px solid rgba(var(--ar),.25);
    border-radius: 20px 20px 4px 20px;
    padding: 12px 14px;
    display: flex; flex-direction: column; gap: 8px;
    max-width: 68%;
    margin-left: auto;
    animation: mi .3s cubic-bezier(.34,1.56,.64,1) both;
}
.edit-msg-ta {
    width: 100%;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 10px;
    padding: 9px 12px;
    color: var(--t1);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    outline: none;
    resize: none;
    min-height: 60px;
    transition: border-color .2s, box-shadow .2s;
}
.edit-msg-ta:focus {
    border-color: rgba(var(--ar),.5);
    box-shadow: 0 0 0 3px rgba(var(--ar),.12);
}
.edit-actions {
    display: flex; gap: 6px; justify-content: flex-end;
}
.edit-btn {
    padding: 6px 14px;
    border-radius: 9px;
    font-size: 12px; font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    border: 1px solid;
    transition: all .15s;
    line-height: 1.4;
}
.edit-btn.save {
    background: rgba(var(--ar),.2);
    border-color: rgba(var(--ar),.35);
    color: var(--accent);
}
.edit-btn.save:hover {
    background: rgba(var(--ar),.35);
    border-color: rgba(var(--ar),.5);
    color: #fff;
    transform: translateY(-1px);
}
.edit-btn.cancel {
    background: rgba(255,255,255,.05);
    border-color: rgba(255,255,255,.12);
    color: var(--t2);
}
.edit-btn.cancel:hover {
    background: rgba(255,255,255,.1);
    color: var(--t1);
}

/* ══════════════════════════════════════════════════════════
   CODE BLOCK
   ══════════════════════════════════════════════════════════ */
.cb {
    margin: 10px 0; border-radius: 12px; overflow: hidden;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(0,0,0,.38);
    backdrop-filter: blur(10px);
    width: 100%; max-width: 100%;
}
.cbh {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 14px;
    background: rgba(255,255,255,.05);
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.clng {
    font-size: 11px; color: var(--a2);
    font-family: var(--mono); font-weight: 500;
}
.cpb {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11px; color: var(--t2);
    cursor: pointer; padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.05);
    transition: all .15s; font-family: var(--font);
}
.cpb:hover { background: rgba(255,255,255,.1); color: var(--t1); }
.cpb.copied { color: var(--success); border-color: rgba(74,222,128,.3); }
.cpb svg { width: 11px; height: 11px; }

.cbb {
    padding: 14px 16px; overflow-x: auto;
    font-family: var(--mono); font-size: 12.5px; line-height: 1.7;
    color: rgba(255,255,255,.82); max-width: 100%;
}
.cbb::-webkit-scrollbar { height: 4px; }
.cbb::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }
.cbb pre { white-space: pre; overflow-x: visible; min-width: 0; margin: 0; }

/* Syntax tokens */
.kw  { color: #c084fc; }
.fn  { color: #67e8f9; }
.str { color: #86efac; }
.cm  { color: #6b7280; font-style: italic; }
.num { color: #fbbf24; }
.var { color: #e2e8f0; }

/* ══════════════════════════════════════════════════════════
   MARKDOWN TABLE
   ══════════════════════════════════════════════════════════ */
.tbl-wrap {
    width: 100%; overflow-x: auto;
    margin: 10px 0;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(0,0,0,.25);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.1) transparent;
}
.tbl-wrap::-webkit-scrollbar { height: 4px; }
.tbl-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

.md-table {
    width: 100%; border-collapse: collapse;
    font-size: 13.5px; line-height: 1.5;
}
.md-table thead tr {
    background: rgba(var(--ar),.08);
    border-bottom: 1px solid rgba(var(--ar),.2);
}
.md-table th {
    padding: 10px 16px;
    font-size: 11px; font-weight: 600;
    letter-spacing: .06em; text-transform: uppercase;
    color: var(--accent); white-space: nowrap;
    text-align: left;
}
.md-table td {
    padding: 9px 16px;
    color: var(--t2);
    border-bottom: 1px solid rgba(255,255,255,.05);
    vertical-align: middle;
}
.md-table tbody tr:last-child td { border-bottom: none; }
.md-table tbody tr:hover td {
    background: rgba(255,255,255,.03);
    color: var(--t1);
}
.md-table tbody tr:hover td:first-child {
    border-radius: 0;
}
.md-table strong { color: var(--t1); font-weight: 600; }

/* ══════════════════════════════════════════════════════════
   IMAGE GENERATION BLOCK
   ══════════════════════════════════════════════════════════ */
.igb {
    margin: 10px 0; border-radius: 14px; overflow: hidden;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(0,0,0,.25); width: 100%;
}
.igh {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px;
    font-size: 12px; color: var(--t2);
    border-bottom: 1px solid rgba(255,255,255,.07);
    background: rgba(255,255,255,.04);
}
.igh svg { width: 12px; height: 12px; color: var(--accent); }
.igh-st { font-size: 11px; color: var(--t3); margin-left: auto; }

.igc {
    width: 100%; aspect-ratio: 16/9; min-height: 180px;
    position: relative; background: #0a0812;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.shim {
    position: absolute; inset: 0;
    background: linear-gradient(
            105deg,
            rgba(255,255,255,0) 0%,
            rgba(167,139,250,.08) 50%,
            rgba(255,255,255,0) 100%
    );
    background-size: 200% 100%;
    animation: shim 1.8s ease-in-out infinite;
}
@keyframes shim {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.igph {
    display: flex; flex-direction: column;
    align-items: center; gap: 12px; z-index: 1;
}
.igph svg { opacity: .2; width: 40px; height: 40px; }
.pwrap { width: 200px; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.ptrack { width: 100%; height: 3px; background: rgba(255,255,255,.08); border-radius: 2px; overflow: hidden; }
.pfill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--a2));
    border-radius: 2px; width: 0%;
    transition: width .3s ease;
    box-shadow: 0 0 8px rgba(var(--ar),.6);
}
.ptxt { font-size: 11px; color: var(--t3); }
.igr {
    width: 100%; height: 100%; object-fit: cover;
    opacity: 0; transition: opacity .8s ease;
    position: absolute; inset: 0;
}
.igr.show { opacity: 1; }
.igf {
    padding: 8px 14px; font-size: 11px; color: var(--t3);
    display: flex; align-items: center; justify-content: space-between;
    border-top: 1px solid rgba(255,255,255,.07);
}

/* ══════════════════════════════════════════════════════════
   TYPING INDICATOR
   ══════════════════════════════════════════════════════════ */
.tyb {
    background: rgba(255,255,255,.055);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 20px 20px 20px 4px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 14px 18px;
    display: inline-flex; gap: 5px; align-items: center;
    animation: mi .3s ease both;
}
.dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: rgba(255,255,255,.4);
    animation: bc 1.2s ease-in-out infinite;
}
.dot:nth-child(2) { animation-delay: .2s; }
.dot:nth-child(3) { animation-delay: .4s; }
@keyframes bc {
    0%,100% { transform: translateY(0);   opacity: .4; }
    50%      { transform: translateY(-6px); opacity: 1; }
}

/* Blinking cursor */
.cur {
    display: inline-block; width: 2px; height: 1em;
    background: var(--accent); border-radius: 1px;
    vertical-align: text-bottom; margin-left: 2px;
    animation: blk 1s step-end infinite;
}
@keyframes blk { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

/* ══════════════════════════════════════════════════════════
   INPUT ZONE
   ══════════════════════════════════════════════════════════ */
.iz {
    flex-shrink: 0;
    padding: 10px 22px 22px;
    background: linear-gradient(to top, rgba(7,5,15,.94) 58%, transparent);
    animation: slb .5s cubic-bezier(.34,1.2,.64,1) .35s both;
}
@keyframes slb {
    from { transform: translateY(16px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.iw {
    max-width: 720px; margin: 0 auto;
    position: relative; display: flex; align-items: flex-end; gap: 8px;
}

.iex { display: flex; gap: 6px; padding-bottom: 11px; }

/* Attach / toolbar buttons */
.ibts {
    width: 38px; height: 38px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.06);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--t2);
    transition: all .2s;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.ibts:hover {
    background: rgba(255,255,255,.11);
    color: var(--t1);
    transform: scale(1.08);
    border-color: rgba(255,255,255,.18);
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.ibts:active { transform: scale(.92); }

.taw { flex: 1; position: relative; }

textarea {
    width: 100%; min-height: 52px; max-height: 180px;
    padding: 14px 50px 14px 18px;
    border-radius: 18px; resize: none; overflow-y: auto;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--t1); font-family: var(--font);
    font-size: 15px; line-height: 1.5;
    outline: none;
    transition: border-color .25s, box-shadow .25s;
    scrollbar-width: none;
    box-shadow: 0 2px 8px rgba(0,0,0,.15), inset 0 1px 0 rgba(255,255,255,.08);
}
textarea::placeholder { color: var(--t3); }
textarea:focus {
    border-color: rgba(var(--ar),.5);
    box-shadow: 0 0 0 3px rgba(var(--ar),.12),
    0 2px 8px rgba(0,0,0,.18),
    inset 0 1px 0 rgba(255,255,255,.1);
}
textarea::-webkit-scrollbar { display: none; }

/* Send / Stop button */
.sndb {
    position: absolute; right: 8px; bottom: 12px;
    width: 36px; height: 36px; border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.08);
    color: var(--t2);
    transition: all .25s;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.sndb:disabled {
    opacity: .35; cursor: default;
    pointer-events: none;
}
.sndb.active {
    background: var(--accent);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 0 24px rgba(var(--ar),.5), 0 4px 12px rgba(0,0,0,.25);
}
.sndb.active:hover { transform: scale(1.1); }
.sndb:active:not(:disabled) { transform: scale(.9); }

/* Stop mode */
.sndb.stop-mode {
    background: rgba(248,113,113,.15);
    border-color: rgba(248,113,113,.35);
    color: var(--danger);
    box-shadow: 0 0 16px rgba(248,113,113,.2), 0 2px 8px rgba(0,0,0,.2);
}
.sndb.stop-mode:hover {
    background: rgba(248,113,113,.28);
    transform: scale(1.08);
}

.hint {
    text-align: center;
    font-size: 11px; color: var(--t3);
    margin-top: 10px;
}

/* ══════════════════════════════════════════════════════════
   SCROLL-TO-BOTTOM
   ══════════════════════════════════════════════════════════ */
.scrb {
    position: absolute; bottom: 16px; left: 50%;
    transform: translateX(-50%);
    width: 32px; height: 32px; border-radius: 50%;
    cursor: pointer;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex; align-items: center; justify-content: center;
    color: var(--t2);
    opacity: 0; pointer-events: none;
    transition: all .25s; z-index: 10;
}
.scrb.show { opacity: 1; pointer-events: all; }
.scrb:hover { background: rgba(255,255,255,.18); color: var(--t1); }

/* ══════════════════════════════════════════════════════════
   MODALS
   ══════════════════════════════════════════════════════════ */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    opacity: 0; pointer-events: none;
    transition: opacity .25s;
}
.modal-backdrop.show {
    opacity: 1; pointer-events: all;
}

.modal-box {
    width: 100%; max-width: 480px;
    background: linear-gradient(
            158deg,
            rgba(28, 20, 48, .97) 0%,
            rgba(12, 8, 24, .99) 100%
    );
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 20px;
    box-shadow:
            0 8px 32px rgba(0,0,0,.5),
            0 32px 80px rgba(0,0,0,.4),
            inset 0 1px 0 rgba(255,255,255,.18);
    overflow: hidden;
    transform: translateY(24px) scale(.96);
    transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.modal-backdrop.show .modal-box {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.03);
}
.modal-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; font-weight: 600; color: var(--t1);
}
.modal-close {
    width: 28px; height: 28px; border-radius: 8px;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.05);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--t2);
    transition: all .15s;
}
.modal-close:hover {
    background: rgba(255,255,255,.12);
    border-color: rgba(255,255,255,.18);
    color: var(--t1);
    transform: scale(1.08);
}
.modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.1) transparent;
}
.modal-body::-webkit-scrollbar { width: 4px; }
.modal-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 2px; }

/* ── Share modal ─────────────────────────────────────────── */
.share-toggle-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    transition: border-color .2s;
}
.share-toggle-row:has(.toggle-btn.on) {
    border-color: rgba(74,222,128,.2);
    background: rgba(74,222,128,.04);
}
.share-toggle-label { font-size: 14px; font-weight: 500; margin-bottom: 3px; }
.share-toggle-sub   { font-size: 12px; color: var(--t3); line-height: 1.4; }

/* Toggle switch */
.toggle-btn {
    width: 44px; height: 26px; border-radius: 13px;
    flex-shrink: 0;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.14);
    cursor: pointer;
    position: relative;
    transition: all .25s;
}
.toggle-btn.on {
    background: var(--success);
    border-color: var(--success);
    box-shadow: 0 0 14px rgba(74,222,128,.35);
}
.toggle-knob {
    position: absolute; top: 3px; left: 3px;
    width: 18px; height: 18px; border-radius: 50%;
    background: rgba(255,255,255,.6);
    transition: all .25s cubic-bezier(.34,1.56,.64,1);
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.toggle-btn.on .toggle-knob {
    left: 21px;
    background: #fff;
}

.share-link-row { margin-top: 12px; animation: wta .3s ease both; }
.share-link-box {
    display: flex; align-items: center; gap: 8px;
    background: rgba(74,222,128,.05);
    border: 1px solid rgba(74,222,128,.2);
    border-radius: 12px; padding: 10px 14px;
    overflow: hidden;
}
.share-link-text {
    flex: 1; font-family: var(--mono); font-size: 12px;
    color: var(--success); overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
}
.share-copy-btn {
    flex-shrink: 0; padding: 6px 14px;
    border-radius: 8px;
    background: rgba(74,222,128,.15);
    border: 1px solid rgba(74,222,128,.3);
    color: var(--success); font-size: 12px;
    font-weight: 600; font-family: var(--font);
    cursor: pointer; transition: all .15s; white-space: nowrap;
}
.share-copy-btn:hover {
    background: rgba(74,222,128,.28);
    transform: scale(1.04);
}
.share-link-hint {
    font-size: 11px; color: var(--t3); margin-top: 8px; line-height: 1.5;
}

/* ── Chat settings modal ─────────────────────────────────── */
.cs-stat-row {
    display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap;
}
.cs-stat {
    flex: 1; min-width: 90px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px; padding: 12px 14px;
    display: flex; flex-direction: column; gap: 4px;
    transition: border-color .15s;
}
.cs-stat:hover { border-color: rgba(var(--ar),.25); }
.cs-stat-val { font-size: 22px; font-weight: 700; color: var(--accent); }
.cs-stat-lbl { font-size: 11px; color: var(--t3); }

.cs-section-label {
    font-size: 11px; font-weight: 600;
    color: var(--t3); letter-spacing: .07em;
    text-transform: uppercase; margin: 14px 0 8px;
}
.cs-file-list { display: flex; flex-direction: column; gap: 6px; }
.cs-file {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 10px;
    font-size: 13px; color: var(--t2);
    transition: background .15s;
}
.cs-file:hover { background: rgba(255,255,255,.07); color: var(--t1); }
.cs-delete-btn {
    width: 100%; margin-top: 16px; padding: 11px;
    background: rgba(248,113,113,.08);
    border: 1px solid rgba(248,113,113,.2);
    color: var(--danger); border-radius: 12px;
    cursor: pointer; font-family: var(--font);
    font-size: 14px; font-weight: 500;
    transition: all .2s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.cs-delete-btn:hover {
    background: rgba(248,113,113,.18);
    border-color: rgba(248,113,113,.35);
    transform: translateY(-1px);
}
.cs-delete-btn svg{width: 16px;}
.cs-loading {
    text-align: center; padding: 36px;
    color: var(--t3); font-size: 13px;
}

/* ── Rename modal input ──────────────────────────────────── */
.rename-inp {
    width: 100%; padding: 12px 14px;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 12px; color: var(--t1);
    font-family: var(--font); font-size: 15px; outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.rename-inp:focus {
    border-color: rgba(var(--ar),.5);
    box-shadow: 0 0 0 3px rgba(var(--ar),.12);
}

/* ══════════════════════════════════════════════════════════
   AUTH PAGE STYLES  (used by auth-layout.php)
   ══════════════════════════════════════════════════════════ */
body.auth-body {
    overflow: auto;
    display: block;
}
.auth-center {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    min-height: 100vh; padding: 32px 16px;
    gap: 20px;
    position: relative; z-index: 2;
}
.auth-logo {
    display: flex; align-items: center; gap: 12px;
    animation: wta .5s cubic-bezier(.34,1.4,.64,1) both;
}
.auth-card {
    width: 100%; max-width: 420px;
    background: linear-gradient(
            158deg,
            rgba(255,255,255,.11) 0%,
            rgba(255,255,255,.06) 50%,
            rgba(255,255,255,.04) 100%
    );
    backdrop-filter: blur(56px) saturate(185%);
    -webkit-backdrop-filter: blur(56px) saturate(185%);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 22px;
    box-shadow:
            0 8px 40px rgba(0,0,0,.35),
            0 40px 80px rgba(0,0,0,.25),
            inset 0 1px 0 rgba(255,255,255,.22);
    overflow: hidden;
    animation: wta .6s cubic-bezier(.34,1.4,.64,1) .1s both;
}
.auth-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.auth-tab {
    flex: 1; padding: 16px;
    background: none; border: none;
    color: var(--t2); font-family: var(--font);
    font-size: 14px; font-weight: 500;
    cursor: pointer; transition: all .2s;
    position: relative;
}
.auth-tab::after {
    content: ''; position: absolute;
    bottom: 0; left: 20%; right: 20%;
    height: 2px; background: var(--accent);
    border-radius: 1px;
    opacity: 0; transition: opacity .2s;
}
.auth-tab.active           { color: var(--t1); }
.auth-tab.active::after    { opacity: 1; }
.auth-tab:hover            { color: var(--t1); background: rgba(255,255,255,.04); }

.auth-form { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.auth-form.hidden { display: none; }

.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field label {
    font-size: 12px; color: var(--t2);
    font-weight: 500; letter-spacing: .02em;
}
.auth-field input {
    width: 100%; padding: 11px 14px;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 12px; color: var(--t1);
    font-family: var(--font); font-size: 15px; outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.auth-field input::placeholder { color: var(--t3); }
.auth-field input:focus {
    border-color: rgba(var(--ar),.5);
    box-shadow: 0 0 0 3px rgba(var(--ar),.12);
}

.auth-error {
    font-size: 13px; color: var(--danger);
    min-height: 18px;
}
.auth-success {
    font-size: 13px; color: var(--success);
    min-height: 18px;
}

.auth-btn {
    width: 100%; padding: 13px;
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(var(--ar),.28), rgba(103,232,249,.18));
    border: 1px solid rgba(var(--ar),.3);
    color: var(--t1); font-family: var(--font);
    font-size: 15px; font-weight: 600;
    cursor: pointer; transition: all .2s;
    box-shadow: 0 2px 12px rgba(var(--ar),.18), inset 0 1px 0 rgba(255,255,255,.1);
    display: flex; align-items: center; justify-content: center;
}
.auth-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(var(--ar),.42), rgba(103,232,249,.28));
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(var(--ar),.28);
}
.auth-btn:active:not(:disabled) { transform: scale(.98); }
.auth-btn:disabled { opacity: .6; cursor: default; }

.auth-footer { font-size: 12px; color: var(--t3); animation: wta .6s ease .3s both; }

/* ── Settings page ───────────────────────────────────────── */
.settings-wrap { max-width: 600px; margin: 0 auto; padding: 32px 16px 60px; position: relative; z-index: 2; }
.settings-nav  { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.sn-back {
    display: flex; align-items: center; gap: 8px;
    color: var(--t2); text-decoration: none;
    font-size: 13px; font-weight: 500;
    padding: 8px 14px; border-radius: 10px;
    border: 1px solid rgba(255,255,255,.09);
    background: rgba(255,255,255,.05);
    transition: all .2s;
}
.sn-back:hover { background: rgba(255,255,255,.1); color: var(--t1); transform: translateX(-2px); }
.sn-title { font-size: 18px; font-weight: 600; }

.settings-card {
    background: linear-gradient(158deg, rgba(255,255,255,.1) 0%, rgba(255,255,255,.05) 100%);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 20px; overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.18);
}
.sc-section { padding: 22px 24px; }
.sc-label {
    font-size: 11px; font-weight: 600;
    letter-spacing: .08em; color: var(--t3);
    text-transform: uppercase; margin-bottom: 14px;
}
.sc-avatar  { display: flex; align-items: center; gap: 16px; }
.sc-divider { height: 1px; background: rgba(255,255,255,.07); }

/* ══════════════════════════════════════════════════════════
   MOBILE OVERLAY
   ══════════════════════════════════════════════════════════ */
.ov {
    position: fixed; inset: 0; z-index: 99;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(6px);
    display: none;
}
.ov.show { display: block; }

/* ══════════════════════════════════════════════════════════
   MOBILE  ≤ 768px
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .app { padding: 0; gap: 0; }

    .sidebar {
        position: fixed;
        left: 10px; top: 10px; bottom: 10px;
        z-index: 100; border-radius: 20px;
        transform: translateX(calc(-100% - 20px));
        transition: transform .35s cubic-bezier(.34,1.2,.64,1);
        animation: none; width: 285px;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow:
                0 8px 40px rgba(0,0,0,.55),
                0 32px 80px rgba(0,0,0,.4),
                inset 0 1px 0 rgba(255,255,255,.22);
    }

    .main { border-radius: 0; }
    .mmb  { display: flex !important; }

    .feed  { padding: 20px 14px 12px; }
    .bbl   { max-width: 88%; }
    .iz    { padding: 10px 14px 20px; }
    .wlc-t { font-size: 26px; }
    .suggs { flex-direction: column; align-items: stretch; }
    .sug   { text-align: center; }

    .umenu { left: 16px !important; bottom: 80px !important; }
}
.mmb { display: none; }

/* ══════════════════════════════════════════════════════════
   REDUCED MOTION
   ══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

/* ── Feed wrapper ────────────────────────────────────────── */

/* fw-wrap — занимает всё свободное место, position:relative
   чтобы scrb мог позиционироваться внутри него абсолютно     */
.fw-wrap {
    flex: 1;
    position: relative;   /* якорь для .scrb */
    overflow: hidden;     /* не даём вылезть */
    min-height: 0;        /* важно для flex-детей */
}

/* fw — сам скроллируемый контейнер, занимает весь fw-wrap */
.fw {
    position: absolute;   /* растягиваем на весь fw-wrap */
    inset: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.1) transparent;
}
.fw::-webkit-scrollbar       { width: 4px; }
.fw::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

/* scrb — кнопка скролла вниз.
   Позиционируется относительно fw-wrap (не fw!),
   поэтому не уезжает со скроллом.
   Отступ снизу учитывает зону ввода (~130px) + небольшой отступ */
.scrb {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;

    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;

    background: rgba(20, 14, 40, .85);
    border: 1px solid rgba(255,255,255,.15);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);

    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--t2);

    /* скрыт по умолчанию */
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s, background .15s;

    box-shadow:
            0 2px 8px  rgba(0,0,0,.3),
            0 0  0 1px rgba(255,255,255,.06) inset;
}
.scrb.show {
    opacity: 1;
    pointer-events: all;
}
.scrb:hover {
    background: rgba(var(--ar), .2);
    border-color: rgba(var(--ar), .35);
    color: var(--t1);
    transform: translateX(-50%) scale(1.1);
    box-shadow:
            0 4px 16px rgba(var(--ar),.25),
            0 0  0 1px rgba(var(--ar),.2) inset;
}
.scrb:active {
    transform: translateX(-50%) scale(.93);
}
.scrb svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}