:root {
    --bg: #050a08;
    --panel: #09110d;
    --panel-2: #0d1712;
    --line: rgba(107, 255, 163, .14);
    --line-strong: rgba(107, 255, 163, .25);
    --text: #edf8f1;
    --muted: #7f9588;
    --green: #20f57c;
    --green-soft: #0c2b1c;
    --user: #102d1e;
    --shadow: 0 18px 70px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body {
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow: hidden;
}
button, textarea { font: inherit; }

.app-shell {
    width: 100%;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    max-width: 920px;
    margin: 0 auto;
    background:
        radial-gradient(circle at 50% 10%, rgba(0, 255, 112, .05), transparent 35%),
        var(--bg);
}

.topbar {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: rgba(4, 9, 7, .92);
    backdrop-filter: blur(18px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand-wrap { display: flex; align-items: center; gap: 12px; }
.brand-icon, .avatar, .hero-bot {
    display: grid;
    place-items: center;
    border: 1px solid var(--line-strong);
    background: linear-gradient(145deg, #11261b, #08130e);
    box-shadow: 0 0 28px rgba(32,245,124,.07);
}
.brand-icon {
    width: 48px; height: 48px; border-radius: 15px;
    color: var(--green); font-size: 19px; font-weight: 800;
}
.brand-name { font-size: 21px; font-weight: 750; letter-spacing: -.3px; }
.brand-status { color: var(--green); font-size: 14px; margin-top: 2px; }
.brand-status span {
    width: 7px; height: 7px; border-radius: 50%; display: inline-block;
    background: var(--green); box-shadow: 0 0 10px var(--green); margin-right: 5px;
}

.icon-btn {
    width: 48px; height: 48px; border-radius: 15px;
    border: 1px solid var(--line-strong); background: transparent; color: #dcece3;
    cursor: pointer; font-size: 23px;
}
.icon-btn:hover { background: var(--green-soft); }

.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 28px 18px 145px;
    scroll-behavior: smooth;
}
.chat-area::-webkit-scrollbar { width: 5px; }
.chat-area::-webkit-scrollbar-thumb { background: rgba(255,255,255,.09); border-radius: 99px; }

.welcome {
    min-height: 62vh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center;
    padding: 30px 12px;
}
.hero-bot {
    width: 116px; height: 116px; border-radius: 32px;
    font-size: 53px; margin-bottom: 22px;
    box-shadow: 0 0 60px rgba(32,245,124,.09);
}
.welcome h1 { font-size: clamp(31px, 7vw, 46px); margin: 0 0 10px; letter-spacing: -.8px; }
.welcome p { color: #92a79a; font-size: 18px; margin: 5px 0; }
.welcome .sub { font-size: 15px; max-width: 540px; }
.suggestions {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
    margin-top: 26px;
}
.suggestions button {
    border: 1px solid var(--line);
    background: rgba(9, 22, 15, .75);
    color: #bfd1c5;
    padding: 12px 17px;
    border-radius: 999px;
    cursor: pointer;
}
.suggestions button:hover { border-color: var(--line-strong); color: white; transform: translateY(-1px); }

.message-row {
    width: 100%;
    display: flex;
    gap: 10px;
    margin: 14px 0;
    align-items: flex-end;
}
.message-row.user { justify-content: flex-end; }
.message-row.assistant { justify-content: flex-start; }
.avatar {
    width: 38px; height: 38px; min-width: 38px;
    border-radius: 12px; font-size: 20px;
}
.bubble {
    max-width: min(78%, 720px);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 12px 15px;
    line-height: 1.58;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    box-shadow: var(--shadow);
}
.assistant .bubble { background: rgba(9, 17, 13, .92); border-top-left-radius: 6px; }
.user .bubble { background: var(--user); border-color: rgba(32,245,124,.16); border-bottom-right-radius: 6px; }

.code-block {
    margin: 10px 0 2px;
    border: 1px solid var(--line);
    border-radius: 13px;
    overflow: hidden;
    background: #030704;
}
.code-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 12px; color: #87a294; font-size: 12px;
    background: rgba(255,255,255,.025); border-bottom: 1px solid var(--line);
}
.copy-code {
    border: 0; border-radius: 9px; padding: 7px 10px;
    color: #bfe4cc; background: #10271b; cursor: pointer;
}
.code-block pre {
    margin: 0; padding: 14px; overflow-x: auto; font-size: 12.5px; line-height: 1.55;
    color: #d7e8dd;
}

.typing { display: flex; align-items: center; gap: 5px; min-width: 175px; }
.typing span {
    width: 6px; height: 6px; border-radius: 50%; background: #6b8c79;
    animation: blink 1s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
.typing em { font-style: normal; color: var(--muted); margin-left: 6px; font-size: 13px; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.hidden { display: none !important; }

.notice {
    position: fixed;
    left: 50%; bottom: 92px; transform: translate(-50%, 15px);
    opacity: 0; pointer-events: none;
    background: #0d2016; border: 1px solid var(--line-strong); color: #bce6ca;
    padding: 10px 14px; border-radius: 12px; font-size: 13px;
    transition: .2s ease; z-index: 30; max-width: calc(100% - 28px); text-align: center;
}
.notice.show { opacity: 1; transform: translate(-50%, 0); }

.composer {
    position: fixed;
    left: 50%; bottom: 0; transform: translateX(-50%);
    width: min(920px, 100%);
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    display: flex; align-items: flex-end; gap: 10px;
    background: linear-gradient(180deg, transparent, rgba(5,10,8,.96) 28%);
    z-index: 20;
}
.composer textarea {
    flex: 1; min-height: 56px; max-height: 150px; resize: none;
    padding: 16px 18px; border-radius: 17px;
    color: var(--text); background: rgba(9, 17, 13, .96);
    border: 1px solid var(--line);
    outline: none;
}
.composer textarea:focus { border-color: var(--line-strong); box-shadow: 0 0 0 3px rgba(32,245,124,.05); }
.composer textarea::placeholder { color: #667a6e; }
.send-btn {
    width: 56px; height: 56px; border: 0; border-radius: 17px;
    background: var(--green); color: #031108; font-size: 25px; font-weight: 900;
    cursor: pointer; box-shadow: 0 8px 30px rgba(32,245,124,.16);
}
.send-btn:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 600px) {
    .topbar { min-height: 68px; padding: 10px 13px; }
    .brand-icon { width: 44px; height: 44px; }
    .brand-name { font-size: 19px; }
    .chat-area { padding: 18px 12px 138px; }
    .welcome { min-height: 57vh; }
    .hero-bot { width: 100px; height: 100px; font-size: 45px; }
    .welcome p { font-size: 16px; }
    .bubble { max-width: 86%; font-size: 14px; }
    .suggestions button { padding: 10px 13px; font-size: 13px; }
    .composer { padding-left: 10px; padding-right: 10px; }
    .composer textarea { min-height: 52px; padding: 14px; }
    .send-btn { width: 52px; height: 52px; }
}
.attach-btn{width:56px;height:56px;border:1px solid var(--line);border-radius:17px;background:rgba(9,17,13,.96);color:#bfe4cc;font-size:28px;cursor:pointer}.attach-btn:disabled{opacity:.45}.attachments{position:fixed;left:50%;bottom:80px;transform:translateX(-50%);width:min(920px,100%);padding:0 14px;display:flex;gap:7px;flex-wrap:wrap;z-index:21}.attachment-chip{max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:#10271b;border:1px solid var(--line);color:#bfe4cc;border-radius:999px;padding:6px 10px;font-size:12px;cursor:pointer}.zip-card a{display:inline-block;margin-top:8px;color:var(--green);font-weight:700;text-decoration:none}.zip-card b{font-weight:700}@media(max-width:600px){.attach-btn{width:52px;height:52px}.attachments{padding:0 10px;bottom:76px}.attachment-chip{max-width:160px}.composer{gap:7px}}
