@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    --bg: #07101b;
    --panel: #0f1722;
    --panel2: #111b2a;
    --panel3: #182335;
    --line: rgba(255,255,255,.08);
    --text: #f8fafc;
    --muted: #9aa8bb;
    --gold: #d7b667;
    --gold2: #8a682e;
    --green: #22c55e;
    --red: #ef4444;
    --font: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    width: 100%;
    height: 100%;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

body.tl-chat-page {
    height: 100dvh;
}

.tl-app {
    width: 100vw;
    height: 100dvh;
    display: grid;
    grid-template-columns: 292px 388px minmax(0, 1fr) 340px;
    overflow: hidden;
    background:
        radial-gradient(circle at 70% 0%, rgba(215,182,103,.10), transparent 30%),
        #07101b;
}

.tl-nav {
    background: rgba(10,16,26,.98);
    border-right: 1px solid var(--line);
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow-y: auto;
}

.tl-brand, .tl-me {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tl-logo, .tl-avatar, .tl-conv-avatar span, .tl-profile-avatar span {
    background: linear-gradient(135deg, var(--gold), var(--gold2));
    color: #111827;
    font-weight: 900;
    display: grid;
    place-items: center;
}

.tl-logo {
    width: 54px;
    height: 54px;
    border-radius: 17px;
    font-size: 19px;
}

.tl-brand-name {
    font-size: 18px;
    font-weight: 900;
}

.tl-brand-sub, .tl-me-mail {
    color: var(--muted);
    font-size: 13px;
}

.tl-me {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255,255,255,.03);
}

.tl-avatar {
    width: 48px;
    height: 48px;
    border-radius: 15px;
}

.tl-me-name {
    font-weight: 800;
}

.tl-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tl-menu a {
    color: #dbe5f2;
    text-decoration: none;
    font-weight: 800;
    padding: 13px 14px;
    border-radius: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.tl-menu a.active,
.tl-menu a:hover {
    background: linear-gradient(90deg, rgba(215,182,103,.18), rgba(255,255,255,.03));
    color: #f8e2a0;
}

.tl-support {
    margin-top: auto;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.04);
    border-radius: 18px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tl-support-icon {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    background: var(--panel3);
    display: grid;
    place-items: center;
}

.tl-support b {
    display: block;
    font-size: 13px;
}

.tl-support span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.tl-support i {
    width: 8px;
    height: 8px;
    background: var(--green);
    border-radius: 50%;
    margin-left: auto;
}

.tl-list {
    background: rgba(12,19,31,.96);
    border-right: 1px solid var(--line);
    padding: 18px 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tl-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.tl-list-head h1 {
    margin: 0;
    font-size: 22px;
    letter-spacing: -.03em;
}

.tl-compose {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(215,182,103,.12);
    color: var(--gold);
    text-decoration: none;
}

.tl-search {
    height: 46px;
    background: var(--panel3);
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    margin-bottom: 14px;
}

.tl-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: white;
}

.tl-search input::placeholder {
    color: var(--muted);
}

.tl-conversations {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 3px;
}

.tl-conv {
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 17px;
    color: inherit;
    text-decoration: none;
    border: 1px solid transparent;
}

.tl-conv:hover,
.tl-conv.active {
    background: rgba(255,255,255,.045);
    border-color: rgba(215,182,103,.35);
    box-shadow: inset 3px 0 0 var(--gold);
}

.tl-conv-avatar, .tl-profile-avatar {
    position: relative;
    width: 48px;
    height: 48px;
    min-width: 48px;
}

.tl-conv-avatar span, .tl-conv-avatar img,
.tl-profile-avatar span, .tl-profile-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    object-fit: cover;
}

.tl-conv-avatar i,
.tl-profile-avatar i {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #64748b;
    border: 2px solid #101826;
}

.tl-conv-avatar i.on,
.tl-profile-avatar i.on {
    background: var(--green);
}

.tl-conv-body {
    flex: 1;
    min-width: 0;
}

.tl-conv-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.tl-conv-top b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tl-conv-top time {
    color: var(--muted);
    font-size: 12px;
}

.tl-conv p {
    margin: 4px 0 0;
    color: #cbd5e1;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tl-conv small {
    color: #7890aa;
    font-size: 11px;
    display: block;
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tl-chat {
    min-width: 0;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 40% 0%, rgba(215,182,103,.07), transparent 35%),
        #08111c;
}

.tl-chat-head {
    height: 72px;
    min-height: 72px;
    padding: 0 20px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(10,16,26,.75);
    backdrop-filter: blur(18px);
}

.tl-chat-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tl-chat-user h2 {
    margin: 0;
    font-size: 18px;
}

.tl-chat-user p {
    margin: 3px 0 0;
    color: var(--green);
    font-size: 13px;
}

.tl-chat-actions {
    display: flex;
    gap: 8px;
}

.tl-chat-actions button {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #a9b7ca;
    cursor: pointer;
    font-size: 18px;
}

.tl-chat-actions button:hover {
    background: rgba(255,255,255,.06);
}

.tl-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 28px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.tl-day {
    align-self: center;
    background: rgba(255,255,255,.06);
    color: #cbd5e1;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    margin: 2px 0 12px;
}

.tl-msg {
    display: flex;
    width: 100%;
}

.tl-msg.other {
    justify-content: flex-start;
}

.tl-msg.own {
    justify-content: flex-end;
}

.tl-bubble {
    max-width: min(620px, 72%);
    padding: 10px 13px;
    border-radius: 16px;
    background: var(--panel3);
    box-shadow: 0 12px 28px rgba(0,0,0,.16);
    word-break: break-word;
}

.tl-msg.other .tl-bubble {
    border-bottom-left-radius: 5px;
}

.tl-msg.own .tl-bubble {
    border-bottom-right-radius: 5px;
    background: linear-gradient(135deg, rgba(215,182,103,.95), rgba(138,104,46,.95));
    color: #111827;
}

.tl-msg-name {
    color: #93c5fd;
    font-weight: 800;
    font-size: 12px;
    margin-bottom: 4px;
}

.tl-msg-text {
    line-height: 1.45;
}

.tl-msg-time {
    text-align: right;
    opacity: .72;
    font-size: 11px;
    margin-top: 4px;
}

.tl-file {
    display: block;
    margin-top: 8px;
    background: rgba(255,255,255,.10);
    border-radius: 13px;
    padding: 10px;
    color: inherit;
    text-decoration: none;
}

.tl-file b, .tl-file span {
    display: block;
}

.tl-file span {
    font-size: 12px;
    opacity: .75;
    margin-top: 3px;
}

.tl-file.image img {
    max-width: 280px;
    max-height: 220px;
    border-radius: 12px;
    display: block;
    margin-bottom: 7px;
}

.tl-composer {
    min-height: 76px;
    padding: 12px 18px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(10,16,26,.82);
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 56px;
    gap: 10px;
    align-items: end;
}

.tl-plus {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: var(--panel3);
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 26px;
    color: #cbd5e1;
}

.tl-plus input {
    display: none;
}

.tl-composer textarea {
    min-height: 52px;
    max-height: 180px;
    resize: none;
    overflow-y: hidden;
    border: 0;
    outline: 0;
    border-radius: 18px;
    background: var(--panel3);
    color: white;
    padding: 16px;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.45;
}

.tl-composer button {
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold2));
    color: #111827;
    font-weight: 900;
    cursor: pointer;
    font-size: 18px;
}

.tl-profile {
    background: rgba(9,15,24,.96);
    border-left: 1px solid var(--line);
    padding: 16px;
    overflow-y: auto;
}

.tl-profile-card {
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    background: rgba(255,255,255,.025);
}

.tl-profile-avatar {
    width: 84px;
    height: 84px;
    margin: 0 auto 10px;
}

.tl-profile-avatar span,
.tl-profile-avatar img {
    width: 84px;
    height: 84px;
    border-radius: 28px;
    font-size: 32px;
}

.tl-profile-status {
    display: inline-block;
    background: rgba(34,197,94,.15);
    color: #86efac;
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 800;
}

.tl-profile h2 {
    margin: 12px 0 3px;
}

.tl-profile p {
    margin: 0;
    color: var(--muted);
}

.tl-profile-info {
    margin-top: 20px;
    text-align: left;
}

.tl-profile-info div,
.tl-kv,
.tl-profile-link {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 11px 0;
    color: #dbe5f2;
}

.tl-profile-info span {
    color: var(--muted);
}

.tl-profile-info b,
.tl-kv b {
    font-size: 13px;
    word-break: break-word;
}

.tl-kv {
    text-align: left;
}

.tl-kv span {
    color: var(--muted);
    font-size: 13px;
}

.tl-profile-line {
    height: 1px;
    background: var(--line);
    margin: 12px 0;
}

.tl-profile-link {
    text-decoration: none;
    color: #e5e7eb;
}

.tl-empty {
    margin: auto;
    color: var(--muted);
}

/* Tablet */
@media (max-width: 1320px) {
    .tl-app {
        grid-template-columns: 250px 340px minmax(0, 1fr);
    }
    .tl-profile {
        display: none;
    }
}

/* Mobile */
@media (max-width: 860px) {
    .tl-app {
        grid-template-columns: 1fr;
        grid-template-rows: auto 38dvh 62dvh;
    }

    .tl-nav {
        grid-row: 1;
        height: auto;
        padding: 10px;
        flex-direction: row;
        align-items: center;
        overflow-x: auto;
        gap: 10px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .tl-brand {
        min-width: max-content;
    }

    .tl-me,
    .tl-support {
        display: none;
    }

    .tl-menu {
        flex-direction: row;
        gap: 6px;
    }

    .tl-menu a {
        padding: 10px 12px;
        white-space: nowrap;
    }

    .tl-menu a span {
        display: none;
    }

    .tl-list {
        grid-row: 2;
        height: 38dvh;
        padding: 10px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .tl-list-head h1 {
        font-size: 18px;
    }

    .tl-search {
        height: 40px;
        margin-bottom: 8px;
    }

    .tl-conv {
        min-height: 62px;
        padding: 9px;
    }

    .tl-conv-avatar,
    .tl-conv-avatar span,
    .tl-conv-avatar img {
        width: 40px;
        height: 40px;
        min-width: 40px;
        border-radius: 14px;
    }

    .tl-conv small {
        display: none;
    }

    .tl-chat {
        grid-row: 3;
        height: 62dvh;
    }

    .tl-chat-head {
        height: 58px;
        min-height: 58px;
        padding: 0 12px;
    }

    .tl-chat-user h2 {
        font-size: 16px;
    }

    .tl-chat-actions button {
        width: 34px;
        height: 34px;
    }

    .tl-messages {
        padding: 12px;
    }

    .tl-bubble {
        max-width: 86vw;
        font-size: 14px;
    }

    .tl-composer {
        min-height: 66px;
        grid-template-columns: 44px minmax(0, 1fr) 48px;
        padding: 9px;
        padding-bottom: calc(9px + env(safe-area-inset-bottom));
    }

    .tl-plus,
    .tl-composer button {
        width: 44px;
        height: 44px;
    }

    .tl-composer textarea {
        min-height: 44px;
        max-height: 130px;
        padding: 12px;
        font-size: 15px;
    }
}

/* Small phone */
@media (max-width: 430px) {
    .tl-app {
        grid-template-rows: auto 34dvh 66dvh;
    }

    .tl-list {
        height: 34dvh;
    }

    .tl-chat {
        height: 66dvh;
    }

    .tl-brand-sub {
        display: none;
    }

    .tl-conv-top time {
        display: none;
    }
}

/* ===== MOBILE CHAT FIX v4 ===== */

@media (max-width: 860px) {
    html,
    body {
        width: 100%;
        height: 100%;
        overflow: hidden !important;
        background: #07101b !important;
    }

    .tl-app {
        display: flex !important;
        flex-direction: column !important;
        width: 100vw !important;
        height: 100dvh !important;
        overflow: hidden !important;
    }

    .tl-nav {
        height: 52px !important;
        min-height: 52px !important;
        max-height: 52px !important;
        padding: 6px 10px !important;
        flex: 0 0 52px !important;
        display: flex !important;
        align-items: center !important;
        overflow-x: auto !important;
    }

    .tl-logo {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        border-radius: 10px !important;
        font-size: 14px !important;
    }

    .tl-brand-name {
        font-size: 14px !important;
        white-space: nowrap !important;
    }

    .tl-brand-sub {
        display: none !important;
    }

    .tl-menu {
        margin-left: auto !important;
        display: flex !important;
        flex-direction: row !important;
        gap: 4px !important;
    }

    .tl-menu a {
        width: 34px !important;
        height: 34px !important;
        padding: 0 !important;
        justify-content: center !important;
        border-radius: 10px !important;
        font-size: 14px !important;
    }

    .tl-menu a span {
        display: none !important;
    }

    .tl-list {
        height: 154px !important;
        min-height: 154px !important;
        max-height: 154px !important;
        flex: 0 0 154px !important;
        padding: 8px 10px !important;
        border-bottom: 1px solid rgba(255,255,255,.08) !important;
        overflow: hidden !important;
    }

    .tl-list-head {
        margin-bottom: 6px !important;
    }

    .tl-list-head h1 {
        font-size: 16px !important;
    }

    .tl-search {
        height: 36px !important;
        margin-bottom: 7px !important;
        border-radius: 12px !important;
    }

    .tl-conversations {
        display: flex !important;
        gap: 8px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding-bottom: 4px !important;
    }

    .tl-conv {
        min-width: 190px !important;
        width: 190px !important;
        min-height: 62px !important;
        height: 62px !important;
        padding: 8px !important;
        margin: 0 !important;
    }

    .tl-conv-avatar,
    .tl-conv-avatar span,
    .tl-conv-avatar img {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        border-radius: 13px !important;
    }

    .tl-conv-top b {
        font-size: 13px !important;
    }

    .tl-conv p {
        font-size: 12px !important;
    }

    .tl-conv-top time,
    .tl-conv small {
        display: none !important;
    }

    .tl-chat {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
        width: 100vw !important;
        overflow: hidden !important;
    }

    .tl-chat-head {
        height: 56px !important;
        min-height: 56px !important;
        padding: 0 10px !important;
        flex: 0 0 56px !important;
    }

    .tl-chat-user {
        min-width: 0 !important;
    }

    .tl-chat-user .tl-conv-avatar,
    .tl-chat-user .tl-conv-avatar span,
    .tl-chat-user .tl-conv-avatar img {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        border-radius: 13px !important;
    }

    .tl-chat-user h2 {
        font-size: 14px !important;
        max-width: 150px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .tl-chat-user p {
        font-size: 12px !important;
    }

    .tl-chat-actions {
        gap: 2px !important;
    }

    .tl-chat-actions button {
        width: 30px !important;
        height: 30px !important;
        font-size: 14px !important;
    }

    .tl-messages {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        padding: 10px !important;
        gap: 7px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .tl-day {
        font-size: 11px !important;
        padding: 5px 10px !important;
        margin-bottom: 6px !important;
    }

    .tl-bubble {
        max-width: 78vw !important;
        padding: 8px 10px !important;
        border-radius: 14px !important;
        font-size: 13px !important;
    }

    .tl-msg-name {
        font-size: 11px !important;
    }

    .tl-msg-time {
        font-size: 10px !important;
    }

    .tl-composer {
        height: auto !important;
        min-height: 58px !important;
        flex: 0 0 auto !important;
        grid-template-columns: 40px minmax(0, 1fr) 44px !important;
        gap: 7px !important;
        padding: 7px 8px !important;
        padding-bottom: calc(7px + env(safe-area-inset-bottom)) !important;
    }

    .tl-plus,
    .tl-composer button {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        border-radius: 13px !important;
        font-size: 16px !important;
    }

    .tl-composer textarea {
        min-height: 40px !important;
        max-height: 118px !important;
        border-radius: 13px !important;
        padding: 10px 12px !important;
        font-size: 14px !important;
    }

    .tl-profile {
        display: none !important;
    }
}

@media (max-width: 430px) {
    .tl-list {
        height: 142px !important;
        min-height: 142px !important;
        max-height: 142px !important;
        flex-basis: 142px !important;
    }

    .tl-conv {
        min-width: 176px !important;
        width: 176px !important;
    }

    .tl-chat-user h2 {
        max-width: 120px !important;
    }

    .tl-bubble {
        max-width: 82vw !important;
    }
}


/* ===== Telegram-like Mobile + Settings v5 ===== */

@media (max-width: 860px) {
    body.tl-chat-page {
        background: #07101b !important;
    }

    .tl-app {
        width: 100vw !important;
        height: 100dvh !important;
        display: block !important;
        overflow: hidden !important;
        position: relative !important;
    }

    .tl-nav {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        right: 0 !important;
        height: 54px !important;
        z-index: 30 !important;
        padding: 8px 10px !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        overflow-x: auto !important;
        border-bottom: 1px solid rgba(255,255,255,.08) !important;
    }

    .tl-logo {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        border-radius: 11px !important;
        font-size: 14px !important;
    }

    .tl-brand {
        min-width: max-content !important;
    }

    .tl-brand-name {
        font-size: 14px !important;
        line-height: 1.1 !important;
    }

    .tl-brand-sub,
    .tl-me,
    .tl-support {
        display: none !important;
    }

    .tl-menu {
        margin-left: auto !important;
        display: flex !important;
        flex-direction: row !important;
        gap: 4px !important;
    }

    .tl-menu a {
        width: 36px !important;
        height: 36px !important;
        padding: 0 !important;
        display: grid !important;
        place-items: center !important;
        border-radius: 12px !important;
        font-size: 15px !important;
    }

    .tl-menu a span {
        display: none !important;
    }

    .tl-list {
        position: fixed !important;
        left: 0 !important;
        top: 54px !important;
        bottom: 0 !important;
        width: 100vw !important;
        z-index: 20 !important;
        padding: 14px 12px !important;
        overflow-y: auto !important;
        border-right: 0 !important;
    }

    .tl-list-head h1 {
        font-size: 22px !important;
    }

    .tl-search {
        height: 44px !important;
        border-radius: 14px !important;
        margin-bottom: 12px !important;
    }

    .tl-conversations {
        display: block !important;
        overflow-y: visible !important;
        padding-bottom: 20px !important;
    }

    .tl-conv {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 74px !important;
        padding: 12px !important;
        margin-bottom: 8px !important;
    }

    .tl-conv-avatar,
    .tl-conv-avatar span,
    .tl-conv-avatar img {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        border-radius: 16px !important;
    }

    .tl-conv-top b {
        font-size: 15px !important;
    }

    .tl-conv p {
        font-size: 13px !important;
    }

    .tl-chat {
        position: fixed !important;
        inset: 0 !important;
        z-index: 40 !important;
        width: 100vw !important;
        height: 100dvh !important;
        transform: translateX(0) !important;
        display: flex !important;
        flex-direction: column !important;
        background: #07101b !important;
    }

    .tl-chat-head {
        height: 58px !important;
        min-height: 58px !important;
        padding: 0 8px !important;
        flex: 0 0 58px !important;
    }

    .tl-chat-head::before {
        content: "‹";
        width: 34px;
        height: 34px;
        display: grid;
        place-items: center;
        border-radius: 12px;
        margin-right: 4px;
        font-size: 30px;
        color: #d6b56d;
        cursor: pointer;
    }

    .tl-chat-user {
        min-width: 0 !important;
        flex: 1 !important;
    }

    .tl-chat-user .tl-conv-avatar,
    .tl-chat-user .tl-conv-avatar span,
    .tl-chat-user .tl-conv-avatar img {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        border-radius: 14px !important;
    }

    .tl-chat-user h2 {
        font-size: 15px !important;
        max-width: 165px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .tl-chat-user p {
        font-size: 12px !important;
    }

    .tl-chat-actions button {
        width: 32px !important;
        height: 32px !important;
        font-size: 15px !important;
    }

    .tl-messages {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        padding: 12px !important;
        gap: 7px !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .tl-bubble {
        max-width: 82vw !important;
        padding: 9px 11px !important;
        font-size: 14px !important;
        border-radius: 15px !important;
    }

    .tl-msg-time {
        font-size: 10px !important;
    }

    .tl-composer {
        flex: 0 0 auto !important;
        min-height: 62px !important;
        grid-template-columns: 42px minmax(0, 1fr) 46px !important;
        gap: 8px !important;
        padding: 8px !important;
        padding-bottom: calc(8px + env(safe-area-inset-bottom)) !important;
    }

    .tl-plus,
    .tl-composer button {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        border-radius: 14px !important;
    }

    .tl-composer textarea {
        min-height: 42px !important;
        max-height: 130px !important;
        padding: 11px 13px !important;
        border-radius: 14px !important;
        font-size: 15px !important;
    }

    .tl-profile {
        display: none !important;
    }

    body.tl-chat-page:not(.chat-open) .tl-chat {
        display: none !important;
    }

    body.tl-chat-page.chat-open .tl-list {
        display: none !important;
    }
}

/* Settings Page */
.tl-settings-page {
    margin: 0;
    min-height: 100dvh;
    background:
        radial-gradient(circle at 20% 0%, rgba(215,182,103,.12), transparent 28%),
        #07101b;
    color: #f8fafc;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tl-settings-app {
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
}

.tl-settings-side {
    background: rgba(10,16,26,.98);
    border-right: 1px solid rgba(255,255,255,.08);
    padding: 20px 16px;
}

.tl-settings-menu {
    margin-top: 26px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tl-settings-menu a {
    color: #dbe5f2;
    text-decoration: none;
    font-weight: 800;
    padding: 13px 14px;
    border-radius: 15px;
}

.tl-settings-menu a:hover,
.tl-settings-menu a.active {
    background: linear-gradient(90deg, rgba(215,182,103,.18), rgba(255,255,255,.03));
    color: #f8e2a0;
}

.tl-settings-main {
    padding: 34px;
    overflow-y: auto;
}

.tl-settings-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.tl-settings-header h1 {
    margin: 0 0 8px;
    font-size: clamp(30px, 4vw, 46px);
    letter-spacing: -.04em;
}

.tl-settings-header p {
    margin: 0;
    color: #9aa8bb;
}

.tl-settings-back {
    color: #111827;
    background: linear-gradient(135deg, #d7b667, #8a682e);
    padding: 12px 16px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 900;
    white-space: nowrap;
}

.tl-settings-card {
    max-width: 840px;
    background: rgba(17,27,42,.86);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 26px;
    padding: 24px;
    box-shadow: 0 28px 80px rgba(0,0,0,.28);
}

.tl-settings-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.tl-settings-profile img,
.tl-settings-profile > div:first-child {
    width: 82px;
    height: 82px;
    border-radius: 26px;
    object-fit: cover;
}

.tl-settings-profile > div:first-child {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #d7b667, #8a682e);
    color: #111827;
    font-weight: 900;
    font-size: 30px;
}

.tl-settings-profile h2 {
    margin: 0;
}

.tl-settings-profile p {
    margin: 5px 0 0;
    color: #9aa8bb;
}

.tl-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.tl-settings-grid label {
    display: block;
}

.tl-settings-grid span {
    display: block;
    margin-bottom: 7px;
    color: #dbe5f2;
    font-weight: 800;
}

.tl-settings-grid input,
.tl-settings-grid select {
    width: 100%;
    height: 50px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 15px;
    background: rgba(7,16,27,.72);
    color: #fff;
    padding: 0 14px;
    outline: none;
}

.tl-settings-save {
    margin-top: 20px;
    height: 50px;
    border: 0;
    border-radius: 15px;
    background: linear-gradient(135deg, #d7b667, #8a682e);
    color: #111827;
    font-weight: 900;
    padding: 0 20px;
    cursor: pointer;
}

.tl-settings-alert {
    max-width: 840px;
    padding: 13px 15px;
    border-radius: 15px;
    margin-bottom: 14px;
    font-weight: 800;
}

.tl-settings-alert.success {
    background: rgba(34,197,94,.12);
    color: #bbf7d0;
}

.tl-settings-alert.error {
    background: rgba(239,68,68,.12);
    color: #fecaca;
}

@media (max-width: 860px) {
    .tl-settings-app {
        grid-template-columns: 1fr;
    }

    .tl-settings-side {
        padding: 10px;
        border-right: 0;
        border-bottom: 1px solid rgba(255,255,255,.08);
    }

    .tl-settings-menu {
        margin-top: 10px;
        flex-direction: row;
        overflow-x: auto;
        gap: 6px;
    }

    .tl-settings-menu a {
        white-space: nowrap;
        padding: 10px 12px;
    }

    .tl-settings-main {
        padding: 18px;
    }

    .tl-settings-header {
        display: block;
    }

    .tl-settings-back {
        display: inline-flex;
        margin-top: 14px;
    }

    .tl-settings-card {
        padding: 18px;
        border-radius: 22px;
    }

    .tl-settings-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}


/* real mobile back button fix */
.tl-mobile-back {
    display: none;
}

@media (max-width: 860px) {
    .tl-mobile-back {
        display: grid !important;
        place-items: center;
        width: 34px;
        height: 34px;
        min-width: 34px;
        border: 0;
        border-radius: 12px;
        background: transparent;
        color: #d6b56d;
        font-size: 28px;
        cursor: pointer;
        margin-right: 4px;
    }

    .tl-chat-head::before {
        display: none !important;
        content: none !important;
    }
}

/* ===== Mobile bottom tabs like Telegram v6 ===== */

.tl-mobile-tabs {
    display: none;
}

@media (max-width: 860px) {
    .tl-nav {
        display: none !important;
    }

    .tl-mobile-tabs {
        position: fixed;
        left: 16px;
        right: 16px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        height: 64px;
        z-index: 100;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        padding: 7px;
        border-radius: 28px;
        background: rgba(42,42,42,.92);
        border: 1px solid rgba(255,255,255,.14);
        backdrop-filter: blur(18px);
        box-shadow: 0 18px 45px rgba(0,0,0,.35);
    }

    .tl-mobile-tabs a {
        color: #d1d5db;
        text-decoration: none;
        border-radius: 22px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        font-size: 20px;
        font-weight: 800;
    }

    .tl-mobile-tabs a span {
        font-size: 11px;
        line-height: 1;
    }

    .tl-mobile-tabs a.active {
        background: rgba(255,255,255,.12);
        color: #60a5fa;
    }

    .tl-list {
        top: 0 !important;
        bottom: 88px !important;
        height: auto !important;
        padding: 18px 14px 14px !important;
    }

    .tl-list-head {
        height: 48px;
        align-items: center;
    }

    .tl-list-head h1 {
        width: 100%;
        text-align: center;
        font-size: 22px !important;
    }

    .tl-compose {
        position: absolute;
        right: 16px;
        top: 18px;
    }

    .tl-chat {
        bottom: 88px !important;
        height: calc(100dvh - 88px) !important;
    }

    .tl-composer {
        padding-bottom: 8px !important;
    }

    body.tl-chat-page.chat-open .tl-mobile-tabs {
        display: none;
    }
}


/* ===== Mobile chat list fix v7 ===== */

@media (max-width: 860px) {
    body.tl-chat-page:not(.chat-open) .tl-list {
        display: flex !important;
        flex-direction: column !important;
        position: fixed !important;
        inset: 0 0 88px 0 !important;
        width: 100vw !important;
        height: auto !important;
        max-height: none !important;
        overflow: hidden !important;
        padding: 18px 14px 14px !important;
        background: #07101b !important;
    }

    body.tl-chat-page:not(.chat-open) .tl-conversations {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        display: block !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding-bottom: 16px !important;
    }

    body.tl-chat-page:not(.chat-open) .tl-conv {
        width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 74px !important;
        margin: 0 0 8px 0 !important;
        display: flex !important;
    }

    body.tl-chat-page:not(.chat-open) .tl-chat {
        display: none !important;
    }

    body.tl-chat-page.chat-open .tl-list {
        display: none !important;
    }

    body.tl-chat-page.chat-open .tl-chat {
        display: flex !important;
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        height: 100dvh !important;
    }

    .tl-chat-actions {
        display: none !important;
    }

    .tl-chat-head {
        justify-content: flex-start !important;
        gap: 6px !important;
    }

    .tl-chat-user {
        flex: 1 1 auto !important;
    }
}


.tl-avatar-img {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    object-fit: cover;
}

.tl-paste-badge {
    position: absolute;
    left: 74px;
    bottom: calc(100% + 6px);
    max-width: 240px;
    padding: 7px 10px;
    border-radius: 12px;
    background: rgba(215,182,103,.16);
    color: #f8e2a0;
    border: 1px solid rgba(215,182,103,.28);
    font-size: 12px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tl-composer {
    position: relative;
}

@media (max-width: 860px) {
    .tl-paste-badge {
        left: 56px;
        max-width: 190px;
    }
}


/* ===== Mobile header clean v9 ===== */

@media (max-width: 860px) {
    .tl-list-head {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        height: 48px !important;
        margin-bottom: 10px !important;
        position: relative !important;
    }

    .tl-list-head::before {
        content: "TL";
        width: 36px;
        height: 36px;
        min-width: 36px;
        border-radius: 11px;
        background: linear-gradient(135deg, #d7b667, #8a682e);
        color: #111827;
        display: grid;
        place-items: center;
        font-weight: 900;
        margin-right: 10px;
    }

    .tl-list-head::after {
        content: "Trend Lawyers";
        color: #ffffff;
        font-size: 15px;
        font-weight: 900;
    }

    .tl-list-head h1 {
        position: absolute !important;
        left: 0 !important;
        top: 52px !important;
        width: auto !important;
        text-align: left !important;
        font-size: 20px !important;
        margin: 0 !important;
    }

    .tl-compose {
        display: none !important;
    }

    .tl-search {
        margin-top: 34px !important;
    }

    .tl-mobile-tabs a span {
        font-size: 11px !important;
        font-weight: 900 !important;
    }
}


/* ===== Avatar/settings polish v10 ===== */

.tl-settings-profile img {
    background: linear-gradient(135deg, #d7b667, #8a682e);
}

.tl-settings-card input[type="file"] {
    padding: 12px 14px;
    height: auto;
    min-height: 50px;
    line-height: 1.5;
}

.tl-avatar-img {
    background: linear-gradient(135deg, #d7b667, #8a682e);
}


/* ===== Profile + notification v11 ===== */

.tl-notify-box {
    margin-top: 18px;
}

.tl-notify-box h2 {
    margin: 0 0 6px;
}

.tl-notify-box p {
    color: #9aa8bb;
    margin: 0 0 14px;
}

.tl-notify-status {
    margin-top: 12px;
    color: #d7b667;
    font-weight: 800;
    font-size: 14px;
}


/* ===== Settings scroll/lang fix v12 ===== */

html,
body.tl-settings-page {
    min-height: 100%;
    height: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.tl-settings-page {
    overflow-y: auto !important;
}

.tl-settings-app {
    min-height: 100dvh !important;
    height: auto !important;
    overflow: visible !important;
}

.tl-settings-main {
    min-height: 100dvh !important;
    height: auto !important;
    overflow-y: visible !important;
    padding-bottom: 80px !important;
}

.tl-settings-card {
    margin-bottom: 18px !important;
}

@media (max-width: 860px) {
    html,
    body.tl-settings-page {
        height: auto !important;
        min-height: 100dvh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .tl-settings-app {
        display: block !important;
        min-height: 100dvh !important;
        height: auto !important;
        overflow: visible !important;
    }

    .tl-settings-side {
        position: relative !important;
        top: auto !important;
        height: auto !important;
    }

    .tl-settings-main {
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
        padding-bottom: 120px !important;
    }

    .tl-settings-card,
    .tl-notify-box {
        width: 100% !important;
        max-width: 100% !important;
    }
}


/* ===== Chat list polish v13 ===== */

.tl-search input::placeholder {
    color: #9aa8bb !important;
}

.tl-conv {
    transition:
        transform .18s ease,
        background .18s ease,
        border-color .18s ease,
        box-shadow .18s ease !important;
}

.tl-conv:active {
    transform: scale(.985);
}

.tl-conv-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 7px;
    min-width: 42px;
}

.tl-conv-side time {
    color: #8ea0b7;
    font-size: 12px;
    white-space: nowrap;
}

.tl-conv-side em {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, #d7b667, #8a682e);
    color: #111827;
    display: grid;
    place-items: center;
    font-style: normal;
    font-size: 11px;
    font-weight: 900;
}

.tl-conv p {
    color: #9aa8bb !important;
    font-weight: 500 !important;
}

/* Desktop list tuning */
@media (min-width: 861px) {
    .tl-conv {
        min-height: 68px !important;
        padding: 10px 11px !important;
    }

    .tl-conv-avatar,
    .tl-conv-avatar span,
    .tl-conv-avatar img {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        border-radius: 16px !important;
    }

    .tl-conv-top {
        align-items: flex-start !important;
    }

    .tl-conv-top b {
        font-size: 15px !important;
    }

    .tl-conv p {
        font-size: 13px !important;
        margin-top: 3px !important;
    }
}

/* Mobile Telegram-like chat list */
@media (max-width: 860px) {
    .tl-list {
        animation: tlSlideIn .22s ease both;
    }

    .tl-conv {
        min-height: 64px !important;
        height: auto !important;
        padding: 9px 10px !important;
        border-radius: 17px !important;
        gap: 11px !important;
        animation: tlItemIn .22s ease both;
    }

    .tl-conv-avatar,
    .tl-conv-avatar span,
    .tl-conv-avatar img {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        border-radius: 16px !important;
    }

    .tl-conv-top {
        align-items: flex-start !important;
    }

    .tl-conv-top b {
        font-size: 15px !important;
        line-height: 1.15 !important;
    }

    .tl-conv p {
        font-size: 13px !important;
        line-height: 1.25 !important;
        margin-top: 4px !important;
        color: #9aa8bb !important;
    }

    .tl-conv-side {
        min-width: 38px !important;
        gap: 5px !important;
    }

    .tl-conv-side time {
        font-size: 11px !important;
        color: #7f90a8 !important;
    }

    .tl-conv-side em {
        min-width: 19px !important;
        height: 19px !important;
        font-size: 10px !important;
    }

    .tl-chat {
        animation: tlChatOpen .20s ease both;
    }

    body.tl-chat-page:not(.chat-open) .tl-conversations {
        padding-top: 2px !important;
    }
}

@keyframes tlSlideIn {
    from {
        opacity: .6;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes tlItemIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes tlChatOpen {
    from {
        opacity: .85;
        transform: translateX(16px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}


/* ===== Auth animated background ===== */

.auth-body {
    min-height: 100dvh;
    background:
        radial-gradient(circle at 20% 20%, rgba(215,182,103,.22), transparent 28%),
        radial-gradient(circle at 80% 10%, rgba(82,120,255,.16), transparent 30%),
        linear-gradient(135deg, #05070d 0%, #0f172a 55%, #111827 100%) !important;
    position: relative;
    overflow: hidden;
}

.auth-body::before,
.auth-body::after {
    content: "";
    position: fixed;
    width: 520px;
    height: 520px;
    border-radius: 999px;
    filter: blur(70px);
    opacity: .32;
    pointer-events: none;
    z-index: 0;
    animation: tlFloatBg 12s ease-in-out infinite alternate;
}

.auth-body::before {
    left: -160px;
    top: -140px;
    background: rgba(215,182,103,.52);
}

.auth-body::after {
    right: -180px;
    bottom: -160px;
    background: rgba(37,99,235,.42);
    animation-delay: -4s;
}

.auth-shell,
.auth-card {
    position: relative;
    z-index: 1;
}

.auth-card {
    animation: tlAuthCardIn .55s ease both;
}

@keyframes tlFloatBg {
    0% {
        transform: translate3d(0,0,0) scale(1);
    }
    100% {
        transform: translate3d(60px,40px,0) scale(1.12);
    }
}

@keyframes tlAuthCardIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* ===== Auth animated background v14 ===== */

.auth-body {
    min-height: 100dvh !important;
    background: #070b14 !important;
    position: relative !important;
    overflow: hidden !important;
}

.auth-body::before {
    content: "" !important;
    position: fixed !important;
    inset: -30% !important;
    z-index: 0 !important;
    pointer-events: none !important;
    background:
        radial-gradient(circle at 20% 25%, rgba(215,182,103,.35), transparent 22%),
        radial-gradient(circle at 78% 18%, rgba(59,130,246,.22), transparent 26%),
        radial-gradient(circle at 60% 82%, rgba(215,182,103,.16), transparent 24%),
        linear-gradient(135deg, #05070d 0%, #0f172a 55%, #111827 100%);
    animation: tlAuthGradientMove 11s ease-in-out infinite alternate !important;
}

.auth-body::after {
    content: "" !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 0 !important;
    pointer-events: none !important;
    background-image:
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(circle at center, black 0%, transparent 70%);
    animation: tlAuthGridMove 18s linear infinite !important;
}

.auth-shell,
.auth-card {
    position: relative !important;
    z-index: 1 !important;
}

.auth-card {
    animation: tlAuthCardIn .55s ease both !important;
    box-shadow:
        0 30px 90px rgba(0,0,0,.45),
        0 0 90px rgba(215,182,103,.08) !important;
}

@keyframes tlAuthGradientMove {
    0% {
        transform: translate3d(-20px, -10px, 0) scale(1);
        filter: hue-rotate(0deg);
    }
    100% {
        transform: translate3d(35px, 25px, 0) scale(1.08);
        filter: hue-rotate(8deg);
    }
}

@keyframes tlAuthGridMove {
    from {
        background-position: 0 0, 0 0;
    }
    to {
        background-position: 42px 42px, 42px 42px;
    }
}

@keyframes tlAuthCardIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* ===== Visible animated auth background v15 ===== */

body.auth-body {
    min-height: 100dvh !important;
    position: relative !important;
    overflow: hidden !important;
    background: #050814 !important;
}

body.auth-body::before {
    content: "" !important;
    position: fixed !important;
    inset: -40% !important;
    z-index: 0 !important;
    pointer-events: none !important;
    background:
        radial-gradient(circle at 18% 22%, rgba(215,182,103,.55), transparent 18%),
        radial-gradient(circle at 82% 18%, rgba(59,130,246,.42), transparent 22%),
        radial-gradient(circle at 62% 82%, rgba(168,85,247,.22), transparent 20%),
        radial-gradient(circle at 35% 70%, rgba(215,182,103,.24), transparent 18%),
        linear-gradient(135deg, #040711 0%, #0b1220 45%, #111827 100%) !important;
    animation: tlAuthBgMove 8s ease-in-out infinite alternate !important;
}

body.auth-body::after {
    content: "" !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 0 !important;
    pointer-events: none !important;
    background:
        linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px) !important;
    background-size: 46px 46px !important;
    opacity: .45 !important;
    animation: tlAuthGrid 14s linear infinite !important;
    mask-image: radial-gradient(circle at center, black 0%, transparent 75%) !important;
}

.auth-shell,
.auth-card {
    position: relative !important;
    z-index: 2 !important;
}

.auth-card {
    animation: tlAuthCardIn .55s ease both !important;
    box-shadow:
        0 30px 100px rgba(0,0,0,.58),
        0 0 120px rgba(215,182,103,.16) !important;
}

@keyframes tlAuthBgMove {
    0% {
        transform: translate3d(-30px, -18px, 0) scale(1);
        filter: saturate(1);
    }
    100% {
        transform: translate3d(45px, 32px, 0) scale(1.10);
        filter: saturate(1.25);
    }
}

@keyframes tlAuthGrid {
    from {
        background-position: 0 0, 0 0;
    }
    to {
        background-position: 46px 46px, 46px 46px;
    }
}

@keyframes tlAuthCardIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* ===== v16 real auth animation + mobile chat header ===== */

.auth-animated-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 20%, rgba(215,182,103,.20), transparent 24%),
        radial-gradient(circle at 80% 10%, rgba(59,130,246,.18), transparent 28%),
        linear-gradient(135deg, #05070d 0%, #0f172a 55%, #111827 100%);
}

.auth-animated-bg i {
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    filter: blur(45px);
    opacity: .55;
    animation: tlBlobMove 9s ease-in-out infinite alternate;
}

.auth-animated-bg i:nth-child(1) {
    left: -80px;
    top: 10%;
    background: rgba(215,182,103,.55);
}

.auth-animated-bg i:nth-child(2) {
    right: -90px;
    top: 18%;
    background: rgba(59,130,246,.45);
    animation-delay: -2s;
}

.auth-animated-bg i:nth-child(3) {
    left: 35%;
    bottom: -120px;
    background: rgba(168,85,247,.30);
    animation-delay: -4s;
}

.auth-animated-bg i:nth-child(4) {
    right: 30%;
    bottom: 15%;
    background: rgba(215,182,103,.25);
    animation-delay: -6s;
}

@keyframes tlBlobMove {
    from {
        transform: translate3d(0,0,0) scale(1);
    }
    to {
        transform: translate3d(80px,45px,0) scale(1.18);
    }
}

.auth-shell {
    position: relative;
    z-index: 2;
}

/* Mobile opened chat: keep brand header */
@media (max-width: 860px) {
    body.tl-chat-page.chat-open .tl-nav {
        display: flex !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: 56px !important;
        min-height: 56px !important;
        z-index: 90 !important;
        padding: 10px 14px !important;
        background: #07101b !important;
        border-bottom: 1px solid rgba(255,255,255,.08) !important;
    }

    body.tl-chat-page.chat-open .tl-nav .tl-brand {
        display: flex !important;
    }

    body.tl-chat-page.chat-open .tl-nav .tl-menu,
    body.tl-chat-page.chat-open .tl-nav .tl-me,
    body.tl-chat-page.chat-open .tl-nav .tl-support {
        display: none !important;
    }

    body.tl-chat-page.chat-open .tl-chat {
        top: 56px !important;
        height: calc(100dvh - 56px) !important;
        inset: 56px 0 0 0 !important;
    }

    body.tl-chat-page.chat-open .tl-chat-head {
        height: 56px !important;
        min-height: 56px !important;
    }

    body.tl-chat-page.chat-open .tl-mobile-back {
        display: grid !important;
    }

    body.tl-chat-page.chat-open .tl-mobile-tabs {
        display: none !important;
    }
}


/* ===== Mobile unified header height v17 ===== */

@media (max-width: 860px) {
    body.tl-chat-page .tl-nav {
        display: flex !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: 58px !important;
        min-height: 58px !important;
        max-height: 58px !important;
        z-index: 100 !important;
        padding: 10px 14px !important;
        background: #07101b !important;
        border-bottom: 1px solid rgba(255,255,255,.08) !important;
        align-items: center !important;
    }

    body.tl-chat-page .tl-nav .tl-brand {
        display: flex !important;
        align-items: center !important;
    }

    body.tl-chat-page .tl-nav .tl-menu,
    body.tl-chat-page .tl-nav .tl-me,
    body.tl-chat-page .tl-nav .tl-support {
        display: none !important;
    }

    body.tl-chat-page:not(.chat-open) .tl-list {
        top: 58px !important;
    }

    body.tl-chat-page.chat-open .tl-chat {
        top: 58px !important;
        height: calc(100dvh - 58px) !important;
        inset: 58px 0 0 0 !important;
    }

    body.tl-chat-page.chat-open .tl-chat-head {
        height: 58px !important;
        min-height: 58px !important;
        max-height: 58px !important;
        flex: 0 0 58px !important;
        padding: 0 10px !important;
        background: rgba(7,16,27,.96) !important;
        border-bottom: 1px solid rgba(255,255,255,.08) !important;
    }

    body.tl-chat-page.chat-open .tl-mobile-back {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        margin-right: 6px !important;
    }

    body.tl-chat-page.chat-open .tl-chat-user {
        min-width: 0 !important;
    }

    body.tl-chat-page.chat-open .tl-chat-user .tl-conv-avatar,
    body.tl-chat-page.chat-open .tl-chat-user .tl-conv-avatar span,
    body.tl-chat-page.chat-open .tl-chat-user .tl-conv-avatar img {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        border-radius: 13px !important;
    }

    body.tl-chat-page.chat-open .tl-chat-user h2 {
        font-size: 15px !important;
        line-height: 1.1 !important;
        margin: 0 !important;
    }

    body.tl-chat-page.chat-open .tl-chat-user p {
        font-size: 11px !important;
        line-height: 1.1 !important;
        margin-top: 3px !important;
    }
}


/* ===== Fix duplicate mobile header v18 ===== */

@media (max-width: 860px) {
    /* оставляем только верхнюю настоящую шапку TL Trend Lawyers */
    .tl-list-head::before,
    .tl-list-head::after {
        display: none !important;
        content: none !important;
    }

    .tl-list-head {
        height: auto !important;
        min-height: 34px !important;
        margin-top: 0 !important;
        margin-bottom: 10px !important;
        display: flex !important;
        align-items: center !important;
    }

    .tl-list-head h1 {
        position: static !important;
        top: auto !important;
        left: auto !important;
        width: auto !important;
        text-align: left !important;
        font-size: 20px !important;
        margin: 0 !important;
    }

    .tl-search {
        margin-top: 0 !important;
    }

    /* шапка сайта не должна иметь свой скролл */
    body.tl-chat-page .tl-nav {
        overflow: hidden !important;
        flex-wrap: nowrap !important;
    }

    body.tl-chat-page .tl-nav .tl-brand {
        overflow: hidden !important;
        white-space: nowrap !important;
    }

    body.tl-chat-page .tl-brand-name {
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    /* список начинается строго под одной шапкой */
    body.tl-chat-page:not(.chat-open) .tl-list {
        top: 58px !important;
        padding-top: 14px !important;
    }

    /* открытый чат начинается строго под одной шапкой */
    body.tl-chat-page.chat-open .tl-chat {
        top: 58px !important;
        height: calc(100dvh - 58px) !important;
        overflow: hidden !important;
    }

    body.tl-chat-page.chat-open .tl-chat-head {
        overflow: hidden !important;
    }
}


/* ===== Home privacy v19 ===== */

.btn-privacy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0 22px;
    border-radius: 16px;
    color: #f8e2a0;
    text-decoration: none;
    font-weight: 900;
    border: 1px solid rgba(215,182,103,.28);
    background: rgba(215,182,103,.08);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
}

.btn-privacy:hover {
    background: rgba(215,182,103,.14);
}

.privacy-card {
    max-width: 780px;
}

.privacy-card h1 {
    text-align: center;
}

.privacy-card p {
    color: #aeb9c8;
    line-height: 1.65;
    font-size: 16px;
}

@media (max-width: 680px) {
    .hero-actions {
        flex-direction: column;
    }

    .hero-actions a {
        width: 100%;
    }
}


/* ===== Home/Auth clean design v20 ===== */

.auth-body {
    min-height: 100dvh !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #07101b !important;
    color: #f8fafc !important;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    overflow: hidden !important;
}

.auth-shell {
    width: min(760px, calc(100vw - 32px)) !important;
    margin: auto !important;
    padding: 24px !important;
    display: flex !important;
    justify-content: center !important;
}

.auth-card {
    width: 100% !important;
    padding: 44px !important;
    border-radius: 28px !important;
    background: rgba(17, 27, 42, .88) !important;
    border: 1px solid rgba(255,255,255,.10) !important;
    box-shadow: 0 30px 100px rgba(0,0,0,.45) !important;
    text-align: center !important;
    backdrop-filter: blur(18px) !important;
}

.logo-row {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 14px !important;
    margin-bottom: 28px !important;
}

.logo-mark {
    width: 58px !important;
    height: 58px !important;
    border-radius: 18px !important;
    display: grid !important;
    place-items: center !important;
    background: linear-gradient(135deg, #d7b667, #8a682e) !important;
    color: #111827 !important;
    font-weight: 900 !important;
    font-size: 20px !important;
}

.logo-title {
    color: #fff !important;
    font-size: 24px !important;
    font-weight: 900 !important;
    line-height: 1.05 !important;
    text-align: left !important;
}

.logo-sub {
    color: #9aa8bb !important;
    font-size: 14px !important;
    text-align: left !important;
}

.auth-card h1 {
    margin: 0 0 18px !important;
    font-size: clamp(34px, 5vw, 52px) !important;
    line-height: 1.08 !important;
    letter-spacing: -.05em !important;
    color: #fff !important;
}

.auth-card p {
    max-width: 620px !important;
    margin: 0 auto 30px !important;
    color: #aeb9c8 !important;
    font-size: 17px !important;
    line-height: 1.65 !important;
}

.hero-actions {
    display: flex !important;
    justify-content: center !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
    margin: 24px 0 !important;
}

.hero-actions a,
.btn-primary,
.btn-secondary,
.btn-privacy {
    min-height: 52px !important;
    padding: 0 24px !important;
    border-radius: 16px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    font-weight: 900 !important;
    font-size: 15px !important;
}

.btn-primary {
    background: linear-gradient(135deg, #d7b667, #8a682e) !important;
    color: #111827 !important;
    border: 0 !important;
}

.btn-secondary {
    background: rgba(255,255,255,.06) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,.14) !important;
}

.btn-privacy {
    background: rgba(215,182,103,.08) !important;
    color: #f8e2a0 !important;
    border: 1px solid rgba(215,182,103,.28) !important;
}

.hero-note {
    color: #8ea0b7 !important;
    font-size: 14px !important;
    margin-top: 16px !important;
}

@media (max-width: 680px) {
    .auth-card {
        padding: 30px 22px !important;
        border-radius: 24px !important;
    }

    .logo-row {
        margin-bottom: 22px !important;
    }

    .auth-card h1 {
        font-size: 34px !important;
    }

    .hero-actions {
        flex-direction: column !important;
    }

    .hero-actions a {
        width: 100% !important;
    }
}


/* ===== Calls UI v2 ===== */

.tl-call-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #d7b667, #8a682e);
    color: #111827;
    font-size: 20px;
    font-weight: 900;
    cursor: pointer;
    margin-left: auto;
}

.tl-call-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(3,7,18,.72);
    backdrop-filter: blur(18px);
}

.tl-call-modal.show {
    display: flex;
}

.tl-call-box {
    width: min(360px, calc(100vw - 32px));
    padding: 28px;
    border-radius: 28px;
    background: rgba(17,27,42,.96);
    border: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 30px 90px rgba(0,0,0,.45);
    text-align: center;
    color: #fff;
}

.tl-call-avatar {
    width: 76px;
    height: 76px;
    border-radius: 26px;
    display: grid;
    place-items: center;
    margin: 0 auto 18px;
    background: linear-gradient(135deg, #d7b667, #8a682e);
    color: #111827;
    font-size: 34px;
}

.tl-call-box h2 {
    margin: 0 0 8px;
}

.tl-call-box p {
    margin: 0;
    color: #9aa8bb;
}

.tl-call-timer {
    margin: 18px 0;
    color: #d7b667;
    font-weight: 900;
    font-size: 24px;
}

.tl-call-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.tl-call-actions button {
    height: 44px;
    padding: 0 16px;
    border: 0;
    border-radius: 14px;
    font-weight: 900;
    cursor: pointer;
}

.tl-call-actions .accept {
    background: #22c55e;
    color: #052e16;
}

.tl-call-actions .reject,
.tl-call-actions .end {
    background: #ef4444;
    color: #fff;
}

@media (max-width: 860px) {
    .tl-call-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
        border-radius: 13px;
        font-size: 18px;
    }
}


/* ===== Call history messages v3 ===== */

.tl-msg-text {
    white-space: normal;
}

.tl-bubble .tl-msg-text:has(+ .tl-msg-time) {
    max-width: 100%;
}

