/* MIMIC AI visual overhaul — preserves charcoal, silver, red/white palette */
:root{--surface-0:#07080a;--surface-1:#101216;--surface-2:#181b20;--accent:#e10600;--accent-bright:#ff3028;--accent-deep:#700300;--silver:#d9dde0;--hairline:rgba(255,255,255,.095);--shadow-xl:0 32px 90px rgba(0,0,0,.52)}
body{background:radial-gradient(ellipse 75% 55% at 50% -10%,rgba(225,6,0,.22),transparent 64%),linear-gradient(145deg,#050608 0%,#111318 45%,#090a0d 100%)}
body::before{content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;opacity:.26;background-image:linear-gradient(118deg,transparent 0 43%,rgba(255,255,255,.035) 43.2% 43.5%,transparent 43.7%),radial-gradient(circle at 1px 1px,rgba(255,255,255,.08) 1px,transparent 1.2px);background-size:100% 100%,18px 18px;mask-image:linear-gradient(to bottom,#000,transparent 86%)}
.auth-shell{min-height:100dvh;padding:clamp(18px,4vw,48px)}
.auth-card{position:relative;width:min(470px,100%);border-radius:28px;padding:clamp(26px,5vw,42px);border:1px solid rgba(255,255,255,.13);background:linear-gradient(155deg,rgba(32,35,41,.96),rgba(12,13,17,.97) 58%,rgba(35,6,6,.94));box-shadow:var(--shadow-xl),inset 0 1px rgba(255,255,255,.13)}
.auth-card::before{content:"";position:absolute;inset:0 0 auto;height:3px;border-radius:28px 28px 0 0;background:linear-gradient(90deg,transparent,var(--accent-bright) 34%,var(--silver) 50%,var(--accent) 66%,transparent)}
.auth-brand{margin-bottom:34px;font-size:13px;letter-spacing:.16em}.auth-card h1{font-size:clamp(30px,7vw,44px);letter-spacing:-.04em;line-height:1}.auth-card>p{max-width:34ch;margin-top:12px;line-height:1.5}.auth-form{gap:12px;margin-top:28px}.auth-form label{letter-spacing:.1em}
.auth-form input,.settings-form input,.mode-select{border-radius:14px;border-color:rgba(255,255,255,.13);background:rgba(2,3,5,.48);box-shadow:inset 0 1px rgba(255,255,255,.035);transition:border-color .18s ease,box-shadow .18s ease,background .18s ease}.auth-form input{min-height:50px;padding:0 16px}.auth-form input:focus,.settings-form input:focus,.mode-select:focus,textarea:focus{border-color:rgba(255,48,40,.78);background:rgba(8,9,12,.78);box-shadow:0 0 0 4px rgba(225,6,0,.12)}
.auth-form #signupButton,.auth-form #loginButton,.settings-form button,.primary-button{min-height:50px;border-radius:14px;background:linear-gradient(135deg,var(--accent-bright),var(--accent) 54%,var(--accent-deep));box-shadow:0 12px 30px rgba(225,6,0,.18),inset 0 1px rgba(255,255,255,.2)}.auth-nav-button{min-height:48px;border-radius:14px;background:rgba(255,255,255,.045)}
.telegram-shell{grid-template-rows:64px 1fr;background:transparent}.telegram-shell .topbar{min-height:64px;padding:0 clamp(12px,3vw,28px);border-bottom:1px solid var(--hairline);background:rgba(7,8,10,.82);box-shadow:0 10px 34px rgba(0,0,0,.22);backdrop-filter:blur(24px) saturate(130%)}
.telegram-shell .brand{gap:10px;font-size:13px;letter-spacing:.15em}.telegram-shell .orb{width:10px;height:10px;background:var(--accent-bright);box-shadow:0 0 0 5px rgba(225,6,0,.11),0 0 24px rgba(255,48,40,.72)}
.telegram-shell .top-action{min-height:34px;padding:0 12px;border:1px solid var(--hairline);border-radius:10px;color:#dfe2e4;background:rgba(255,255,255,.035);transition:transform .16s ease,background .16s ease,border-color .16s ease}.telegram-shell .top-action:hover{color:#fff;border-color:rgba(255,48,40,.45);background:rgba(225,6,0,.09);transform:translateY(-1px)}
.telegram-shell .workspace{width:min(1080px,100vw);height:calc(100dvh - 64px);padding:clamp(0px,1.8vw,20px)}.telegram-shell .chat-window{border:1px solid var(--hairline);border-radius:clamp(0px,2vw,24px);background:rgba(10,11,14,.64);box-shadow:var(--shadow-xl),inset 0 1px rgba(255,255,255,.05);backdrop-filter:blur(18px)}
.telegram-shell .window-titlebar{min-height:72px;padding:12px 18px;border-bottom-color:var(--hairline);background:linear-gradient(90deg,rgba(22,24,29,.94),rgba(15,16,20,.82))}.telegram-shell .window-titlebar::before{content:"M";display:grid;place-items:center;width:42px;height:42px;flex:0 0 42px;border-radius:14px;color:#fff;font-weight:950;background:linear-gradient(145deg,var(--accent-bright),var(--accent-deep));box-shadow:0 10px 26px rgba(225,6,0,.25),inset 0 1px rgba(255,255,255,.25)}.telegram-shell .window-titlebar h1{font-size:16px;letter-spacing:.015em}.telegram-shell .window-titlebar p{color:#aeb4b8}
.telegram-shell .messages{padding:clamp(16px,3vw,34px);gap:14px;background:radial-gradient(circle at 15% 0%,rgba(225,6,0,.07),transparent 27%),linear-gradient(rgba(255,255,255,.018) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.018) 1px,transparent 1px);background-size:auto,34px 34px,34px 34px}.telegram-shell .message{gap:9px;animation:messageIn .25s ease both}@keyframes messageIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.telegram-shell .avatar{width:32px;height:32px;border:1px solid rgba(255,255,255,.12);background:linear-gradient(145deg,#30343b,#13151a);box-shadow:0 8px 20px rgba(0,0,0,.25)}.telegram-shell .user .avatar{background:linear-gradient(145deg,var(--accent-bright),var(--accent-deep))}.telegram-shell .bubble{max-width:min(700px,76%);padding:12px 14px;border-radius:5px 17px 17px 17px;background:linear-gradient(145deg,rgba(36,39,46,.96),rgba(21,23,28,.96));border-color:rgba(255,255,255,.085);box-shadow:0 12px 28px rgba(0,0,0,.2)}.telegram-shell .user .bubble{border-radius:17px 5px 17px 17px;background:linear-gradient(145deg,rgba(235,24,17,.96),rgba(133,4,0,.98));border-color:rgba(255,255,255,.14)}.telegram-shell .bubble b{color:#fff;letter-spacing:.025em}.telegram-shell .bubble p{color:#e0e3e5;line-height:1.5}.telegram-shell .user .bubble p{color:#fff}
.telegram-shell .composer{gap:8px;padding:12px 14px;padding-bottom:max(12px,env(safe-area-inset-bottom));border-top-color:var(--hairline);background:rgba(10,11,14,.94);box-shadow:0 -16px 40px rgba(0,0,0,.18)}.telegram-shell textarea{min-height:46px;padding:12px 16px;border-radius:15px;border-color:rgba(255,255,255,.105);background:rgba(255,255,255,.055)}.telegram-shell .round-action{width:44px;height:44px;border-radius:14px;border-color:rgba(255,255,255,.1);background:rgba(255,255,255,.045);transition:transform .15s ease,background .15s ease}.telegram-shell .round-action:hover{transform:translateY(-1px);background:rgba(255,255,255,.085)}.telegram-shell .bridge-control{min-height:38px;border-radius:12px;border-color:rgba(255,255,255,.1)}.telegram-shell .composer button[type="submit"]{min-height:44px;border-radius:13px;background:linear-gradient(135deg,var(--accent-bright),var(--accent) 55%,var(--accent-deep));box-shadow:0 9px 24px rgba(225,6,0,.19)}.telegram-shell .attachment-chip{border-radius:10px}
.account-page-card,.admin-panel{border-radius:26px;background:linear-gradient(145deg,rgba(28,30,36,.96),rgba(10,11,14,.97));box-shadow:var(--shadow-xl),inset 0 1px rgba(255,255,255,.08)}.settings-panel,.profile-hero,.subagent-deploy-card,.admin-table-wrap{border-radius:18px;background:rgba(255,255,255,.035)}
:focus-visible{outline:2px solid var(--accent-bright);outline-offset:3px}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important}}
@media(max-width:900px){.telegram-shell{grid-template-rows:58px 1fr}.telegram-shell .topbar{min-height:58px}.telegram-shell .workspace{height:calc(100dvh - 58px);padding:0}.telegram-shell .chat-window{border-left:0;border-right:0;border-bottom:0;border-radius:0}.telegram-shell .window-titlebar{min-height:62px;padding:8px 12px}.telegram-shell .window-titlebar::before{width:38px;height:38px;flex-basis:38px;border-radius:12px}.telegram-shell .messages{padding:16px 10px}.telegram-shell .composer{padding:9px 10px;padding-bottom:max(9px,env(safe-area-inset-bottom))}}
@media(max-width:520px){.auth-shell{padding:12px}.auth-card{border-radius:22px;padding:28px 20px}.telegram-shell .brand{letter-spacing:.11em}.telegram-shell .bubble{max-width:86%}.telegram-shell .window-titlebar p{display:block;max-width:58vw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}
.message-media-gallery{display:grid;gap:8px;margin-top:10px;max-width:min(520px,72vw)}.message-media-gallery img,.message-media-gallery video{display:block;width:100%;max-height:430px;border-radius:12px;object-fit:contain;background:#050608;border:1px solid rgba(255,255,255,.12)}.message-media-gallery video{min-height:120px}.message-file-link{display:block;padding:10px 12px;border-radius:10px;color:#fff;background:rgba(0,0,0,.22);text-decoration:none}.message-file-link:hover{text-decoration:underline}@media(max-width:520px){.message-media-gallery{max-width:72vw}.message-media-gallery img,.message-media-gallery video{max-height:55vh}}
.runtime-hub-backdrop{position:fixed;inset:0;z-index:80;border:0;background:rgba(0,0,0,.55);backdrop-filter:blur(3px)}.runtime-hub{position:fixed;z-index:81;top:0;right:0;width:min(520px,94vw);height:100dvh;overflow:auto;padding:24px;background:linear-gradient(160deg,rgba(23,25,31,.99),rgba(7,8,11,.99));border-left:1px solid rgba(255,255,255,.13);box-shadow:-24px 0 70px rgba(0,0,0,.5)}.runtime-hub-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.runtime-hub-header h2{margin:4px 0 5px;font-size:1.6rem}.runtime-hub-header p{margin:0;color:var(--muted)}.runtime-hub-header p.online{color:#77e4a7}.runtime-kicker{color:var(--accent-bright);font-size:.73rem;font-weight:800;letter-spacing:.16em}.runtime-hub-header button{width:38px;height:38px;border-radius:12px;border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.05);color:#fff;font-size:1.5rem}.runtime-hub-actions{display:flex;align-items:center;gap:10px;margin:22px 0}.runtime-hub-actions button,.runtime-hub-actions a{padding:9px 12px;border-radius:10px;border:1px solid rgba(255,255,255,.11);background:rgba(255,255,255,.05);color:#fff;text-decoration:none;font:inherit}.runtime-section{margin-top:22px}.runtime-section h3{margin:0 0 10px;font-size:.86rem;text-transform:uppercase;letter-spacing:.1em;color:#c8cbd3}.runtime-tool-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.runtime-tool-card{display:flex;flex-direction:column;gap:5px;min-width:0;padding:12px;border:1px solid rgba(255,255,255,.09);border-radius:13px;background:rgba(255,255,255,.035)}.runtime-tool-card span{overflow:hidden;color:var(--muted);font-size:.75rem;white-space:nowrap;text-overflow:ellipsis}.runtime-agent-list p{margin:7px 0;padding:10px 12px;border-radius:10px;background:rgba(255,255,255,.035);color:#d6d8de}.runtime-activity{max-height:36vh;overflow:auto;margin:0;padding:10px 10px 10px 30px;border-radius:14px;background:#07080b;border:1px solid rgba(255,255,255,.08);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.78rem;line-height:1.45}.runtime-activity li{padding:6px 4px;color:#bfc3cc}.runtime-activity li[data-state="tool.started"]{color:#f5b1ae}.runtime-activity li[data-state="tool.completed"],.runtime-activity li[data-state="run.completed"]{color:#77e4a7}.runtime-open{overflow:hidden}@media(max-width:520px){.runtime-hub{width:100vw;padding:18px}.runtime-tool-grid{grid-template-columns:1fr}}
