/* ===== BASE ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

html,
body {
    height: 100%;
    overflow: hidden;
    background: #070b16;
    color: #e2e8f0;
    font-family: 'Inter', sans-serif
}

/* ===== HEADER ===== */
.hdr {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: rgba(7, 11, 22, .97);
    border-bottom: 1px solid #1e2d4a;
    backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 16px
}

.hdr-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0
}

.hdr-title {
    font-size: 15px;
    font-weight: 900;
    color: #00d4ff;
    letter-spacing: .06em
}

.hdr-sub {
    font-size: 7.5px;
    color: #4a5568;
    letter-spacing: .1em;
    text-transform: uppercase
}

.hdr-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: flex-end;
    flex-wrap: wrap
}

.stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10.5px;
    color: #4a5568;
    white-space: nowrap
}

.stat.sep {
    border-left: 1px solid #1e2d4a;
    padding-left: 12px
}

.dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    animation: pdot 1.5s ease-in-out infinite
}

.dot.g {
    background: #22c55e;
    box-shadow: 0 0 5px #22c55e
}

.dot.b {
    background: #2AABEE;
    box-shadow: 0 0 5px #2AABEE
}

.dot.o {
    background: #25D366;
    box-shadow: 0 0 5px #25D366
}

.dot.r {
    background: #ef4444;
    box-shadow: 0 0 5px #ef4444
}

.badge {
    font-size: 8px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    letter-spacing: .05em
}

.badge.g {
    background: rgba(34, 197, 94, .12);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, .25)
}

.badge.b {
    background: rgba(42, 171, 238, .12);
    color: #2AABEE;
    border: 1px solid rgba(42, 171, 238, .25)
}

.badge.o {
    background: rgba(37, 211, 102, .12);
    color: #25D366;
    border: 1px solid rgba(37, 211, 102, .25)
}

.badge.r {
    background: rgba(239, 68, 68, .12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, .25)
}

.count {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 11px;
    color: #00d4ff;
    min-width: 28px;
    text-align: right
}

.count.g {
    color: #22c55e
}

.count.b {
    color: #2AABEE
}

.count.t {
    color: #a78bfa
}

/* ===== FACTORY CANVAS ===== */
.factory {
    position: fixed;
    top: 48px;
    left: 0;
    right: 0;
    bottom: 32px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center
}

#svg {
    width: 100%;
    height: 100%;
    display: block
}

/* ===== LOG BAR ===== */
.logbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 32px;
    background: rgba(7, 11, 22, .98);
    border-top: 1px solid #1e2d4a;
    display: flex;
    align-items: center;
    padding: 0 14px;
    gap: 10px;
    z-index: 100;
    overflow: hidden
}

.log-lbl {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .12em;
    color: #00d4ff;
    white-space: nowrap;
    border: 1px solid rgba(0, 212, 255, .3);
    border-radius: 3px;
    padding: 1px 6px;
    background: rgba(0, 212, 255, .05)
}

.log-msg {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    color: rgba(226, 232, 240, .65);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.log-msg.line {
    color: #22c55e
}

.log-msg.telegram {
    color: #2AABEE
}

.log-msg.whatsapp {
    color: #25D366
}

.log-msg.cron {
    color: #ef4444
}

.log-msg.ai {
    color: #00d4ff
}

.api-status {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    white-space: nowrap;
    border: 1px solid #2a3a5a;
    border-radius: 3px;
    padding: 1px 6px;
    color: #4a5568
}

.api-status.live {
    color: #22c55e;
    border-color: rgba(34, 197, 94, .3);
    background: rgba(34, 197, 94, .05)
}

/* ===== ANIMATIONS ===== */
@keyframes pdot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1)
    }

    50% {
        opacity: .4;
        transform: scale(.75)
    }
}

@keyframes hero-glow {

    0%,
    100% {
        filter: drop-shadow(0 0 8px #00d4ff33)
    }

    50% {
        filter: drop-shadow(0 0 20px #00d4ff77)
    }
}

@keyframes model-on {

    0%,
    100% {
        filter: drop-shadow(0 0 4px #22c55e55)
    }

    50% {
        filter: drop-shadow(0 0 12px #22c55eaa)
    }
}

@keyframes packet-pulse {
    from {
        opacity: .85
    }

    to {
        opacity: 1;
        filter: drop-shadow(0 0 6px currentColor)
    }
}

@keyframes log-in {
    from {
        opacity: 0;
        transform: translateX(20px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

.pdot {
    animation: pdot 1.5s ease-in-out infinite
}

#st-ai-engine {
    animation: hero-glow 3s ease-in-out infinite
}

.model-on {
    animation: model-on 2s ease-in-out infinite
}

.msg-packet {
    animation: packet-pulse 1s ease-in-out infinite alternate
}