*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    -webkit-tap-highlight-color:transparent;
}

body{
    width:100%;
    height:100vh;
    height:100dvh;
    background:#f0f0f0;
    font-family:Arial, Helvetica, sans-serif;
    color:#111;
    overflow:hidden;
}

.bx-page{
    height:100vh;
    height:100dvh;
    display:flex;
    flex-direction:column;
    padding:20px 14px 12px;
    gap:12px;
}

@keyframes bx-shimmer{
    0%{ background-position:-400px 0; }
    100%{ background-position:400px 0; }
}

@keyframes bx-fade{
    from{ opacity:0; }
    to{ opacity:1; }
}

/* TOP BAR */

.bx-top{
    display:flex;
    align-items:center;
    gap:14px;
    flex-shrink:0;
}

.bx-back{
    width:38px;
    height:38px;
    min-width:38px;
    border:none;
    border-radius:50%;
    background:#e0e0e0;
    color:#111;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    transition:transform .1s ease;
    flex-shrink:0;
}

.bx-back:active{ transform:scale(.95); }

.bx-title{
    font-size:18px;
    font-weight:700;
    color:#111;
    background:#e0e0e0;
    border-radius:50px;
    padding:8px 18px;
}

/* CARDS (bubble): user ka safed, Orgete ka kala, dono full width */

.bx-m{
    display:flex;
    width:100%;
}

.bx-m.r{ justify-content:flex-end; }
.bx-m.l{ justify-content:flex-start; }

.bx-bub{
    width:100%;
    min-width:0;
    border-radius:22px;
    padding:14px;
    display:flex;
    flex-direction:column;
    gap:10px;
}

.bx-bub.me{
    background:#fff;
    color:#111;
}

.bx-bub.org{
    background:#111;
    color:#fff;
}

.bx-who{
    font-size:11px;
    font-weight:700;
    color:#999;
}

.bx-bub.org .bx-who{ color:#888; }

.bx-bh{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
}

.bx-bub h2{
    font-size:17px;
    font-weight:800;
}

.bx-bub p{
    font-size:14px;
    line-height:1.6;
    color:#666;
    overflow-wrap:anywhere;
}

.bx-bub.org p{ color:#bbb; }

.bx-pill{
    display:inline-flex;
    align-items:center;
    gap:5px;
    background:#111;
    color:#fff;
    border-radius:50px;
    padding:4px 10px;
    font-size:11px;
    font-weight:700;
    white-space:nowrap;
    flex-shrink:0;
}

/* FORM / bheja hua jawab */

.bx-label{
    font-size:12px;
    font-weight:700;
    color:#777;
    padding:0 4px;
    margin-bottom:-6px;
}

.bx-field{
    width:100%;
    border:none;
    background:#ebebeb;
    border-radius:16px;
    padding:14px 16px;
    font-size:16px;
    font-family:inherit;
    color:#111;
    outline:none;
}

.bx-field::placeholder{ color:#999; }

textarea.bx-field{
    min-height:90px;
    resize:none;
}

.bx-field.bx-filled{
    background:transparent;
    border-radius:0;
    padding:2px 4px 12px;
    border-bottom:1px solid #ececec;
    font-size:16px;
    font-weight:600;
    line-height:1.5;
    white-space:pre-wrap;
    overflow-wrap:anywhere;
    cursor:default;
}

/* BUTTONS */

.bx-primary{
    border:none;
    background:#111;
    color:#fff;
    font-family:inherit;
    font-size:16px;
    font-weight:700;
    padding:14px;
    border-radius:50px;
    cursor:pointer;
    flex-shrink:0;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    transition:transform .1s ease, opacity .15s ease;
}

.bx-primary:active{ transform:scale(.97); }
.bx-primary:disabled{ opacity:.6; }

.bx-secondary{
    border:none;
    background:#ebebeb;
    color:#111;
    font-family:inherit;
    font-size:15px;
    font-weight:700;
    padding:13px;
    border-radius:50px;
    cursor:pointer;
    flex-shrink:0;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    transition:transform .1s ease;
}

.bx-secondary:active{ transform:scale(.97); }

/* CODE */

.bx-code{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    background:#2b2b2b;
    border-radius:16px;
    padding:10px 10px 10px 14px;
    font-size:20px;
    font-weight:800;
    letter-spacing:1.5px;
    color:#fff;
    overflow-wrap:anywhere;
}

/* SQUARE CARDS (user ke neeche wale aur admin ke action squares) */

.bx-squares{
    display:grid;
    grid-template-columns:repeat(var(--n, 4), 1fr);
    gap:8px;
    flex-shrink:0;
    background:#e0e0e0;
    border-radius:28px;
    padding:10px;
}

.bx-sq{
    position:relative;
    border:none;
    background:#ebebeb;
    color:#111;
    border-radius:18px;
    aspect-ratio:1 / 1.1;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:space-between;
    padding:9px 4px 8px;
    font-family:inherit;
    cursor:pointer;
    box-shadow:inset 0 0 0 3px transparent;
    transition:transform .1s ease, background .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.bx-sq:active{ transform:scale(.93); }

.bx-sq-ic{
    font-size:16px;
    line-height:1;
}

.bx-sq-l{
    font-size:11px;
    font-weight:700;
    line-height:1.2;
    text-align:center;
}

/* BOTTOM SHEET */

.bx-sheet-overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.35);
    z-index:1000;
    opacity:0;
    visibility:hidden;
    transition:opacity .3s ease, visibility .3s ease;
}

.bx-sheet-overlay.show{
    opacity:1;
    visibility:visible;
}

.bx-sheet{
    position:fixed;
    left:0;
    right:0;
    bottom:0;
    z-index:1001;
    background:#fff;
    border-radius:24px 24px 0 0;
    padding:10px 22px 26px;
    display:flex;
    flex-direction:column;
    gap:12px;
    transform:translateY(100%);
    transition:transform .35s cubic-bezier(.32,.72,0,1);
    box-shadow:0 -8px 30px rgba(0,0,0,0.15);
}

.bx-sheet.show{ transform:translateY(0); }

.bx-sheet-handle{
    width:42px;
    height:5px;
    background:#ddd;
    border-radius:10px;
    margin:6px auto 8px;
}

.bx-sheet h3{
    font-size:19px;
    font-weight:800;
    color:#111;
    line-height:1.4;
}

.bx-sheet p{
    font-size:14px;
    color:#666;
    line-height:1.6;
}

/* TOAST */

.bx-toast{
    position:fixed;
    left:14px;
    right:14px;
    bottom:130px;
    transform:translateY(14px);
    background:#1c1d21;
    color:#fff;
    font-size:16px;
    font-weight:700;
    padding:16px 18px;
    border-radius:50px;
    display:flex;
    align-items:center;
    gap:12px;
    opacity:0;
    pointer-events:none;
    transition:opacity .2s ease, transform .2s ease;
    z-index:1100;
}

.bx-toast i{
    color:#9a9a9a;
    font-size:20px;
    flex-shrink:0;
}

.bx-toast.show{
    opacity:1;
    transform:translateY(0);
}
/* Identity / Community chunne wala toggle */

.bx-seg{
    display:flex;
    gap:6px;
    background:#ebebeb;
    border-radius:50px;
    padding:4px;
}

.bx-segb{
    flex:1;
    border:none;
    background:transparent;
    color:#777;
    font-family:inherit;
    font-size:14px;
    font-weight:700;
    padding:11px 8px;
    border-radius:50px;
    cursor:pointer;
    transition:background .15s ease, color .15s ease, transform .1s ease;
}

.bx-segb:active{ transform:scale(.96); }

.bx-segb.on{
    background:#111;
    color:#fff;
}

.bx-segb:disabled{
    opacity:.35;
    cursor:default;
}

/* Community chunne wala dropdown */

select.bx-field{
    -webkit-appearance:none;
    appearance:none;
    cursor:pointer;
}

/* =========================================================
   BROWSER JAISI TABS (har page ke upar)
========================================================= */

.bx-tabsrow{
    position:sticky;
    top:-12px;
    z-index:3;
    flex-shrink:0;
    display:flex;
    gap:6px;
    overflow-x:auto;
    overflow-y:hidden;
    overscroll-behavior-x:contain;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
    background:#e0e0e0;
    margin:-12px -12px 0;
    padding:12px 12px 8px;
}

.bx-tabsrow::-webkit-scrollbar{ display:none; }

.bx-tab2{
    flex:0 0 auto;
    max-width:180px;
    display:flex;
    align-items:center;
    gap:7px;
    background:#ebebeb;
    color:#777;
    border:none;
    border-radius:16px;
    padding:8px 8px 8px 12px;
    font-family:inherit;
    font-size:13px;
    font-weight:700;
    cursor:pointer;
    box-shadow:inset 0 0 0 2px transparent;
    transition:background .15s ease, color .15s ease, box-shadow .15s ease, transform .1s ease;
}

.bx-tab2:active{ transform:scale(.95); }

.bx-tab2.on{
    background:#fff;
    color:#111;
    box-shadow:inset 0 0 0 2px #111;
}

.bx-tab2-ic{
    font-size:11px;
    flex-shrink:0;
}

.bx-tab2-t{
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.bx-tab2-x{
    flex-shrink:0;
    width:20px;
    height:20px;
    border:none;
    border-radius:50%;
    background:#d6d6d6;
    color:#111;
    font-size:10px;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    transition:transform .1s ease, background .15s ease;
}

.bx-tab2-x:active{ transform:scale(.85); background:#c4c4c4; }

.bx-tab2.on .bx-tab2-x{ background:#ebebeb; }

.bx-tab2-new{
    padding:8px 14px;
    font-size:14px;
}

.bx-tdot{
    width:8px;
    height:8px;
    border-radius:50%;
    background:#e03030;
    flex-shrink:0;
}

/* Delete: thoda peeche (bounce) phir fade hoke ghat jaye */
.bx-tab2.bx-out{
    pointer-events:none;
    animation:bx-tabout .44s cubic-bezier(.6,-.3,.735,.045) forwards;
}

@keyframes bx-tabout{
    0%{
        transform:scale(1);
        opacity:1;
    }
    30%{
        transform:scale(1.12);
        opacity:1;
    }
    100%{
        transform:scale(.25);
        opacity:0;
        max-width:0;
        padding-left:0;
        padding-right:0;
        margin-right:-6px;
    }
}

/* Tab badalne par card halka fade-in */
.bx-swap{
    animation:bx-swapin .22s ease;
}

@keyframes bx-swapin{
    from{ opacity:0; transform:translateY(6px); }
    to{ opacity:1; transform:translateY(0); }
}

/* NAYI "New ..." tab: "+" ke aage khisakne wali animation */
.bx-tab2.bx-draft{
    animation:bx-tabin .25s ease;
}

@keyframes bx-tabin{
    from{ opacity:0; transform:translateX(-16px) scale(.9); }
    to{ opacity:1; transform:translateX(0) scale(1); }
}

/* ORGETE ke cards: Create community button jaisa gray (user + admin dono) */
.bx-bub.org{
    background:linear-gradient(145deg,#5b5b5b,#2f2f2f);
    color:#fff;
}

.bx-bub.org .bx-who{ color:#bbb; }
.bx-bub.org p{ color:#e6e6e6; }

.bx-bub.org .bx-code{
    background:rgba(0,0,0,.28);
}