/* Compact responsive app styles with sidebar */
:root{ --bg:#0f1113; --card:#0b0e10; --text:#e6eef4; --muted:#9aa7b5; --accent:#2ea3ff; --ok:#3ddc84; --danger:#ff6b6b; --border:rgba(255,255,255,0.04);}
*{box-sizing:border-box} body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial;background:var(--bg);color:var(--text);-webkit-font-smoothing:antialiased}
.app{display:flex;min-height:100vh}
.sidebar{width:220px;background:#071018;padding:16px;border-right:1px solid var(--border);display:flex;flex-direction:column;gap:12px}
.logo{font-weight:700;font-size:1.05rem;margin-bottom:6px}
nav{display:flex;flex-direction:column;gap:6px}
.nav-link{padding:10px;border-radius:8px;color:var(--muted);text-decoration:none;cursor:pointer}
.nav-link.active{background:rgba(255,255,255,0.03);color:var(--text)}
.sidebar-footer{margin-top:auto;font-size:0.9rem;color:var(--muted)}
.btn{padding:8px 12px;border-radius:8px;border:0;background:linear-gradient(180deg,#1e8bff,#0b63d6);color:#fff;cursor:pointer}
.btn.small{padding:6px 8px;font-size:0.85rem;border-radius:6px;background:transparent;border:1px solid var(--border);color:var(--muted)}
.main{flex:1;padding:18px;display:flex;flex-direction:column;gap:12px}
.header{display:flex;justify-content:space-between;align-items:center}
.header-left h1{margin:0;font-size:1.2rem}
.header-right{display:flex;align-items:center;gap:12px}
.signal{display:flex;align-items:center;gap:8px;color:var(--muted)}
.signal .green{display:inline-block;width:12px;height:12px;background:var(--ok);border-radius:99px}
.signal .red{display:inline-block;width:12px;height:12px;background:var(--danger);border-radius:99px}
.card{background:#071018;padding:14px;border-radius:12px;border:1px solid var(--border)}
.deck{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px}
.stats-card .big{font-size:1.6rem;font-weight:700}
.followers{list-style:none;margin:0;padding:0}
.followers li{padding:8px 0;border-bottom:1px solid rgba(255,255,255,0.02)}
.view.hidden{display:none}
.form label{display:block;margin-bottom:8px}
.form input,.form textarea{width:100%;padding:8px;border-radius:8px;border:1px solid rgba(255,255,255,0.03);background:transparent;color:var(--text)}
.form-actions{margin-top:10px}
.notice.error{background:rgba(255,0,0,0.06);padding:8px;border-radius:8px;color:#ffb3b3}
.muted{color:var(--muted);font-size:0.95rem}
@media(max-width:800px){ .sidebar{display:none} .main{padding:12px} }


/* mobile-navigation-fix */
#mobileMenuToggle,
#mobileMenuBackdrop {
    display:none;
}

@media(max-width:800px) {
    #mobileMenuToggle {
        display:block;
        position:fixed;
        top:12px;
        left:12px;
        z-index:1002;
        background:#1677e8;
        color:white;
        border:0;
        border-radius:10px;
        padding:11px 16px;
        font-size:15px;
        font-weight:700;
        box-shadow:0 4px 18px #0006;
    }

    .app .sidebar {
        display:flex;
        position:fixed;
        top:0;
        left:0;
        bottom:0;
        width:260px;
        max-width:85vw;
        height:100dvh;
        z-index:1001;
        overflow-y:auto;
        transform:translateX(-105%);
        transition:transform .25s ease;
        box-shadow:8px 0 30px #0007;
    }

    body.mobile-menu-open .app .sidebar {
        transform:translateX(0);
    }

    body.mobile-menu-open #mobileMenuBackdrop {
        display:block;
        position:fixed;
        inset:0;
        background:rgba(0,0,0,.65);
        z-index:1000;
    }

    body.mobile-menu-open {
        overflow:hidden;
    }

    .app .main {
        min-width:0;
        padding-top:65px;
    }

    .header {
        flex-wrap:wrap;
        gap:12px;
    }
}

/* GLOBAL RESPONSIVE THEME — all dashboard views */
:root {
    --bg: #0b0e11;
    --card: #10161c;
    --text: #e7eef6;
    --muted: #9aaaba;
    --accent: #1688ff;
    --border: rgba(148, 174, 198, .14);
}

* {
    box-sizing: border-box;
}

html {
    width: 100%;
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    margin: 0;
    overflow-x: clip;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
}

.app {
    width: 100%;
    min-width: 0;
}

.main {
    min-width: 0;
    max-width: 100%;
}

.view {
    width: 100%;
    min-width: 0;
}

.card,
.deck,
.form,
header,
section,
article {
    min-width: 0;
    max-width: 100%;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: clamp(16px, 2.5vw, 26px);
    overflow-wrap: anywhere;
}

h1, h2, h3, h4 {
    line-height: 1.25;
    overflow-wrap: anywhere;
}

h1 {
    font-size: clamp(1.55rem, 4vw, 2.25rem);
}

h2 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
}

h3 {
    font-size: clamp(1.05rem, 2.5vw, 1.4rem);
}

img,
video,
canvas,
iframe {
    max-width: 100%;
}

input,
select,
textarea,
button {
    max-width: 100%;
    font: inherit;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 11px 12px;
    color: var(--text);
    background: #0b1117;
    border: 1px solid var(--border);
    border-radius: 10px;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--accent);
}

button,
.btn {
    min-height: 42px;
    border-radius: 10px;
    touch-action: manipulation;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

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

.stats-card .big {
    font-size: clamp(1.6rem, 4vw, 2.5rem);
}

.header {
    gap: 16px;
    min-width: 0;
}

.header-left,
.header-right {
    min-width: 0;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

pre,
code {
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

@media (max-width: 800px) {
    .app .main {
        width: 100%;
        min-width: 0;
        padding: 70px 14px 24px;
        gap: 14px;
    }

    #mobileMenuToggle {
        top: max(12px, env(safe-area-inset-top));
        left: 12px;
    }

    .app .sidebar {
        width: min(290px, 85vw);
        padding: 22px 16px;
        padding-bottom: max(22px, env(safe-area-inset-bottom));
    }

    .header {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .deck {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .card {
        padding: 18px 16px;
        border-radius: 16px;
    }

    .form label {
        display: block;
        width: 100%;
        margin-bottom: 14px;
        line-height: 1.5;
    }

    .form input,
    .form textarea,
    .form select {
        display: block;
        width: 100%;
        margin-top: 6px;
    }

    .form-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .form-actions button,
    .form button[type="submit"] {
        min-height: 46px;
    }

    .followers {
        overflow-wrap: anywhere;
    }

    .view {
        scroll-margin-top: 76px;
    }
}

@media (min-width: 801px) {
    .app .sidebar {
        position: sticky;
        top: 0;
        align-self: flex-start;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .app .main {
        padding: clamp(18px, 3vw, 36px);
    }

    .deck {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 380px) {
    .app .main {
        padding-right: 10px;
        padding-left: 10px;
    }

    .card {
        padding: 14px 12px;
    }

    .header-right {
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}
