:root{
  --bg:#07070b;
  --bg1:#0d0d14;
  --bg2:#14141f;
  --bg3:#1b1b29;
  --border:#29293c;
  --text:#f3f2fa;
  --muted:#aaa8ba;
  --dim:#716f86;
  --accent:#7c5cff;
  --accent2:#9b82ff;
  --gold:#ffb454;
  --danger:#ff6b6b;
  --ok:#61d095;
  --radius:14px;
}

html[data-theme="light"]{
  --bg:#f3f2f9;
  --bg1:#ffffff;
  --bg2:#f1eff8;
  --bg3:#e7e4f2;
  --border:#dcd9e9;
  --text:#1b1b29;
  --muted:#5c5a72;
  --dim:#8c8aa1;
  --accent:#7c5cff;
  --accent2:#6a46e8;
  --gold:#c9791b;
}

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

html,body{
  width:100%;
  height:100%;
  overflow:hidden;
}

body{
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  transition:background .2s,color .2s;
}

button,input,textarea{
  font:inherit;
}

button{
  border:0;
  cursor:pointer;
  color:inherit;
}

.hidden{display:none!important}

::-webkit-scrollbar{width:7px;height:7px}
::-webkit-scrollbar-thumb{
  background:var(--bg3);
  border-radius:10px;
}
::-webkit-scrollbar-thumb:hover{
  background:var(--accent);
}

/* ICONS */

.icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:18px;
  height:18px;
  flex-shrink:0;
}

.icon svg{
  width:100%;
  height:100%;
}

/* APP */

#app{
  width:100vw;
  height:100dvh;
  display:flex;
}

/* SIDEBAR */

#sidebar{
  width:280px;
  min-width:280px;
  height:100%;
  display:flex;
  flex-direction:column;
  background:linear-gradient(180deg, var(--bg1), var(--bg));
  border-right:1px solid var(--border);
  box-shadow:6px 0 24px -12px #000a;
  z-index:50;
  transition:.25s ease;
}

#sidebar.collapsed{
  width:0;
  min-width:0;
  overflow:hidden;
  border:0;
  box-shadow:none;
}

.side-head{
  padding:18px 16px 14px;
  border-bottom:1px solid var(--border);
  margin-bottom:2px;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-size:17px;
  font-weight:800;
  letter-spacing:-.01em;
}

.brand-mark{
  width:32px;
  height:32px;
  display:grid;
  place-items:center;
  border-radius:10px;
  background:linear-gradient(135deg,var(--accent),var(--gold));
  color:#08080d;
  font-weight:900;
  box-shadow:0 0 0 3px #7c5cff14, 0 8px 22px #7c5cff55;
  overflow:hidden;
}

.new-chat{
  margin:5px 16px 12px;
  padding:11px 13px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--bg2);
  display:flex;
  align-items:center;
  gap:9px;
  font-weight:600;
  box-shadow:0 2px 8px -4px #0006;
  transition:.15s;
}

.new-chat:hover{
  border-color:var(--accent);
  background:var(--bg3);
  transform:translateY(-1px);
  box-shadow:0 6px 16px -6px #7c5cff55;
}

.side-label{
  padding:14px 16px 7px;
  color:var(--dim);
  font-size:10.5px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.1em;
}

.search{
  margin:0 16px 12px;
  position:relative;
}

.search input{
  width:100%;
  padding:10px 11px 10px 35px;
  border:1px solid var(--border);
  border-radius:11px;
  background:var(--bg2);
  color:var(--text);
  outline:0;
}

.search input:focus{
  border-color:var(--accent);
}

.search .icon{
  position:absolute;
  left:12px;
  top:10px;
  color:var(--dim);
  width:15px;
  height:15px;
}

#chat-list{
  flex:1;
  overflow:auto;
  padding:2px 10px 10px;
}

.chat-item{
  width:100%;
  padding:10px 10px 10px 12px;
  border-radius:10px;
  color:var(--muted);
  display:flex;
  gap:6px;
  align-items:center;
  border-left:3px solid transparent;
  transition:.12s;
}

.chat-item:hover{
  background:var(--bg3);
  color:var(--text);
}

.chat-item.active{
  background:#7c5cff16;
  color:var(--text);
  border-left-color:var(--accent);
}

.chat-open{
  min-width:0;
  flex:1;
  display:flex;
  gap:8px;
  align-items:center;
  background:transparent;
  text-align:left;
}

.chat-open .icon{
  color:var(--dim);
}

.chat-title{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.chat-delete{
  opacity:0;
  background:transparent;
  color:var(--dim);
  width:24px;
  height:24px;
  display:grid;
  place-items:center;
  border-radius:7px;
}

.chat-item:hover .chat-delete{
  opacity:1;
}

.chat-delete:hover{
  color:var(--danger);
  background:var(--bg2);
}

.empty{
  text-align:center;
  color:var(--dim);
  font-size:12px;
  padding:15px;
}

.side-foot{
  border-top:1px solid var(--border);
  padding:10px;
}

.side-btn{
  width:100%;
  padding:10px;
  background:transparent;
  color:var(--muted);
  border-radius:9px;
  text-align:left;
  display:flex;
  align-items:center;
  gap:9px;
}

.side-btn:hover{
  background:var(--bg2);
  color:var(--text);
}

/* MAIN */

#main{
  min-width:0;
  flex:1;
  height:100%;
  display:flex;
  flex-direction:column;
}

#topbar{
  height:56px;
  flex-shrink:0;
  display:flex;
  align-items:center;
  gap:12px;
  padding:0 15px;
  border-bottom:1px solid var(--border);
}

.icon-btn{
  width:36px;
  height:36px;
  border-radius:9px;
  display:grid;
  place-items:center;
  background:transparent;
  color:var(--muted);
  flex-shrink:0;
}

.icon-btn:hover{
  background:var(--bg2);
  color:var(--text);
}

.top-title{
  font-weight:600;
  color:var(--muted);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  flex:1;
  min-width:0;
}

.topbar-right{
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:6px;
  flex-shrink:0;
}

.pill-btn{
  display:flex;
  align-items:center;
  gap:7px;
  padding:0 12px;
  height:36px;
  border-radius:10px;
  background:transparent;
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}

.pill-btn:hover{
  background:var(--bg2);
  color:var(--text);
}

.menu-anchor{
  position:relative;
}

.menu-pop{
  position:absolute;
  top:44px;
  right:0;
  background:var(--bg2);
  border:1px solid var(--border);
  border-radius:12px;
  padding:6px;
  display:none;
  flex-direction:column;
  gap:2px;
  min-width:170px;
  box-shadow:0 15px 35px #0007;
  z-index:80;
}

.menu-pop.open{
  display:flex;
}

.menu-pop-up{
  top:auto;
  bottom:44px;
  left:50%;
  right:auto;
  transform:translateX(-50%);
}

.composer-model-wrap{
  display:flex;
  justify-content:center;
  margin:0 auto 8px;
  position:relative;
  width:min(780px,100%);
}

.composer-model-btn{
  background:var(--bg1);
  border:1px solid var(--border);
}

.menu-pop button{
  display:flex;
  align-items:center;
  gap:9px;
  padding:9px 10px;
  border-radius:8px;
  background:transparent;
  color:var(--muted);
  text-align:left;
  width:100%;
  font-size:13px;
}

.menu-pop button:hover{
  background:var(--bg3);
  color:var(--text);
}

.menu-pop button.active{
  color:var(--accent);
  background:var(--bg3);
}

.ai-mode-pop{
  min-width:230px;
}

.ai-mode-pop button{
  align-items:flex-start;
  padding:10px;
}

.ai-mode-pop .icon{
  margin-top:1px;
}

.mode-opt-text{
  display:flex;
  flex-direction:column;
  gap:2px;
}

.mode-opt-title{
  font-weight:700;
  font-size:12.5px;
  color:var(--text);
}

.ai-mode-pop button.active .mode-opt-title{
  color:var(--accent);
}

.mode-opt-sub{
  font-size:10.5px;
  color:var(--dim);
  line-height:1.3;
}

/* CHAT */

#chat-view{
  flex:1;
  min-height:0;
  display:flex;
  flex-direction:column;
}

#welcome{
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:25px;
  text-align:center;
  gap:14px;
}

.welcome-mark{
  width:66px;
  height:66px;
  border-radius:18px;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,var(--accent),var(--gold));
  color:#08080d;
  font-size:27px;
  font-weight:900;
  box-shadow:0 0 0 3px var(--bg1), 0 14px 38px #7c5cff66;
  overflow:hidden;
}

.welcome-mark img{
  width:100%;
  height:100%;
  object-fit:cover;
}

#welcome h1{
  font-size:25px;
}

#welcome p{
  max-width:460px;
  color:var(--muted);
  line-height:1.6;
  font-size:14px;
}

.suggestions{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:8px;
}

.suggestion{
  padding:9px 13px;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--bg2);
  color:var(--muted);
}

.suggestion:hover{
  border-color:var(--accent);
  color:var(--text);
}

/* MESSAGES */

#messages{
  flex:1;
  min-height:0;
  overflow:auto;
  padding:25px 0 15px;
}

.msg{
  width:min(780px,100%);
  margin:0 auto 23px;
  padding:0 18px;
  display:flex;
  gap:11px;
}

.msg.user{
  flex-direction:row-reverse;
}

.avatar{
  width:30px;
  height:30px;
  min-width:30px;
  border-radius:9px;
  display:grid;
  place-items:center;
  font-size:12px;
  font-weight:800;
  overflow:hidden;
}

.avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.avatar.ai{
  background:linear-gradient(135deg,var(--accent),var(--gold));
  color:#08080d;
  box-shadow:0 0 0 2px var(--bg1), 0 4px 14px -2px #7c5cff77;
}

.avatar.user{
  background:var(--bg3);
  color:var(--muted);
  border:1px solid var(--border);
}

.msg-body{
  max-width:calc(100% - 42px);
}

.msg.user .msg-body{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
}

.bubble{
  font-size:14.5px;
  line-height:1.65;
  overflow-wrap:anywhere;
}

.bubble.live-bubble{
  white-space:pre-wrap;
}

.msg.user .bubble{
  padding:10px 14px;
  background:var(--bg2);
  border:1px solid var(--border);
  border-radius:16px 16px 4px 16px;
  cursor:pointer;
  user-select:text;
}

.bubble p{
  margin-bottom:9px;
}

.bubble p:last-child{
  margin-bottom:0;
}

.bubble strong{
  font-weight:800;
}

.bubble .inline-code{
  font-family:monospace;
  background:var(--bg2);
  padding:1px 5px;
  border-radius:5px;
}

.bubble ul,
.bubble ol{
  margin:6px 0 12px 22px;
}

.bubble li{
  margin:3px 0;
}

.bubble table{
  border-collapse:collapse;
  width:100%;
  margin:8px 0 13px;
}

.bubble th,
.bubble td{
  border:1px solid var(--border);
  padding:7px 9px;
  text-align:left;
}

.bubble th{
  background:var(--bg2);
}

.msg-imgs,
.msg-docs{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:7px;
}

.msg-imgs img{
  max-width:180px;
  max-height:180px;
  object-fit:cover;
  border-radius:10px;
  border:1px solid var(--border);
}

.doc-chip{
  display:flex;
  align-items:center;
  gap:6px;
  padding:7px 10px;
  border:1px solid var(--border);
  border-radius:9px;
  background:var(--bg2);
  font-size:11.5px;
  max-width:190px;
}

.doc-chip .icon{
  color:var(--accent2);
  width:15px;
  height:15px;
}

.doc-chip span.doc-name{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.doc-chip button{
  background:transparent;
  color:var(--dim);
  width:15px;
  height:15px;
  display:grid;
  place-items:center;
  flex-shrink:0;
}

.doc-chip button:hover{
  color:var(--danger);
}

/* MESSAGE ACTIONS */

.msg-actions{
  display:flex;
  gap:4px;
  margin-top:6px;
}

.msg-actions button{
  height:28px;
  padding:0 9px;
  border-radius:8px;
  background:transparent;
  color:var(--dim);
  display:flex;
  align-items:center;
  gap:5px;
  font-size:11px;
}

.msg-actions button .icon{
  width:14px;
  height:14px;
}

.msg-actions button:hover{
  background:var(--bg2);
  color:var(--text);
}

/* CONTEXT MENU */

#ctx-menu{
  position:fixed;
  z-index:300;
  background:var(--bg2);
  border:1px solid var(--border);
  border-radius:12px;
  padding:6px;
  display:none;
  flex-direction:column;
  gap:2px;
  min-width:165px;
  box-shadow:0 18px 40px #0009;
}

#ctx-menu.open{
  display:flex;
}

#ctx-menu button{
  display:flex;
  align-items:center;
  gap:9px;
  padding:10px 11px;
  border-radius:8px;
  background:transparent;
  color:var(--text);
  text-align:left;
  width:100%;
  font-size:13px;
}

#ctx-menu button:hover{
  background:var(--bg3);
}

/* THINKING */

.thinking{
  color:var(--dim);
  font-size:13px;
  display:flex;
  align-items:center;
  gap:8px;
}

.dots{
  display:flex;
  gap:3px;
}

.dots i{
  width:5px;
  height:5px;
  border-radius:50%;
  background:var(--accent2);
  animation:pulse 1s infinite;
}

.dots i:nth-child(2){animation-delay:.15s}
.dots i:nth-child(3){animation-delay:.3s}

@keyframes pulse{
  0%,80%,100%{opacity:.2;transform:scale(.7)}
  40%{opacity:1;transform:scale(1)}
}

/* CODE */

.code{
  border:1px solid var(--border);
  border-radius:12px;
  overflow:hidden;
  background:var(--bg1);
  margin:5px 0;
}

.code-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:8px 11px;
  background:var(--bg2);
  border-bottom:1px solid var(--border);
}

.code-lang{
  font-family:monospace;
  color:var(--muted);
  font-size:11px;
}

.code-actions{
  display:flex;
  gap:4px;
}

.code-actions button{
  display:flex;
  align-items:center;
  gap:5px;
  padding:5px 9px;
  border-radius:7px;
  background:transparent;
  color:var(--muted);
  font-size:11px;
}

.code-actions button .icon{
  width:13px;
  height:13px;
}

.code-actions button:hover{
  background:var(--bg3);
  color:var(--text);
}

.code pre{
  margin:0;
  padding:13px;
  max-height:360px;
  overflow:auto;
  font:12px/1.6 monospace;
  white-space:pre;
  color:var(--text);
}

/* THINKING PANEL */

.thinking-panel{
  border:1px solid var(--accent2);
  border-radius:12px;
  overflow:hidden;
  background:var(--bg1);
  margin:5px 0;
}

.thinking-head{
  width:100%;
  display:flex;
  align-items:center;
  gap:9px;
  padding:10px 12px;
  background:#7c5cff14;
  color:var(--accent2);
  font-size:12.5px;
  font-weight:700;
  text-align:left;
}

.thinking-head .icon{
  width:15px;
  height:15px;
}

.thinking-chevron{
  margin-left:auto;
  transform:rotate(-90deg);
  transition:transform .15s;
}

.thinking-panel.collapsed .thinking-chevron{
  transform:rotate(90deg);
}

.thinking-panel.collapsed .thinking-body{
  display:none;
}

.thinking-body{
  padding:12px 14px;
  font-size:12.5px;
  line-height:1.7;
  color:var(--muted);
  white-space:pre-wrap;
  border-top:1px solid #7c5cff22;
}

.thinking-live-dots{
  margin-left:auto;
}

.thinking-live .thinking-body{
  max-height:220px;
  overflow:auto;
}

/* GEMINI IMAGE GENERATION */

.image-gen-box{
  border:1px solid var(--border);
  border-radius:14px;
  overflow:hidden;
  background:var(--bg1);
  margin:5px 0;
}

.image-gen-head{
  display:flex;
  align-items:center;
  gap:9px;
  padding:10px 13px;
  background:var(--bg2);
  border-bottom:1px solid var(--border);
  font-size:12.5px;
  font-weight:700;
  color:var(--muted);
}

.image-gen-head .icon{
  width:15px;
  height:15px;
  color:var(--gold);
}

.image-gen-body{
  padding:14px;
}

.image-gen-status-label{
  display:flex;
  align-items:center;
  gap:9px;
  font-size:13px;
  color:var(--text);
  margin-bottom:10px;
}

.image-gen-bar{
  height:5px;
  border-radius:3px;
  background:var(--bg3);
  overflow:hidden;
}

.image-gen-bar-fill{
  height:100%;
  background:linear-gradient(90deg,var(--accent),var(--gold));
  transition:width .5s ease;
}

.btn-inline-run{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:9px 15px;
  border-radius:10px;
  background:var(--accent);
  color:#fff;
  font-size:12.5px;
  font-weight:700;
  margin-top:10px;
}

.btn-inline-run:hover{
  background:var(--accent2);
}

.btn-inline-run .icon{
  width:14px;
  height:14px;
}

/* PYTHON RUN RESULT */

.py-result{
  border-top:1px solid var(--border);
  padding:11px 13px;
  background:var(--bg1);
}

.py-status{
  font-size:12px;
  color:var(--muted);
  display:flex;
  align-items:center;
  gap:8px;
}

.py-output{
  font:12px/1.5 monospace;
  white-space:pre-wrap;
  background:var(--bg2);
  padding:10px;
  border-radius:9px;
  margin-top:6px;
  max-height:200px;
  overflow:auto;
  color:var(--text);
}

.py-error{
  color:var(--danger);
}

.py-files{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:6px;
}

/* PASTE-AS-FILE (teks tempel) */

.paste-chip{
  max-width:230px;
}

.paste-square{
  width:24px;
  height:19px;
  min-width:24px;
  border-radius:5px;
  background:var(--accent);
  color:#fff;
  font-size:8.5px;
  font-weight:800;
  display:grid;
  place-items:center;
  letter-spacing:.02em;
}

/* FILE */

.file-card{
  width:min(360px,100%);
  border:1px solid var(--border);
  border-radius:13px;
  background:var(--bg1);
  overflow:hidden;
  margin:5px 0;
}

.file-open{
  width:100%;
  padding:13px;
  background:transparent;
  display:flex;
  gap:11px;
  align-items:center;
  text-align:left;
}

.file-open:hover{
  background:var(--bg2);
}

.file-icon{
  width:39px;
  height:39px;
  min-width:39px;
  display:grid;
  place-items:center;
  border-radius:10px;
  background:linear-gradient(135deg,var(--accent),var(--accent2));
  color:#fff;
}

.file-icon .icon{
  width:19px;
  height:19px;
}

.file-name{
  font-size:13px;
  font-weight:700;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.file-info{
  font-size:11px;
  color:var(--dim);
  margin-top:3px;
}

/* COMPOSER */

#composer-wrap{
  flex-shrink:0;
  padding:10px 18px 17px;
}

#composer{
  width:min(780px,100%);
  margin:auto;
  padding:8px 8px 8px 13px;
  border:1px solid var(--border);
  border-radius:18px;
  background:var(--bg1);
}

#composer:focus-within{
  border-color:var(--accent);
}

#composer-row{
  display:flex;
  align-items:flex-end;
  gap:7px;
}

.composer-btn{
  width:35px;
  height:35px;
  min-width:35px;
  border-radius:10px;
  background:transparent;
  display:grid;
  place-items:center;
  color:var(--muted);
}

.composer-btn:hover{
  background:var(--bg3);
  color:var(--text);
}

#send{
  background:var(--accent);
  color:#fff;
}

#send:hover{
  background:var(--accent2);
}

#send.stop-mode{
  background:var(--danger);
}

#send.stop-mode:hover{
  background:#ff8787;
}

#send:disabled{
  opacity:.4;
  cursor:not-allowed;
}

#input{
  flex:1;
  min-width:0;
  resize:none;
  border:0;
  outline:0;
  background:transparent;
  color:var(--text);
  line-height:1.5;
  font-size:14px;
  max-height:150px;
  padding:7px 0;
}

#input::placeholder{
  color:var(--dim);
}

#previews{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  padding:3px 0 6px;
}

.preview{
  width:55px;
  height:55px;
  border-radius:9px;
  overflow:hidden;
  position:relative;
  border:1px solid var(--border);
}

.preview img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.preview button{
  position:absolute;
  top:2px;
  right:2px;
  width:17px;
  height:17px;
  border-radius:50%;
  background:#000b;
  color:#fff;
  display:grid;
  place-items:center;
}

.preview button .icon{
  width:10px;
  height:10px;
}

.preview.doc{
  width:auto;
  height:auto;
  border:0;
}

.hint{
  text-align:center;
  color:var(--dim);
  font-size:10.5px;
  margin-top:7px;
}

/* DEV PAGE */

#developer,
#account{
  position:fixed;
  inset:0;
  z-index:100;
  background:var(--bg);
  transform:translateX(100%);
  transition:.3s ease;
  display:flex;
  flex-direction:column;
}

#developer.open,
#account.open{
  transform:translateX(0);
}

.dev-top{
  height:56px;
  flex-shrink:0;
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  gap:10px;
  padding:0 15px;
}

.dev-scroll{
  flex:1;
  overflow:auto;
}

.dev-content{
  width:min(520px,100%);
  margin:auto;
  padding:0 22px 70px;
  text-align:center;
}

.dev-cover{
  width:calc(100% + 44px);
  margin:0 -22px 0;
  height:190px;
  border-radius:0 0 28px 28px;
  overflow:hidden;
  position:relative;
  background:linear-gradient(135deg,var(--accent),var(--gold));
  background-size:cover;
  background-position:center;
}

.dev-cover::after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(180deg, rgba(0,0,0,0) 45%, var(--bg) 100%);
  pointer-events:none;
  z-index:1;
}

.dev-audio-fab{
  position:absolute;
  right:14px;
  bottom:14px;
  z-index:3;
  width:44px;
  height:44px;
  border-radius:50%;
  background:rgba(0,0,0,.45);
  backdrop-filter:blur(6px);
  border:1px solid rgba(255,255,255,.25);
  color:#fff;
  display:grid;
  place-items:center;
}

.dev-audio-fab:hover{
  background:rgba(0,0,0,.65);
}

.dev-audio-fab.disabled{
  opacity:.4;
}

.dev-avatar{
  width:100px;
  height:100px;
  margin:-50px auto 0;
  border-radius:26px;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,var(--accent),var(--gold));
  color:#08080d;
  font-size:36px;
  font-weight:900;
  box-shadow:0 15px 40px #7c5cff44;
  border:4px solid var(--bg);
  position:relative;
  z-index:2;
  overflow:hidden;
}

.dev-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.dev-name{
  font-size:24px;
  font-weight:800;
  margin-top:16px;
}

.dev-role{
  color:var(--muted);
  margin-top:3px;
  font-size:13px;
}

.dev-badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 13px;
  border-radius:20px;
  background:var(--bg2);
  border:1px solid var(--border);
  font-size:11px;
  color:var(--muted);
  margin-top:12px;
}

.dev-bio{
  color:var(--muted);
  line-height:1.65;
  margin:16px auto 26px;
  font-size:13.5px;
}

#account-avatar{
  margin:10px auto 0;
  font-size:28px;
}

.account-info-row{
  display:flex;
  align-items:center;
  gap:13px;
  padding:13px 15px;
  border:1px solid var(--border);
  border-radius:13px;
  background:var(--bg2);
  margin-bottom:9px;
  text-align:left;
}

.account-info-row .icon{
  color:var(--accent2);
  width:20px;
  height:20px;
}

.account-signout{
  width:100%;
  justify-content:center;
  margin-top:16px;
}

.account-card{
  border:1px solid var(--border);
  border-radius:16px;
  background:var(--bg2);
  padding:17px;
  margin-bottom:13px;
  text-align:left;
}

.account-card-title{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:700;
  font-size:13px;
  margin-bottom:13px;
  color:var(--text);
}

.account-card-title .icon{
  width:16px;
  height:16px;
  color:var(--accent2);
}

.account-card-desc{
  font-size:11.5px;
  color:var(--dim);
  line-height:1.6;
  margin-bottom:13px;
}

.account-card-btn{
  width:100%;
  justify-content:center;
}

.account-card .account-info-row{
  border:0;
  background:transparent;
  padding:6px 0;
  margin-bottom:0;
}

.dev-audio-spin.spinning{
  animation:dev-audio-spin-anim 3s linear infinite;
}

@keyframes dev-audio-spin-anim{
  from{ transform:rotate(0deg); }
  to{ transform:rotate(360deg); }
}

.dev-links{
  display:flex;
  flex-direction:column;
  gap:9px;
  text-align:left;
}

.dev-link{
  padding:13px 15px;
  border:1px solid var(--border);
  border-radius:13px;
  background:var(--bg2);
  color:var(--text);
  text-decoration:none;
  display:flex;
  align-items:center;
  gap:13px;
  transition:.15s;
}

.dev-link:hover{
  border-color:var(--accent);
  background:var(--bg3);
  transform:translateY(-1px);
}

.dev-link.disabled{
  opacity:.5;
  cursor:default;
}

.dev-link.disabled:hover{
  border-color:var(--border);
  background:var(--bg2);
  transform:none;
}

.dev-link-icon{
  width:38px;
  height:38px;
  min-width:38px;
  border-radius:11px;
  background:var(--bg3);
  display:grid;
  place-items:center;
  color:var(--accent2);
}

.dev-link:hover .dev-link-icon{
  color:var(--accent);
}

.dev-link-text{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
}

.dev-link-title{
  font-weight:700;
  font-size:13.5px;
}

.dev-link-sub{
  font-size:11px;
  color:var(--dim);
}

/* MODAL */

#modal{
  position:fixed;
  inset:0;
  z-index:200;
  background:#000b;
  display:none;
  padding:20px;
}

#modal.open{
  display:flex;
  align-items:center;
  justify-content:center;
}

.modal-box{
  width:min(950px,100%);
  height:min(720px,94vh);
  background:var(--bg1);
  border:1px solid var(--border);
  border-radius:15px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}

.modal-head{
  height:53px;
  flex-shrink:0;
  display:flex;
  align-items:center;
  gap:9px;
  padding:0 11px;
  background:var(--bg2);
  border-bottom:1px solid var(--border);
}

.modal-name{
  font-family:monospace;
  font-size:12px;
  font-weight:700;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.modal-tabs{
  margin-left:auto;
  display:flex;
  gap:4px;
}

.modal-tab{
  display:flex;
  align-items:center;
  gap:6px;
  padding:7px 11px;
  border-radius:8px;
  background:transparent;
  color:var(--muted);
  font-size:12px;
}

.modal-tab .icon{
  width:14px;
  height:14px;
}

.modal-tab.active{
  background:var(--accent);
  color:#fff;
}

.modal-body{
  flex:1;
  min-height:0;
}

#frame{
  width:100%;
  height:100%;
  border:0;
  background:#fff;
}

#modal-code{
  width:100%;
  height:100%;
  padding:15px;
  overflow:auto;
  white-space:pre;
  font:12px/1.6 monospace;
  color:var(--text);
  background:var(--bg1);
}

/* SETTINGS */

#settings{
  position:fixed;
  inset:0;
  z-index:150;
  background:#000b;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
}

#settings.open{
  display:flex;
}

.settings-box{
  width:min(520px,100%);
  max-height:90vh;
  overflow:auto;
  padding:20px;
  border:1px solid var(--border);
  border-radius:16px;
  background:var(--bg1);
}

.settings-box h2{
  margin-bottom:6px;
}

.settings-note{
  color:var(--muted);
  font-size:12px;
  line-height:1.5;
  margin-bottom:15px;
}

.field{
  margin-bottom:13px;
}

.field label{
  display:block;
  color:var(--muted);
  font-size:12px;
  margin-bottom:6px;
}

.field input{
  width:100%;
  padding:10px;
  border:1px solid var(--border);
  border-radius:9px;
  outline:0;
  background:var(--bg2);
  color:var(--text);
}

.field input:focus{
  border-color:var(--accent);
}

.field-hint{
  font-size:10.5px;
  color:var(--dim);
  margin-top:5px;
}

/* AUTH PAGE */

#auth{
  position:fixed;
  inset:0;
  z-index:500;
  background:
    radial-gradient(900px 480px at 15% -10%, #7c5cff26, transparent),
    radial-gradient(760px 460px at 110% 10%, #ffb45420, transparent),
    var(--bg);
  background-size:cover;
  background-position:center;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
}

#auth.has-bg::after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(180deg, #07070bcc, #07070bf2);
  z-index:1;
}

#auth.hidden{
  display:none;
}

.auth-box{
  position:relative;
  z-index:2;
  width:min(400px,100%);
  max-height:92vh;
  overflow:auto;
  padding:30px 26px;
  border:1px solid #ffffff1c;
  border-radius:24px;
  background:#0d0d14cc;
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  box-shadow:0 30px 90px #000a, 0 0 0 1px #7c5cff14;
}

.auth-brand{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  font-size:20px;
  font-weight:800;
  letter-spacing:-.01em;
  margin-bottom:26px;
}

.auth-brand .brand-mark{
  box-shadow:0 0 0 3px #ffffff10, 0 10px 30px #7c5cff55;
}

.auth-tabs{
  display:flex;
  gap:6px;
  padding:4px;
  background:var(--bg2);
  border-radius:13px;
  margin-bottom:20px;
}

.auth-tab{
  flex:1;
  padding:10px;
  border-radius:10px;
  background:transparent;
  color:var(--muted);
  font-weight:700;
  font-size:13px;
}

.auth-tab.active{
  background:var(--accent);
  color:#fff;
}

.auth-form.hidden{
  display:none;
}

.auth-submit{
  width:100%;
  justify-content:center;
  margin-top:8px;
}

.auth-error{
  background:#ff6b6b1a;
  border:1px solid var(--danger);
  color:var(--danger);
  padding:10px 12px;
  border-radius:10px;
  font-size:12px;
  margin-bottom:16px;
  line-height:1.5;
}

.auth-note{
  text-align:center;
  color:var(--dim);
  font-size:10.5px;
  margin-top:18px;
}

.auth-divider{
  display:flex;
  align-items:center;
  gap:10px;
  margin:20px 0 16px;
  color:var(--dim);
  font-size:11px;
}

.auth-divider::before,
.auth-divider::after{
  content:"";
  flex:1;
  height:1px;
  background:var(--border);
}

.google-signin-container{
  display:flex;
  justify-content:center;
  min-height:44px;
}

.google-fallback{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:9px;
  padding:11px;
  border:1px dashed var(--border);
  border-radius:11px;
  background:var(--bg2);
  color:var(--dim);
  font-size:12px;
  text-align:center;
}

.google-fallback .icon{
  width:16px;
  height:16px;
}

.settings-actions{
  display:flex;
  gap:8px;
  justify-content:flex-end;
}

.primary,
.secondary{
  padding:9px 14px;
  border-radius:9px;
  display:inline-flex;
  align-items:center;
  gap:7px;
  font-size:13px;
}

.primary .icon,
.secondary .icon{
  width:14px;
  height:14px;
}

.primary{
  background:var(--accent);
  color:#fff;
}

.secondary{
  background:var(--bg3);
  color:var(--text);
}

/* MOBILE */

@media(max-width:820px){
  #sidebar{
    position:fixed;
    left:0;
    top:0;
    bottom:0;
    box-shadow:20px 0 50px #0008;
  }

  #sidebar.collapsed{
    box-shadow:none;
  }

  .msg{
    padding:0 13px;
  }

  #composer-wrap{
    padding:8px 10px 12px;
  }

  #modal{
    padding:0;
  }

  .modal-box{
    width:100%;
    height:100%;
    border-radius:0;
  }
}

@media(max-width:480px){
  .pill-btn span:not(.icon){
    display:none;
  }

  .pill-btn{
    padding:0 9px;
  }
}
