/* =====================================================
   BuildStart — Design System v12
   ===================================================== */

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

/* =================== TOKENS =================== */
:root {
    --tg-bg:           var(--tg-theme-bg-color, #0d0d14);
    --tg-text:         var(--tg-theme-text-color, #ffffff);
    --tg-hint:         var(--tg-theme-hint-color, #6b7280);
    --tg-secondary-bg: var(--tg-theme-secondary_bg_color, #161621);

    --accent:      #7c6ef0;
    --accent-2:    #9b6ef0;
    --accent-glow: rgba(124,110,240,0.28);
    --accent-soft: rgba(124,110,240,0.12);
    --gold:        #f5c842;
    --gold-2:      #e8943a;
    --gold-glow:   rgba(245,200,66,0.22);
    --danger:      #ff4a6a;
    --success:     #34d399;

    --s0:  #0d0d14;
    --s1:  rgba(255,255,255,0.04);
    --s2:  rgba(255,255,255,0.08);
    --s3:  rgba(255,255,255,0.12);
    --sh:  rgba(255,255,255,0.09);
    --bdr: rgba(255,255,255,0.08);
    --bdr2:rgba(255,255,255,0.06);
    --bda: rgba(124,110,240,0.3);

    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 18px;
    --r-xl: 24px;

    --nav-h:  70px;
    --hdr-h:  58px;
    --font:   'Inter', -apple-system, sans-serif;
    --ease:   cubic-bezier(0.25,0.8,0.25,1);
    --spring: cubic-bezier(0.34,1.56,0.64,1);
}

/* =================== RESET =================== */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; -webkit-tap-highlight-color:transparent; }
html,body { height:100%; }
body {
    font-family: var(--font);
    background: var(--tg-bg);
    color: var(--tg-text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
}

/* =================== LAYOUT =================== */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 600px;
    margin: 0 auto;
}

/* =================== HEADER =================== */
.app-header {
    position: sticky;
    top: 0;
    z-index: 200;
    height: var(--hdr-h);
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(13,13,20,0.92);
    border-bottom: 1px solid var(--bdr);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    flex-shrink: 0;
}

.header-brand { display:flex; align-items:center; gap:9px; }

.header-menu-btn {
    background: none;
    border: none;
    color: var(--tg-hint);
    cursor: pointer;
    padding: 7px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    transition: color .2s, background .2s;
}
.header-menu-btn:active { background: var(--s2); color: var(--tg-text); }

.header-logo {
    width: 33px;
    height: 33px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 12px var(--accent-glow);
    flex-shrink: 0;
}

.header-title { font-size:17px; font-weight:800; letter-spacing:-.3px; }

.header-right { display:flex; align-items:center; gap:9px; }

.balance-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--s1);
    border: 1px solid var(--bdr);
    border-radius: 20px;
    padding: 5px 11px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s var(--ease);
}
.balance-chip:active { transform: scale(.96); background: var(--s2); }
.balance-val { color: var(--gold); }

.lang-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: none;
    color: white;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 12px var(--accent-glow);
    transition: transform .2s var(--spring);
    font-family: var(--font);
}
.lang-btn:active { transform: scale(.9); }

/* =================== PAGE CONTENT =================== */
.page-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: calc(var(--nav-h) + 8px);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.page-content::-webkit-scrollbar { display: none; }

/* =================== VIEWS =================== */
.view { display:none; }
.view.active {
    display: block;
    animation: fadeUp .28s var(--ease) forwards;
}
@keyframes fadeUp {
    from { opacity:0; transform:translateY(8px); }
    to   { opacity:1; transform:translateY(0); }
}

/* =================== HERO BANNER =================== */
.hero-banner {
    background: linear-gradient(145deg, #1c0f40 0%, #110d2e 40%, #0f0a22 70%, #0d0d14 100%);
    border-bottom: 1px solid rgba(124,110,240,0.14);
    padding: 20px 18px 22px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    min-height: 210px;
    position: relative;
    overflow: hidden;
}
.hero-banner::before {
    content:'';
    position: absolute;
    top: -50px; right: -30px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(155,110,240,.22), transparent 70%);
    pointer-events: none;
}

.hero-left { z-index: 1; }

.hero-title {
    font-size: 23px;
    font-weight: 900;
    line-height: 1.18;
    letter-spacing: -.4px;
    color: #fff;
    margin-bottom: 6px;
}

.hero-sub {
    font-size: 13px;
    color: rgba(200,190,240,.7);
    font-weight: 500;
    margin-bottom: 13px;
}

.hero-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 18px;
}
.hero-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,.85);
}

.hero-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.hero-right {
    position: relative;
    width: 140px;
    height: 160px;
    flex-shrink: 0;
    z-index: 1;
}

.hero-robot {
    width: 135px;
    height: 150px;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(155,110,240,.5));
    animation: floatY 3s ease-in-out infinite;
}
@keyframes floatY {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-7px); }
}

/* Floating icons */
.hf {
    position: absolute;
    border-radius: 10px;
    animation: bob 4s ease-in-out infinite;
}
.hf-chat { top:  2px; left:-12px; animation-delay:  0s; }
.hf-code { bottom:46px; left:-18px; animation-delay: 1s; }
.hf-play { top: 28px; right:-10px; animation-delay:.5s; }
.hf-star { bottom: 8px; right: 4px; animation-delay:1.5s; }
@keyframes bob {
    0%,100% { transform:translateY(0) rotate(0); }
    40%     { transform:translateY(-5px) rotate(3deg); }
    70%     { transform:translateY(3px) rotate(-2deg); }
}

/* =================== HERO BUTTONS =================== */
.btn-glass {
    padding: 11px 15px;
    font-size: 14px;
    font-weight: 700;
    border-radius: var(--r-md);
    background: rgba(255,255,255,.10);
    color: white;
    border: 1px solid rgba(255,255,255,.18);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all .18s var(--ease);
    font-family: var(--font);
}
.btn-glass:active { transform:scale(.96); background:rgba(255,255,255,.16); }

/* =================== SECTION HEADER =================== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    margin-bottom: 10px;
}
.section-title {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.3px;
}
.section-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 2px;
    font-family: var(--font);
    transition: opacity .2s;
}
.section-link:active { opacity: .7; }

/* =================== BOTS ROW (home preview) =================== */
.bots-row {
    display: flex;
    gap: 11px;
    overflow-x: auto;
    padding: 0 16px 4px;
    scrollbar-width: none;
}
.bots-row::-webkit-scrollbar { display: none; }

.bot-mini-card {
    background: var(--s1);
    border: 1px solid var(--bdr);
    border-radius: var(--r-lg);
    padding: 15px 13px;
    min-width: 148px;
    max-width: 160px;
    flex-shrink: 0;
    cursor: pointer;
    transition: all .2s var(--ease);
}
.bot-mini-card:active { transform:scale(.97); background:var(--s2); }

.bmc-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 10px;
}
.bmc-av-purple { background:linear-gradient(135deg,#7c5af0,#9b6ef0); box-shadow:0 4px 14px rgba(155,110,240,.4); }
.bmc-av-pink   { background:linear-gradient(135deg,#d05af0,#c84fbd); box-shadow:0 4px 14px rgba(208,90,240,.35); }
.bmc-av-orange { background:linear-gradient(135deg,#e98939,#f5c842); box-shadow:0 4px 14px rgba(233,137,57,.35); }
.bmc-av-blue   { background:linear-gradient(135deg,#3b82f6,#6c8bef); box-shadow:0 4px 14px rgba(59,130,246,.35); }

.bmc-name {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bmc-user {
    font-size: 11px;
    color: var(--tg-hint);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bmc-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    margin-bottom: 10px;
}
.bmc-tag.premium { background:var(--gold-glow); color:var(--gold); border:1px solid rgba(245,200,66,.22); }
.bmc-tag.free    { background:var(--accent-soft); color:var(--accent); border:1px solid var(--bda); }
.bmc-tag.standard { background:rgba(45,212,191,.12); color:#2dd4bf; border:1px solid rgba(45,212,191,.22); }

.bmc-stats-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 2px;
}
.bmc-num {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -.5px;
}
.bmc-plus {
    font-size: 11px;
    font-weight: 700;
    color: var(--success);
}
.bmc-label {
    font-size: 10px;
    color: var(--tg-hint);
    margin-bottom: 8px;
}

.bmc-chart {
    height: 30px;
    margin: 0 0 10px;
}
.bmc-chart svg { width:100%; height:100%; }

.bmc-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.bmc-open { font-size:12px; font-weight:600; color:var(--accent); }
.bmc-dots { color:var(--tg-hint); font-size:15px; letter-spacing:1px; line-height:1; }

/* =================== QUICK ACTIONS =================== */
.qa-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 9px;
    padding: 0 16px;
    margin-bottom: 4px;
}

.qa-item {
    background: var(--s1);
    border: 1px solid var(--bdr);
    border-radius: var(--r-lg);
    padding: 13px 9px 11px;
    cursor: pointer;
    transition: all .2s var(--ease);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.qa-item:active { transform:scale(.96); background:var(--s2); }

.qa-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 9px;
}
.qa-purple { background:linear-gradient(135deg,rgba(124,110,240,.25),rgba(155,110,240,.12)); box-shadow:0 3px 12px rgba(124,110,240,.22); }
.qa-blue   { background:linear-gradient(135deg,rgba(108,139,239,.25),rgba(99,102,241,.12)); box-shadow:0 3px 12px rgba(108,139,239,.22); }
.qa-orange { background:linear-gradient(135deg,rgba(233,137,57,.25),rgba(245,200,66,.10)); box-shadow:0 3px 12px rgba(233,137,57,.22); }
.qa-teal   { background:linear-gradient(135deg,rgba(45,212,191,.22),rgba(52,211,153,.10)); box-shadow:0 3px 12px rgba(45,212,191,.2); }
.qa-green  { background:linear-gradient(135deg,rgba(52,211,153,.22),rgba(45,212,191,.10)); box-shadow:0 3px 12px rgba(52,211,153,.2); }
.qa-violet { background:linear-gradient(135deg,rgba(167,143,255,.22),rgba(155,110,240,.10)); box-shadow:0 3px 12px rgba(167,143,255,.2); }
.qa-indigo { background:linear-gradient(135deg,rgba(99,102,241,.22),rgba(108,139,239,.10)); box-shadow:0 3px 12px rgba(99,102,241,.2); }
.qa-gray   { background:linear-gradient(135deg,rgba(148,163,184,.18),rgba(100,116,139,.10)); box-shadow:0 3px 12px rgba(148,163,184,.14); }

.qa-name { font-size:11.5px; font-weight:700; color:var(--tg-text); line-height:1.2; margin-bottom:2px; }
.qa-hint { font-size:10px; color:var(--tg-hint); font-weight:500; line-height:1.3; }

/* =================== PREMIUM STRIP BANNER =================== */
.prem-banner-strip {
    margin: 16px 16px 8px;
    background: linear-gradient(135deg, #1d1050, #140e38);
    border: 1px solid rgba(155,110,240,.28);
    border-radius: var(--r-xl);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-shadow: 0 6px 28px rgba(108,139,239,.14);
}
.prem-strip-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.prem-strip-title { font-size:14px; font-weight:800; color:#c084fc; margin-bottom:2px; }
.prem-strip-sub   { font-size:11px; color:rgba(192,132,252,.55); font-weight:500; line-height:1.3; }

/* =================== VIEW HEADER =================== */
.view-header {
    padding: 12px 16px 4px;
}
.view-title {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -.4px;
    margin-bottom: 3px;
}
.view-subtitle {
    font-size: 13px;
    color: var(--tg-hint);
    margin-bottom: 6px;
}
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 0 0 10px;
    font-family: var(--font);
    transition: opacity .2s;
}
.btn-back:active { opacity: .7; }

/* =================== FORMS =================== */
.form-section {
    padding: 0 16px;
    margin-bottom: 18px;
}
.form-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--tg-hint);
    letter-spacing: .8px;
    text-transform: uppercase;
    margin-bottom: 7px;
}
.form-input {
    width: 100%;
    padding: 13px 15px;
    background: var(--s1);
    border: 1px solid var(--bdr);
    border-radius: var(--r-md);
    color: var(--tg-text);
    font-family: var(--font);
    font-size: 15px;
    outline: none;
    transition: all .2s var(--ease);
}
.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--s2);
}
.form-input::placeholder { color: var(--tg-hint); }
textarea.form-input { resize:vertical; min-height:100px; line-height:1.5; }
.form-hint { font-size:12px; color:var(--tg-hint); margin-top:6px; }

/* =================== CARDS =================== */
.card {
    background: var(--s1);
    border: 1px solid var(--bdr);
    border-radius: var(--r-lg);
    padding: 16px;
    transition: all .2s var(--ease);
}
.card + .card { margin-top: 11px; }
.card-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 14px;
}

/* =================== BUTTONS =================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 12px 18px;
    border-radius: var(--r-md);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all .18s var(--ease);
    font-family: var(--font);
    outline: none;
    letter-spacing: -.1px;
    position: relative;
}
.btn:active { transform: scale(.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    box-shadow: 0 4px 16px var(--accent-glow);
}
.btn-primary:active { box-shadow: 0 2px 8px var(--accent-glow); }

.btn-secondary {
    background: var(--s2);
    color: var(--tg-text);
    border: 1px solid var(--bdr);
}
.btn-danger {
    background: rgba(255,74,106,.12);
    color: var(--danger);
    border: 1px solid rgba(255,74,106,.2);
}
.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-2));
    color: #1a0d00;
    font-weight: 800;
    box-shadow: 0 4px 16px var(--gold-glow);
}
.btn-gold:active { box-shadow: 0 2px 8px var(--gold-glow); }

.btn-sm   { padding:8px 13px; font-size:13px; border-radius:var(--r-sm); }
.btn-block { width:100%; }
.btn-icon-only { width:34px; height:34px; padding:0; border-radius:var(--r-sm); }

/* =================== TEMPLATES CAROUSEL =================== */
.templates-carousel {
    display: flex;
    gap: 12px;
    padding: 0 16px 12px;
    margin: 0 -16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.templates-carousel::-webkit-scrollbar {
    display: none;
}
.templates-carousel .tpl-card {
    min-width: 250px;
    max-width: 280px;
    flex: 0 0 auto;
    scroll-snap-align: center;
}

/* =================== TEMPLATES =================== */
.templates-grid {
    display: flex;
    flex-direction: column;
    gap: 11px;
    padding: 0 16px 16px;
}

.tpl-card {
    background: var(--s1);
    border: 1px solid var(--bdr);
    border-radius: var(--r-lg);
    padding: 18px;
    cursor: pointer;
    transition: all .2s var(--ease);
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
}
.tpl-card:active { transform:scale(.98); }
.tpl-card.selected,
.tpl-card.featured {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.tpl-card-icon {
    width: 54px;
    height: 54px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}

.tpl-card-body { flex: 1; min-width: 0; }
.tpl-card-name { font-size:16px; font-weight:700; margin-bottom:4px; }
.tpl-card-desc { font-size:13px; color:var(--tg-hint); line-height:1.4; }
.tpl-card-tags { display:flex; gap:6px; margin-top:8px; flex-wrap:wrap; }

.tpl-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
}
.tpl-tag-free   { background:rgba(52,211,153,.15); color:var(--success); border:1px solid rgba(52,211,153,.25); }
.tpl-tag-prem   { background:var(--gold-glow); color:var(--gold); border:1px solid rgba(245,200,66,.22); }
.tpl-tag-pop    { background:var(--accent-soft); color:var(--accent); border:1px solid var(--bda); }

.tpl-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    background: var(--success);
    color: #000;
}

/* Create form template picker */
.create-tpl-list { display:flex; flex-direction:column; gap:9px; }
.create-tpl-item {
    background: var(--s1);
    border: 2px solid transparent;
    border-radius: var(--r-lg);
    padding: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 13px;
    transition: all .2s var(--ease);
}
.create-tpl-item:active { transform:scale(.98); }
.create-tpl-item.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.create-tpl-item-icon { width:48px; height:48px; border-radius:13px; display:flex; align-items:center; justify-content:center; font-size:24px; flex-shrink:0; background:var(--accent-soft); }
.create-tpl-item-name { font-size:15px; font-weight:700; margin-bottom:3px; }
.create-tpl-item-desc { font-size:12px; color:var(--tg-hint); }
.create-tpl-item-badge { margin-left:auto; font-size:10px; font-weight:700; padding:2px 8px; border-radius:20px; background:var(--success); color:#000; flex-shrink:0; }

/* =================== BOTS LIST =================== */
.bot-card {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 15px 16px;
    margin: 0 16px 10px;
    background: var(--s1);
    border: 1px solid var(--bdr);
    border-radius: var(--r-lg);
    cursor: pointer;
    transition: all .2s var(--ease);
}
.bot-card:active { transform:scale(.98); background:var(--s2); }

.bot-avatar {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}
.bot-av-purple { background:linear-gradient(135deg,#7c5af0,#9b6ef0); box-shadow:0 4px 12px rgba(155,110,240,.4); }
.bot-av-pink   { background:linear-gradient(135deg,#d05af0,#c84fbd); box-shadow:0 4px 12px rgba(208,90,240,.35); }
.bot-av-orange { background:linear-gradient(135deg,#e98939,#f5c842); box-shadow:0 4px 12px rgba(233,137,57,.35); }
.bot-av-blue   { background:linear-gradient(135deg,#3b82f6,#6c8bef); box-shadow:0 4px 12px rgba(59,130,246,.35); }

.bot-info { flex:1; min-width:0; }
.bot-name { font-size:15px; font-weight:700; margin-bottom:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bot-meta { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }

.bot-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.bot-tag.premium { background:var(--gold-glow); color:var(--gold); border:1px solid rgba(245,200,66,.22); }
.bot-tag.free    { background:var(--accent-soft); color:var(--accent); border:1px solid var(--bda); }

.bot-stat-mini { font-size:11px; color:var(--tg-hint); }
.bot-arrow { color:var(--tg-hint); display:flex; align-items:center; flex-shrink:0; }

/* =================== EMPTY STATE =================== */
.empty-state {
    text-align: center;
    padding: 50px 20px;
}
.empty-icon { font-size:52px; margin-bottom:13px; }
.empty-title { font-size:18px; font-weight:800; margin-bottom:7px; }
.empty-sub { font-size:14px; color:var(--tg-hint); line-height:1.5; }

/* =================== BOT SETTINGS =================== */
.bot-hero-card {
    margin: 0 16px 14px;
    background: linear-gradient(135deg, var(--s2), var(--s1));
    border: 1px solid var(--bdr);
    border-radius: var(--r-xl);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.bot-hero-avatar {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 20px var(--accent-glow);
}
.bot-hero-info { flex:1; }
.bot-hero-name { font-size:18px; font-weight:700; margin-bottom:6px; }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
}
.status-badge.free    { background:var(--s2); color:var(--tg-hint); border:1px solid var(--bdr); }
.status-badge.premium { background:var(--gold-glow); color:var(--gold); border:1px solid rgba(245,200,66,.28); }

/* =================== SECTION TABS =================== */
.stabs {
    display: flex;
    gap: 7px;
    padding: 0 16px 14px;
    overflow-x: auto;
    scrollbar-width: none;
}
.stabs::-webkit-scrollbar { display:none; }

.stab {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border-radius: 22px;
    border: 1px solid var(--bdr);
    background: var(--s1);
    color: var(--tg-hint);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all .2s var(--ease);
}
.stab:active { transform:scale(.96); }
.stab.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.spanel { display:none; padding:0 16px; }
.spanel.active { display:block; animation:fadeUp .22s var(--ease) forwards; }

/* =================== STATS GRID =================== */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}
.stat-card {
    background: var(--s1);
    border: 1px solid var(--bdr);
    border-radius: var(--r-lg);
    padding: 17px 13px;
    text-align: center;
}
.stat-card:active { transform:scale(.97); }
.stat-icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 9px;
}
.stat-blue   { background:rgba(108,139,239,.12); }
.stat-purple { background:rgba(155,110,240,.12); }
.stat-orange { background:rgba(233,137,57,.12); }
.stat-green  { background:rgba(52,211,153,.12); }

.stat-num { font-size:24px; font-weight:900; color:var(--accent); margin-bottom:4px; letter-spacing:-.5px; }
.stat-lbl { font-size:11px; color:var(--tg-hint); font-weight:600; }

/* =================== PREMIUM SECTION =================== */
.premium-card {
    background: linear-gradient(135deg,#1a1240,#0f0f1a);
    border: 1px solid var(--bda);
    border-radius: var(--r-lg);
    padding: 20px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}
.premium-card::before {
    content:'';
    position:absolute;
    top:-40px; right:-40px;
    width:130px; height:130px;
    background:radial-gradient(circle,var(--accent-glow),transparent 70%);
}
.premium-card-icon  { font-size:28px; margin-bottom:9px; }
.premium-card-title { font-size:16px; font-weight:700; margin-bottom:5px; }
.premium-card-desc  { font-size:13px; color:var(--tg-hint); line-height:1.5; }

.feat-list {
    background: var(--s1);
    border: 1px solid var(--bdr);
    border-radius: var(--r-lg);
    overflow: hidden;
}
.feat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--bdr2);
    font-size: 14px;
    font-weight: 500;
}
.feat-check {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(52,211,153,.12);
    border: 1px solid rgba(52,211,153,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* =================== LOCK OVERLAY =================== */
.lock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10,10,18,.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: inherit;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}
.lock-icon  { font-size:36px; margin-bottom:9px; }
.lock-title { font-size:16px; font-weight:700; margin-bottom:6px; }
.lock-desc  { font-size:13px; color:var(--tg-hint); line-height:1.5; }

/* =================== VIDEO ITEMS =================== */
.video-item {
    background: var(--s1);
    border: 1px solid var(--bdr);
    border-radius: var(--r-md);
    padding: 13px;
    margin-bottom: 9px;
    display: flex;
    align-items: flex-start;
    gap: 11px;
}
.video-item-icon {
    width: 38px; height:38px;
    border-radius: 10px;
    background: rgba(233,137,57,.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}
.video-item-info { flex:1; min-width:0; }
.video-item-title { font-size:13px; font-weight:600; margin-bottom:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.video-item-code  { font-size:12px; color:var(--tg-hint); font-family:monospace; }
.video-item-link  { font-size:11px; color:var(--accent); word-break:break-all; margin-top:3px; }

/* =================== MENU BUTTON EDITOR =================== */
.menu-btn-row {
    display: flex;
    gap: 7px;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.menu-btn-row input {
    flex: 1;
    min-width: 110px;
    padding: 9px 11px;
    background: var(--s1);
    border: 1px solid var(--bdr);
    border-radius: var(--r-sm);
    color: var(--tg-text);
    font-family: var(--font);
    font-size: 13px;
    outline: none;
}
.menu-btn-row input:focus { border-color: var(--accent); }

.add-row-btn {
    width: 100%;
    padding: 11px;
    background: var(--s1);
    border: 1px dashed var(--bda);
    border-radius: var(--r-md);
    color: var(--accent);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s var(--ease);
    margin-top: 4px;
}
.add-row-btn:active { background: var(--accent-soft); }

/* =================== DIVIDER =================== */
.divider { height:1px; background:var(--bdr); margin:14px 0; }

/* =================== INFO BLOCK =================== */
.info-block {
    background: rgba(124,110,240,.07);
    border: 1px solid var(--bda);
    border-radius: var(--r-md);
    padding: 13px;
    font-size: 13px;
    color: var(--tg-hint);
    line-height: 1.6;
    margin-bottom: 13px;
}

/* =================== PROFILE =================== */
.profile-top { text-align:center; padding:24px 20px 16px; }
.profile-avatar {
    width: 78px; height:78px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    box-shadow: 0 0 28px var(--accent-glow);
    font-size: 32px;
    font-weight: 800;
    color: white;
}
.profile-name { font-size:22px; font-weight:800; margin-bottom:4px; }
.profile-id   { font-size:13px; color:var(--tg-hint); }

.balance-row { display:flex; align-items:center; justify-content:space-between; }
.balance-lbl { font-size:12px; color:var(--tg-hint); margin-bottom:4px; }
.balance-num { font-size:26px; font-weight:800; color:var(--gold); }

.menu-list {
    background: var(--s1);
    border-radius: var(--r-lg);
    overflow: hidden;
    margin: 0 16px 16px;
}
.menu-item {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 15px 16px;
    border-bottom: 1px solid var(--bdr2);
    cursor: pointer;
    transition: background .15s;
}
.menu-item:last-child { border-bottom:none; }
.menu-item:active { background: var(--sh); }
.menu-icon  { font-size:20px; width:32px; text-align:center; }
.menu-text  { flex:1; font-size:15px; font-weight:500; }
.menu-badge { font-size:12px; font-weight:700; color:var(--accent); }
.menu-arrow { color:var(--tg-hint); }

/* =================== BOTTOM NAV =================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    height: var(--nav-h);
    background: rgba(13,13,20,.94);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border-top: 1px solid var(--bdr);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 4px 8px;
    z-index: 300;
}

.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 4px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--tg-hint);
    font-family: var(--font);
    transition: color .2s var(--ease);
    border-radius: var(--r-md);
}

.nav-ico {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .22s var(--ease), filter .22s;
}
.nav-lbl {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .15px;
}

.nav-btn.active { color: var(--accent); }
.nav-btn.active .nav-ico {
    transform: translateY(-2px);
    filter: drop-shadow(0 0 6px var(--accent));
}

/* Center Create button */
.nav-center-btn { color: var(--tg-hint); }
.nav-center-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 18px var(--accent-glow);
    transition: all .2s var(--spring);
    margin-bottom: -3px;
}
.nav-center-btn:active .nav-center-circle { transform: scale(.9); }

/* =================== SPINNER =================== */
.spinner {
    width:34px; height:34px;
    border:3px solid var(--s2);
    border-top-color: var(--accent);
    border-radius:50%;
    animation:spin .85s linear infinite;
    margin:0 auto 13px;
}
@keyframes spin { to { transform:rotate(360deg); } }
.loading-view {
    display:flex; flex-direction:column;
    align-items:center; justify-content:center;
    padding:80px 20px;
    color:var(--tg-hint);
    font-size:14px; font-weight:500;
}

/* =================== TOAST =================== */
.toast {
    position: fixed;
    top: calc(var(--hdr-h) + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(28,28,42,.96);
    border: 1px solid var(--bdr);
    border-radius: var(--r-md);
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(18px);
    box-shadow: 0 12px 40px rgba(0,0,0,.5);
    z-index: 999;
    opacity: 0;
    transition: all .28s var(--ease);
    white-space: nowrap;
    pointer-events: none;
    max-width: calc(100% - 40px);
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* =================== RESPONSIVE =================== */
@media (max-width:360px) {
    .qa-grid { grid-template-columns:repeat(4,1fr); gap:7px; }
    .qa-name { font-size:10.5px; }
    .hero-title { font-size:20px; }
    .nav-lbl { font-size:9px; }
}

