﻿/* =========================================================
   THEME VARIABLES
========================================================= */

:root {
    --bg-main: #0d1117;
    --bg-card: #161b22;
    --bg-soft: #1c1f26;
    --border-main: #30363d;
    --border-soft: #21262d;
    --text-main: #c9d1d9;
    --text-muted: #8b949e;
    --accent: #58a6ff;
    --success: #3fb950;
    --danger: #f85149;
    --warning: #d29922;
    --shadow-soft: rgba(0,0,0,.3);
    /* для rgba() */
    --accent-rgb: 88,166,255;
    --success-rgb: 63,185,80;
    --steam-accent: #7ee787;
    --twitch-accent: #a371f7;
    --calendar-day-bg: #262a33;
    --success-soft: #2ea043;
}

[data-theme="light"] {
    --bg-main: #f6f8fa;
    --bg-card: #ffffff;
    --bg-soft: #f0f2f5;
    --border-main: #d0d7de;
    --border-soft: #e5e7eb;
    --text-main: #24292f;
    --text-muted: #57606a;
    --accent: #0969da;
    --success: #1a7f37;
    --danger: #cf222e;
    --warning: #9a6700;
    --shadow-soft: rgba(0,0,0,.08);
    --accent-rgb: 9,105,218;
    --success-rgb: 26,127,55;
    --steam-accent: #7ee787;
    --twitch-accent: #a371f7;
    --calendar-day-bg: #eaeef2;
    --success-soft: #2ea043;
}

/* =========================================================
   BASE
========================================================= */

html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    background: var(--bg-main);
    color: var(--text-main);
    font-family: system-ui;
}

hr {
    border: none;
    border-top: 1px solid var(--border-main);
    margin: 30px 0;
}

.page-title {
    margin-bottom: 20px;
}


/* =========================================================
   LAYOUT
========================================================= */


.row {
    margin-bottom: 16px;
}

label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
}


/* =========================================================
   NAVBAR
========================================================= */

.tg-navbar {
    background: var(--bg-main);
    border-bottom: 1px solid var(--border-main);
    position: relative;
}

    .tg-navbar .navbar-brand,
    .tg-navbar .nav-link {
        color: var(--text-main) !important;
    }

        .tg-navbar .nav-link:hover {
            color: var(--accent) !important;
        }


/* =========================================================
   FORM CONTROLS
========================================================= */

select {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-main);
    border-radius: 8px;
    padding: 6px 12px;
    outline: none;
}

    select:focus {
        border-color: var(--accent);
    }


/* =========================================================
   USER CARD (MAIN CARD)
========================================================= */

.user-card {
    background: linear-gradient(180deg, var(--bg-card), var(--bg-main));
    border: 1px solid var(--border-main);
    border-radius: 18px;
    padding: 26px;
    margin: 0px 0;
}


/* ---------- header ---------- */

.uc-header {
    display: flex;
    gap: 18px;
    margin-bottom: 22px;
    align-items: center;
}

.uc-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--border-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    min-width: 64px;
    min-height: 64px;
    flex-shrink: 0;
    overflow: hidden;
}
    .uc-avatar img {
        width: 100%;
        height: 100%;
        border-radius: 50%;
        object-fit: cover;
        padding: 5px;
    }

.uc-name {
    font-size: 22px;
    font-weight: 600;
}

    .uc-name span {
        font-size: 14px;
        color: var(--text-muted);
        margin-left: 8px;
    }

.uc-status {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}


/* ---------- stats ---------- */

.uc-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    text-align: center;
    margin: 22px 0;
    gap: 10px;
}

    .uc-stats .icon {
        font-size: 26px;
        margin-bottom: 4px;
    }

    .uc-stats .value {
        font-size: 18px;
        font-weight: 600;
    }

    .uc-stats .label {
        font-size: 12px;
        color: var(--text-muted);
    }


/* ---------- dates ---------- */

.uc-dates {
    margin-top: 10px;
    font-size: 14px;
}


/* ---------- links ---------- */

.uc-links {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-main);
    width: 100%;
}

    .uc-links > * {
        flex: 1 1 0;
        min-width: 0;
    }

    .uc-links a {
        color: var(--accent);
        text-decoration: none;
    }


/* ---------- roles ---------- */

.uc-roles {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-main);
    font-size: 14px;
}


/* =========================================================
   STATS LIST (SECONDARY BLOCK)
========================================================= */

.stats {
    margin-top: 24px;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-soft);
}

    .stat-row:last-child {
        border-bottom: none;
    }

    .stat-row select {
        min-width: 150px;
    }

/* ===== PAGE LAYOUT ===== */

.layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.layout-content {
    flex: 1;
    padding: 4px;
}

.layout-footer {
    border-top: 1px solid var(--border-main);
    color: var(--text-muted);
    font-size: 13px;
    padding: 14px 0;
    text-align: center;
    background: var(--bg-main);
}

    .layout-footer a {
        color: var(--accent);
        text-decoration: none;
    }

.stats-card {
    background: linear-gradient(180deg, var(--bg-card), var(--bg-main));
    border: 1px solid var(--border-main);
    border-radius: 18px;
    padding: 18px;
    margin-top: 18px;
    position: relative;
    padding-top: 20px;
    margin-bottom: 20px;
}
.stat-row span {
    min-width: 0;
    word-break: break-word;
}
    .stat-row span {
        display: block;
        line-height: 1.4;
    }
.stat-row {
    display: flex;
    align-items: center;

    min-height: 44px;        /* 🔥 фиксируем высоту строки */
    padding: 0 0 10px 0;     /* отступ только вниз */

    gap: 18px;
    border-bottom: 1px solid var(--border-soft);
}

    .stat-row span {
        line-height: 1.4;
        white-space: normal; /* ✅ разрешаем перенос */
    }

.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 8px;
}
.tg-panel,
.user-card,
.stats-card {
    width: 100%;
    box-sizing: border-box;
}
.tg-panel {
    width: 100%;
}

.panel-block {
    background: linear-gradient(180deg, var(--bg-card), var(--bg-main));
    border: 1px solid var(--border-main);
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 24px;
}


    /* ВСЁ внутри одинаковой ширины */
    .panel-block select,
    .user-card,
    .stats-card {
        width: 100%;
        box-sizing: border-box;
    }


/* ===== LOGIN ===== */

.login-card {
    background: var(--bg-card);
    border-radius: 18px;
    padding: 30px 35px;
    max-width: 520px;
    margin: 0px auto;
    box-shadow: 0 0 0 1px var(--border-soft);
}

.login-header {
    display: flex;
    gap: 18px;
    align-items: center;
    margin-bottom: 25px;
}

.login-icon {
    font-size: 42px;
}

.login-title {
    font-size: 22px;
    font-weight: 600;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

.login-info {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 30px;
}

    .login-info p {
        margin-bottom: 12px;
    }

    .login-info ul {
        padding-left: 18px;
        margin: 0;
    }

    .login-info li {
        margin: 6px 0;
    }

.login-button {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}
.stats-title {
    font-size: 18px;
    font-weight: 600;
    padding-bottom: 10px;
}
.steam-box {
    display: flex;
    gap: 14px;
    align-items: center;
}

    .steam-box img {
        width: 48px;
        height: 48px;
        border-radius: 50%;
    }
.steam-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-radius: 14px;
    min-width: 220px;
}

    .steam-card img {
        width: 48px;
        height: 48px;
        border-radius: 50%;
    }

.steam-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.steam-name {
    font-weight: 600;
    font-size: 15px;
}

.steam-status {
    font-size: 13px;
}

    .steam-status.online {
        color: #3fb950;
    }

.steam-game {
    font-size: 13px;
    color: var(--steam-accent);
    text-decoration: none;
}
.steam-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-radius: 14px;
}

    .steam-card img {
        width: 48px;
        height: 48px;
        border-radius: 50%;
    }

.steam-info {
    display: flex;
    flex-direction: column;
}

.steam-name {
    font-weight: 600;
    font-size: 15px;
    color: #58a6ff;
    text-decoration: none;
}

    .steam-name:hover {
        text-decoration: underline;
    }

    .steam-game:hover {
        text-decoration: underline;
    }

.steam-status {
    font-size: 13px;
}

    .steam-status.online {
        color: #3fb950;
    }

    .steam-status.busy {
        color: #d29922;
    }

    .steam-status.away {
        color: #f85149;
    }


.steam-status.offline {
    color: var(--text-muted);
}
.steam-playing {
    font-size: 12px;
    color: var(--steam-accent);
}

.steam-lastseen {
    font-size: 12px;
}
.steam-card img {
    width: 64px;
    height: 64px;
    min-width: 64px;
    min-height: 64px;
    border-radius: 50%;
    flex-shrink: 0;
}
.uc-links {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-main);
}
/* ===== ОБЩАЯ КАРТОЧКА ===== */
.steam-card,
.twitch-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-radius: 14px;
    min-width: 240px;
    max-width: 100%;
}

    /* ===== АВАТАР ===== */

    .steam-card img,
    .twitch-card img {
        width: 64px;
        height: 64px;
        min-width: 64px;
        min-height: 64px;
        border-radius: 50%;
        object-fit: cover;
        flex-shrink: 0;
    }

/* ===== INFO ===== */

.steam-info,
.twitch-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ===== TITLES ===== */

.steam-name {
    font-weight: 600;
    font-size: 15px;
    color: #58a6ff;
    text-decoration: none;
}

.twitch-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--twitch-accent);
    text-decoration: none;
}

    .steam-name:hover,
    .twitch-name:hover {
        text-decoration: underline;
    }

.steam-lastseen {
    font-size: 12px;
}

/* ===== TWITCH ===== */

.twitch-card {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 12px 16px;
    border-radius: 14px;
}

    .twitch-card img,
    .twitch-avatar-fallback {
        width: 64px;
        height: 64px;
        border-radius: 50%;
        flex-shrink: 0;
    }

.twitch-avatar-fallback {
    background: #161b22;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.twitch-name {
    font-weight: 600;
    color: #58a6ff;
    text-decoration: none;
}

.steam-card,
.twitch-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    flex: 1; 
    min-width: 0;
}
.twitch-avatar-fallback {
    width: 64px;
    height: 64px;
    min-width: 64px;
    min-height: 64px;
    border-radius: 50%;
    background: var(--bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .twitch-avatar-fallback img {
        width: 36px;
        height: 36px;
        object-fit: contain;
    }

.calendar-stat {
    margin-top: 16px;
}

/* 📱 телефон */
@media (max-width: 768px) {
    .calendar-grid {
        grid-template-columns: 1fr;
    }
}

.calendar-month {
    background: var(--bg-soft);
    border-radius: 12px;
    padding: 10px;
    max-width: 100%;
    overflow: hidden;
}

.month-title {
    text-align: center;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: capitalize;
    opacity: .9;
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

/* дни */
.day {
    background: var(--calendar-day-bg);
    border-radius: 4px;
    padding: 4px 2px;
    font-size: 11px;
    text-align: center;
    min-height: 42px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.day-num {
    font-size: 10px;
    opacity: .6;
}

.day-msg {
    font-weight: 600;
    font-size: 11px;
}

.day-sym {
    font-size: 9px;
    opacity: .6;
}

/* пустые дни */
.day.empty {
    opacity: .25;
}

.month-total {
    margin-top: 6px;
    padding-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    border-top: 1px solid rgba(255,255,255,.08);
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* 📱 телефон */
@media (max-width: 768px) {
    .calendar-grid {
        grid-template-columns: 1fr;
    }
}


.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px; /* ✅ нормальный отступ */
}

.day.lvl-1 {
    background: rgba(88,166,255,.15);
}

.day.lvl-2 {
    background: rgba(88,166,255,.30);
}

.day.lvl-3 {
    background: rgba(88,166,255,.50);
}

.day.lvl-4 {
    background: rgba(88,166,255,.75);
}
.day.today {
    outline: 2px solid var(--success);
    outline-offset: -2px;
    box-shadow: 0 0 0 2px rgba(var(--success-rgb), .25);
}

/* ===== VINNI DEVICES (CLEAN) ===== */

.vinni-device {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.vinni-device-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.vinni-device-name {
    font-size: 16px;
    font-weight: 600;
}

.vinni-device-hint {
    font-size: 13px;
    color: var(--text-muted);
}

.vinni-device-qr img {
    width: 160px;
    height: 160px;
    border-radius: 12px;
    border: 5px solid var(--border-soft);
    background: var(--bg-card);
    position: absolute;
    top: 18px;
    right: 18px;
}

.copy-link {
    cursor: pointer;
    color: var(--accent);
}

    .copy-link:hover {
        text-decoration: underline;
    }
.auto-links-title {
    font-size: 14px; 
    font-weight: 600;
    margin-top: 8px;
}

.uc-email {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ===== TELEGRAM BLUE · MATTE BUTTON ===== */

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    /* Telegram blue, но мягкий */
    color: #fff;
    background: #229ED9; /* основной TG */
    border: 1px solid rgba(34, 158, 217, .55);
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, transform .12s ease;
}

    /* hover — чуть темнее, без glow */
    .btn-primary:hover {
        background: #1d8fc6;
        border-color: #1d8fc6;
        transform: translateY(-1px);
    }

    /* active — лёгкий “клик” */
    .btn-primary:active {
        background: #1986b8;
        transform: scale(.98);
    }

    /* иконка */
    .btn-primary .icon {
        font-size: 17px;
        line-height: 1;
    }

/* ===== LOGIN PAGE POLISH ===== */

.login-card {
    background: linear-gradient( 180deg, var(--bg-card), var(--bg-main) );
    border: 1px solid var(--border-main);
}

/* заголовок более «геройский» */
.login-title {
    font-size: 24px;
    letter-spacing: .2px;
}

/* подзаголовок — спокойный */
.login-subtitle {
    margin-top: 2px;
    font-size: 13px;
    color: var(--text-muted);
}

/* текст */
.login-info {
    font-size: 14px;
    line-height: 1.6;
}

/* нижняя подсказка */
.login-hint {
    margin-top: 22px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

/* центрируем telegram widget аккуратнее */
.login-button {
    margin-top: 26px;
    display: flex;
    justify-content: center;
}

.navbar-actions {
    display: flex;
    align-items: center; /* 🔥 центр по вертикали */
}

.theme-toggle-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-main);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    box-shadow: none;
    transition: background .2s ease, transform .15s ease;
}

    .theme-toggle-btn:hover {
        background: var(--bg-soft);
        transform: translateY(-1px);
    }

    .theme-toggle-btn:active {
        transform: scale(.96);
    }


.btn-apple {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-main);
    background: linear-gradient(180deg, var(--bg-card), var(--bg-main));
    border: 1px solid var(--border-main);
    transition: transform .15s ease, box-shadow .15s ease;
}

    .btn-apple:hover {
        transform: translateY(-1px);
        box-shadow: 0 8px 22px var(--shadow-soft);
    }

/* ===== iOS STYLE TAB BAR ===== */

.ios-tabbar {
    display: none; /* по умолчанию скрыто */
}

@media (max-width: 768px) {
    .ios-tabbar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 64px;
        background: rgba(255, 255, 255, 0.06);
        backdrop-filter: blur(22px) saturate(180%);
        -webkit-backdrop-filter: blur(22px) saturate(180%);
        border-top: 1px solid var(--border-main);
        display: flex;
        justify-content: space-around;
        align-items: center;
        z-index: 9998;
    }

        .ios-tabbar .tab-item {
            flex: 1;
            text-align: center;
            text-decoration: none;
            color: var(--text-muted);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            gap: 2px;
        }

        .ios-tabbar .icon {
            font-size: 20px;
            line-height: 1;
        }

        .ios-tabbar .tab-item.active {
            color: var(--accent);
        }

    /* чтобы контент не прятался под таббар */
    .layout-content {
        padding-bottom: 80px;
    }

    /* верхнее меню на телефоне можно сделать менее важным */
    .tg-navbar {
        position: sticky;
        top: 0;
        z-index: 1000;
        position: relative;
    }
}

@media (max-width: 768px) {
    .tg-navbar .navbar-nav {
        display: none;
        position: relative;
    }
}

/* ===== UNIVERSAL STATUS SYSTEM ===== */

.status {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

    .status::before {
        content: "";
        width: 8px;
        height: 8px;
        border-radius: 50%;
        display: inline-block;
    }

.status-live {
    color: var(--success);
}

    .status-live::before {
        background: var(--success);
    }

.status-online {
    color: var(--success);
}

    .status-online::before {
        background: var(--success);
    }

.status-busy {
    color: var(--warning);
}

    .status-busy::before {
        background: var(--warning);
    }

.status-offline {
    color: var(--text-muted);
}

    .status-offline::before {
        background: var(--text-muted);
    }

/* Никнеймы одинаковые */
.steam-name,
.twitch-name {
    color: var(--accent);
}

/* ===== GAME LINK (UNIFIED) ===== */

.game-link {
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

    .game-link:hover {
        text-decoration: underline;
    }

/* если игра активная (стрим / играет) */
.status-live + .game-link,
.status-online + .game-link {
    opacity: 0.9;
}
.game-inline {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

    .game-inline:hover {
        text-decoration: underline;
    }
.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    line-height: 1.2;
}

    .status::before {
        content: "";
        width: 8px;
        height: 8px;
        border-radius: 50%;
        flex-shrink: 0;
    }
.steam-card,
.twitch-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    flex: 1 1 0; /* ← важно */
}
@media (max-width: 768px) {
    .uc-links {
        flex-direction: column;
    }

        .uc-links > * {
            flex: 1 1 100%;
        }
}
.login-card form .btn-primary {
    width: 100%;
    justify-content: center;
}
.login-card input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-soft);
    color: var(--text-main);
    border: 1px solid var(--border-main);
    border-radius: 10px;
    outline: none;
}

    .login-card input:focus {
        border-color: var(--accent);
    }
.form-error {
    background: rgba(248,81,73,.12);
    border: 1px solid var(--danger);
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 13px;
}
.auth-switch {
    margin-top: 16px;
    text-align: center;
}

    .auth-switch a {
        color: var(--accent);
        text-decoration: none;
        font-size: 13px;
    }

        .auth-switch a:hover {
            text-decoration: underline;
        }
.btn-primary,
.btn-secondary,
.btn-apple {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

.tg-link-box {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border-main);
}

.tg-link-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.tg-link-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 14px;
}
.settings-group {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--border-soft);
}

    .settings-group:first-of-type {
        border-top: none;
        padding-top: 0;
        margin-top: 10px;
    }

.settings-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-muted);
}

.panel-block input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-soft);
    color: var(--text-main);
    border: 1px solid var(--border-main);
    border-radius: 10px;
    outline: none;
    transition: border .15s ease, box-shadow .15s ease;
}

    .panel-block input:focus {
        border-color: var(--accent);
        box-shadow: 0 0 0 2px rgba(var(--accent-rgb), .25);
    }
.setting-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-soft);
}

    .setting-row:last-child {
        border-bottom: none;
    }

.setting-info {
    min-width: 180px;
}

.setting-name {
    font-weight: 600;
    font-size: 14px;
}

.setting-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.setting-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    flex: 1;
}

    .setting-form input {
        flex: 1;
        min-width: 140px;
    }

    .setting-form .btn-primary {
        width: auto;
        padding: 8px 14px;
    }

@media (max-width: 768px) {
    .setting-row {
        flex-direction: column;
    }

    .setting-info {
        min-width: 100%;
    }

    .setting-form {
        width: 100%;
    }
}
.user-card {
    margin-bottom: 20px;
}
.status-error {
    color: var(--danger);
}

    .status-error::before {
        background: var(--danger);
    }

/* ===== LEGAL TEXT ===== */
.legal-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-main);
}

    .legal-text p {
        margin-bottom: 12px;
    }

    .legal-text ul {
        padding-left: 18px;
        margin: 10px 0;
    }

    .legal-text li {
        margin: 6px 0;
        color: var(--text-muted);
    }

/* ===== SMOOTH SCROLL ===== */
html {
    scroll-behavior: smooth;
}

.legal-nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

    .legal-nav .btn-apple {
        width: 100%;
    }

@media (max-width: 500px) {
    .legal-nav {
        grid-template-columns: 1fr;
    }
}
.tg-raw-link {
    font-family: monospace;
    font-size: .875em;
    color: var(--accent);
    text-decoration: none;
    word-break: break-all;
    cursor: pointer;
}

    .tg-raw-link:hover {
        text-decoration: underline;
    }

.layout-content {
    flex: 1;
    padding: 4px;
    padding-bottom: 80px; 
}

.layout-footer {
    margin-top: auto;
}
@media (max-width: 768px) {
    .layout {
        padding-bottom: 60px;
    }
}
.login-button {
    margin-bottom: 16px;
}

/* ===== PAY PAGE ===== */

.pay-warning {
    background: rgba(248,81,73,.15);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 13px;
    text-align: center;
}

.pay-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

@media (max-width: 600px) {
    .pay-grid {
        grid-template-columns: 1fr;
    }
}

.pay-card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    padding: 16px;
    text-align: center;
}

.pay-title {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.pay-price {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}

.tg-pay-info {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border-soft);
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}
.profile-actions {
    margin-top: 14px;
}
/* ===== QUICK SETUP ===== */

.quick-setup {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* HAPP BLOCK */

.qs-happ {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    padding: 14px;
}

.qs-happ-left {
    flex: 1;
    min-width: 0;
}

.qs-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.qs-link-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

    .qs-link-row code {
        flex: 1;
        word-break: break-all;
    }

.qs-copy-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: 10px;
    padding: 6px 10px;
    cursor: pointer;
}

/* APPS */

.qs-apps {
    display: flex;
    gap: 10px;
}

.qs-app-btn {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 12px;
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: .15s;
}

    .qs-app-btn:hover {
        background: var(--accent);
        color: white;
    }

/* TELEGRAM */

.qs-telegram-title {
    font-size: 13px;
    color: var(--text-muted);
}

.qs-telegram {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.qs-tg-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-main);
    transition: .15s;
}

    .qs-tg-item:hover {
        border-color: var(--accent);
        background: rgba(var(--accent-rgb), .1);
    }

/* ===== QUICK SETUP STEPS ===== */

.qs-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(var(--accent-rgb), 0.06);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 12px;
}

.qs-step {
    font-size: 13px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.qs-step-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

/* ===== PRIMARY (AUTO SETUP BUTTON) ===== */

.qs-app-btn--primary {
    background: var(--success-soft);
    color: #fff;
    border: 1px solid rgba(46,160,67,.6);
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

.qs-app-btn.qs-app-btn--primary:hover {
    background: var(--success-soft);
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.icon-md {
    width: 24px;
    height: 24px;
    object-fit: contain;
}
.icon-mdm {
    width: 20px;
    height: 20px;
    object-fit: contain;
}
.icon-button {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.vinni-device-name {
    display: flex;
    align-items: center;
    gap: 4px;
}
.qs-label {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* textarea */
.tg-textarea {
    width: 100%;
    min-height: 100px;
    resize: vertical;
    padding: 10px 12px;
    background: var(--bg-soft);
    color: var(--text-main);
    border: 1px solid var(--border-main);
    border-radius: 10px;
    outline: none;
}

/* switch toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
}

    .switch input {
        display: none;
    }

    .switch span {
        position: absolute;
        cursor: pointer;
        inset: 0;
        background: var(--border-main);
        border-radius: 20px;
        transition: .2s;
    }

        .switch span::before {
            content: "";
            position: absolute;
            height: 16px;
            width: 16px;
            left: 3px;
            top: 3px;
            background: white;
            border-radius: 50%;
            transition: .2s;
        }

    .switch input:checked + span {
        background: var(--accent);
    }

        .switch input:checked + span::before {
            transform: translateX(20px);
        }

.setting-row-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .setting-row-toggle .setting-info {
        max-width: 70%;
    }

.tg-textarea {
    width: 100%;
    min-height: 80px;
    resize: none; /* ❗ убираем ручной ресайз */
    padding: 10px 12px;
    background: var(--bg-soft);
    color: var(--text-main);
    border: 1px solid var(--border-main);
    border-radius: 10px;
    outline: none;
    line-height: 1.5;
}

.tg-text-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    line-height: 1.5;
}

    .tg-text-hint code {
        background: var(--bg-soft);
        padding: 2px 6px;
        border-radius: 6px;
    }

.tg-format-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}

    .tg-format-list div {
        font-size: 12px;
        color: var(--text-muted);
        line-height: 1.4;
    }

    .tg-format-list code {
        background: var(--bg-soft);
        padding: 2px 6px;
        border-radius: 6px;
        font-size: 12px;
    }

.settings-title-Rudolf {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tg-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(46,160,67,.95);
    color: #fff;
    padding: 12px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    box-shadow: 0 10px 25px rgba(0,0,0,.25);
    z-index: 9999;
    animation: toast-in .25s ease;
}

.tg-toast-icon {
    font-size: 16px;
}

.tg-toast.hide {
    opacity: 0;
    transform: translateY(-10px);
    transition: .25s;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.setting-row-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

    .setting-row-toggle .setting-info {
        flex: 1;
        min-width: 0;
    }
@media (max-width: 768px) {
    .setting-row-toggle {
        flex-direction: row; 
        align-items: center;
    }

        .setting-row-toggle .setting-info {
            flex: 1;
        }

        .setting-row-toggle .switch {
            flex-shrink: 0; 
        }
}