*{
    box-sizing:border-box;
    margin:0;
    padding:0;
}

html,body{
    width:100%;
    height:100%;
    overflow:hidden;
    background:#000;
    font-family:monospace;
}

#avatarCanvas{
    position:fixed;
    inset:0;
    display:block;
    width:100%;
    height:100%;
    background:#000;
    touch-action:none;
    z-index:0;
}

/* ===== Top-left launcher icon ===== */
#launcher-icon{
    position:fixed;
    top:10px;
    left:10px;
    width:40px;
    height:40px;
    border:2px solid #00FFFF;
    border-radius:8px;
    background:rgba(0,20,20,0.85);
    color:#00FFFF;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    z-index:2000;
    box-shadow:0 0 8px rgba(0,255,255,0.5);
    user-select:none;
}

#launcher-icon:active{
    background:#00FFFF;
    color:#000;
}

#launcher-icon svg{
    width:22px;
    height:22px;
    fill:none;
    stroke:currentColor;
    stroke-width:2;
}

#launcher-icon:active svg{
    stroke:#000;
}

/* ===== Bottom taskbar ===== */
#taskbar{
    position:fixed;
    left:0;
    right:0;
    bottom:0;
    height:44px;
    background:rgba(0,15,15,0.92);
    border-top:1px solid #00FFFF;
    display:flex;
    align-items:center;
    gap:6px;
    padding:0 8px;
    z-index:2000;
    overflow-x:auto;
}

#taskbar .tb-apps-btn{
    flex:0 0 auto;
    height:32px;
    padding:0 10px;
    border:1px solid #00FFFF;
    background:transparent;
    color:#00FFFF;
    font-family:monospace;
    font-size:12px;
    letter-spacing:1px;
    cursor:pointer;
}

#taskbar .tb-apps-btn:active{
    background:#00FFFF;
    color:#000;
}

#taskbar .tb-item{
    flex:0 0 auto;
    height:32px;
    max-width:160px;
    padding:0 10px;
    border:1px solid #00FFFF;
    background:rgba(0,255,255,0.08);
    color:#00FFFF;
    font-size:12px;
    display:flex;
    align-items:center;
    gap:6px;
    cursor:pointer;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

#taskbar .tb-item.minimized{
    opacity:0.55;
}

#taskbar .tb-item .tb-x{
    border:none;
    background:transparent;
    color:#00FFFF;
    font-size:14px;
    cursor:pointer;
    padding:0 2px;
}

/* ===== Windows ===== */
#windows-root{
    position:fixed;
    inset:0;
    z-index:1000;
    pointer-events:none;
}

.cyan-window{
    position:absolute;
    pointer-events:auto;
    display:flex;
    flex-direction:column;
    overflow:hidden;
    background:rgba(0,15,15,0.97);
    border:2px solid #00FFFF;
    box-shadow:
        0 0 8px rgba(0,255,255,0.7),
        inset 0 0 20px rgba(0,255,255,0.08);
    color:#00FFFF;
    font-family:monospace;
    min-width:220px;
    min-height:150px;
}

.cyan-window-header{
    flex:0 0 auto;
    height:40px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    border-bottom:1px solid #00FFFF;
    background:rgba(0,255,255,0.08);
    padding:0 8px 0 12px;
    cursor:grab;
    touch-action:none;
}

.cyan-window-header:active{
    cursor:grabbing;
}

.cyan-window-title{
    font-size:13px;
    letter-spacing:1.5px;
    color:#00FFFF;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.cyan-window-btns{
    display:flex;
    gap:4px;
}

.cyan-window-btns button{
    width:26px;
    height:26px;
    border:1px solid #00FFFF;
    background:transparent;
    color:#00FFFF;
    font-family:monospace;
    font-size:15px;
    line-height:1;
    cursor:pointer;
    padding:0;
}

.cyan-window-btns button:active{
    background:#00FFFF;
    color:#000;
}

.cyan-window-content{
    flex:1 1 auto;
    overflow:auto;
    color:#00FFFF;
    position:relative;
}

.cyan-window-content.no-pad{
    padding:0;
}

.cyan-window-content:not(.no-pad){
    padding:14px;
}

.cyan-window-content iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    display: block;
}

.cyan-window-content h1,
.cyan-window-content h2,
.cyan-window-content h3{
    color:#00FFFF;
    margin-bottom:10px;
}

.cyan-window-content p{
    margin-bottom:8px;
    line-height:1.4;
}

.cyan-window-content button{
    background:transparent;
    color:#00FFFF;
    border:1px solid #00FFFF;
    padding:6px 12px;
    font-family:monospace;
    cursor:pointer;
}

.cyan-window-content button:active{
    background:#00FFFF;
    color:#000;
}

.cyan-window-content input,
.cyan-window-content textarea,
.cyan-window-content select{
    background:#001010;
    color:#00FFFF;
    border:1px solid #00FFFF;
    padding:6px;
    font-family:monospace;
    outline:none;
}

.resize-handle{
    position:absolute;
    right:0;
    bottom:0;
    width:16px;
    height:16px;
    cursor:nwse-resize;
    background:linear-gradient(135deg,transparent 50%,#00FFFF 50%);
    opacity:0.6;
}

/* ===== Messenger ===== */
.msg-app{
    display:flex;
    flex-direction:column;
    height:100%;
    background:#000d0d;
}

.msg-log{
    flex:1 1 auto;
    overflow-y:auto;
    padding:12px;
    display:flex;
    flex-direction:column;
    gap:10px;
}

.msg-row{
    max-width:82%;
    padding:8px 10px;
    border:1px solid #00FFFF;
    font-size:13px;
    line-height:1.4;
    white-space:pre-wrap;
    word-break:break-word;
}

.msg-row.user{
    align-self:flex-end;
    background:rgba(0,255,255,0.14);
}

.msg-row.ai{
    align-self:flex-start;
    background:rgba(0,255,255,0.04);
}

.msg-row.sys{
    align-self:center;
    opacity:0.6;
    font-size:11px;
    border-style:dashed;
}

.msg-inputbar{
    flex:0 0 auto;
    display:flex;
    border-top:1px solid #00FFFF;
}

.msg-inputbar input{
    flex:1 1 auto;
    border:none;
    background:transparent;
    padding:10px;
    color:#00FFFF;
    font-family:monospace;
    font-size:13px;
    outline:none;
}

.msg-inputbar button{
    flex:0 0 auto;
    border:none;
    border-left:1px solid #00FFFF;
    background:transparent;
    color:#00FFFF;
    padding:0 16px;
    cursor:pointer;
    font-family:monospace;
}

.msg-inputbar button:active{
    background:#00FFFF;
    color:#000;
}

/* ===== Apps grid ===== */
.apps-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(84px,1fr));
    gap:14px;
    padding:6px;
}

.apps-grid .app-tile{
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:6px;
    cursor:pointer;
    text-align:center;
    font-size:11px;
}

.apps-grid .app-tile .icon-box{
    width:52px;
    height:52px;
    border:1px solid #00FFFF;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:22px;
}

.apps-grid .app-tile:active .icon-box{
    background:#00FFFF;
    color:#000;
}

.terminal{height:100%;display:flex;flex-direction:column;background:#000;color:#00FFFF;font-family:monospace;}
.terminal-head{padding:8px 10px;border-bottom:1px solid #00FFFF;letter-spacing:1px;background:rgba(0,255,255,0.06);}
.terminal pre{margin:0;padding:12px;white-space:pre-wrap;word-break:break-word;font-family:monospace;font-size:12px;line-height:1.5;}
.cursor{animation:terminalBlink 0.7s steps(1,end) infinite;}
@keyframes terminalBlink{50%{opacity:0;}}
